diff --git a/README.md b/README.md index a8bbc9bc..90ec1324 100644 --- a/README.md +++ b/README.md @@ -29,25 +29,25 @@ 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: ```bash -npm install @maxio-com/advanced-billing-sdk@9.1.0 +npm install @maxio-com/advanced-billing-sdk@10.0.0 ``` -For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@9.1.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/9.1.0). +For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@10.0.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/10.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/9.1.0/doc/client.md) +**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/client.md) The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | | site | `string` | The subdomain for your Advanced Billing site.
*Default*: `'subdomain'` | -| environment | [`Environment`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | +| environment | [`Environment`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/README.md#environments) | The API environment.
**Default: `Environment.US`** | | timeout | `number` | Timeout for API calls.
*Default*: `120000` | -| httpClientOptions | [`Partial`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/http-client-options.md) | Stable configurable http client options. | +| httpClientOptions | [`Partial`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/http-client-options.md) | Stable configurable http client options. | | unstableHttpClientOptions | `any` | Unstable configurable http client options. | -| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/auth/basic-authentication.md) | The credential object for basicAuth | +| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/auth/basic-authentication.md) | The credential object for basicAuth | The API client can be initialized as follows: @@ -84,7 +84,7 @@ const fileContent = fs.readFileSync(absolutePath, 'utf-8'); const client = Client.fromJsonConfig(fileContent); ``` -See the [Configuration-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/configuration-based-client-initialization.md) section for details. +See the [Configuration-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/configuration-based-client-initialization.md) section for details. ### Environment-Based Client Initialization @@ -106,7 +106,7 @@ if (fs.existsSync(absolutePath)) { const client = Client.fromEnvironment(process.env); ``` -See the [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) section for details. +See the [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) section for details. ## Environments @@ -123,60 +123,60 @@ The SDK can be configured to use a different environment for making API calls. A This API uses the following authentication schemes. -* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/auth/basic-authentication.md) +* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/auth/basic-authentication.md) ## List of APIs -* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/api-exports.md) -* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/advance-invoice.md) -* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/billing-portal.md) -* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/component-price-points.md) -* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/custom-fields.md) -* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/events-based-billing-segments.md) -* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/payment-profiles.md) -* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/product-families.md) -* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/product-price-points.md) -* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/proforma-invoices.md) -* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/reason-codes.md) -* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/referral-codes.md) -* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/sales-commissions.md) -* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-components.md) -* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-groups.md) -* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-group-invoice-account.md) -* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-group-status.md) -* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-invoice-account.md) -* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-notes.md) -* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-products.md) -* [Subscription Renewals](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-renewals.md) -* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscription-status.md) -* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/coupons.md) -* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/components.md) -* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/customers.md) -* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/events.md) -* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/insights.md) -* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/invoices.md) -* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/offers.md) -* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/products.md) -* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/sites.md) -* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/subscriptions.md) -* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/controllers/webhooks.md) +* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/api-exports.md) +* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/advance-invoice.md) +* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/billing-portal.md) +* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/component-price-points.md) +* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/custom-fields.md) +* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/events-based-billing-segments.md) +* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/payment-profiles.md) +* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/product-families.md) +* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/product-price-points.md) +* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/proforma-invoices.md) +* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/reason-codes.md) +* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/referral-codes.md) +* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/sales-commissions.md) +* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-components.md) +* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-groups.md) +* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-group-invoice-account.md) +* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-group-status.md) +* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-invoice-account.md) +* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-notes.md) +* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-products.md) +* [Subscription Renewals](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-renewals.md) +* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscription-status.md) +* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/coupons.md) +* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/components.md) +* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/customers.md) +* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/events.md) +* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/insights.md) +* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/invoices.md) +* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/offers.md) +* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/products.md) +* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/sites.md) +* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/subscriptions.md) +* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/controllers/webhooks.md) ## SDK Infrastructure ### Configuration -* [HttpClientOptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/http-client-options.md) -* [RetryConfiguration](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/retry-configuration.md) -* [ProxySettings](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/proxy-settings.md) -* [Configuration-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/configuration-based-client-initialization.md) -* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/environment-based-client-initialization.md) +* [HttpClientOptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/http-client-options.md) +* [RetryConfiguration](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/retry-configuration.md) +* [ProxySettings](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/proxy-settings.md) +* [Configuration-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/configuration-based-client-initialization.md) +* [Environment-Based Client Initialization](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/environment-based-client-initialization.md) ### HTTP -* [HttpRequest](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/http-request.md) +* [HttpRequest](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/http-request.md) ### Utilities -* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/api-response.md) -* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/9.1.0/doc/api-error.md) +* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/api-response.md) +* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/10.0.0/doc/api-error.md) diff --git a/doc/controllers/advance-invoice.md b/doc/controllers/advance-invoice.md index 4773adf0..9db1ab1c 100644 --- a/doc/controllers/advance-invoice.md +++ b/doc/controllers/advance-invoice.md @@ -17,10 +17,13 @@ const advanceInvoiceController = new AdvanceInvoiceController(client); # Issue Advance Invoice -Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility for generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided. -A subscription may only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists will return an error. -That said, regeneration of the invoice may be forced with the params `force: true`, which will void an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one will be generated. -We recommend using either the create or preview endpoints for proforma invoices to preview this advance invoice before using this endpoint to generate it. +Issues an invoice in advance for a subscription's next renewal date. For the most part, advance invoices function like any other invoice, except they are issued early and have special behavior upon being voided. For more information on advance invoices, including eligibility for generating one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance). + +A subscription can only have one advance invoice per billing period. Attempting to issue an advance invoice when one already exists returns an error. + +Regeneration of the invoice can be forced with the params `force: true`, which voids an advance invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. + +Consider 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( @@ -161,8 +164,11 @@ try { # Void Advance Invoice -Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. -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, [see our help docs](../../doc/models/invoice.md). +Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. + +A `reason` is required to void, and the invoice must have an open status. Voiding causes 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, see [Invoice](../../doc/models/invoice.md). ```ts async voidAdvanceInvoice( diff --git a/doc/controllers/api-exports.md b/doc/controllers/api-exports.md index 940a16bb..7f8b20f8 100644 --- a/doc/controllers/api-exports.md +++ b/doc/controllers/api-exports.md @@ -263,9 +263,7 @@ try { # Export Proforma Invoices -Creates a proforma invoices export and returns a batch job object. - -It is only available for Relationship Invoicing architecture. +Creates a proforma invoices export and returns a batch job object. Proforma invoices are only available on Relationship Invoicing sites. ```ts async exportProformaInvoices( @@ -456,7 +454,7 @@ try { # Read Proforma Invoices Export -Returns a batch job object for a proforma invoices export. +Returns a batch job object for a proforma invoices export. Proforma invoices are only available on Relationship Invoicing sites. ```ts async readProformaInvoicesExport( diff --git a/doc/controllers/billing-portal.md b/doc/controllers/billing-portal.md index be71de39..b1e5e4a4 100644 --- a/doc/controllers/billing-portal.md +++ b/doc/controllers/billing-portal.md @@ -20,21 +20,15 @@ const billingPortalController = new BillingPortalController(client); Enables Billing Portal access for a customer, with an option to send an invitation email at the same time. -## Billing Portal Documentation - -Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - -This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber Interaction and Merchant Management of the Billing Portal. - -You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending the Customer an Invitation email at the same time. - ## Billing Portal Security -If your customer has been invited to the Billing Portal, then they will receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** +If your customer has been invited to the Billing Portal, they receive a link to manage their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and receipts. **This link changes periodically for security and is only valid for 65 days.** + +If you need to provide your customer their Management URL through other means, you can retrieve it [via the API](../../doc/controllers/billing-portal.md#read-billing-portal-link). Because the URL is cryptographically signed with a timestamp, merchants cannot generate the URL without requesting it through the API. -If you need to provide your customer their Management URL through other means, you can retrieve it via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for merchants to generate the URL without requesting it from Advanced Billing. +To prevent abuse and overuse, 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), **do not** make an API request every time. -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), **do not** make an API request to Advanced Billing every time. +For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). ```ts async enableBillingPortalForCustomer( @@ -105,13 +99,13 @@ try { Returns the exact URL required for a subscriber to access the Billing Portal. -## Rules for Management Link API +## Management Link Request Rules -+ When retrieving a management URL, multiple requests for the same customer in a short period will return the **same** URL -+ We will not generate a new URL for 15 days ++ When retrieving a management URL, multiple requests for the same customer in a short period return the **same** URL ++ A new URL is not generated for 15 days + You must cache and remember this URL if you are going to need it again within 15 days + Only request a new URL after the `new_link_available_at` date -+ 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`) ++ You are limited to 15 requests for the same URL. If you make more than 15 requests before `new_link_available_at`, you are blocked from further Management URL requests (with a response code `429`). ```ts async readBillingPortalLink( diff --git a/doc/controllers/component-price-points.md b/doc/controllers/component-price-points.md index 02406921..f257b564 100644 --- a/doc/controllers/component-price-points.md +++ b/doc/controllers/component-price-points.md @@ -225,8 +225,6 @@ Lists the price points associated with a component. You may specify the component by using either the numeric id or the `handle:gold` syntax. -When fetching a component'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 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 @@ -257,7 +255,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `componentId` | `number` | Template, Required | The Advanced Billing id of the component | -| `currencyPrices` | `boolean \| undefined` | Query, Optional | Include an array of currency price data | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | Include an array of currency price data. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | | `filterType` | [`PricePointType[] \| undefined`](../../doc/models/price-point-type.md) | Query, Optional | Use in query: `filter[type]=catalog,default`. | @@ -803,7 +801,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `componentId` | [`ReadComponentPricePointComponentId`](../../doc/models/containers/read-component-price-point-component-id.md) | Template, Required | This is a container for one-of cases. | | `pricePointId` | [`ReadComponentPricePointPricePointId`](../../doc/models/containers/read-component-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | -| `currencyPrices` | `boolean \| undefined` | Query, Optional | Include an array of currency price data | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | Include an array of currency price data. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type diff --git a/doc/controllers/components.md b/doc/controllers/components.md index 0ed134cc..0be0f72b 100644 --- a/doc/controllers/components.md +++ b/doc/controllers/components.md @@ -32,8 +32,14 @@ Metered components are used to bill for any type of unit that resets to 0 at the Note that this is different from recurring quantity-based components, which DO NOT reset to zero at the start of every billing period. If you want to bill for a quantity of something that does not change unless you change it, then you want quantity components, instead. +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. This does not apply to metered components configured for event-based billing (metric, meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ts async createMeteredComponent( productFamilyId: string, @@ -172,7 +178,7 @@ try { Creates a Quantity Based component definition under the specified product family. A Quantity Based component can then be added and “allocated” for a subscription. -When defining a Quantity Based component, you can choose one of 2 types: +When defining a Quantity Based component, you can choose one of two types: #### Recurring @@ -184,8 +190,16 @@ One-time quantity-based components are used to create ad hoc usage charges that The allocated quantity for one-time quantity-based components immediately gets reset back to zero after the allocation is made. +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +#### Hybrid Pricing + +A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and configuration details. + For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ts async createQuantityBasedComponent( productFamilyId: string, @@ -329,6 +343,8 @@ On/off components are used for any flat fee, recurring add on (think $99/month f For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ts async createOnOffComponent( productFamilyId: string, @@ -453,9 +469,11 @@ try { Creates a prepaid usage component definition under the specified product family. A prepaid component can then be added and “allocated” for a subscription. -Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and we subsequently keep track of the usage against the amount purchased. +Prepaid components allow customers to pre-purchase units that can be used up over time on their subscription. In a sense, they are the mirror image of metered components; while metered components charge at the end of the period for the amount of units used, prepaid components are charged for at the time of purchase, and usage is subsequently tracked against the amount purchased. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ts async createPrepaidUsageComponent( @@ -623,7 +641,9 @@ Event-based components are similar to other component types, in that you define So, instead of reporting usage directly for each component (as you would with metered components), the usage is derived from analysis of your events. -For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). +For more information, see [Components Overview](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview). + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending a blank value results in a validation error. ```ts async createEventBasedComponent( @@ -943,6 +963,8 @@ Updates 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:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ts async updateProductFamilyComponent( productFamilyId: number, @@ -1195,8 +1217,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `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. | | `startDatetime` | `string \| undefined` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | -| `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional | -| `includeArchived` | `boolean \| undefined` | Query, Optional | Include archived items | +| `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | +| `includeArchived` | `boolean \| undefined` | Query, Optional | Include archived items. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | | `filter` | [`ListComponentsFilter \| undefined`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | @@ -1354,6 +1376,8 @@ Updates 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:`. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending `"tax_code": ""` returns `422`. + ```ts async updateComponent( componentId: string, @@ -1506,7 +1530,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `filter` | [`ListComponentsFilter \| undefined`](../../doc/models/list-components-filter.md) | Query, Optional | Filter to use for List Components operations | | `dateField` | [`BasicDateField \| undefined`](../../doc/models/basic-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=created_at`. | | `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. | -| `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. optional. | +| `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | | `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. | | `startDatetime` | `string \| undefined` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | diff --git a/doc/controllers/coupons.md b/doc/controllers/coupons.md index e507531d..772a82db 100644 --- a/doc/controllers/coupons.md +++ b/doc/controllers/coupons.md @@ -30,11 +30,7 @@ const couponsController = new CouponsController(client); Creates a coupon under the specified product family. -You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by specifying percentage -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 }` - -Coupons can be administered in the Advanced Billing application or created via API. See [creating coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting-Coupons) for more information. +You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by specifying `percentage`. See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced Billing UI. @@ -165,7 +161,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter \| undefined`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | -| `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. Use in query `currency_prices=true`. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -317,9 +313,9 @@ try { # Find Coupon -Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, the find will attempt to locate a coupon that matches that code. +Searches for a coupon by 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. +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, you need to specify (either in the URL or as a query string param) the `product_family_id`. ```ts async findCoupon( @@ -340,7 +336,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `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. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -385,12 +381,11 @@ try { # Read Coupon -Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by the ID parameter that Advanced Billing assigns. -If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. +Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID parameter assigned to it. -When fetching a coupon, 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 instead you would like to find a Coupon using a Coupon code, use the [Find Coupon](../../doc/controllers/coupons.md#find-coupon) endpoint. -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. +If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current exchange rate. If the flag is set to false, it returns all of the defined prices for each currency. ```ts async readCoupon( @@ -411,7 +406,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `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. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -746,7 +741,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 30. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.
Use in query `per_page=200`.

**Default**: `30`

**Constraints**: `<= 200` | | `filter` | [`ListCouponsFilter \| undefined`](../../doc/models/list-coupons-filter.md) | Query, Optional | Filter to use for List Coupons operations | -| `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. Use in query `currency_prices=true`. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass `?currency_prices=true` to include an array of currency price data in the response. Use in query `currency_prices=true`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -953,23 +948,17 @@ try { # Validate Coupon -Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. If the coupon is found and is valid, the coupon will be returned with a 200 status code. - -If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. If the coupon is valid, the status code will be 200 and the coupon will be returned. The following reasons for invalidity are supported: - -+ Coupon not found -+ Coupon is invalid -+ Coupon expired +Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes that are entered by a customer. -If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, then you will need to specify the product family, either in the url or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. +If you have more than one product family and if the coupon you are validating does not belong to the first product family in your site, you need to specify the product family, either in the URL or as a query string param. This can be done by supplying the id or the handle in the `handle:my-family` format. -Eg. +Supplying the `product_family_handle` in the URL: ``` https://.chargify.com/product_families/handle:/coupons/validate.?code= ``` -Or: +Supplying the `product_family_id` as a query parameter: ``` https://.chargify.com/coupons/validate.?code=&product_family_id= @@ -1160,8 +1149,6 @@ try { Creates subcodes for an existing coupon. -## Coupon Subcodes Intro - Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one coupon. For example: @@ -1176,21 +1163,9 @@ Coupon Subcodes: + DP80302 + SPRINGBALTIMORE -Coupon subcodes can be administered in the Admin Interface or via the API. - -When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters will be capitalized before the subcode is created. - -## Coupon Subcodes Documentation +When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid coupon subcodes are all capital letters, contain only letters and numbers, and do not have any spaces. Lowercase letters are capitalized before the subcode is created. -Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - -Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). - -## Create Coupon Subcode - -This request allows you to create specific subcodes underneath an existing coupon code. - -*Note*: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. +Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you must encode them for use in the URL. % to %25 @ to %40 @@ -1199,7 +1174,9 @@ This request allows you to create specific subcodes underneath an existing coupo _ to %5F . to %2E -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.` +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.`. + +For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). ```ts async createCouponSubcodes( @@ -1487,7 +1464,7 @@ Note: If you are using any of the allowed special characters (“%”, “@”, ## Percent Encoding Example -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. +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( diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md index e16f2548..aef6bf62 100644 --- a/doc/controllers/customers.md +++ b/doc/controllers/customers.md @@ -21,30 +21,29 @@ const customersController = new CustomersController(client); # Create Customer -Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you may only create one customer for a given reference value. +Creates a new customer; can also be created alongside a new subscription. The only validation restriction is that you can only create one customer for a given reference value. -If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store Advanced Billing’s unique ID for the customer, which is in the `id` attribute. +If provided, the `reference` value must be unique. It represents a unique identifier for the customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store the system-assigned unique ID for the customer, which is in the `id` attribute. -Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). +For more information, see [Customer Details](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). ## Required Country Format -Advanced Billing requires that you use the ISO Standard Country codes when formatting country attribute of the customer. +Format the country attribute of the customer using the ISO Standard Country codes. -Countries should be formatted as 2 characters. For more information, see the following wikipedia article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) +Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes). ## Required State Format -Advanced Billing requires that you use the ISO Standard State codes when formatting state attribute of the customer. +Format the state attribute of the customer using the ISO Standard State codes. -+ US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) ++ US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). -+ States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to country you wish to populate. ++ States Outside the US (two to three characters): To find the correct state codes outside the US, go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the “ISO 3166-2 codes” column next to the country you wish to populate. ## Locale -Advanced Billing allows you to attribute a language/region to your customer to deliver invoices in any required language. -For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale) +You can attribute a language/region to the customer to deliver invoices in any required language. For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer-Locale). ```ts async createCustomer( @@ -147,6 +146,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "en-US" @@ -290,7 +290,8 @@ try { "portal_customer_created_at": "2016-10-04T15:22:29-04:00", "portal_invite_last_sent_at": "2016-10-04T15:22:30-04:00", "portal_invite_last_accepted_at": null, - "tax_exempt": false + "tax_exempt": false, + "surcharging": false } }, { @@ -316,6 +317,7 @@ try { "portal_invite_last_sent_at": "2016-10-13T16:52:54-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": true, "parent_id": 123 } }, @@ -342,6 +344,7 @@ try { "portal_invite_last_sent_at": "2016-10-19T10:49:19-04:00", "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "parent_id": null } } @@ -434,6 +437,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": null, "parent_id": null, "locale": "es-MX", @@ -543,6 +547,7 @@ try { "portal_invite_last_sent_at": null, "portal_invite_last_accepted_at": null, "tax_exempt": false, + "surcharging": false, "vat_number": "012345678" } } @@ -676,6 +681,8 @@ try { Lists all subscriptions that belong to a customer. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, subscriptions no longer require an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ```ts async listCustomerSubscriptions( customerId: number, diff --git a/doc/controllers/events-based-billing-segments.md b/doc/controllers/events-based-billing-segments.md index 4af8b2af..6a28de2c 100644 --- a/doc/controllers/events-based-billing-segments.md +++ b/doc/controllers/events-based-billing-segments.md @@ -215,9 +215,9 @@ try { # Update Segment -Updates a single segment for a component with a segmented metric. It allows you to update the pricing for the segment. +Updates a single segment for a component with a segmented metric. You can also update the pricing for the segment. -You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. +You can specify component and/or price point by using either the numeric ID or the `handle:gold` syntax. ```ts async updateSegment( diff --git a/doc/controllers/events.md b/doc/controllers/events.md index 6d63f908..28832a9d 100644 --- a/doc/controllers/events.md +++ b/doc/controllers/events.md @@ -19,15 +19,11 @@ const eventsController = new EventsController(client); Lists events for a site. -## Events Intro +Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. -Advanced Billing Events include various activity that happens around a Site. This information is **especially** useful to track down issues that arise when subscriptions are not created due to errors. +Within the UI, Events are referred to as Site Activity. For more information, see [Site Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). -Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). - -## List Events for a Site - -This method will retrieve a list of events for a site. Use query string filters to narrow down results. You may use the `key` filter as part of your query string to narrow down results. +Use query string filters to narrow down results. You can use the `filter` parameter to filter by event key. ### Legacy Filters @@ -42,7 +38,7 @@ The following keys are no longer supported. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -59,7 +55,7 @@ Here’s an example event for the `subscription_product_change` event: "event": { "id": 351, "key": "subscription_product_change", - "message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'", + "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", "subscription_id": 205, "event_specific_data": { "new_product_id": 3, @@ -77,7 +73,7 @@ Here’s an example event for the `subscription_state_change` event: "event": { "id": 353, "key": "subscription_state_change", - "message": "State changed on Marky Mark's subscription to Pro from trialing to active", + "message": "State changed on Mark Alan's subscription to Pro from trialing to active", "subscription_id": 205, "event_specific_data": { "new_subscription_state": "active", @@ -88,6 +84,22 @@ Here’s an example event for the `subscription_state_change` event: } ``` +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Plan changed on Subscription from previous plan to new plan” +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” + ```ts async listEvents( { @@ -129,8 +141,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | -| `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 | +| `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` | [`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. | @@ -253,7 +265,7 @@ Lists events for a subscription. ## Event Key -The event type is identified by the key property. You can check supported keys [here](../../doc/models/event-key.md). +The event type is identified by the key property. See [Event Key](../../doc/models/event-key.md) for a complete list of supported keys. ## Event Specific Data @@ -261,6 +273,22 @@ Different event types may include additional data in `event_specific_data` prope 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). +## Enhanced Catalog Experience + +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```ts async listSubscriptionEvents( { @@ -295,8 +323,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscriptionId` | `number` | Template, Required | The Chargify id of the subscription. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | -| `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 | +| `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` | [`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. | @@ -393,6 +421,20 @@ try { Returns the total count of events for a given site. +If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + +Event name changes: + +- subscription_product_change → subscription_plan_change +- component_allocation_change → allocation_change +- component_billing_date_change → product_billing_date_change + +Message updates: + +- “Successful payment for allocation changes to Product on Subscription” +- “Failed payment for allocation changes to Product on Subscription” +- “Plan changed on Subscription from previous plan to new plan” + ```ts async readEventsCount( { @@ -424,8 +466,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | -| `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 | +| `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` | [`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. | diff --git a/doc/controllers/insights.md b/doc/controllers/insights.md index d3264148..1ac24d54 100644 --- a/doc/controllers/insights.md +++ b/doc/controllers/insights.md @@ -119,8 +119,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `atTime` | `string \| undefined` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time | -| `subscriptionId` | `number \| undefined` | Query, Optional | submit the id of a subscription in order to limit results | +| `atTime` | `string \| undefined` | Query, Optional | submit a timestamp in ISO8601 format to request MRR for a historic time. | +| `subscriptionId` | `number \| undefined` | Query, Optional | submit the id of a subscription in order to limit results. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -231,7 +231,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `subscriptionId` | `number \| undefined` | Query, Optional | optionally filter results by subscription | +| `subscriptionId` | `number \| undefined` | Query, Optional | (Optional) Filter results by subscription. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 50; any per_page value over 50 will be changed to 50.
Use in query `per_page=20`.

**Default**: `10`

**Constraints**: `<= 50` | | `direction` | [`SortingDirection \| undefined`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | @@ -332,7 +332,7 @@ try { **This endpoint is deprecated.** -This endpoint returns your site's current MRR, including plan and usage breakouts split per subscription. +Lists your site's current MRR, including plan and usage breakouts split per subscription. ```ts async listMrrPerSubscription( diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md index 0263128f..0fef5535 100644 --- a/doc/controllers/invoices.md +++ b/doc/controllers/invoices.md @@ -23,6 +23,8 @@ const invoicesController = new InvoicesController(client); * [Void Invoice](../../doc/controllers/invoices.md#void-invoice) * [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments) * [Create Invoice](../../doc/controllers/invoices.md#create-invoice) +* [Update Invoice](../../doc/controllers/invoices.md#update-invoice) +* [Delete Invoice](../../doc/controllers/invoices.md#delete-invoice) * [Send Invoice](../../doc/controllers/invoices.md#send-invoice) * [Preview Customer Information Changes](../../doc/controllers/invoices.md#preview-customer-information-changes) * [Update Customer Information](../../doc/controllers/invoices.md#update-customer-information) @@ -31,7 +33,7 @@ const invoicesController = new InvoicesController(client); # Refund Invoice -Refund an invoice, segment, or consolidated invoice. +Refunds an invoice, segment, or consolidated invoice. ## Partial Refund for Consolidated Invoice @@ -120,7 +122,7 @@ try { # List Invoices -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`. +Lists invoices for a site. 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( @@ -194,13 +196,13 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`Direction \| undefined`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction.Desc` | -| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `boolean \| undefined` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `boolean \| undefined` | Query, Optional | Include payments data

**Default**: `false` | -| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data

**Default**: `false` | -| `refunds` | `boolean \| undefined` | Query, Optional | Include refunds data

**Default**: `false` | +| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `boolean \| undefined` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `boolean \| undefined` | Query, Optional | Include payments data.

**Default**: `false` | +| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data.

**Default**: `false` | +| `refunds` | `boolean \| undefined` | Query, Optional | Include refunds data.

**Default**: `false` | | `dateField` | [`InvoiceDateField \| undefined`](../../doc/models/invoice-date-field.md) | Query, Optional | The type of filter you would like to apply to your search. Use in query `date_field=issue_date`.

**Default**: `InvoiceDateField.DueDate` | | `startDatetime` | `string \| undefined` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Allowed to be used only along with date_field set to created_at or updated_at. | | `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns invoices with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Allowed to be used only along with date_field set to created_at or updated_at. | @@ -547,7 +549,7 @@ try { # Read Invoice -Use this endpoint to retrieve the details for an invoice. +Returns the details for an invoice. ## PDF Invoice retrieval @@ -728,7 +730,7 @@ try { # List Invoice Events -This endpoint returns a list of invoice events. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. +Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as well as a snapshot of the `invoice` at the time of event completion. Exposed event types are: @@ -1221,7 +1223,7 @@ try { # Record Payment for Invoice -Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the Bulk Payment endpoint. +Applies a payment of a given type against a specific invoice. If you would like to apply a payment across multiple invoices, you can use the [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices) endpoint. ```ts async recordPaymentForInvoice( @@ -1302,31 +1304,10 @@ try { # Record Payment for Multiple Invoices -This API call should be used when you want to record an external payment against multiple invoices. +Records an external payment against multiple invoices. To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., `invoice_uid` and `amount`) details. -``` -{ - "payment": { - "memo": "to pay the bills", - "details": "check number 8675309", - "method": "check", - "amount": "250.00", - "applications": [ - { - "invoice_uid": "inv_8gk5bwkct3gqt", - "amount": "100.00" - }, - { - "invoice_uid": "inv_7bc6bwkct3lyt", - "amount": "150.00" - } - ] - } -} -``` - Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum. ```ts @@ -1435,7 +1416,7 @@ try { # List Credit Notes -Credit Notes are like inverse invoices. They reduce the amount a customer owes. +Lists credit notes for a site. 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`. @@ -1475,11 +1456,11 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `subscriptionId` | `number \| undefined` | Query, Optional | The subscription's Advanced Billing id | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | -| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data

**Default**: `false` | -| `refunds` | `boolean \| undefined` | Query, Optional | Include refunds data

**Default**: `false` | -| `applications` | `boolean \| undefined` | Query, Optional | Include applications data

**Default**: `false` | +| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data.

**Default**: `false` | +| `refunds` | `boolean \| undefined` | Query, Optional | Include refunds data.

**Default**: `false` | +| `applications` | `boolean \| undefined` | Query, Optional | Include applications data.

**Default**: `false` | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -1835,7 +1816,7 @@ try { # Read Credit Note -Use this endpoint to retrieve the details for a credit note. +Returns the details for a credit note. ```ts async readCreditNote( @@ -2208,7 +2189,7 @@ try { # Record Payment for Subscription -Record an external payment made against a subscription that will pay partially or in full one or more invoices. +Records an external payment made against a subscription that will pay partially or in full one or more invoices. Payment will be applied starting with the oldest open invoice and then next oldest, and so on until the amount of the payment is fully consumed. @@ -2317,7 +2298,7 @@ try { # Reopen Invoice -This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). +Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open at the time the subscription was canceled (whether through dunning or an intentional cancellation). Invoices with "canceled" status are no longer considered to be due. Once reopened, they are considered due for payment. Payment may then be captured in one of the following ways: @@ -2396,7 +2377,7 @@ try { # Void Invoice -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. +Voids 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( @@ -2475,7 +2456,7 @@ try { # List Consolidated Invoice Segments -Invoice segments returned on the index will only include totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. +Lists segments for a consolidated invoice. 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( @@ -2824,7 +2805,7 @@ try { # Create Invoice -This endpoint will allow you to create an ad hoc invoice. +Creates an ad hoc invoice. ### Basic Behavior @@ -3210,9 +3191,215 @@ try { | 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseError`](../../doc/models/error-array-map-response-error.md) | +# Update Invoice + +Updates an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through this endpoint and the request returns a `422` error. If the invoice does not belong to the provided subscription, a `404` error is returned. + +Only the attributes submitted in the request are changed — omitted attributes keep their current values. + +### Line Items + +The `line_items` array describes changes to the invoice's line items. Line items not referenced in the array remain unchanged. + +#### Adding a line item + +A line item without a `uid` is added to the invoice. The same line item types and options as on invoice creation are supported (custom items, `product_id`, `component_id`, price points, period date ranges, taxes). + +#### Updating a line item + +A line item with the `uid` of an existing line item updates that line item with the submitted attributes. Amounts and taxes are recalculated. + +#### Removing a line item + +A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain unchanged. + +Referencing a `uid` which does not exist on the invoice returns a `422` error. + +### Coupons + +When the `coupons` key is present, the submitted coupons replace all discounts currently applied to the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice creation. + +### Invoice Options + +#### Issue Date and Net Terms + +The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in the past are accepted. The date is interpreted and validated in your site's time zone, using the `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on which the invoice is due. The due date is recalculated whenever the issue date or net terms change. + +#### Addresses + +The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after an address change. + +#### Memo and Payment Instructions + +A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be sent with the `payment_instructions` parameter. + +```ts +async updateInvoice( + subscriptionId: number, + uid: string, + body?: UpdateInvoiceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `number` | Template, Required | The Chargify id of the subscription. | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `body` | [`UpdateInvoiceRequest \| undefined`](../../doc/models/update-invoice-request.md) | Body, Optional | Request payload for updating a draft ad hoc invoice. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +**200**: OK + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The `result` property of this instance returns the response data which is of type [`InvoiceResponse`](../../doc/models/invoice-response.md). + +## Example Usage + +```ts +const subscriptionId = 222; + +const uid = 'uid0'; + +const body: UpdateInvoiceRequest = { + invoice: { + netTerms: 30, + memo: 'Updated memo', + }, +}; + +try { + const response = await invoicesController.updateInvoice( + subscriptionId, + uid, + body + ); + + // Extracting fully parsed response body. + console.log(response.result); + + // Extracting response status code. + console.log(response.statusCode); + // Extracting response headers. + console.log(response.headers); + // Extracting response body of type `string | Stream` + console.log(response.body); +} catch (error) { + if (error instanceof ApiError) { + // Extracting response error status code. + console.log(error.statusCode); + // Extracting response error headers. + console.log(error.headers); + // Extracting response error body of type `string | Stream`. + console.log(error.body); + if (error instanceof ErrorListResponseError) { + console.log(error.result); + } else if (error instanceof ErrorArrayMapResponseError) { + console.log(error.result); + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorArrayMapResponseError`](../../doc/models/error-array-map-response-error.md) | + + +# Delete Invoice + +Deletes an ad hoc invoice while it is in the `draft` state. + +**Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If the invoice does not belong to the provided subscription, a `404` error is returned. + +A successful deletion returns a `204 No Content` response and the invoice is permanently removed. + +```ts +async deleteInvoice( + subscriptionId: number, + uid: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Authentication + +This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `number` | Template, Required | The Chargify id of the subscription. | +| `uid` | `string` | Template, Required | The unique identifier for the invoice, this does not refer to the public facing invoice number. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +**204**: No Content + +This method returns an [`ApiResponse`](../../doc/api-response.md) instance. + +## Example Usage + +```ts +const subscriptionId = 222; + +const uid = 'uid0'; + +try { + const response = await invoicesController.deleteInvoice( + subscriptionId, + uid + ); + + // Extracting fully parsed response body. + console.log(response.result); + + // Extracting response status code. + console.log(response.statusCode); + // Extracting response headers. + console.log(response.headers); + // Extracting response body of type `string | Stream` + console.log(response.body); +} catch (error) { + if (error instanceof ApiError) { + // Extracting response error status code. + console.log(error.statusCode); + // Extracting response error headers. + console.log(error.headers); + // Extracting response error body of type `string | Stream`. + console.log(error.body); + if (error instanceof ErrorListResponseError) { + console.log(error.result); + } + } +} +``` + +## Errors + +| HTTP Status Code | Error Description | Exception Class | +| --- | --- | --- | +| 404 | Not Found | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | +| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) | + + # Send Invoice -This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. +Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by providing URLs to the files you want to attach. When using attachments, the request must use `multipart/form-data` content type. Max 10 files, 10MB per file. @@ -3302,7 +3489,7 @@ try { # Preview Customer Information Changes -Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. +Previews the effect of customer information changes on an open invoice. Customer information may change after an invoice is issued, which may lead to a mismatch between customer information that is present on an open invoice and actual customer information. This endpoint allows you to preview these differences, if any. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -3425,7 +3612,7 @@ try { # Update Customer Information -This endpoint updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. +Updates customer information on an open invoice and returns the updated invoice. If you would like to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` endpoint first. The endpoint doesn't accept a request body. Customer information differences are calculated on the application side. @@ -3683,7 +3870,7 @@ try { # Issue Invoice -This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. +Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that was created when allocating new quantity on a component and using "accrue charges" option. You cannot issue a pending child invoice that was created for a member subscription in a group. diff --git a/doc/controllers/offers.md b/doc/controllers/offers.md index 0d0b2dbf..b5a6917a 100644 --- a/doc/controllers/offers.md +++ b/doc/controllers/offers.md @@ -19,15 +19,13 @@ const offersController = new OffersController(client); # Create Offer -Creates an offer within your Advanced Billing site. - -## Documentation +Creates an offer within your site. Offers allow you to package complicated combinations of products, components and coupons into a convenient package which can then be subscribed to just like products. Once an offer is defined it can be used as an alternative to the product when creating subscriptions. -Full documentation on how to use offers in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). +For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview) in the product documentation. ## Using a Product Price Point diff --git a/doc/controllers/payment-profiles.md b/doc/controllers/payment-profiles.md index dbb6b071..e84e92ed 100644 --- a/doc/controllers/payment-profiles.md +++ b/doc/controllers/payment-profiles.md @@ -160,7 +160,7 @@ try { # List Payment Profiles -Returns all 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. +Lists all active payment profiles for a site, or for one customer within a site. If no payment profiles are found, this endpoint returns an empty array. ```ts async listPaymentProfiles( @@ -567,7 +567,7 @@ try { 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. +If the payment profile is in use by one or more subscriptions or groups, an error message is returned. ```ts async deleteUnusedPaymentProfile( @@ -637,9 +637,9 @@ try { Deletes a payment profile belonging to the customer on the subscription. -+ If the customer has multiple subscriptions, the payment profile will be removed from all of them. +If the customer has multiple subscriptions, the payment profile is removed from all of them. -+ 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). +If you delete the default payment profile for a subscription, you 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( @@ -985,7 +985,7 @@ try { # Change Subscription Group Default Payment Profile -This will change the default payment profile on the subscription group to the existing payment profile with the id specified. +Changes the default payment profile on the subscription group to the existing payment profile with the specified ID. 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. @@ -1092,7 +1092,7 @@ try { # Read One Time Token -One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. +Returns the one-time token data, including credit card or ACH details, associated with the provided token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe only) data for a customer. You can use One Time Tokens while creating a subscription or payment profile instead of passing all bank account or credit card data directly to a given API endpoint. @@ -1163,7 +1163,7 @@ try { # Send Request Update Payment Email -You can send a "request payment update" email to the customer associated with the subscription. +Sends a "request payment update" email to the customer associated with the subscription. If you attempt to send a "request payment update" email more than five times within a 30-minute period, you will receive a `422` response with an error message in the body. This error message will indicate that the request has been rejected due to excessive attempts, and will provide instructions on how to resubmit the request. diff --git a/doc/controllers/product-families.md b/doc/controllers/product-families.md index d10b46a9..b26daa6b 100644 --- a/doc/controllers/product-families.md +++ b/doc/controllers/product-families.md @@ -68,7 +68,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `endDate` | `string \| undefined` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns products with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. | | `startDatetime` | `string \| undefined` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. | | `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns products with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. | -| `includeArchived` | `boolean \| undefined` | Query, Optional | Include archived products | +| `includeArchived` | `boolean \| undefined` | Query, Optional | Include archived products. | | `include` | [`ListProductsInclude \| undefined`](../../doc/models/list-products-include.md) | Query, Optional | Allows including additional data in the response. Use in query `include=prepaid_product_price_point`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | @@ -228,7 +228,7 @@ try { # Create Product Family -Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a container for your products, components, and coupons. +Creates a Product Family within your site. Create a Product Family to act as a container for your products, components, and coupons. 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). @@ -263,6 +263,7 @@ const body: CreateProductFamilyRequest = { productFamily: { name: 'Acme Projects', description: 'Amazing project management tool', + surcharging: false, }, }; @@ -302,7 +303,8 @@ try { "name": "Acme Projects", "description": "Amazing project management tool", "handle": "acme-projects", - "accounting_code": null + "accounting_code": null, + "surcharging": false } } ``` @@ -316,7 +318,7 @@ try { # List Product Families -Returns a list of Product Families for a site. +Lists Product Families for a site. ```ts async listProductFamilies( @@ -400,6 +402,7 @@ try { "description": null, "handle": "acme-projects", "accounting_code": null, + "surcharging": false, "created_at": "2013-02-20T15:05:51-07:00", "updated_at": "2013-02-20T15:05:51-07:00", "archived_at": null @@ -412,6 +415,7 @@ try { "description": "Another family.", "handle": "bat-family", "accounting_code": null, + "surcharging": true, "created_at": "2014-04-16T12:41:13-06:00", "updated_at": "2014-04-16T12:41:13-06:00", "archived_at": "2024-11-05T09:30:00-07:00" @@ -490,6 +494,7 @@ try { "description": "", "handle": "billing-plans", "accounting_code": null, + "surcharging": false, "archived_at": null } } diff --git a/doc/controllers/product-price-points.md b/doc/controllers/product-price-points.md index 11bd5ccd..de6fa010 100644 --- a/doc/controllers/product-price-points.md +++ b/doc/controllers/product-price-points.md @@ -176,7 +176,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `productId` | [`ListProductPricePointsInputProductId`](../../doc/models/containers/list-product-price-points-input-product-id.md) | Template, Required | This is a container for one-of cases. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | This parameter indicates how many records to fetch in each request. Default value is 10. The maximum allowed values is 200; any per_page value over 200 will be changed to 200.

**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. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true 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. | @@ -378,7 +378,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `productId` | [`ReadProductPricePointProductId`](../../doc/models/containers/read-product-price-point-product-id.md) | Template, Required | This is a container for one-of cases. | | `pricePointId` | [`ReadProductPricePointPricePointId`](../../doc/models/containers/read-product-price-point-price-point-id.md) | Template, Required | This is a container for one-of cases. | -| `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. | +| `currencyPrices` | `boolean \| undefined` | Query, Optional | (Optional) If you have defined multiple currencies at the site level, you can pass ?currency_prices=true 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. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type diff --git a/doc/controllers/products.md b/doc/controllers/products.md index a5cd9420..e761f2fa 100644 --- a/doc/controllers/products.md +++ b/doc/controllers/products.md @@ -20,11 +20,13 @@ const productsController = new ProductsController(client); # Create Product -Creates a product in your Advanced Billing site. +Creates a product in your site. -See the following product documentation for more information: +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If `auto_create_signup_page` is included (with any value) an error is returned. -+ [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) +For more information, see: + ++ [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations) ```ts diff --git a/doc/controllers/proforma-invoices.md b/doc/controllers/proforma-invoices.md index fd0721de..df2e92d3 100644 --- a/doc/controllers/proforma-invoices.md +++ b/doc/controllers/proforma-invoices.md @@ -24,7 +24,7 @@ const proformaInvoicesController = new ProformaInvoicesController(client); # Create Consolidated Proforma Invoice -Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the subscription group listing for proforma invoices; only one consolidated proforma invoice may be created per group at a time. +Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated proforma invoice, you can poll the subscription group listing for proforma invoices; only one consolidated proforma invoice can be created per group at a time. If the information becomes outdated, simply void the old consolidated proforma invoice and generate a new one. @@ -133,12 +133,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `uid` | `string` | Template, Required | The uid of the subscription group | -| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `boolean \| undefined` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `boolean \| undefined` | Query, Optional | Include payments data

**Default**: `false` | -| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data

**Default**: `false` | +| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `boolean \| undefined` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `boolean \| undefined` | Query, Optional | Include payments data.

**Default**: `false` | +| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data.

**Default**: `false` | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -386,12 +386,12 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | | `direction` | [`Direction \| undefined`](../../doc/models/direction.md) | Query, Optional | The sort direction of the returned invoices.

**Default**: `Direction.Desc` | -| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data

**Default**: `false` | -| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data

**Default**: `false` | -| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data

**Default**: `false` | -| `credits` | `boolean \| undefined` | Query, Optional | Include credits data

**Default**: `false` | -| `payments` | `boolean \| undefined` | Query, Optional | Include payments data

**Default**: `false` | -| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data

**Default**: `false` | +| `lineItems` | `boolean \| undefined` | Query, Optional | Include line items data.

**Default**: `false` | +| `discounts` | `boolean \| undefined` | Query, Optional | Include discounts data.

**Default**: `false` | +| `taxes` | `boolean \| undefined` | Query, Optional | Include taxes data.

**Default**: `false` | +| `credits` | `boolean \| undefined` | Query, Optional | Include credits data.

**Default**: `false` | +| `payments` | `boolean \| undefined` | Query, Optional | Include payments data.

**Default**: `false` | +| `customFields` | `boolean \| undefined` | Query, Optional | Include custom fields data.

**Default**: `false` | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -611,7 +611,7 @@ try { # Preview Proforma Invoice -Returns a preview of the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. +Previews the data that will be included on a given subscription's proforma invoice if one were to be generated. It will have similar line items and totals as a renewal preview, but the response will be presented in the format of a proforma invoice. Consequently it will include additional information such as the name and addresses that will appear on the proforma invoice. The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For example, previews are only available on the Relationship Invoicing architecture, and previews cannot be made for end-of-life subscriptions. diff --git a/doc/controllers/reason-codes.md b/doc/controllers/reason-codes.md index f3b47e58..433fa110 100644 --- a/doc/controllers/reason-codes.md +++ b/doc/controllers/reason-codes.md @@ -21,21 +21,11 @@ const reasonCodesController = new ReasonCodesController(client); Creates a reason code for a given site. -# Reason Codes Intro - Reason Codes are a way to gain a high-level view of why your customers are cancelling the subscription to your product or service. Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your subscribers decide to cancel their subscription, learn why they decided to cancel. -## Reason Code Documentation - -Full documentation on how Reason Codes operate within Advanced Billing can be located under the following links. - -[Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) - -## Create Reason Code - -This method gives a merchant the option to create reason codes for a given site. +For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes). ```ts async createReasonCode( diff --git a/doc/controllers/referral-codes.md b/doc/controllers/referral-codes.md index 240379a2..476632ce 100644 --- a/doc/controllers/referral-codes.md +++ b/doc/controllers/referral-codes.md @@ -13,13 +13,7 @@ const referralCodesController = new ReferralCodesController(client); Validates whether a referral code is valid and applicable within your site. This method is useful for validating referral codes that are entered by a customer. -## Referrals Documentation - -Full documentation on how to use the referrals feature in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). - -## Server Response - -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. +For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en-us/articles/24286981223693-Understanding-Referrals) in the product documentation. ```ts async validateReferralCode( diff --git a/doc/controllers/sales-commissions.md b/doc/controllers/sales-commissions.md index 95af1b05..97c9eb89 100644 --- a/doc/controllers/sales-commissions.md +++ b/doc/controllers/sales-commissions.md @@ -25,7 +25,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ts async listSalesCommissionSettings( @@ -138,7 +138,7 @@ try { # List Sales Reps -Returns a sales rep list with details. +Lists sales reps with details. ## Modified Authentication Process @@ -146,7 +146,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ts async listSalesReps( @@ -316,7 +316,7 @@ The Sales Commission API differs from other Chargify API endpoints. This resourc Access to the Sales Commission API endpoints is available to users with financial access, where the seller has the Advanced Analytics component enabled. For further information on getting access to Advanced Analytics contact Maxio support. -> Note: The request is at seller level, it means `<>` variable will be replaced by `app` +> Note: The request is at seller level, it means `<>` variable will be replaced by `app`. ```ts async readSalesRep( diff --git a/doc/controllers/sites.md b/doc/controllers/sites.md index b32ca75c..1fc1df18 100644 --- a/doc/controllers/sites.md +++ b/doc/controllers/sites.md @@ -19,20 +19,19 @@ const sitesController = new SitesController(client); Retrieves site data. -Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites). - -Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint documentation. +For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. #### Relationship invoicing enabled -If the site has RI enabled then you will see more settings like: +If the site has Relationship invoicing enabled, additional properties are returned in the response: - "customer_hierarchy_enabled": true, - "whopays_enabled": true, - "whopays_default_payer": "self" +``` +"customer_hierarchy_enabled": true, +"whopays_enabled": true, +"whopays_default_payer": "self" +``` -You can read more about these settings here: -[Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays) +For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer-Hierarchies-WhoPays). ```ts async readSite( @@ -197,7 +196,7 @@ try { # List Chargify Js Public Keys -Returns public keys used for Maxio.js (formerly Chargify.js). +Lists public keys used for Maxio.js (formerly Chargify.js). ```ts async listChargifyJsPublicKeys( diff --git a/doc/controllers/subscription-components.md b/doc/controllers/subscription-components.md index aa911587..0ba619be 100644 --- a/doc/controllers/subscription-components.md +++ b/doc/controllers/subscription-components.md @@ -715,7 +715,7 @@ try { # List Allocations -Returns the 50 most recent Allocations, ordered by most recent first. +Lists the 50 most recent Allocations, ordered by most recent first. ## On/Off Components @@ -1538,7 +1538,7 @@ try { # List Usages -Returns a list of usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. +Lists usages associated with a subscription for a particular metered component. This will display the previously recorded components for a subscription. This endpoint is not compatible with quantity-based components. @@ -1589,8 +1589,8 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `subscriptionIdOrReference` | [`ListUsagesInputSubscriptionIdOrReference`](../../doc/models/containers/list-usages-input-subscription-id-or-reference.md) | Template, Required | This is a container for one-of cases. | | `componentId` | [`ListUsagesInputComponentId`](../../doc/models/containers/list-usages-input-component-id.md) | Template, Required | This is a container for one-of cases. | -| `sinceId` | `bigint \| undefined` | Query, Optional | Returns usages with an id greater than or equal to the one specified | -| `maxId` | `bigint \| undefined` | Query, Optional | Returns usages with an id less than or equal to the one specified | +| `sinceId` | `bigint \| undefined` | Query, Optional | Returns usages with an id greater than or equal to the one specified. | +| `maxId` | `bigint \| undefined` | Query, Optional | Returns usages with an id less than or equal to the one specified. | | `sinceDate` | `string \| undefined` | Query, Optional | Returns usages with a created_at date greater than or equal to midnight (12:00 AM) on the date specified. | | `untilDate` | `string \| undefined` | Query, Optional | Returns usages with a created_at date less than or equal to midnight (12:00 AM) on the date specified. | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | @@ -1673,13 +1673,13 @@ try { Activates an event-based component for a single subscription. -In order to bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. +To bill your subscribers on your Events data under the Events-Based Billing feature, the components must be activated for the subscriber. -Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes Advanced Billing to bill for events when the subscription is renewed. +Use this endpoint to activate an event-based component for a single subscription. Activating an event-based component causes billing for events when the subscription is renewed. -*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.* +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( @@ -1834,21 +1834,15 @@ try { Records a single event for Events-Based Billing. -## Documentation - Events-Based Billing is an evolved form of metered billing that is based on data-rich events streamed in real-time from your system to Advanced Billing. These events can then be transformed, enriched, or analyzed to form the computed totals of usage charges billed to your customers. This API allows you to stream events into the Advanced Billing data ingestion engine. -Learn more about the feature in general in the [Events-Based Billing help docs](https://maxio.zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - -## Record Event - -Use this endpoint to record a single event. +For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en-us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). -*Note: this endpoint differs from the standard Chargify API endpoints in that the URL subdomain will be `events` and your site subdomain will be included in the URL path. For example:* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. For example: ``` https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle @@ -1872,7 +1866,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `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. | +| `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. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`EBBEvent \| undefined`](../../doc/models/ebb-event.md) | Body, Optional | - | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | @@ -1927,7 +1921,7 @@ try { Records a collection of events. -*Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be `events` and your site subdomain will be included in the URL path.* +Note: this endpoint differs from the standard URL for this API in that `events` and your site subdomain are included in the path. A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit is exceeded. @@ -1949,7 +1943,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `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. | +| `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. This applies to Legacy Metering sites only — it has no effect on Maxio Metering sites. | | `body` | [`EBBEvent[] \| undefined`](../../doc/models/ebb-event.md) | Body, Optional | - | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | diff --git a/doc/controllers/subscription-groups.md b/doc/controllers/subscription-groups.md index 738dfd5b..43f8b39a 100644 --- a/doc/controllers/subscription-groups.md +++ b/doc/controllers/subscription-groups.md @@ -216,7 +216,7 @@ try { # List Subscription Groups -Returns an array of subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. +Lists subscription groups for the site. The response is paginated and will return a `meta` key with pagination information. #### Account Balance Information @@ -420,9 +420,9 @@ try { "current_billing_amount_in_cents": 11500, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -625,7 +625,7 @@ try { Finds the subscription group associated with a subscription. -If the subscription is not in a group, the endpoint will return a 404 code. +If the subscription is not in a group, this endpoint returns an error. ```ts async findSubscriptionGroup( @@ -699,9 +699,9 @@ try { "cancel_at_end_of_period": false, "customer": { "first_name": "Mark", - "last_name": "Wannabewahlberg", - "organization": "The Funky Bunch", - "email": "markymark@example.com", + "last_name": "Smith", + "organization": "Acme Inc.", + "email": "smith@example.com", "reference": "4c92223b-bc16-4d0d-87ff-b177a89a2655" }, "account_balances": { @@ -730,7 +730,7 @@ try { # Add Subscription to Group -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 add existing subscriptions to subscription groups. +Adds an existing subscription to a subscription group. 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 add existing subscriptions to subscription groups. Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already part of a hierarchy, the subscription will become a member of the customer's subscription group. If the target customer or subscription is not part of a subscription group, a new group will be created and the subscription will become part of the group with the specified target customer set as the responsible payer for the group's subscriptions. @@ -842,7 +842,7 @@ try { # Remove Subscription from Group -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 an existing subscription from a subscription group. +Removes an existing subscription from a subscription group. 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 an existing subscription from a subscription group. ```ts async removeSubscriptionFromGroup( diff --git a/doc/controllers/subscription-notes.md b/doc/controllers/subscription-notes.md index 1ef144ba..7f8b7276 100644 --- a/doc/controllers/subscription-notes.md +++ b/doc/controllers/subscription-notes.md @@ -21,13 +21,11 @@ const subscriptionNotesController = new SubscriptionNotesController(client); Creates a note for a subscription. -## How to Use Subscription Notes - Notes allow you to record information about a particular Subscription in a free text format. -If you have structured data such as birth date, color, etc., consider using Metadata instead. +If you have structured data such as birth date, color, etc., consider using [Metadata](../../doc/controllers/custom-fields.md#create-metadata) instead. -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). +For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997-Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.-,Adding%20Notes,-Notes%20are%20optional) in the product documentation. ```ts async createSubscriptionNote( diff --git a/doc/controllers/subscription-products.md b/doc/controllers/subscription-products.md index 9216a320..f8b8819f 100644 --- a/doc/controllers/subscription-products.md +++ b/doc/controllers/subscription-products.md @@ -18,17 +18,15 @@ const subscriptionProductsController = new SubscriptionProductsController(client Migrates a subscription to a different product. -In order to create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You may also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed the subscription will be moved to the products default price point. The response will be the updated subscription. +To create a migration, you must pass the `product_id` or `product_handle` in the object when you send a POST request. You can also pass either a `product_price_point_id` or `product_price_point_handle` to choose which price point the subscription is moved to. If no price point identifier is passed, the subscription is moved to the product's default price point. The response is the updated subscription. ## Valid Subscriptions -Subscriptions should be in the `active` or `trialing` state in order to be migrated. +Subscriptions should be in the `active` or `trialing` state to be migrated. (For backwards compatibility reasons, it is possible to migrate a subscription that is in the `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of-life state, the subscription should be canceled, the product changed, and then the subscription can be reactivated.) -## Migrations Documentation - -Full documentation on how to record Migrations in the Advanced Billing UI can be located [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced-Billing). +For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en-us/articles/24252069837581-Product-Changes-and-Migrations). ## Failed Migrations diff --git a/doc/controllers/subscription-renewals.md b/doc/controllers/subscription-renewals.md index fb691b75..d79019a1 100644 --- a/doc/controllers/subscription-renewals.md +++ b/doc/controllers/subscription-renewals.md @@ -730,7 +730,7 @@ try { # Unpublish Scheduled Renewal Configuration -Returns a scheduled renewal configuration to an editable state. +Restores a scheduled renewal configuration to an editable state. ```ts async unpublishScheduledRenewalConfiguration( @@ -948,6 +948,8 @@ try { Adds product and component line items to the scheduled renewal. +If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ts async createScheduledRenewalConfigurationItem( subscriptionId: number, @@ -1063,6 +1065,8 @@ try { Updates an existing configuration item’s pricing and quantity. +If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price.list_price_point_id, validates and persists it; omitted value follows existing/default behavior; with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This functionality is supported in the API, but is not currently supported in SDKs. + ```ts async updateScheduledRenewalConfigurationItem( subscriptionId: number, diff --git a/doc/controllers/subscription-status.md b/doc/controllers/subscription-status.md index 9b9f8013..84140cef 100644 --- a/doc/controllers/subscription-status.md +++ b/doc/controllers/subscription-status.md @@ -638,7 +638,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `number` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest \| undefined`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest \| undefined`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -831,7 +831,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `subscriptionId` | `number` | Template, Required | The Chargify id of the subscription. | -| `body` | [`PauseRequest \| undefined`](../../doc/models/pause-request.md) | Body, Optional | Allows to pause a Subscription | +| `body` | [`PauseRequest \| undefined`](../../doc/models/pause-request.md) | Body, Optional | Allows you to pause a Subscription. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -1581,26 +1581,26 @@ try { Previews a subscription’s next renewal assessment. Renewal Preview is an object representing a subscription’s next assessment. You can retrieve it to see a snapshot of how much your customer will be charged on their next renewal. -The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +The "Next Billing" amount and "Next Billing" date are already represented in the UI on each Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). ## Optional Component Fields -This endpoint is particularly useful due to the fact that it will return the computed billing amount for the base product and the components which are in use by a subscriber. +This endpoint is particularly useful because it returns the computed billing amount for the base product and the components which are in use by a subscriber. -By default, the preview will include billing details for all components _at their **current** quantities_. This means: +By default, the preview includes billing details for all components _at their **current** quantities_. This means: * Current `allocated_quantity` for quantity-based components * Current enabled/disabled status for on/off components * Current metered usage `unit_balance` for metered components * Current metric quantity value for events recorded thus far for events-based components -In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. We do not predict end-of-period values for components, so metered or events-based usage may be less than it will eventually be at the end of the period. +In the above statements, "current" means the quantity or value as of the call to the renewal preview endpoint. End-of-period values for components are not predicted, so metered or events-based usage may be less than it will eventually be at the end of the period. -Optionally, **you may provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. +Optionally, **you can provide your own custom quantities** for any component to see a billing preview for non-current quantities. This is accomplished by sending a request body with data under the `components` key. See the request body documentation below. -## Subscription Side Effects +## Preview Behavior -You can request a `POST` to obtain this data from the endpoint without any side effects. This method allows you to preview data, but does not log any changes against a subscription. +Sending a `POST` request to this endpoint returns preview data without modifying the subscription. This method previews data, but does not log any changes against a subscription. ```ts async previewRenewal( diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md index 4a4c6ba0..8571865f 100644 --- a/doc/controllers/subscriptions.md +++ b/doc/controllers/subscriptions.md @@ -34,6 +34,48 @@ Identify an existing customer with `customer_id` or `customer_reference`. Option Select an option from the **Request Examples** drop-down on the right side of the portal to see examples of common scenarios for creating subscriptions. +## List vs Sales Pricing + +When a subscription uses custom pricing as the sales price, you can optionally provide a list price for any item. If omitted, the list price defaults to the sales price. The difference between the list price and sales price is used to calculate implicit discounts, which appear on Invoices and in reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio.com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + +If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom pricing, validates and persists it, and returns list price metadata in subscription responses. If list pricing is disabled, this input is ignored and related response fields are omitted. + +When list pricing is enabled: + +- Subscription → Product `product_price_point_list_price_point_id` (integer) +- `product_price_point_list_price_point_handle` (string) +- Subscription Components (when components are included in the response, such as with subscriptions built from components or component serialization paths) `component_id` (integer) +- `price_point_id` (integer) +- `list_price_point_id` (integer) + +When list pricing is disabled: + +- Subscription → Product `product_price_point_list_price_point_id`: omitted +- `product_price_point_list_price_point_handle`: omitted +- Subscription Components `list_price_point_id`: omitted + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. + +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) +- a configured metered component + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. + +## Payment information + +Payment information may be required to create a subscription, depending on the options for the Product being subscribed. See [product options](https://docs.maxio.com/hc/en-us/articles/24261076617869-Edit-Products) for more information. See the [Payments Profile](../../doc/controllers/payment-profiles.md#create-payment-profile) endpoint for details on payment parameters. See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for more information on working with subscriptions in Advanced Billing. ## Payment information @@ -273,7 +315,9 @@ try { # List Subscriptions -Returns an array of subscriptions from a Site. Pay close attention to query string filters and pagination in order to control responses from the server. +Lists subscriptions for a site. Use the query string filters and pagination to control responses from the server. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. ## Search for a subscription @@ -288,36 +332,54 @@ async listSubscriptions( { page, perPage, + sort, + direction, state, product, + q, + qScope, + customerId, productPricePointId, coupon, couponCode, + collectionMethod, + brandingThemeId, dateField, startDate, endDate, startDatetime, endDatetime, metadata, - direction, - sort, + groupStatus, + dunningExemption, + paymentGateways, + currencies, include, }: { page?: number; perPage?: number; + sort?: SubscriptionSort; + direction?: SortingDirection; state?: SubscriptionStateFilter; - product?: number; + product?: ListSubscriptionsInputProduct; + q?: string; + qScope?: QScope; + customerId?: number; productPricePointId?: number; coupon?: number; couponCode?: string; + collectionMethod?: CollectionMethod1; + brandingThemeId?: number; dateField?: SubscriptionDateField; startDate?: string; endDate?: string; startDatetime?: string; endDatetime?: string; metadata?: Record; - direction?: SortingDirection; - sort?: SubscriptionSort; + groupStatus?: GroupStatus; + dunningExemption?: boolean; + paymentGateways?: string; + currencies?: string; include?: SubscriptionListInclude[]; }, requestOptions?: RequestOptions @@ -334,19 +396,28 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | --- | --- | --- | --- | | `page` | `number \| undefined` | Query, Optional | 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`.

**Default**: `1`

**Constraints**: `>= 1` | | `perPage` | `number \| undefined` | Query, Optional | 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`.

**Default**: `20`

**Constraints**: `<= 200` | +| `sort` | [`SubscriptionSort \| undefined`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort.SignupDate` | +| `direction` | [`SortingDirection \| undefined`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | | `state` | [`SubscriptionStateFilter \| undefined`](../../doc/models/subscription-state-filter.md) | Query, Optional | The current state of the subscription | -| `product` | `number \| undefined` | Query, Optional | The product id of the subscription. (Note that the product handle cannot be used.) | -| `productPricePointId` | `number \| undefined` | Query, Optional | The ID of the product price point. If supplied, product is required | +| `product` | [`ListSubscriptionsInputProduct \| undefined`](../../doc/models/containers/list-subscriptions-input-product.md) | Query, Optional | This is a container for one-of cases. | +| `q` | `string \| undefined` | Query, Optional | Search string. | +| `qScope` | [`QScope \| undefined`](../../doc/models/q-scope.md) | Query, Optional | Scope of fields used by the q search. | +| `customerId` | `number \| undefined` | Query, Optional | The Advanced Billing id of the customer. | +| `productPricePointId` | `number \| undefined` | Query, Optional | The ID of the product price point. If supplied, product is required. | | `coupon` | `number \| undefined` | Query, Optional | The numeric id of the coupon currently applied to the subscription. (This can be found in the URL when editing a coupon. Note that the coupon code cannot be used.) | | `couponCode` | `string \| undefined` | Query, Optional | The coupon code currently applied to the subscription | +| `collectionMethod` | [`CollectionMethod1 \| undefined`](../../doc/models/collection-method-1.md) | Query, Optional | The collection method for the subscription. | +| `brandingThemeId` | `number \| undefined` | Query, Optional | Filter subscriptions by the ID of an assigned Branding Theme. Branding Themes is a beta feature. See [Understand Branding Themes](https://docs.maxio.com/hc/en-us/articles/43796895662093-Understand-Branding-Themes#understand-branding-themes-0-0) for more information. | | `dateField` | [`SubscriptionDateField \| undefined`](../../doc/models/subscription-date-field.md) | Query, Optional | The type of filter you'd like to apply to your search. Allowed Values: , current_period_ends_at, current_period_starts_at, created_at, activated_at, canceled_at, expires_at, trial_started_at, trial_ended_at, updated_at | | `startDate` | `string \| undefined` | Query, Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp at or after midnight (12:00:00 AM) in your site’s time zone on the date specified. Use in query `start_date=2022-07-01`. | | `endDate` | `string \| undefined` | Query, Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns subscriptions with a timestamp up to and including 11:59:59PM in your site’s time zone on the date specified. Use in query `end_date=2022-08-01`. | | `startDatetime` | `string \| undefined` | Query, Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of start_date. Use in query `start_datetime=2022-07-01 09:00:05`. | | `endDatetime` | `string \| undefined` | Query, Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns subscriptions with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site's time zone will be used. If provided, this parameter will be used instead of end_date. Use in query `end_datetime=2022-08-01 10:00:05`. | | `metadata` | `Record \| undefined` | Query, Optional | The value of the metadata field specified in the parameter. Use in query `metadata[my-field]=value&metadata[other-field]=another_value`. | -| `direction` | [`SortingDirection \| undefined`](../../doc/models/sorting-direction.md) | Query, Optional | Controls the order in which results are returned.
Use in query `direction=asc`. | -| `sort` | [`SubscriptionSort \| undefined`](../../doc/models/subscription-sort.md) | Query, Optional | The attribute by which to sort

**Default**: `SubscriptionSort.SignupDate` | +| `groupStatus` | [`GroupStatus \| undefined`](../../doc/models/group-status.md) | Query, Optional | Filter by whether a subscription is in a group. | +| `dunningExemption` | `boolean \| undefined` | Query, Optional | Filter by dunning exemption status. | +| `paymentGateways` | `string \| undefined` | Query, Optional | Comma-separated payment gateway identifiers. | +| `currencies` | `string \| undefined` | Query, Optional | Comma-separated currency codes. | | `include` | [`SubscriptionListInclude[] \| undefined`](../../doc/models/subscription-list-include.md) | Query, Optional | Allows including additional data in the response. Use in query: `include[]=self_service_page_token`. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | @@ -362,10 +433,6 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The const collect = { page: 1, perPage: 50, - startDate: '2022-07-01', - endDate: '2022-08-01', - startDatetime: '2022-07-01 09:00:05', - endDatetime: '2022-08-01 10:00:05', sort: SubscriptionSort.SignupDate, include: [ SubscriptionListInclude.SelfServicePageToken @@ -447,7 +514,9 @@ The server response will not return data under the key/value pair of `next_billi For a subscription using Calendar Billing, setting the next billing date is a bit different. Send the `snap_day` attribute to change the calendar billing date for **a subscription using a product eligible for calendar billing**. -> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The `snap_day` will reset to null on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. +> Note: If you change the product associated with a subscription that contains a `snap_day` and immediately READ/GET the subscription data, it will still contain the original `snap_day`. The `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is instantaneous and only affects the product associated with a subscription. + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, `product`, `product_price_point_id`, and `product_price_point_type` are returned as `null`. ```ts async updateSubscription( @@ -638,6 +707,8 @@ try { Retrieves subscription details. +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, some subscriptions may not have an associated product. For subscriptions without an associated product, 'product', 'product_price_point_id', and 'product_price_point_type' are returned as 'null'. + ## Self-Service Page token 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. @@ -1010,7 +1081,7 @@ try { Purges an individual subscription for sites in test mode. -Provide the subscription ID in the url. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` +Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string `ack` parameter. You may also delete the customer record and/or payment profiles by passing `cascade` parameters. For example, to delete just the customer record, the query params would be: `?ack={customer_id}&cascade[]=customer` If you need to remove subscriptions from a live site, contact support to discuss your use case. @@ -1194,27 +1265,43 @@ Previews a subscription by POSTing the same JSON or XML as for a subscription cr The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. -A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. +This endpoint does not create a subscription; it is meant to serve as a prediction. + +For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + +## Subscriptions can now work independently from the catalog + +If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog-experience-and-terminology) enabled, you can create subscriptions without a `product_id` or `product_handle` using POST /subscriptions, building them entirely from components. -For more information, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). +A valid subscription must include at least one active component with: + +- a positive `allocated_quantity`, +- a positive `unit_balance`, or +- 'enabled: true' (for on/off components) + +`component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and `trial_interval_unit` are included, they are applied at creation. + +In the response, product and product price point fields are null, and component details are returned instead. + +This functionality is supported in the API, but is not currently supported in SDKs. ## Taxable Subscriptions -This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the following conditions must be met: +This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following conditions must be met: + Taxes must be configured on the subscription + The preview must be for the purchase of a taxable product or component, or combination of the two. -+ The subscription payload must contain a full billing or shipping address in order to calculate tax ++ The subscription payload must contain a full billing or shipping address to calculate tax -For more information about creating taxable previews, see our documentation guide on how to create [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) +For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes). -You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored in Advanced Billing. The billing address and the credit card information are stored together within the payment profile object. Also, you may not send a billing address to Advanced Billing without payment profile information, as the address is stored on the card. +You do **not** need to include a card number to generate tax information when you are previewing a subscription. However, when you actually want to create the subscription, you must include the credit card information if you want the billing address to be stored. The billing address and the credit card information are stored together within the payment profile object. Also, you cannot send a billing address without payment profile information, as the address is stored on the card. You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, pass `skip_billing_manifest_taxes: true` attribute. ## Non-taxable Subscriptions -If you'd like to calculate subscriptions that do not include tax you may leave off the billing information. +If you'd like to calculate subscriptions that do not include tax, you can leave off the billing information. ```ts async previewSubscription( @@ -1638,7 +1725,7 @@ try { Removes a coupon from an existing subscription. -For more information on the expected behavior of removing a coupon from a subscription, see our documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon) +For more information on the expected behavior of removing a coupon from a subscription, see [Coupons and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions#removing-a-coupon). ```ts async removeCouponFromSubscription( @@ -1713,16 +1800,14 @@ try { # Activate Subscription -Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. - -For details on how the activation works, and how to activate subscriptions through the application, see [activation](#). +Activates awaiting signup and trialing subscriptions. This feature is only available on the Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. The `revert_on_failure` parameter controls the behavior upon activation failure. -- If set to `true` and something goes wrong i.e. payment fails, then Advanced Billing will not change the subscription's state. The subscription’s billing period will also remain the same. -- If set to `false` and something goes wrong i.e. payment fails, then Advanced Billing will continue through with the activation and enter an end of life state. For trialing subscriptions, that will either be trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that will always be canceled. +- If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not change. The subscription’s billing period also remains the same. +- If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, that is always canceled. -The default activation failure behavior can be configured per activation attempt, or you may set a default value under Config > Settings > Subscription Activation Settings. +The default activation failure behavior can be configured per activation attempt, or you can set a default value under Config > Settings > Subscription Activation Settings. ## Activation Scenarios @@ -1754,8 +1839,8 @@ The default activation failure behavior can be configured per activation attempt ### Activate Trialing subscription -You can read more about the behavior of trialing subscriptions [here](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). -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. +For more information about the behavior of trialing subscriptions, see [Trialing Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). +When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; the invoice from activation is voided, and any prepayments and credits applied to the invoice are returned to the subscription. ```ts async activateSubscription( diff --git a/doc/controllers/webhooks.md b/doc/controllers/webhooks.md index 9bc087f0..0f442581 100644 --- a/doc/controllers/webhooks.md +++ b/doc/controllers/webhooks.md @@ -115,7 +115,7 @@ try { "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Pookie&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=pookie999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Pookie%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Pookie&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", + "body": "id=141765032&event=statement_settled&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][balance_in_cents]=0&payload[customer][id]=14585695&payload[customer][first_name]=Alan&payload[customer][last_name]=Test&payload[customer][reference]=&payload[customer][organization]=&payload[customer][address]=&payload[customer][address_2]=&payload[customer][city]=&payload[customer][state]=&payload[customer][zip]=&payload[customer][country]=&payload[customer][email]=alan999%40example.com&payload[customer][phone]=&payload[statement][closed_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][id]=80168049&payload[statement][opened_at]=2016-11-07%2016%3A22%3A15%20-0500&payload[statement][settled_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][subscription_id]=15100141&payload[statement][updated_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][starting_balance_in_cents]=0&payload[statement][ending_balance_in_cents]=0&payload[statement][total_in_cents]=6400&payload[statement][memo]=We%20thank%20you%20for%20your%20continued%20business!&payload[statement][events][0][id]=346956565&payload[statement][events][0][key]=renewal_success&payload[statement][events][0][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][1][id]=346956579&payload[statement][events][1][key]=payment_success&payload[statement][events][1][message]=Successful%20payment%20of%20%2464.00%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][events][2][id]=347299359&payload[statement][events][2][key]=renewal_success&payload[statement][events][2][message]=Successful%20renewal%20for%20Alan%20Test's%20subscription%20to%20%2410%20Basic%20Plan&payload[statement][transactions][0][id]=161537343&payload[statement][transactions][0][subscription_id]=15100141&payload[statement][transactions][0][type]=Charge&payload[statement][transactions][0][kind]=baseline&payload[statement][transactions][0][transaction_type]=charge&payload[statement][transactions][0][success]=true&payload[statement][transactions][0][amount_in_cents]=1000&payload[statement][transactions][0][memo]=%2410%20Basic%20Plan%20(11%2F08%2F2016%20-%2011%2F09%2F2016)&payload[statement][transactions][0][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][0][starting_balance_in_cents]=0&payload[statement][transactions][0][ending_balance_in_cents]=1000&payload[statement][transactions][0][gateway_used]=&payload[statement][transactions][0][gateway_transaction_id]=&payload[statement][transactions][0][gateway_order_id]=&payload[statement][transactions][0][payment_id]=161537369&payload[statement][transactions][0][product_id]=3792003&payload[statement][transactions][0][tax_id]=&payload[statement][transactions][0][component_id]=&payload[statement][transactions][0][statement_id]=80168049&payload[statement][transactions][0][customer_id]=14585695&payload[statement][transactions][0][original_amount_in_cents]=&payload[statement][transactions][0][discount_amount_in_cents]=&payload[statement][transactions][0][taxable_amount_in_cents]=&payload[statement][transactions][1][id]=161537344&payload[statement][transactions][1][subscription_id]=15100141&payload[statement][transactions][1][type]=Charge&payload[statement][transactions][1][kind]=quantity_based_component&payload[statement][transactions][1][transaction_type]=charge&payload[statement][transactions][1][success]=true&payload[statement][transactions][1][amount_in_cents]=5400&payload[statement][transactions][1][memo]=Timesheet%20Users%3A%2018%20Timesheet%20Users&payload[statement][transactions][1][created_at]=2016-11-08%2016%3A22%3A18%20-0500&payload[statement][transactions][1][starting_balance_in_cents]=1000&payload[statement][transactions][1][ending_balance_in_cents]=6400&payload[statement][transactions][1][gateway_used]=&payload[statement][transactions][1][gateway_transaction_id]=&payload[statement][transactions][1][gateway_order_id]=&payload[statement][transactions][1][payment_id]=161537369&payload[statement][transactions][1][product_id]=3792003&payload[statement][transactions][1][tax_id]=&payload[statement][transactions][1][component_id]=277221&payload[statement][transactions][1][statement_id]=80168049&payload[statement][transactions][1][customer_id]=14585695&payload[statement][transactions][1][original_amount_in_cents]=&payload[statement][transactions][1][discount_amount_in_cents]=&payload[statement][transactions][1][taxable_amount_in_cents]=&payload[statement][transactions][2][id]=161537369&payload[statement][transactions][2][subscription_id]=15100141&payload[statement][transactions][2][type]=Payment&payload[statement][transactions][2][kind]=&payload[statement][transactions][2][transaction_type]=payment&payload[statement][transactions][2][success]=true&payload[statement][transactions][2][amount_in_cents]=6400&payload[statement][transactions][2][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[statement][transactions][2][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[statement][transactions][2][starting_balance_in_cents]=6400&payload[statement][transactions][2][ending_balance_in_cents]=0&payload[statement][transactions][2][gateway_used]=bogus&payload[statement][transactions][2][gateway_transaction_id]=53433&payload[statement][transactions][2][gateway_order_id]=&payload[statement][transactions][2][payment_id]=&payload[statement][transactions][2][product_id]=3792003&payload[statement][transactions][2][tax_id]=&payload[statement][transactions][2][component_id]=&payload[statement][transactions][2][statement_id]=80168049&payload[statement][transactions][2][customer_id]=14585695&payload[statement][transactions][2][card_number]=XXXX-XXXX-XXXX-1&payload[statement][transactions][2][card_expiration]=10%2F2020&payload[statement][transactions][2][card_type]=bogus&payload[statement][transactions][2][refunded_amount_in_cents]=0&payload[product][id]=3792003&payload[product][name]=%2410%20Basic%20Plan&payload[product_family][id]=527890&payload[product_family][name]=Acme%20Projects&payload[payment_profile][id]=10102821&payload[payment_profile][first_name]=Alan&payload[payment_profile][last_name]=Test&payload[payment_profile][billing_address]=&payload[payment_profile][billing_address_2]=&payload[payment_profile][billing_city]=&payload[payment_profile][billing_country]=&payload[payment_profile][billing_state]=&payload[payment_profile][billing_zip]=&payload[event_id]=347299384", "signature": "7c606ec4628ce75ec46e284097ce163a", "signature_hmac_sha_256": "40f25e83dd324508bb2149e3e525821922fb210535ebfbfa81e7ab951996b41d" } @@ -131,7 +131,7 @@ try { "last_sent_at": "2016-11-08T16:43:54-05:00", "last_sent_url": "http://requestb.in/11u45x71", "successful": false, - "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=pookie999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Pookie&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Pookie%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", + "body": "id=141765008&event=payment_success&payload[site][id]=31615&payload[site][subdomain]=general-goods&payload[subscription][id]=15100141&payload[subscription][state]=active&payload[subscription][trial_started_at]=&payload[subscription][trial_ended_at]=&payload[subscription][activated_at]=2016-11-04%2017%3A06%3A43%20-0400&payload[subscription][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][updated_at]=2016-11-08%2016%3A22%3A22%20-0500&payload[subscription][expires_at]=&payload[subscription][balance_in_cents]=0&payload[subscription][current_period_ends_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][next_assessment_at]=2016-11-09%2016%3A06%3A42%20-0500&payload[subscription][canceled_at]=&payload[subscription][cancellation_message]=&payload[subscription][next_product_id]=&payload[subscription][cancel_at_end_of_period]=false&payload[subscription][payment_collection_method]=automatic&payload[subscription][snap_day]=&payload[subscription][cancellation_method]=&payload[subscription][current_period_started_at]=2016-11-08%2016%3A06%3A42%20-0500&payload[subscription][previous_state]=active&payload[subscription][signup_payment_id]=161034048&payload[subscription][signup_revenue]=64.00&payload[subscription][delayed_cancel_at]=&payload[subscription][coupon_code]=&payload[subscription][total_revenue_in_cents]=32000&payload[subscription][product_price_in_cents]=1000&payload[subscription][product_version_number]=7&payload[subscription][payment_type]=credit_card&payload[subscription][referral_code]=pggn84&payload[subscription][coupon_use_count]=&payload[subscription][coupon_uses_allowed]=&payload[subscription][customer][id]=14585695&payload[subscription][customer][first_name]=Test&payload[subscription][customer][last_name]=Test&payload[subscription][customer][organization]=&payload[subscription][customer][email]=alan999%40example.com&payload[subscription][customer][created_at]=2016-11-04%2017%3A06%3A42%20-0400&payload[subscription][customer][updated_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][reference]=&payload[subscription][customer][address]=&payload[subscription][customer][address_2]=&payload[subscription][customer][city]=&payload[subscription][customer][state]=&payload[subscription][customer][zip]=&payload[subscription][customer][country]=&payload[subscription][customer][phone]=&payload[subscription][customer][portal_invite_last_sent_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][portal_invite_last_accepted_at]=&payload[subscription][customer][verified]=false&payload[subscription][customer][portal_customer_created_at]=2016-11-04%2017%3A06%3A45%20-0400&payload[subscription][customer][cc_emails]=&payload[subscription][product][id]=3792003&payload[subscription][product][name]=%2410%20Basic%20Plan&payload[subscription][product][handle]=basic&payload[subscription][product][description]=lorem%20ipsum&payload[subscription][product][accounting_code]=basic&payload[subscription][product][request_credit_card]=false&payload[subscription][product][expiration_interval]=&payload[subscription][product][expiration_interval_unit]=never&payload[subscription][product][created_at]=2016-03-24%2013%3A38%3A39%20-0400&payload[subscription][product][updated_at]=2016-11-03%2013%3A03%3A05%20-0400&payload[subscription][product][price_in_cents]=1000&payload[subscription][product][interval]=1&payload[subscription][product][interval_unit]=day&payload[subscription][product][initial_charge_in_cents]=&payload[subscription][product][trial_price_in_cents]=&payload[subscription][product][trial_interval]=&payload[subscription][product][trial_interval_unit]=month&payload[subscription][product][archived_at]=&payload[subscription][product][require_credit_card]=false&payload[subscription][product][return_params]=&payload[subscription][product][taxable]=false&payload[subscription][product][update_return_url]=&payload[subscription][product][initial_charge_after_trial]=false&payload[subscription][product][version_number]=7&payload[subscription][product][update_return_params]=&payload[subscription][product][product_family][id]=527890&payload[subscription][product][product_family][name]=Acme%20Projects&payload[subscription][product][product_family][description]=&payload[subscription][product][product_family][handle]=billing-plans&payload[subscription][product][product_family][accounting_code]=&payload[subscription][product][public_signup_pages][id]=281054&payload[subscription][product][public_signup_pages][return_url]=http%3A%2F%2Fwww.example.com%3Fsuccessfulsignup&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fkqvmfrbgd89q%2Fbasic&payload[subscription][product][public_signup_pages][id]=281240&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fdkffht5dxfd8%2Fbasic&payload[subscription][product][public_signup_pages][id]=282694&payload[subscription][product][public_signup_pages][return_url]=&payload[subscription][product][public_signup_pages][return_params]=&payload[subscription][product][public_signup_pages][url]=https%3A%2F%2Fgeneral-goods.chargify.com%2Fsubscribe%2Fjwffwgdd95s8%2Fbasic&payload[subscription][credit_card][id]=10102821&payload[subscription][credit_card][first_name]=Alan&payload[subscription][credit_card][last_name]=Test&payload[subscription][credit_card][masked_card_number]=XXXX-XXXX-XXXX-1&payload[subscription][credit_card][card_type]=bogus&payload[subscription][credit_card][expiration_month]=10&payload[subscription][credit_card][expiration_year]=2020&payload[subscription][credit_card][customer_id]=14585695&payload[subscription][credit_card][current_vault]=bogus&payload[subscription][credit_card][vault_token]=1&payload[subscription][credit_card][billing_address]=&payload[subscription][credit_card][billing_city]=&payload[subscription][credit_card][billing_state]=&payload[subscription][credit_card][billing_zip]=&payload[subscription][credit_card][billing_country]=&payload[subscription][credit_card][customer_vault_token]=&payload[subscription][credit_card][billing_address_2]=&payload[subscription][credit_card][payment_type]=credit_card&payload[subscription][credit_card][site_gateway_setting_id]=&payload[subscription][credit_card][gateway_handle]=&payload[transaction][id]=161537369&payload[transaction][subscription_id]=15100141&payload[transaction][type]=Payment&payload[transaction][kind]=&payload[transaction][transaction_type]=payment&payload[transaction][success]=true&payload[transaction][amount_in_cents]=6400&payload[transaction][memo]=Alan%20Test%20-%20%2410%20Basic%20Plan%3A%20Renewal%20payment&payload[transaction][created_at]=2016-11-08%2016%3A22%3A20%20-0500&payload[transaction][starting_balance_in_cents]=6400&payload[transaction][ending_balance_in_cents]=0&payload[transaction][gateway_used]=bogus&payload[transaction][gateway_transaction_id]=53433&payload[transaction][gateway_response_code]=&payload[transaction][gateway_order_id]=&payload[transaction][payment_id]=&payload[transaction][product_id]=3792003&payload[transaction][tax_id]=&payload[transaction][component_id]=&payload[transaction][statement_id]=80168049&payload[transaction][customer_id]=14585695&payload[transaction][card_number]=XXXX-XXXX-XXXX-1&payload[transaction][card_expiration]=10%2F2020&payload[transaction][card_type]=bogus&payload[transaction][refunded_amount_in_cents]=0&payload[transaction][invoice_id]=&payload[event_id]=347299364", "signature": "fbcf2f6be579f9658cff90c4373e0ca2", "signature_hmac_sha_256": "db96654f5456c5460062feb944ac8bb1418f9d181ae04a8ed982fe9ffdca8de1" } @@ -299,7 +299,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | -| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type @@ -376,7 +376,7 @@ try { # List Endpoints -Returns created endpoints for a site. +Lists endpoints configured for a site. ```ts async listEndpoints( @@ -482,7 +482,7 @@ This endpoint requires [BasicAuth](../../doc/auth/basic-authentication.md) | Parameter | Type | Tags | Description | | --- | --- | --- | --- | | `endpointId` | `number` | Template, Required | The Advanced Billing id for the endpoint that should be updated | -| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint | +| `body` | [`CreateOrUpdateEndpointRequest \| undefined`](../../doc/models/create-or-update-endpoint-request.md) | Body, Optional | Used to Create or Update Endpoint. | | `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | ## Response Type diff --git a/doc/models/account-balance.md b/doc/models/account-balance.md index 07130d00..ecf9c371 100644 --- a/doc/models/account-balance.md +++ b/doc/models/account-balance.md @@ -13,13 +13,15 @@ | `automaticBalanceInCents` | `bigint \| null \| undefined` | Optional | The automatic balance in cents. | | `remittanceBalanceInCents` | `bigint \| null \| undefined` | Optional | The remittance balance in cents. | -## Example (as JSON) - -```json -{ - "balance_in_cents": 16, - "automatic_balance_in_cents": 226, - "remittance_balance_in_cents": 62 -} +## Example + +```ts +import { AccountBalance } from '@maxio-com/advanced-billing-sdk'; + +const accountBalance: AccountBalance = { + balanceInCents: BigInt(242), + automaticBalanceInCents: BigInt(0), + remittanceBalanceInCents: BigInt(32), +}; ``` diff --git a/doc/models/account-balances.md b/doc/models/account-balances.md index 30e1a5f9..cd6e4272 100644 --- a/doc/models/account-balances.md +++ b/doc/models/account-balances.md @@ -9,41 +9,43 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `openInvoices` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | -| `pendingInvoices` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | +| `openInvoices` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's open, payable invoices. | +| `pendingInvoices` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the sum of the subscription's pending, payable invoices. | | `pendingDiscounts` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Pending Discount account. | | `serviceCredits` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Service Credit account. | | `prepayments` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | The balance, in cents, of the subscription's Prepayment account. | -## Example (as JSON) +## Example -```json -{ - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 +```ts +import { AccountBalances } from '@maxio-com/advanced-billing-sdk'; + +const accountBalances: AccountBalances = { + openInvoices: { + balanceInCents: BigInt(40), + automaticBalanceInCents: BigInt(202), + remittanceBalanceInCents: BigInt(170), + }, + pendingInvoices: { + balanceInCents: BigInt(0), + automaticBalanceInCents: BigInt(242), + remittanceBalanceInCents: BigInt(46), }, - "pending_invoices": { - "balance_in_cents": 0, - "automatic_balance_in_cents": 242, - "remittance_balance_in_cents": 46 + pendingDiscounts: { + balanceInCents: BigInt(88), + automaticBalanceInCents: BigInt(154), + remittanceBalanceInCents: BigInt(134), }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 + serviceCredits: { + balanceInCents: BigInt(84), + automaticBalanceInCents: BigInt(70), + remittanceBalanceInCents: BigInt(38), }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 + prepayments: { + balanceInCents: BigInt(192), + automaticBalanceInCents: BigInt(178), + remittanceBalanceInCents: BigInt(146), }, - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 - } -} +}; ``` diff --git a/doc/models/ach-agreement.md b/doc/models/ach-agreement.md index b706a116..23080306 100644 --- a/doc/models/ach-agreement.md +++ b/doc/models/ach-agreement.md @@ -16,14 +16,16 @@ | `authorizerLastName` | `string \| undefined` | Optional | (Required when providing ACH agreement params) The last name of the person authorizing the ACH agreement. | | `ipAddress` | `string \| undefined` | Optional | (Required when providing ACH agreement params) The IP address of the person authorizing the ACH agreement. | -## Example (as JSON) - -```json -{ - "agreement_terms": "agreement_terms4", - "authorizer_first_name": "authorizer_first_name2", - "authorizer_last_name": "authorizer_last_name2", - "ip_address": "ip_address2" -} +## Example + +```ts +import { ACHAgreement } from '@maxio-com/advanced-billing-sdk'; + +const aCHAgreement: ACHAgreement = { + agreementTerms: 'agreement_terms4', + authorizerFirstName: 'authorizer_first_name2', + authorizerLastName: 'authorizer_last_name2', + ipAddress: 'ip_address2', +}; ``` diff --git a/doc/models/activate-event-based-component.md b/doc/models/activate-event-based-component.md index 252dda55..76eb136a 100644 --- a/doc/models/activate-event-based-component.md +++ b/doc/models/activate-event-based-component.md @@ -13,33 +13,39 @@ | `billingSchedule` | [`BillingSchedule \| undefined`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `customPrice` | [`ComponentCustomPrice \| undefined`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "price_point_id": 44, - "billing_schedule": { - "initial_billing_at": "2016-03-13T12:52:32.123Z" +## Example + +```ts +import { + ActivateEventBasedComponent, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const activateEventBasedComponent: ActivateEventBasedComponent = { + pricePointId: 68, + billingSchedule: { + initialBillingAt: '2016-03-13T12:52:32.123Z', }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ + customPrice: { + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } -} + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 66, + intervalUnit: IntervalUnit.Day, + listPricePointId: 174, + }, +}; ``` diff --git a/doc/models/activate-subscription-request.md b/doc/models/activate-subscription-request.md index b99d43a7..822e495c 100644 --- a/doc/models/activate-subscription-request.md +++ b/doc/models/activate-subscription-request.md @@ -9,13 +9,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `revertOnFailure` | `boolean \| null \| undefined` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the site settings (default: `true`) | +| `revertOnFailure` | `boolean \| null \| undefined` | Optional | You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end-of-life state. If this parameter is omitted or `null` is passed it will default to the value set in the site settings (default: `true`). | -## Example (as JSON) +## Example -```json -{ - "revert_on_failure": false -} +```ts +import { ActivateSubscriptionRequest } from '@maxio-com/advanced-billing-sdk'; + +const activateSubscriptionRequest: ActivateSubscriptionRequest = { + revertOnFailure: false, +}; ``` diff --git a/doc/models/add-coupons-request.md b/doc/models/add-coupons-request.md index 9890bcb2..026902dd 100644 --- a/doc/models/add-coupons-request.md +++ b/doc/models/add-coupons-request.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `codes` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes0", - "codes1" - ] -} +## Example + +```ts +import { AddCouponsRequest } from '@maxio-com/advanced-billing-sdk'; + +const addCouponsRequest: AddCouponsRequest = { + codes: [ + 'codes6', + 'codes7' + ], +}; ``` diff --git a/doc/models/add-subscription-to-a-group.md b/doc/models/add-subscription-to-a-group.md index 2d1a222c..b07ed9f7 100644 --- a/doc/models/add-subscription-to-a-group.md +++ b/doc/models/add-subscription-to-a-group.md @@ -11,21 +11,26 @@ | --- | --- | --- | --- | | `group` | [`GroupSettings \| undefined`](../../doc/models/group-settings.md) | Optional | - | -## Example (as JSON) - -```json -{ - "group": { - "target": { - "type": "parent", - "id": 236 +## Example + +```ts +import { + AddSubscriptionToAGroup, + GroupTargetType, +} from '@maxio-com/advanced-billing-sdk'; + +const addSubscriptionToAGroup: AddSubscriptionToAGroup = { + group: { + target: { + type: GroupTargetType.Parent, + id: 236, }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } - } -} + billing: { + accrue: false, + alignDate: false, + prorate: false, + }, + }, +}; ``` diff --git a/doc/models/address-change.md b/doc/models/address-change.md index 81b4da7f..60690570 100644 --- a/doc/models/address-change.md +++ b/doc/models/address-change.md @@ -12,24 +12,26 @@ | `before` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | | `after` | [`InvoiceAddress`](../../doc/models/invoice-address.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" +## Example + +```ts +import { AddressChange } from '@maxio-com/advanced-billing-sdk'; + +const addressChange: AddressChange = { + before: { + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4', }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } -} + after: { + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4', + }, +}; ``` diff --git a/doc/models/agreement-acceptance.md b/doc/models/agreement-acceptance.md index d6bd708e..758d289f 100644 --- a/doc/models/agreement-acceptance.md +++ b/doc/models/agreement-acceptance.md @@ -12,21 +12,23 @@ Required when creating a subscription with Maxio Payments. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `ipAddress` | `string \| undefined` | Optional | Required when providing agreement acceptance params. | -| `termsUrl` | `string \| undefined` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. | +| `termsUrl` | `string \| undefined` | Optional | Required when creating a subscription with Maxio Payments. Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. | | `privacyPolicyUrl` | `string \| undefined` | Optional | - | | `returnRefundPolicyUrl` | `string \| undefined` | Optional | - | | `deliveryPolicyUrl` | `string \| undefined` | Optional | - | | `secureCheckoutPolicyUrl` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ip_address": "ip_address2", - "terms_url": "terms_url0", - "privacy_policy_url": "privacy_policy_url0", - "return_refund_policy_url": "return_refund_policy_url4", - "delivery_policy_url": "delivery_policy_url8" -} +```ts +import { AgreementAcceptance } from '@maxio-com/advanced-billing-sdk'; + +const agreementAcceptance: AgreementAcceptance = { + ipAddress: 'ip_address8', + termsUrl: 'terms_url6', + privacyPolicyUrl: 'privacy_policy_url4', + returnRefundPolicyUrl: 'return_refund_policy_url0', + deliveryPolicyUrl: 'delivery_policy_url4', +}; ``` diff --git a/doc/models/all-vaults.md b/doc/models/all-vaults.md index be2f56f6..a01bdbd0 100644 --- a/doc/models/all-vaults.md +++ b/doc/models/all-vaults.md @@ -46,3 +46,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `Unipaas` | | `Wirecard` | +## Example + +```ts +import { AllVaults } from '@maxio-com/advanced-billing-sdk'; + +const allVaults = AllVaults.EwayRapidStd; +``` + diff --git a/doc/models/allocate-components.md b/doc/models/allocate-components.md index 7658ead9..97242bb6 100644 --- a/doc/models/allocate-components.md +++ b/doc/models/allocate-components.md @@ -15,35 +15,48 @@ | `accrueCharge` | `boolean \| undefined` | Optional | - | | `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. | | `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. | -| `paymentCollectionMethod` | [`CollectionMethod \| undefined`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription | +| `paymentCollectionMethod` | [`CollectionMethod \| undefined`](../../doc/models/collection-method.md) | Optional | (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription. | | `initiateDunning` | `boolean \| undefined` | Optional | If true, if the immediate component payment fails, initiate dunning for the subscription.
Otherwise, leave the charges on the subscription to pay for at renewal. | -## Example (as JSON) +## Example -```json -{ - "proration_upgrade_scheme": "proration_upgrade_scheme2", - "proration_downgrade_scheme": "proration_downgrade_scheme0", - "allocations": [ +```ts +import { + AllocateComponents, + CreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const allocateComponents: AllocateComponents = { + prorationUpgradeScheme: 'proration_upgrade_scheme8', + prorationDowngradeScheme: 'proration_downgrade_scheme6', + allocations: [ + { + quantity: 26.48, + decimalQuantity: 'decimal_quantity8', + previousQuantity: 55.5, + decimalPreviousQuantity: 'decimal_previous_quantity2', + componentId: 242, + memo: 'memo6', + }, { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" + quantity: 26.48, + decimalQuantity: 'decimal_quantity8', + previousQuantity: 55.5, + decimalPreviousQuantity: 'decimal_previous_quantity2', + componentId: 242, + memo: 'memo6', }, { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" + quantity: 26.48, + decimalQuantity: 'decimal_quantity8', + previousQuantity: 55.5, + decimalPreviousQuantity: 'decimal_previous_quantity2', + componentId: 242, + memo: 'memo6', } ], - "accrue_charge": false, - "upgrade_charge": "full" -} + accrueCharge: false, + upgradeCharge: CreditType.Prorated, +}; ``` diff --git a/doc/models/allocation-expiration-date.md b/doc/models/allocation-expiration-date.md index 4ec371e8..3932198c 100644 --- a/doc/models/allocation-expiration-date.md +++ b/doc/models/allocation-expiration-date.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `expiresAt` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "expires_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { AllocationExpirationDate } from '@maxio-com/advanced-billing-sdk'; + +const allocationExpirationDate: AllocationExpirationDate = { + expiresAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/allocation-preview-direction.md b/doc/models/allocation-preview-direction.md index 26731f4c..aa287161 100644 --- a/doc/models/allocation-preview-direction.md +++ b/doc/models/allocation-preview-direction.md @@ -12,3 +12,11 @@ | `Upgrade` | | `Downgrade` | +## Example + +```ts +import { AllocationPreviewDirection } from '@maxio-com/advanced-billing-sdk'; + +const allocationPreviewDirection = AllocationPreviewDirection.Upgrade; +``` + diff --git a/doc/models/allocation-preview-item.md b/doc/models/allocation-preview-item.md index 07b3cbfb..d93846f4 100644 --- a/doc/models/allocation-preview-item.md +++ b/doc/models/allocation-preview-item.md @@ -21,22 +21,24 @@ | `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. | | `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. | | `pricePointId` | `number \| undefined` | Optional | - | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | | `previousPricePointId` | `number \| undefined` | Optional | - | | `pricePointHandle` | `string \| undefined` | Optional | - | | `pricePointName` | `string \| undefined` | Optional | - | | `componentHandle` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "component_id": 54, - "subscription_id": 54, - "quantity": 78, - "previous_quantity": 192, - "memo": "memo6" -} +```ts +import { AllocationPreviewItem } from '@maxio-com/advanced-billing-sdk'; + +const allocationPreviewItem: AllocationPreviewItem = { + componentId: 176, + subscriptionId: 176, + quantity: 200, + previousQuantity: 30, + memo: 'memo8', +}; ``` diff --git a/doc/models/allocation-preview-line-item-kind.md b/doc/models/allocation-preview-line-item-kind.md index 7fb25c3f..d11b25e0 100644 --- a/doc/models/allocation-preview-line-item-kind.md +++ b/doc/models/allocation-preview-line-item-kind.md @@ -16,3 +16,13 @@ A handle for the line item kind for allocation preview | `Coupon` | | `Tax` | +## Example + +```ts +import { + AllocationPreviewLineItemKind, +} from '@maxio-com/advanced-billing-sdk'; + +const allocationPreviewLineItemKind = AllocationPreviewLineItemKind.Coupon; +``` + diff --git a/doc/models/allocation-preview-line-item.md b/doc/models/allocation-preview-line-item.md index 6a88c4e0..9cbbcccd 100644 --- a/doc/models/allocation-preview-line-item.md +++ b/doc/models/allocation-preview-line-item.md @@ -17,17 +17,23 @@ | `taxableAmountInCents` | `bigint \| undefined` | Optional | - | | `componentId` | `number \| undefined` | Optional | - | | `componentHandle` | `string \| undefined` | Optional | - | -| `direction` | [`AllocationPreviewDirection \| undefined`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control | - -## Example (as JSON) - -```json -{ - "transaction_type": "credit", - "kind": "quantity_based_component", - "amount_in_cents": 24, - "memo": "memo6", - "discount_amount_in_cents": 172 -} +| `direction` | [`AllocationPreviewDirection \| undefined`](../../doc/models/allocation-preview-direction.md) | Optional | Visible when using Fine-grained Component Control. | + +## Example + +```ts +import { + AllocationPreviewLineItem, + AllocationPreviewLineItemKind, + LineItemTransactionType, +} from '@maxio-com/advanced-billing-sdk'; + +const allocationPreviewLineItem: AllocationPreviewLineItem = { + transactionType: LineItemTransactionType.Credit, + kind: AllocationPreviewLineItemKind.QuantityBasedComponent, + amountInCents: BigInt(236), + memo: 'memo6', + discountAmountInCents: BigInt(40), +}; ``` diff --git a/doc/models/allocation-preview-response.md b/doc/models/allocation-preview-response.md index 5172f406..f300721e 100644 --- a/doc/models/allocation-preview-response.md +++ b/doc/models/allocation-preview-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `allocationPreview` | [`AllocationPreview`](../../doc/models/allocation-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation_preview": { - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 240, - "total_tax_in_cents": 108, - "total_discount_in_cents": 142 - } -} +## Example + +```ts +import { AllocationPreviewResponse } from '@maxio-com/advanced-billing-sdk'; + +const allocationPreviewResponse: AllocationPreviewResponse = { + allocationPreview: { + startDate: '2016-03-13T12:52:32.123Z', + endDate: '2016-03-13T12:52:32.123Z', + subtotalInCents: BigInt(240), + totalTaxInCents: BigInt(108), + totalDiscountInCents: BigInt(142), + }, +}; ``` diff --git a/doc/models/allocation-preview.md b/doc/models/allocation-preview.md index 92d0607a..4cfa0a65 100644 --- a/doc/models/allocation-preview.md +++ b/doc/models/allocation-preview.md @@ -23,15 +23,17 @@ | `periodType` | `string \| undefined` | Optional | - | | `existingBalanceInCents` | `bigint \| undefined` | Optional | An integer representing the amount of the subscription's current balance | -## Example (as JSON) - -```json -{ - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 4, - "total_tax_in_cents": 128, - "total_discount_in_cents": 122 -} +## Example + +```ts +import { AllocationPreview } from '@maxio-com/advanced-billing-sdk'; + +const allocationPreview: AllocationPreview = { + startDate: '2016-03-13T12:52:32.123Z', + endDate: '2016-03-13T12:52:32.123Z', + subtotalInCents: BigInt(140), + totalTaxInCents: BigInt(8), + totalDiscountInCents: BigInt(242), +}; ``` diff --git a/doc/models/allocation-response.md b/doc/models/allocation-response.md index 97832490..7e8e5131 100644 --- a/doc/models/allocation-response.md +++ b/doc/models/allocation-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `allocation` | [`Allocation \| undefined`](../../doc/models/allocation.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "allocation_id": 238, - "component_id": 8, - "component_handle": "component_handle8", - "subscription_id": 8, - "quantity": 32 - } -} +## Example + +```ts +import { AllocationResponse } from '@maxio-com/advanced-billing-sdk'; + +const allocationResponse: AllocationResponse = { + allocation: { + allocationId: 238, + componentId: 8, + componentHandle: 'component_handle8', + subscriptionId: 8, + quantity: 32, + }, +}; ``` diff --git a/doc/models/allocation-settings.md b/doc/models/allocation-settings.md index 9d9ed0fb..430d9a94 100644 --- a/doc/models/allocation-settings.md +++ b/doc/models/allocation-settings.md @@ -13,13 +13,18 @@ | `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. | | `accrueCharge` | `string \| undefined` | Optional | Either "true" or "false". | -## Example (as JSON) - -```json -{ - "upgrade_charge": "none", - "downgrade_credit": "prorated", - "accrue_charge": "accrue_charge0" -} +## Example + +```ts +import { + AllocationSettings, + CreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const allocationSettings: AllocationSettings = { + upgradeCharge: CreditType.Prorated, + downgradeCredit: CreditType.Prorated, + accrueCharge: 'accrue_charge2', +}; ``` diff --git a/doc/models/allocation.md b/doc/models/allocation.md index f557c619..6049edd2 100644 --- a/doc/models/allocation.md +++ b/doc/models/allocation.md @@ -9,21 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `allocationId` | `number \| undefined` | Optional | The allocation unique id | -| `componentId` | `number \| undefined` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup | -| `componentHandle` | `string \| null \| undefined` | Optional | The handle of the component. This references a component that you have created in your Product setup | -| `subscriptionId` | `number \| undefined` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site | +| `allocationId` | `number \| undefined` | Optional | The allocation unique ID | +| `componentId` | `number \| undefined` | Optional | The integer component ID for the allocation. This references a component that you have created in your Product setup. | +| `componentHandle` | `string \| null \| undefined` | Optional | The handle of the component. This references a component that you have created in your Product setup. | +| `subscriptionId` | `number \| undefined` | Optional | The integer subscription ID for the allocation. This references a unique subscription in your Site. | | `quantity` | [`AllocationQuantity \| undefined`](../../doc/models/containers/allocation-quantity.md) | Optional | This is a container for one-of cases. | | `previousQuantity` | [`AllocationPreviousQuantity \| undefined`](../../doc/models/containers/allocation-previous-quantity.md) | Optional | This is a container for one-of cases. | | `memo` | `string \| null \| undefined` | Optional | The memo passed when the allocation was created | -| `timestamp` | `string \| undefined` | Optional | The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z | +| `timestamp` | `string \| undefined` | Optional | The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., 2012-11-20T22:00:37Z | | `createdAt` | `string \| undefined` | Optional | Timestamp indicating when this allocation was created | | `prorationUpgradeScheme` | `string \| undefined` | Optional | The scheme used if the proration was an upgrade. This is only present when the allocation was created mid-period. | | `prorationDowngradeScheme` | `string \| undefined` | Optional | The scheme used if the proration was a downgrade. This is only present when the allocation was created mid-period. | | `pricePointId` | `number \| undefined` | Optional | - | | `pricePointName` | `string \| undefined` | Optional | - | | `pricePointHandle` | `string \| undefined` | Optional | - | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | | `previousPricePointId` | `number \| undefined` | Optional | - | | `accrueCharge` | `boolean \| undefined` | Optional | If the change in cost is an upgrade, this determines if the charge should accrue to the next renewal or if capture should be attempted immediately. | @@ -35,15 +35,17 @@ | `usedQuantity` | `bigint \| undefined` | Optional | - | | `chargeId` | `bigint \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "allocation_id": 102, - "component_id": 144, - "component_handle": "component_handle0", - "subscription_id": 144, - "quantity": 168 -} +```ts +import { Allocation } from '@maxio-com/advanced-billing-sdk'; + +const allocation: Allocation = { + allocationId: 238, + componentId: 8, + componentHandle: 'component_handle8', + subscriptionId: 8, + quantity: 32, +}; ``` diff --git a/doc/models/apple-pay-payment-profile.md b/doc/models/apple-pay-payment-profile.md index bd29620b..53b0d4eb 100644 --- a/doc/models/apple-pay-payment-profile.md +++ b/doc/models/apple-pay-payment-profile.md @@ -12,7 +12,7 @@ | `id` | `number \| undefined` | Optional | The Chargify-assigned ID of the Apple Pay payment profile. | | `firstName` | `string \| undefined` | Optional | The first name of the Apple Pay account holder | | `lastName` | `string \| undefined` | Optional | The last name of the Apple Pay account holder | -| `customerId` | `number \| undefined` | Optional | The Chargify-assigned id for the customer record to which the Apple Pay account belongs | +| `customerId` | `number \| undefined` | Optional | The Chargify-assigned ID for the customer record to which the Apple Pay account belongs | | `currentVault` | [`ApplePayVault \| undefined`](../../doc/models/apple-pay-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. | | `vaultToken` | `string \| undefined` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `billingAddress` | `string \| null \| undefined` | Optional | The current billing street address for the Apple Pay account | @@ -28,16 +28,22 @@ | `createdAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was created | | `updatedAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" -} +## Example + +```ts +import { + ApplePayPaymentProfile, + ApplePayVault, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const applePayPaymentProfile: ApplePayPaymentProfile = { + paymentType: PaymentType.ApplePay, + id: 252, + firstName: 'first_name0', + lastName: 'last_name8', + customerId: 34, + currentVault: ApplePayVault.BraintreeBlue, +}; ``` diff --git a/doc/models/apple-pay-vault.md b/doc/models/apple-pay-vault.md index ca51e9f1..ef46ce09 100644 --- a/doc/models/apple-pay-vault.md +++ b/doc/models/apple-pay-vault.md @@ -13,3 +13,11 @@ The vault that stores the payment profile with the provided vault_token. | --- | | `BraintreeBlue` | +## Example + +```ts +import { ApplePayVault } from '@maxio-com/advanced-billing-sdk'; + +const applePayVault = ApplePayVault.BraintreeBlue; +``` + diff --git a/doc/models/applied-credit-note-data.md b/doc/models/applied-credit-note-data.md index f884ae3a..0e9f8f00 100644 --- a/doc/models/applied-credit-note-data.md +++ b/doc/models/applied-credit-note-data.md @@ -12,12 +12,14 @@ | `uid` | `string \| undefined` | Optional | The UID of the credit note | | `number` | `string \| undefined` | Optional | The number of the credit note | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "number": "number0" -} +```ts +import { AppliedCreditNoteData } from '@maxio-com/advanced-billing-sdk'; + +const appliedCreditNoteData: AppliedCreditNoteData = { + uid: 'uid4', + number: 'number2', +}; ``` diff --git a/doc/models/apply-credit-note-event-data.md b/doc/models/apply-credit-note-event-data.md index 7aca9187..656f63db 100644 --- a/doc/models/apply-credit-note-event-data.md +++ b/doc/models/apply-credit-note-event-data.md @@ -19,32 +19,38 @@ Example schema for an `apply_credit_note` event | `transactionTime` | `string \| undefined` | Optional | The time the credit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | | `memo` | `string \| null \| undefined` | Optional | The credit note memo. | | `role` | `string \| undefined` | Optional | The role of the credit note (e.g. 'general') | -| `consolidatedInvoice` | `boolean \| undefined` | Optional | Shows whether it was applied to consolidated invoice or not | +| `consolidatedInvoice` | `boolean \| undefined` | Optional | Shows whether it was applied to consolidated invoice or not. | | `appliedCreditNotes` | [`AppliedCreditNoteData[] \| undefined`](../../doc/models/applied-credit-note-data.md) | Optional | List of credit notes applied to children invoices (if consolidated invoice) | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "credit_note_number": "credit_note_number4", - "credit_note_uid": "credit_note_uid4", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "role": "role4", - "consolidated_invoice": false, - "applied_credit_notes": [ +## Example + +```ts +import { ApplyCreditNoteEventData } from '@maxio-com/advanced-billing-sdk'; + +const applyCreditNoteEventData: ApplyCreditNoteEventData = { + uid: 'uid0', + creditNoteNumber: 'credit_note_number6', + creditNoteUid: 'credit_note_uid4', + originalAmount: 'original_amount4', + appliedAmount: 'applied_amount8', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo4', + role: 'role4', + consolidatedInvoice: false, + appliedCreditNotes: [ { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', }, { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', + }, + { + uid: 'uid4', + number: 'number8', } - ] -} + ], +}; ``` diff --git a/doc/models/apply-credit-note-event.md b/doc/models/apply-credit-note-event.md index aa800a61..521dc78a 100644 --- a/doc/models/apply-credit-note-event.md +++ b/doc/models/apply-credit-note-event.md @@ -15,49 +15,54 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ApplyCreditNote` | | `eventData` | [`ApplyCreditNoteEventData`](../../doc/models/apply-credit-note-event-data.md) | Required | Example schema for an `apply_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ApplyCreditNoteEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const applyCreditNoteEvent: ApplyCreditNoteEvent = { + id: BigInt(86), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "apply_credit_note", - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ + eventType: InvoiceEventType.ApplyCreditNote, + eventData: { + uid: 'uid6', + creditNoteNumber: 'credit_note_number0', + creditNoteUid: 'credit_note_uid0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo0', + role: 'role0', + consolidatedInvoice: false, + appliedCreditNotes: [ { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', }, { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', }, { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/apply-debit-note-event-data.md b/doc/models/apply-debit-note-event-data.md index 85e2438b..59dc2afd 100644 --- a/doc/models/apply-debit-note-event-data.md +++ b/doc/models/apply-debit-note-event-data.md @@ -18,16 +18,18 @@ Example schema for an `apply_debit_note` event | `memo` | `string \| null \| undefined` | Optional | The debit note memo. | | `transactionTime` | `string \| null \| undefined` | Optional | The time the debit note was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "debit_note_number": "debit_note_number0", - "debit_note_uid": "debit_note_uid6", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "memo": "memo4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { ApplyDebitNoteEventData } from '@maxio-com/advanced-billing-sdk'; + +const applyDebitNoteEventData: ApplyDebitNoteEventData = { + debitNoteNumber: 'debit_note_number8', + debitNoteUid: 'debit_note_uid4', + originalAmount: 'original_amount2', + appliedAmount: 'applied_amount0', + memo: 'memo2', + transactionTime: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/apply-debit-note-event.md b/doc/models/apply-debit-note-event.md index 2568234d..f9420a5a 100644 --- a/doc/models/apply-debit-note-event.md +++ b/doc/models/apply-debit-note-event.md @@ -15,32 +15,37 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ApplyDebitNote` | | `eventData` | [`ApplyDebitNoteEventData`](../../doc/models/apply-debit-note-event-data.md) | Required | Example schema for an `apply_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 164, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ApplyDebitNoteEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const applyDebitNoteEvent: ApplyDebitNoteEvent = { + id: BigInt(180), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "apply_debit_note", - "event_data": { - "debit_note_number": "debit_note_number6", - "debit_note_uid": "debit_note_uid2", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "memo": "memo0", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} + eventType: InvoiceEventType.ApplyDebitNote, + eventData: { + debitNoteNumber: 'debit_note_number6', + debitNoteUid: 'debit_note_uid2', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + memo: 'memo0', + transactionTime: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/apply-payment-event-data.md b/doc/models/apply-payment-event-data.md index e3010cd7..bf10c565 100644 --- a/doc/models/apply-payment-event-data.md +++ b/doc/models/apply-payment-event-data.md @@ -23,23 +23,29 @@ Example schema for an `apply_payment` event | `prepayment` | `boolean \| undefined` | Optional | - | | `external` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "consolidation_level": "child", - "memo": "memo8", - "original_amount": "original_amount8", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" +## Example + +```ts +import { + ApplyPaymentEventData, + InvoiceConsolidationLevel, + InvoiceEventPaymentMethod, +} from '@maxio-com/advanced-billing-sdk'; + +const applyPaymentEventData: ApplyPaymentEventData = { + consolidationLevel: InvoiceConsolidationLevel.Child, + memo: 'memo0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + paymentMethod: { + type: InvoiceEventPaymentMethod.ApplePay, }, - "transaction_id": 196, - "parent_invoice_number": 174, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false -} + transactionId: 142, + parentInvoiceNumber: 228, + remainingPrepaymentAmount: 'remaining_prepayment_amount4', + prepayment: false, + external: false, +}; ``` diff --git a/doc/models/apply-payment-event.md b/doc/models/apply-payment-event.md index e1c4b248..24eb9f96 100644 --- a/doc/models/apply-payment-event.md +++ b/doc/models/apply-payment-event.md @@ -15,39 +15,46 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ApplyPayment` | | `eventData` | [`ApplyPaymentEventData`](../../doc/models/apply-payment-event-data.md) | Required | Example schema for an `apply_payment` event | -## Example (as JSON) - -```json -{ - "id": 234, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ApplyPaymentEvent, + InvoiceConsolidationLevel, + InvoiceEventPaymentMethod, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const applyPaymentEvent: ApplyPaymentEvent = { + id: BigInt(112), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "apply_payment", - "event_data": { - "consolidation_level": "child", - "memo": "memo0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" + eventType: InvoiceEventType.ApplyPayment, + eventData: { + consolidationLevel: InvoiceConsolidationLevel.Child, + memo: 'memo0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + paymentMethod: { + type: InvoiceEventPaymentMethod.ApplePay, }, - "transaction_id": 78, - "parent_invoice_number": 36, - "remaining_prepayment_amount": "remaining_prepayment_amount6", - "prepayment": false, - "external": false - } -} + transactionId: 78, + parentInvoiceNumber: 36, + remainingPrepaymentAmount: 'remaining_prepayment_amount6', + prepayment: false, + external: false, + }, +}; ``` diff --git a/doc/models/attribute-error.md b/doc/models/attribute-error.md index fec7481c..1c52c9ac 100644 --- a/doc/models/attribute-error.md +++ b/doc/models/attribute-error.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `attribute` | `string[]` | Required | - | -## Example (as JSON) - -```json -{ - "attribute": [ - "attribute6", - "attribute7" - ] -} +## Example + +```ts +import { AttributeError } from '@maxio-com/advanced-billing-sdk'; + +const attributeError: AttributeError = { + attribute: [ + 'attribute8', + 'attribute7' + ], +}; ``` diff --git a/doc/models/auto-invite.md b/doc/models/auto-invite.md index 2ee5341e..a17048ad 100644 --- a/doc/models/auto-invite.md +++ b/doc/models/auto-invite.md @@ -12,3 +12,11 @@ | `No` | Do not send the invitation email. | | `Yes` | Automatically send the invitation email. | +## Example + +```ts +import { AutoInvite } from '@maxio-com/advanced-billing-sdk'; + +const autoInvite = AutoInvite.No; +``` + diff --git a/doc/models/auto-resume.md b/doc/models/auto-resume.md index 0482bb4f..d34c9e53 100644 --- a/doc/models/auto-resume.md +++ b/doc/models/auto-resume.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `automaticallyResumeAt` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "automatically_resume_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { AutoResume } from '@maxio-com/advanced-billing-sdk'; + +const autoResume: AutoResume = { + automaticallyResumeAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/available-actions.md b/doc/models/available-actions.md index 1d52bab1..873f9582 100644 --- a/doc/models/available-actions.md +++ b/doc/models/available-actions.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `sendEmail` | [`SendEmail \| undefined`](../../doc/models/send-email.md) | Optional | - | -## Example (as JSON) - -```json -{ - "send_email": { - "can_execute": false, - "url": "url0" - } -} +## Example + +```ts +import { AvailableActions } from '@maxio-com/advanced-billing-sdk'; + +const availableActions: AvailableActions = { + sendEmail: { + canExecute: false, + url: 'url0', + }, +}; ``` diff --git a/doc/models/backport-invoice-event.md b/doc/models/backport-invoice-event.md index be10f091..2d0f6eb8 100644 --- a/doc/models/backport-invoice-event.md +++ b/doc/models/backport-invoice-event.md @@ -15,35 +15,40 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.BackportInvoice` | | `eventData` | [`Invoice`](../../doc/models/invoice.md) | Required | Example schema for an `backport_invoice` event | -## Example (as JSON) - -```json -{ - "id": 78, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + BackportInvoiceEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const backportInvoiceEvent: BackportInvoiceEvent = { + id: BigInt(210), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "backport_invoice", - "event_data": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 206, - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60 - } -} + eventType: InvoiceEventType.BackportInvoice, + eventData: { + id: BigInt(206), + uid: 'uid6', + siteId: 132, + customerId: 244, + subscriptionId: 60, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', + }, +}; ``` diff --git a/doc/models/bank-account-attributes.md b/doc/models/bank-account-attributes.md index 58efdce3..c9628746 100644 --- a/doc/models/bank-account-attributes.md +++ b/doc/models/bank-account-attributes.md @@ -11,26 +11,31 @@ | --- | --- | --- | --- | | `chargifyToken` | `string \| undefined` | Optional | - | | `bankName` | `string \| undefined` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | -| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH; optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bankAccountNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | | `bankAccountType` | [`BankAccountType \| undefined`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | -| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | -| `bankIban` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | +| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | +| `bankIban` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | | `bankAccountHolderType` | [`BankAccountHolderType \| undefined`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `paymentType` | [`PaymentType \| undefined`](../../doc/models/payment-type.md) | Optional | - | | `currentVault` | [`BankAccountVault \| undefined`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vaultToken` | `string \| undefined` | Optional | - | | `customerVaultToken` | `string \| undefined` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token0", - "bank_name": "bank_name2", - "bank_routing_number": "bank_routing_number8", - "bank_account_number": "bank_account_number4", - "bank_account_type": "checking" -} +## Example + +```ts +import { + BankAccountAttributes, + BankAccountType, +} from '@maxio-com/advanced-billing-sdk'; + +const bankAccountAttributes: BankAccountAttributes = { + chargifyToken: 'chargify_token0', + bankName: 'bank_name2', + bankRoutingNumber: 'bank_routing_number8', + bankAccountNumber: 'bank_account_number4', + bankAccountType: BankAccountType.Checking, +}; ``` diff --git a/doc/models/bank-account-holder-type.md b/doc/models/bank-account-holder-type.md index b820e92d..3422137c 100644 --- a/doc/models/bank-account-holder-type.md +++ b/doc/models/bank-account-holder-type.md @@ -14,3 +14,11 @@ Defaults to personal | `Personal` | | `Business` | +## Example + +```ts +import { BankAccountHolderType } from '@maxio-com/advanced-billing-sdk'; + +const bankAccountHolderType = BankAccountHolderType.Personal; +``` + diff --git a/doc/models/bank-account-payment-profile.md b/doc/models/bank-account-payment-profile.md index 8ffa180a..43b90b5f 100644 --- a/doc/models/bank-account-payment-profile.md +++ b/doc/models/bank-account-payment-profile.md @@ -9,10 +9,10 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `id` | `number \| undefined` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer | +| `id` | `number \| undefined` | Optional | The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `firstName` | `string \| undefined` | Optional | The first name of the bank account holder | | `lastName` | `string \| undefined` | Optional | The last name of the bank account holder | -| `customerId` | `number \| undefined` | Optional | The Chargify-assigned id for the customer record to which the bank account belongs | +| `customerId` | `number \| undefined` | Optional | The Chargify-assigned ID for the customer record to which the bank account belongs | | `currentVault` | [`BankAccountVault \| undefined`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `vaultToken` | `string \| undefined` | Optional | The "token" provided by your vault storage for an already stored payment profile | | `billingAddress` | `string \| null \| undefined` | Optional | The current billing street address for the bank account | @@ -23,28 +23,34 @@ | `customerVaultToken` | `string \| null \| undefined` | Optional | (only for Authorize.Net CIM storage): the customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token. | | `billingAddress2` | `string \| null \| undefined` | Optional | The current billing street address, second line, for the bank account | | `bankName` | `string \| undefined` | Optional | The bank where the account resides | -| `maskedBankRoutingNumber` | `string \| null \| undefined` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account | -| `maskedBankAccountNumber` | `string \| null \| undefined` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') | +| `maskedBankRoutingNumber` | `string \| null \| undefined` | Optional | A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. | +| `maskedBankAccountNumber` | `string \| null \| undefined` | Optional | A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). | | `bankAccountType` | [`BankAccountType \| undefined`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bankAccountHolderType` | [`BankAccountHolderType \| undefined`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `paymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType.BankAccount` | -| `verified` | `boolean \| undefined` | Optional | denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account

**Default**: `false` | +| `verified` | `boolean \| undefined` | Optional | Denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account.

**Default**: `false` | | `siteGatewaySettingId` | `number \| null \| undefined` | Optional | - | | `gatewayHandle` | `string \| null \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was created | | `updatedAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "bank_account", - "verified": false, - "id": 188, - "first_name": "first_name6", - "last_name": "last_name4", - "customer_id": 226, - "current_vault": "authorizenet" -} +## Example + +```ts +import { + BankAccountPaymentProfile, + BankAccountVault, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const bankAccountPaymentProfile: BankAccountPaymentProfile = { + paymentType: PaymentType.BankAccount, + id: 16, + firstName: 'first_name0', + lastName: 'last_name8', + customerId: 54, + currentVault: BankAccountVault.Gocardless, + verified: false, +}; ``` diff --git a/doc/models/bank-account-response.md b/doc/models/bank-account-response.md index f0b60123..28a35101 100644 --- a/doc/models/bank-account-response.md +++ b/doc/models/bank-account-response.md @@ -11,19 +11,25 @@ | --- | --- | --- | --- | | `paymentProfile` | [`BankAccountPaymentProfile`](../../doc/models/bank-account-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "bank_account", - "verified": false, - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "customer_id": 82, - "current_vault": "authorizenet" - } -} +## Example + +```ts +import { + BankAccountResponse, + BankAccountVault, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const bankAccountResponse: BankAccountResponse = { + paymentProfile: { + paymentType: PaymentType.BankAccount, + id: 44, + firstName: 'first_name4', + lastName: 'last_name2', + customerId: 82, + currentVault: BankAccountVault.Authorizenet, + verified: false, + }, +}; ``` diff --git a/doc/models/bank-account-type.md b/doc/models/bank-account-type.md index ccce016c..bbe99c09 100644 --- a/doc/models/bank-account-type.md +++ b/doc/models/bank-account-type.md @@ -14,3 +14,11 @@ Defaults to checking | `Checking` | | `Savings` | +## Example + +```ts +import { BankAccountType } from '@maxio-com/advanced-billing-sdk'; + +const bankAccountType = BankAccountType.Checking; +``` + diff --git a/doc/models/bank-account-vault.md b/doc/models/bank-account-vault.md index cbef4ba6..b91b5270 100644 --- a/doc/models/bank-account-vault.md +++ b/doc/models/bank-account-vault.md @@ -20,3 +20,11 @@ The vault that stores the payment profile with the provided vault_token. Use `bo | `Maxp` | | `StripeConnect` | +## Example + +```ts +import { BankAccountVault } from '@maxio-com/advanced-billing-sdk'; + +const bankAccountVault = BankAccountVault.Maxp; +``` + diff --git a/doc/models/bank-account-verification-request.md b/doc/models/bank-account-verification-request.md index 17970892..a1d1fa5c 100644 --- a/doc/models/bank-account-verification-request.md +++ b/doc/models/bank-account-verification-request.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | | `bankAccountVerification` | [`BankAccountVerification`](../../doc/models/bank-account-verification.md) | Required | - | -## Example (as JSON) - -```json -{ - "bank_account_verification": { - "deposit_1_in_cents": 244, - "deposit_2_in_cents": 6 - } -} +## Example + +```ts +import { + BankAccountVerificationRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const bankAccountVerificationRequest: BankAccountVerificationRequest = { + bankAccountVerification: { + deposit1InCents: BigInt(244), + deposit2InCents: BigInt(6), + }, +}; ``` diff --git a/doc/models/bank-account-verification.md b/doc/models/bank-account-verification.md index 7e617bc9..c7e85c21 100644 --- a/doc/models/bank-account-verification.md +++ b/doc/models/bank-account-verification.md @@ -12,12 +12,14 @@ | `deposit1InCents` | `bigint \| undefined` | Optional | - | | `deposit2InCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "deposit_1_in_cents": 142, - "deposit_2_in_cents": 132 -} +```ts +import { BankAccountVerification } from '@maxio-com/advanced-billing-sdk'; + +const bankAccountVerification: BankAccountVerification = { + deposit1InCents: BigInt(248), + deposit2InCents: BigInt(10), +}; ``` diff --git a/doc/models/base-refund-error.md b/doc/models/base-refund-error.md index f32d6af1..8de979ba 100644 --- a/doc/models/base-refund-error.md +++ b/doc/models/base-refund-error.md @@ -11,24 +11,16 @@ | --- | --- | --- | --- | | `base` | `unknown[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - }, - { - "key1": "val1", - "key2": "val2" - } - ] -} +## Example + +```ts +import { BaseRefundError } from '@maxio-com/advanced-billing-sdk'; + +const baseRefundError: BaseRefundError = { + base: [ + { 'key1': 'val1', 'key2': 'val2' }, + { 'key1': 'val1', 'key2': 'val2' } + ], +}; ``` diff --git a/doc/models/base-string-error.md b/doc/models/base-string-error.md index bebb50b8..8ceb6693 100644 --- a/doc/models/base-string-error.md +++ b/doc/models/base-string-error.md @@ -13,13 +13,16 @@ The error is base if it is not directly associated with a single attribute. | --- | --- | --- | --- | | `base` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "base": [ - "base3" - ] -} +## Example + +```ts +import { BaseStringError } from '@maxio-com/advanced-billing-sdk'; + +const baseStringError: BaseStringError = { + base: [ + 'base5', + 'base6' + ], +}; ``` diff --git a/doc/models/basic-date-field.md b/doc/models/basic-date-field.md index ebcf891c..ba347367 100644 --- a/doc/models/basic-date-field.md +++ b/doc/models/basic-date-field.md @@ -16,7 +16,9 @@ Allows to filter by `created_at` or `updated_at`. ## Example -``` -updated_at +```ts +import { BasicDateField } from '@maxio-com/advanced-billing-sdk'; + +const basicDateField = BasicDateField.UpdatedAt; ``` diff --git a/doc/models/batch-job-response.md b/doc/models/batch-job-response.md index 575293fd..0ab83a40 100644 --- a/doc/models/batch-job-response.md +++ b/doc/models/batch-job-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `batchjob` | [`BatchJob`](../../doc/models/batch-job.md) | Required | - | -## Example (as JSON) - -```json -{ - "batchjob": { - "id": 54, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 62, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed4" - } -} +## Example + +```ts +import { BatchJobResponse } from '@maxio-com/advanced-billing-sdk'; + +const batchJobResponse: BatchJobResponse = { + batchjob: { + id: 54, + finishedAt: '2016-03-13T12:52:32.123Z', + rowCount: 62, + createdAt: '2016-03-13T12:52:32.123Z', + completed: 'completed4', + }, +}; ``` diff --git a/doc/models/batch-job.md b/doc/models/batch-job.md index 713d90fc..8767fa6d 100644 --- a/doc/models/batch-job.md +++ b/doc/models/batch-job.md @@ -15,15 +15,17 @@ | `createdAt` | `string \| null \| undefined` | Optional | - | | `completed` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 246, - "finished_at": "2016-03-13T12:52:32.123Z", - "row_count": 254, - "created_at": "2016-03-13T12:52:32.123Z", - "completed": "completed0" -} +## Example + +```ts +import { BatchJob } from '@maxio-com/advanced-billing-sdk'; + +const batchJob: BatchJob = { + id: 60, + finishedAt: '2016-03-13T12:52:32.123Z', + rowCount: 68, + createdAt: '2016-03-13T12:52:32.123Z', + completed: 'completed6', +}; ``` diff --git a/doc/models/billing-manifest-item.md b/doc/models/billing-manifest-item.md index 7af8650a..c078d3e1 100644 --- a/doc/models/billing-manifest-item.md +++ b/doc/models/billing-manifest-item.md @@ -24,15 +24,21 @@ | `periodRangeStart` | `string \| undefined` | Optional | - | | `periodRangeEnd` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "info_transaction", - "kind": "baseline", - "amount_in_cents": 216, - "memo": "memo4", - "discount_amount_in_cents": 236 -} +## Example + +```ts +import { + BillingManifestItem, + BillingManifestLineItemKind, + LineItemTransactionType, +} from '@maxio-com/advanced-billing-sdk'; + +const billingManifestItem: BillingManifestItem = { + transactionType: LineItemTransactionType.Payment, + kind: BillingManifestLineItemKind.Trial, + amountInCents: BigInt(148), + memo: 'memo0', + discountAmountInCents: BigInt(88), +}; ``` diff --git a/doc/models/billing-manifest-line-item-kind.md b/doc/models/billing-manifest-line-item-kind.md index dd5e0a15..fd39c361 100644 --- a/doc/models/billing-manifest-line-item-kind.md +++ b/doc/models/billing-manifest-line-item-kind.md @@ -18,3 +18,11 @@ A handle for the billing manifest line item kind | `Component` | | `Tax` | +## Example + +```ts +import { BillingManifestLineItemKind } from '@maxio-com/advanced-billing-sdk'; + +const billingManifestLineItemKind = BillingManifestLineItemKind.Component; +``` + diff --git a/doc/models/billing-manifest.md b/doc/models/billing-manifest.md index 4586d94b..12e55e7a 100644 --- a/doc/models/billing-manifest.md +++ b/doc/models/billing-manifest.md @@ -19,37 +19,29 @@ | `periodType` | `string \| null \| undefined` | Optional | - | | `existingBalanceInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "line_items": [ - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, - { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 - }, +```ts +import { + BillingManifest, + BillingManifestLineItemKind, + LineItemTransactionType, +} from '@maxio-com/advanced-billing-sdk'; + +const billingManifest: BillingManifest = { + lineItems: [ { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), } ], - "total_in_cents": 192, - "total_discount_in_cents": 178, - "total_tax_in_cents": 172, - "subtotal_in_cents": 48 -} + totalInCents: BigInt(96), + totalDiscountInCents: BigInt(174), + totalTaxInCents: BigInt(76), + subtotalInCents: BigInt(208), +}; ``` diff --git a/doc/models/billing-schedule.md b/doc/models/billing-schedule.md index cea1d2bd..960f63ac 100644 --- a/doc/models/billing-schedule.md +++ b/doc/models/billing-schedule.md @@ -13,11 +13,13 @@ Billing schedule settings for component allocations or usages on multi-frequency | --- | --- | --- | --- | | `initialBillingAt` | `string \| null \| undefined` | Optional | Custom start date (ISO 8601 date, YYYY-MM-DD) for the component's first billing period. If omitted or null, billing aligns with the product schedule. If provided, date must be on or after the minimum allowed date for the subscription or component. | -## Example (as JSON) +## Example -```json -{ - "initial_billing_at": "2026-01-01" -} +```ts +import { BillingSchedule } from '@maxio-com/advanced-billing-sdk'; + +const billingSchedule: BillingSchedule = { + initialBillingAt: '2026-01-01', +}; ``` diff --git a/doc/models/breakouts.md b/doc/models/breakouts.md index bb177123..544e6420 100644 --- a/doc/models/breakouts.md +++ b/doc/models/breakouts.md @@ -14,14 +14,16 @@ | `usageAmountInCents` | `bigint \| undefined` | Optional | - | | `usageAmountFormatted` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "plan_amount_in_cents": 68, - "plan_amount_formatted": "plan_amount_formatted2", - "usage_amount_in_cents": 176, - "usage_amount_formatted": "usage_amount_formatted0" -} +## Example + +```ts +import { Breakouts } from '@maxio-com/advanced-billing-sdk'; + +const breakouts: Breakouts = { + planAmountInCents: BigInt(254), + planAmountFormatted: 'plan_amount_formatted0', + usageAmountInCents: BigInt(106), + usageAmountFormatted: 'usage_amount_formatted8', +}; ``` diff --git a/doc/models/bulk-components-price-point-assignment.md b/doc/models/bulk-components-price-point-assignment.md index 652525cf..dbdb3346 100644 --- a/doc/models/bulk-components-price-point-assignment.md +++ b/doc/models/bulk-components-price-point-assignment.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `components` | [`ComponentPricePointAssignment[] \| undefined`](../../doc/models/component-price-point-assignment.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "components": [ +```ts +import { + BulkComponentsPricePointAssignment, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkComponentsPricePointAssignment: BulkComponentsPricePointAssignment = { + components: [ { - "component_id": 108, - "price_point": "String5" + componentId: 108, + pricePoint: 'String5', } - ] -} + ], +}; ``` diff --git a/doc/models/bulk-create-product-price-points-request.md b/doc/models/bulk-create-product-price-points-request.md index 4467975f..44759b8e 100644 --- a/doc/models/bulk-create-product-price-points-request.md +++ b/doc/models/bulk-create-product-price-points-request.md @@ -11,24 +11,30 @@ | --- | --- | --- | --- | | `pricePoints` | [`CreateProductPricePoint[]`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "price_points": [ +```ts +import { + BulkCreateProductPricePointsRequest, + IntervalUnit, + TrialType, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkCreateProductPricePointsRequest: BulkCreateProductPricePointsRequest = { + pricePoints: [ { - "name": "name2", - "price_in_cents": 108, - "interval": 92, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle8", - "trial_price_in_cents": 196, - "trial_interval": 250, - "trial_interval_unit": "day", - "trial_type": "no_obligation" + name: 'name2', + priceInCents: BigInt(108), + interval: 92, + intervalUnit: IntervalUnit.Day, + handle: 'handle8', + trialPriceInCents: BigInt(196), + trialInterval: 250, + trialIntervalUnit: IntervalUnit.Day, + trialType: TrialType.NoObligation, + useSiteExchangeRate: true, } - ] -} + ], +}; ``` diff --git a/doc/models/bulk-create-product-price-points-response.md b/doc/models/bulk-create-product-price-points-response.md index 51fe0140..9f805d23 100644 --- a/doc/models/bulk-create-product-price-points-response.md +++ b/doc/models/bulk-create-product-price-points-response.md @@ -11,19 +11,37 @@ | --- | --- | --- | --- | | `pricePoints` | [`ProductPricePoint[] \| undefined`](../../doc/models/product-price-point.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "price_points": [ +```ts +import { + BulkCreateProductPricePointsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkCreateProductPricePointsResponse: BulkCreateProductPricePointsResponse = { + pricePoints: [ + { + id: 40, + name: 'name2', + handle: 'handle8', + priceInCents: BigInt(108), + interval: 92, + }, + { + id: 40, + name: 'name2', + handle: 'handle8', + priceInCents: BigInt(108), + interval: 92, + }, { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 + id: 40, + name: 'name2', + handle: 'handle8', + priceInCents: BigInt(108), + interval: 92, } - ] -} + ], +}; ``` diff --git a/doc/models/bulk-create-segments.md b/doc/models/bulk-create-segments.md index 04a89c7d..1a4927a4 100644 --- a/doc/models/bulk-create-segments.md +++ b/doc/models/bulk-create-segments.md @@ -11,36 +11,41 @@ | --- | --- | --- | --- | | `segments` | [`CreateSegment[] \| undefined`](../../doc/models/create-segment.md) | Optional | **Constraints**: *Maximum Items*: `2000` | -## Example (as JSON) +## Example -```json -{ - "segments": [ +```ts +import { + BulkCreateSegments, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkCreateSegments: BulkCreateSegments = { + segments: [ { - "segment_property_1_value": "String3", - "segment_property_2_value": "String5", - "segment_property_3_value": "String3", - "segment_property_4_value": "String7", - "pricing_scheme": "stairstep", - "prices": [ + pricingScheme: PricingScheme.Stairstep, + segmentProperty1Value: 'String3', + segmentProperty2Value: 'String5', + segmentProperty3Value: 'String3', + segmentProperty4Value: 'String7', + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] + ], } - ] -} + ], +}; ``` diff --git a/doc/models/bulk-update-segments-item.md b/doc/models/bulk-update-segments-item.md index a5868bff..0e2bec37 100644 --- a/doc/models/bulk-update-segments-item.md +++ b/doc/models/bulk-update-segments-item.md @@ -13,19 +13,24 @@ | `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` | [`CreateOrUpdateSegmentPrice[]`](../../doc/models/create-or-update-segment-price.md) | Required | - | -## Example (as JSON) - -```json -{ - "id": 180, - "pricing_scheme": "per_unit", - "prices": [ +## Example + +```ts +import { + BulkUpdateSegmentsItem, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkUpdateSegmentsItem: BulkUpdateSegmentsItem = { + id: 220, + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] -} + ], +}; ``` diff --git a/doc/models/bulk-update-segments.md b/doc/models/bulk-update-segments.md index 220edcb0..7d91705c 100644 --- a/doc/models/bulk-update-segments.md +++ b/doc/models/bulk-update-segments.md @@ -11,54 +11,59 @@ | --- | --- | --- | --- | | `segments` | [`BulkUpdateSegmentsItem[] \| undefined`](../../doc/models/bulk-update-segments-item.md) | Optional | **Constraints**: *Maximum Items*: `1000` | -## Example (as JSON) +## Example -```json -{ - "segments": [ +```ts +import { + BulkUpdateSegments, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const bulkUpdateSegments: BulkUpdateSegments = { + segments: [ { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ + id: 50, + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] + ], }, { - "id": 50, - "pricing_scheme": "stairstep", - "prices": [ + id: 50, + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] + ], } - ] -} + ], +}; ``` diff --git a/doc/models/calendar-billing.md b/doc/models/calendar-billing.md index 8bea8c8f..7f0795dd 100644 --- a/doc/models/calendar-billing.md +++ b/doc/models/calendar-billing.md @@ -1,7 +1,7 @@ # Calendar Billing -(Optional). Cannot be used when also specifying next_billing_at +(Optional). Cannot be used when also specifying next_billing_at. ## Structure @@ -14,12 +14,17 @@ | `snapDay` | [`CalendarBillingSnapDay \| undefined`](../../doc/models/containers/calendar-billing-snap-day.md) | Optional | This is a container for one-of cases. | | `calendarBillingFirstCharge` | [`FirstChargeType \| undefined`](../../doc/models/first-charge-type.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "snap_day": 210, - "calendar_billing_first_charge": "prorated" -} +```ts +import { + CalendarBilling, + FirstChargeType, +} from '@maxio-com/advanced-billing-sdk'; + +const calendarBilling: CalendarBilling = { + snapDay: 200, + calendarBillingFirstCharge: FirstChargeType.Delayed, +}; ``` diff --git a/doc/models/cancel-grouped-subscriptions-request.md b/doc/models/cancel-grouped-subscriptions-request.md index bcfcbef4..74127e70 100644 --- a/doc/models/cancel-grouped-subscriptions-request.md +++ b/doc/models/cancel-grouped-subscriptions-request.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `chargeUnbilledUsage` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "charge_unbilled_usage": false -} +```ts +import { + CancelGroupedSubscriptionsRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const cancelGroupedSubscriptionsRequest: CancelGroupedSubscriptionsRequest = { + chargeUnbilledUsage: false, +}; ``` diff --git a/doc/models/cancellation-method.md b/doc/models/cancellation-method.md index ee5676d9..cd7e02bd 100644 --- a/doc/models/cancellation-method.md +++ b/doc/models/cancellation-method.md @@ -18,3 +18,11 @@ The process used to cancel the subscription, if the subscription has been cancel | `Unknown` | | `Imported` | +## Example + +```ts +import { CancellationMethod } from '@maxio-com/advanced-billing-sdk'; + +const cancellationMethod = CancellationMethod.MerchantUi; +``` + diff --git a/doc/models/cancellation-options.md b/doc/models/cancellation-options.md index b46d109f..37ebe264 100644 --- a/doc/models/cancellation-options.md +++ b/doc/models/cancellation-options.md @@ -12,18 +12,20 @@ | `cancellationMessage` | `string \| undefined` | Optional | An indication as to why the subscription is being canceled. For your internal use. | | `reasonCode` | `string \| undefined` | Optional | The reason code associated with the cancellation. Use the [List Reason Codes](../../doc/controllers/reason-codes.md#list-reason-codes) endpoint to retrieve the reason codes associated with your site. | | `cancelAtEndOfPeriod` | `boolean \| undefined` | Optional | When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -| `scheduledCancellationAt` | `string \| null \| undefined` | Optional | Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | +| `scheduledCancellationAt` | `string \| null \| undefined` | Optional | Schedules the cancellation on the provided date. This option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | | `refundPrepaymentAccountBalance` | `boolean \| undefined` | Optional | Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. | -## Example (as JSON) +## Example -```json -{ - "cancellation_message": "cancellation_message0", - "reason_code": "reason_code6", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false -} +```ts +import { CancellationOptions } from '@maxio-com/advanced-billing-sdk'; + +const cancellationOptions: CancellationOptions = { + cancellationMessage: 'cancellation_message0', + reasonCode: 'reason_code6', + cancelAtEndOfPeriod: false, + scheduledCancellationAt: '2016-03-13T12:52:32.123Z', + refundPrepaymentAccountBalance: false, +}; ``` diff --git a/doc/models/cancellation-request.md b/doc/models/cancellation-request.md index 7b229041..b0ef0bf7 100644 --- a/doc/models/cancellation-request.md +++ b/doc/models/cancellation-request.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `subscription` | [`CancellationOptions`](../../doc/models/cancellation-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "cancellation_message": "cancellation_message2", - "reason_code": "reason_code8", - "cancel_at_end_of_period": false, - "scheduled_cancellation_at": "2016-03-13T12:52:32.123Z", - "refund_prepayment_account_balance": false - } -} +## Example + +```ts +import { CancellationRequest } from '@maxio-com/advanced-billing-sdk'; + +const cancellationRequest: CancellationRequest = { + subscription: { + cancellationMessage: 'cancellation_message2', + reasonCode: 'reason_code8', + cancelAtEndOfPeriod: false, + scheduledCancellationAt: '2016-03-13T12:52:32.123Z', + refundPrepaymentAccountBalance: false, + }, +}; ``` diff --git a/doc/models/card-type.md b/doc/models/card-type.md index 2acd7669..bff6204f 100644 --- a/doc/models/card-type.md +++ b/doc/models/card-type.md @@ -48,3 +48,11 @@ The type of card used. | `Solo` | | `Laser` | +## Example + +```ts +import { CardType } from '@maxio-com/advanced-billing-sdk'; + +const cardType = CardType.Solo; +``` + diff --git a/doc/models/change-chargeback-status-event-data.md b/doc/models/change-chargeback-status-event-data.md index f8952e53..858be27f 100644 --- a/doc/models/change-chargeback-status-event-data.md +++ b/doc/models/change-chargeback-status-event-data.md @@ -13,11 +13,16 @@ Example schema for an `change_chargeback_status` event | --- | --- | --- | --- | | `chargebackStatus` | [`ChargebackStatus`](../../doc/models/chargeback-status.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "chargeback_status": "open" -} +```ts +import { + ChangeChargebackStatusEventData, + ChargebackStatus, +} from '@maxio-com/advanced-billing-sdk'; + +const changeChargebackStatusEventData: ChangeChargebackStatusEventData = { + chargebackStatus: ChargebackStatus.Won, +}; ``` diff --git a/doc/models/change-chargeback-status-event.md b/doc/models/change-chargeback-status-event.md index c0609049..063e3f7b 100644 --- a/doc/models/change-chargeback-status-event.md +++ b/doc/models/change-chargeback-status-event.md @@ -15,27 +15,33 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ChangeChargebackStatus` | | `eventData` | [`ChangeChargebackStatusEventData`](../../doc/models/change-chargeback-status-event-data.md) | Required | Example schema for an `change_chargeback_status` event | -## Example (as JSON) - -```json -{ - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ChangeChargebackStatusEvent, + ChargebackStatus, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const changeChargebackStatusEvent: ChangeChargebackStatusEvent = { + id: BigInt(136), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "change_chargeback_status", - "event_data": { - "chargeback_status": "won" - } -} + eventType: InvoiceEventType.ChangeChargebackStatus, + eventData: { + chargebackStatus: ChargebackStatus.Won, + }, +}; ``` diff --git a/doc/models/change-invoice-collection-method-event-data.md b/doc/models/change-invoice-collection-method-event-data.md index 92659f56..f6a4e0ef 100644 --- a/doc/models/change-invoice-collection-method-event-data.md +++ b/doc/models/change-invoice-collection-method-event-data.md @@ -14,12 +14,16 @@ Example schema for an `change_invoice_collection_method` event | `fromCollectionMethod` | `string` | Required | The previous collection method of the invoice. | | `toCollectionMethod` | `string` | Required | The new collection method of the invoice. | -## Example (as JSON) +## Example -```json -{ - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method2" -} +```ts +import { + ChangeInvoiceCollectionMethodEventData, +} from '@maxio-com/advanced-billing-sdk'; + +const changeInvoiceCollectionMethodEventData: ChangeInvoiceCollectionMethodEventData = { + fromCollectionMethod: 'from_collection_method8', + toCollectionMethod: 'to_collection_method4', +}; ``` diff --git a/doc/models/change-invoice-collection-method-event.md b/doc/models/change-invoice-collection-method-event.md index 6a1a820e..0f3842aa 100644 --- a/doc/models/change-invoice-collection-method-event.md +++ b/doc/models/change-invoice-collection-method-event.md @@ -15,28 +15,33 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ChangeInvoiceCollectionMethod` | | `eventData` | [`ChangeInvoiceCollectionMethodEventData`](../../doc/models/change-invoice-collection-method-event-data.md) | Required | Example schema for an `change_invoice_collection_method` event | -## Example (as JSON) - -```json -{ - "id": 246, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ChangeInvoiceCollectionMethodEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const changeInvoiceCollectionMethodEvent: ChangeInvoiceCollectionMethodEvent = { + id: BigInt(110), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "change_invoice_collection_method", - "event_data": { - "from_collection_method": "from_collection_method4", - "to_collection_method": "to_collection_method8" - } -} + eventType: InvoiceEventType.ChangeInvoiceCollectionMethod, + eventData: { + fromCollectionMethod: 'from_collection_method4', + toCollectionMethod: 'to_collection_method8', + }, +}; ``` diff --git a/doc/models/change-invoice-status-event-data.md b/doc/models/change-invoice-status-event-data.md index 3f4a240b..28524eb5 100644 --- a/doc/models/change-invoice-status-event-data.md +++ b/doc/models/change-invoice-status-event-data.md @@ -17,15 +17,21 @@ Example schema for an `change_invoice_status` event | `toStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The updated status of the invoice after changes have been made. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | - | -## Example (as JSON) - -```json -{ - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount2", - "from_status": "draft", - "to_status": "pending", - "consolidation_level": "none" -} +## Example + +```ts +import { + ChangeInvoiceStatusEventData, + InvoiceConsolidationLevel, + InvoiceStatus, +} from '@maxio-com/advanced-billing-sdk'; + +const changeInvoiceStatusEventData: ChangeInvoiceStatusEventData = { + fromStatus: InvoiceStatus.Canceled, + toStatus: InvoiceStatus.Processing, + gatewayTransId: 'gateway_trans_id4', + amount: 'amount6', + consolidationLevel: InvoiceConsolidationLevel.Parent, +}; ``` diff --git a/doc/models/change-invoice-status-event.md b/doc/models/change-invoice-status-event.md index c486e7d1..7e66832e 100644 --- a/doc/models/change-invoice-status-event.md +++ b/doc/models/change-invoice-status-event.md @@ -15,31 +15,38 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.ChangeInvoiceStatus` | | `eventData` | [`ChangeInvoiceStatusEventData`](../../doc/models/change-invoice-status-event-data.md) | Required | Example schema for an `change_invoice_status` event | -## Example (as JSON) - -```json -{ - "id": 92, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + ChangeInvoiceStatusEvent, + InvoiceConsolidationLevel, + InvoiceEventType, + InvoiceStatus, +} from '@maxio-com/advanced-billing-sdk'; + +const changeInvoiceStatusEvent: ChangeInvoiceStatusEvent = { + id: BigInt(148), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "change_invoice_status", - "event_data": { - "gateway_trans_id": "gateway_trans_id2", - "amount": "amount8", - "from_status": "open", - "to_status": "pending", - "consolidation_level": "child" - } -} + eventType: InvoiceEventType.ChangeInvoiceStatus, + eventData: { + fromStatus: InvoiceStatus.Open, + toStatus: InvoiceStatus.Pending, + gatewayTransId: 'gateway_trans_id2', + amount: 'amount8', + consolidationLevel: InvoiceConsolidationLevel.Child, + }, +}; ``` diff --git a/doc/models/chargeback-status.md b/doc/models/chargeback-status.md index d57bae0f..b92d08e3 100644 --- a/doc/models/chargeback-status.md +++ b/doc/models/chargeback-status.md @@ -16,3 +16,11 @@ The current chargeback status. | `Won` | | `Closed` | +## Example + +```ts +import { ChargebackStatus } from '@maxio-com/advanced-billing-sdk'; + +const chargebackStatus = ChargebackStatus.Open; +``` + diff --git a/doc/models/chargify-ebb.md b/doc/models/chargify-ebb.md index 7c3be830..75d5d5d1 100644 --- a/doc/models/chargify-ebb.md +++ b/doc/models/chargify-ebb.md @@ -16,15 +16,17 @@ | `subscriptionId` | `number \| undefined` | Optional | Id of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream. | | `subscriptionReference` | `string \| undefined` | Optional | Reference of Maxio Advanced Billing Subscription which is connected to this event.
Provide `subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream. | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "id": "id4", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token0", - "subscription_id": 200 -} +## Example + +```ts +import { ChargifyEBB } from '@maxio-com/advanced-billing-sdk'; + +const chargifyEBB: ChargifyEBB = { + timestamp: '2016-03-13T12:52:32.123Z', + id: 'id2', + createdAt: '2016-03-13T12:52:32.123Z', + uniquenessToken: 'uniqueness_token8', + subscriptionId: 224, +}; ``` diff --git a/doc/models/chjs-tokenization-failure.md b/doc/models/chjs-tokenization-failure.md index d4a3ab0a..f14127e2 100644 --- a/doc/models/chjs-tokenization-failure.md +++ b/doc/models/chjs-tokenization-failure.md @@ -12,16 +12,18 @@ | `errors` | `string` | Required | - | | `paymentProfileParams` | [`PaymentProfileParams \| undefined`](../../doc/models/payment-profile-params.md) | Optional | PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are never included. | -## Example (as JSON) - -```json -{ - "errors": "errors2", - "payment_profile_params": { - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type2" - } -} +## Example + +```ts +import { ChjsTokenizationFailure } from '@maxio-com/advanced-billing-sdk'; + +const chjsTokenizationFailure: ChjsTokenizationFailure = { + errors: 'errors2', + paymentProfileParams: { + firstName: 'first_name2', + lastName: 'last_name0', + cardType: 'card_type2', + }, +}; ``` diff --git a/doc/models/chjs-tokenization-success.md b/doc/models/chjs-tokenization-success.md index c21e9368..4c968bad 100644 --- a/doc/models/chjs-tokenization-success.md +++ b/doc/models/chjs-tokenization-success.md @@ -12,17 +12,19 @@ | `paymentProfile` | [`TokenizedPaymentProfile`](../../doc/models/tokenized-payment-profile.md) | Required | - | | `gatewayCustomerId` | `number \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": 44, - "vault_token": "vault_token6", - "gateway_handle": "gateway_handle4", - "customer_vault_token": "customer_vault_token2" +## Example + +```ts +import { ChjsTokenizationSuccess } from '@maxio-com/advanced-billing-sdk'; + +const chjsTokenizationSuccess: ChjsTokenizationSuccess = { + paymentProfile: { + id: 44, + vaultToken: 'vault_token6', + gatewayHandle: 'gateway_handle4', + customerVaultToken: 'customer_vault_token2', }, - "gateway_customer_id": 44 -} + gatewayCustomerId: 228, +}; ``` diff --git a/doc/models/cleanup-scope.md b/doc/models/cleanup-scope.md index 51cb5160..f0ea2f68 100644 --- a/doc/models/cleanup-scope.md +++ b/doc/models/cleanup-scope.md @@ -14,3 +14,11 @@ all: Will clear all products, customers, and related subscriptions from the site | `All` | | `Customers` | +## Example + +```ts +import { CleanupScope } from '@maxio-com/advanced-billing-sdk'; + +const cleanupScope = CleanupScope.All; +``` + diff --git a/doc/models/clone-component-price-point-request.md b/doc/models/clone-component-price-point-request.md index ef8f66f3..d1248068 100644 --- a/doc/models/clone-component-price-point-request.md +++ b/doc/models/clone-component-price-point-request.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | | `pricePoint` | [`CloneComponentPricePoint`](../../doc/models/clone-component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6" - } -} +## Example + +```ts +import { + CloneComponentPricePointRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const cloneComponentPricePointRequest: CloneComponentPricePointRequest = { + pricePoint: { + name: 'name0', + handle: 'handle6', + }, +}; ``` diff --git a/doc/models/clone-component-price-point.md b/doc/models/clone-component-price-point.md index d29c8798..bf55240a 100644 --- a/doc/models/clone-component-price-point.md +++ b/doc/models/clone-component-price-point.md @@ -12,12 +12,14 @@ | `name` | `string` | Required | - | | `handle` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "handle": "handle8" -} +```ts +import { CloneComponentPricePoint } from '@maxio-com/advanced-billing-sdk'; + +const cloneComponentPricePoint: CloneComponentPricePoint = { + name: 'name4', + handle: 'handle0', +}; ``` diff --git a/doc/models/collection-method-1.md b/doc/models/collection-method-1.md new file mode 100644 index 00000000..9d9cb262 --- /dev/null +++ b/doc/models/collection-method-1.md @@ -0,0 +1,23 @@ + +# Collection Method 1 + +## Enumeration + +`CollectionMethod1` + +## Fields + +| Name | +| --- | +| `Automatic` | +| `Remittance` | +| `Prepaid` | + +## Example + +```ts +import { CollectionMethod1 } from '@maxio-com/advanced-billing-sdk'; + +const collectionMethod1 = CollectionMethod1.Automatic; +``` + diff --git a/doc/models/collection-method.md b/doc/models/collection-method.md index 337df240..e4479eaa 100644 --- a/doc/models/collection-method.md +++ b/doc/models/collection-method.md @@ -16,3 +16,11 @@ The type of payment collection to be used in the subscription. For legacy Statem | `Prepaid` | | `Invoice` | +## Example + +```ts +import { CollectionMethod } from '@maxio-com/advanced-billing-sdk'; + +const collectionMethod = CollectionMethod.Automatic; +``` + diff --git a/doc/models/component-allocation-change.md b/doc/models/component-allocation-change.md index e3f46f37..100b3c37 100644 --- a/doc/models/component-allocation-change.md +++ b/doc/models/component-allocation-change.md @@ -17,17 +17,19 @@ | `allocationId` | `number` | Required | - | | `allocatedQuantity` | [`ComponentAllocationChangeAllocatedQuantity \| undefined`](../../doc/models/containers/component-allocation-change-allocated-quantity.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "previous_allocation": 94, - "new_allocation": 102, - "component_id": 88, - "component_handle": "component_handle8", - "memo": "memo2", - "allocation_id": 158, - "allocated_quantity": 104 -} +## Example + +```ts +import { ComponentAllocationChange } from '@maxio-com/advanced-billing-sdk'; + +const componentAllocationChange: ComponentAllocationChange = { + previousAllocation: 78, + newAllocation: 118, + componentId: 72, + componentHandle: 'component_handle8', + memo: 'memo2', + allocationId: 174, + allocatedQuantity: 88, +}; ``` diff --git a/doc/models/component-allocation-error-item.md b/doc/models/component-allocation-error-item.md index 407df465..5064b2c3 100644 --- a/doc/models/component-allocation-error-item.md +++ b/doc/models/component-allocation-error-item.md @@ -14,14 +14,18 @@ | `kind` | `string \| undefined` | Optional | - | | `on` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 188, - "message": "message0", - "kind": "kind8", - "on": "on0" -} +## Example + +```ts +import { + ComponentAllocationErrorItem, +} from '@maxio-com/advanced-billing-sdk'; + +const componentAllocationErrorItem: ComponentAllocationErrorItem = { + componentId: 122, + message: 'message8', + kind: 'kind6', + on: 'on8', +}; ``` diff --git a/doc/models/component-allocation-error.md b/doc/models/component-allocation-error.md index 1c3adcda..ef374d9d 100644 --- a/doc/models/component-allocation-error.md +++ b/doc/models/component-allocation-error.md @@ -11,30 +11,15 @@ | --- | --- | --- | --- | | `errors` | [`ComponentAllocationErrorItem[] \| undefined`](../../doc/models/component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - }, - { - "component_id": 236, - "message": "message0", - "kind": "kind8", - "on": "on0" - } - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ComponentAllocationError) { + console.log(error.result); + } } ``` diff --git a/doc/models/component-cost-data-rate-tier.md b/doc/models/component-cost-data-rate-tier.md index 0afa3b22..58e78cd1 100644 --- a/doc/models/component-cost-data-rate-tier.md +++ b/doc/models/component-cost-data-rate-tier.md @@ -15,15 +15,17 @@ | `unitPrice` | `string \| undefined` | Optional | - | | `amount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "starting_quantity": 132, - "ending_quantity": 106, - "quantity": "quantity0", - "unit_price": "unit_price2", - "amount": "amount6" -} +## Example + +```ts +import { ComponentCostDataRateTier } from '@maxio-com/advanced-billing-sdk'; + +const componentCostDataRateTier: ComponentCostDataRateTier = { + startingQuantity: 204, + endingQuantity: 178, + quantity: 'quantity4', + unitPrice: 'unit_price6', + amount: 'amount0', +}; ``` diff --git a/doc/models/component-cost-data.md b/doc/models/component-cost-data.md index 461324d9..451faa43 100644 --- a/doc/models/component-cost-data.md +++ b/doc/models/component-cost-data.md @@ -17,15 +17,17 @@ | `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. | | `tiers` | [`ComponentCostDataRateTier[] \| undefined`](../../doc/models/component-cost-data-rate-tier.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component_code_id": 16, - "price_point_id": 186, - "product_id": 250, - "quantity": "quantity8", - "amount": "amount4" -} +## Example + +```ts +import { ComponentCostData } from '@maxio-com/advanced-billing-sdk'; + +const componentCostData: ComponentCostData = { + componentCodeId: 40, + pricePointId: 210, + productId: 18, + quantity: 'quantity4', + amount: 'amount0', +}; ``` diff --git a/doc/models/component-currency-price.md b/doc/models/component-currency-price.md index 1499c89b..d3318948 100644 --- a/doc/models/component-currency-price.md +++ b/doc/models/component-currency-price.md @@ -16,15 +16,17 @@ | `priceId` | `number \| undefined` | Optional | - | | `pricePointId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 4, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 162 -} +## Example + +```ts +import { ComponentCurrencyPrice } from '@maxio-com/advanced-billing-sdk'; + +const componentCurrencyPrice: ComponentCurrencyPrice = { + id: 128, + currency: 'currency2', + price: 'price4', + formattedPrice: 'formatted_price6', + priceId: 38, +}; ``` diff --git a/doc/models/component-currency-prices-response.md b/doc/models/component-currency-prices-response.md index 7992f8a4..81821ff7 100644 --- a/doc/models/component-currency-prices-response.md +++ b/doc/models/component-currency-prices-response.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | | `currencyPrices` | [`ComponentCurrencyPrice[]`](../../doc/models/component-currency-price.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { + ComponentCurrencyPricesResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const componentCurrencyPricesResponse: ComponentCurrencyPricesResponse = { + currencyPrices: [ { - "id": 50, - "currency": "currency8", - "price": "price4", - "formatted_price": "formatted_price6", - "price_id": 116 + id: 50, + currency: 'currency8', + price: 'price4', + formattedPrice: 'formatted_price6', + priceId: 116, } - ] -} + ], +}; ``` diff --git a/doc/models/component-custom-price.md b/doc/models/component-custom-price.md index 02313e12..7181a8e1 100644 --- a/doc/models/component-custom-price.md +++ b/doc/models/component-custom-price.md @@ -12,10 +12,10 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | Name | Type | Tags | Description | | --- | --- | --- | --- | | `taxIncluded` | `boolean \| undefined` | Optional | Whether or not the price point includes tax | -| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components | -| `interval` | `number \| 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. | +| `pricingScheme` | [`PricingScheme \| undefined`](../../doc/models/pricing-scheme.md) | Optional | Omit for On/Off components. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | -| `listPricePointId` | `number \| null \| undefined` | Optional | Optional id of the price point to use for list price calculations when
overriding the customer price. | +| `listPricePointId` | `number \| null \| undefined` | Optional | (Optional) Id of the price point to use for list price calculations when
overriding the customer price. | | `useDefaultListPrice` | `boolean \| undefined` | Optional | When true, list price calculations will continue to use the default price point even when a `custom_price` is supplied. | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | | `renewPrepaidAllocation` | `boolean \| undefined` | Optional | Applicable only to prepaid usage components. Controls whether the allocated quantity renews each period. | @@ -23,22 +23,28 @@ Create or update custom pricing unique to the subscription. Used in place of `pr | `expirationInterval` | `number \| null \| undefined` | Optional | Applicable only when rollover is enabled. Number of `expiration_interval_unit`s after which rollover amounts expire. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | Applicable only when rollover is enabled. Interval unit for rollover expiration (month or day). | -## Example (as JSON) +## Example -```json -{ - "prices": [ +```ts +import { + ComponentCustomPrice, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentCustomPrice: ComponentCustomPrice = { + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 162, - "interval_unit": "day", - "list_price_point_id": 146 -} + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 58, + intervalUnit: IntervalUnit.Day, + listPricePointId: 182, +}; ``` diff --git a/doc/models/component-kind.md b/doc/models/component-kind.md index 915b0b68..52e60823 100644 --- a/doc/models/component-kind.md +++ b/doc/models/component-kind.md @@ -17,3 +17,11 @@ A handle for the component type | `PrepaidUsageComponent` | | `EventBasedComponent` | +## Example + +```ts +import { ComponentKind } from '@maxio-com/advanced-billing-sdk'; + +const componentKind = ComponentKind.PrepaidUsageComponent; +``` + diff --git a/doc/models/component-price-point-assignment.md b/doc/models/component-price-point-assignment.md index cdabf99f..adeab6f7 100644 --- a/doc/models/component-price-point-assignment.md +++ b/doc/models/component-price-point-assignment.md @@ -12,12 +12,16 @@ | `componentId` | `number \| undefined` | Optional | - | | `pricePoint` | [`ComponentPricePointAssignmentPricePoint \| undefined`](../../doc/models/containers/component-price-point-assignment-price-point.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) +## Example -```json -{ - "component_id": 114, - "price_point": "String9" -} +```ts +import { + ComponentPricePointAssignment, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointAssignment: ComponentPricePointAssignment = { + componentId: 190, + pricePoint: 'String7', +}; ``` diff --git a/doc/models/component-price-point-currency-overage-response.md b/doc/models/component-price-point-currency-overage-response.md index fd3cae2d..5e4c8d36 100644 --- a/doc/models/component-price-point-currency-overage-response.md +++ b/doc/models/component-price-point-currency-overage-response.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | | `pricePoint` | [`CurrencyOveragePrices`](../../doc/models/currency-overage-prices.md) | Required | Extends a component price point with currency overage prices. | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ts +import { + ComponentPricePointCurrencyOverageResponse, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointCurrencyOverageResponse: ComponentPricePointCurrencyOverageResponse = { + pricePoint: { + id: 248, + type: PricePointType.Default, + mDefault: false, + name: 'name0', + pricingScheme: PricingScheme.PerUnit, + }, +}; ``` diff --git a/doc/models/component-price-point-error-item.md b/doc/models/component-price-point-error-item.md index 42c57bb2..007a633c 100644 --- a/doc/models/component-price-point-error-item.md +++ b/doc/models/component-price-point-error-item.md @@ -13,13 +13,17 @@ | `message` | `string \| undefined` | Optional | - | | `pricePoint` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 206, - "message": "message4", - "price_point": 152 -} +## Example + +```ts +import { + ComponentPricePointErrorItem, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointErrorItem: ComponentPricePointErrorItem = { + componentId: 174, + message: 'message2', + pricePoint: 72, +}; ``` diff --git a/doc/models/component-price-point-error.md b/doc/models/component-price-point-error.md index 7a780d5f..216a70ea 100644 --- a/doc/models/component-price-point-error.md +++ b/doc/models/component-price-point-error.md @@ -11,22 +11,15 @@ | --- | --- | --- | --- | | `errors` | [`ComponentPricePointErrorItem[] \| undefined`](../../doc/models/component-price-point-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "component_id": 236, - "message": "message0", - "price_point": 122 - }, - { - "component_id": 236, - "message": "message0", - "price_point": 122 - } - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ComponentPricePointError) { + console.log(error.result); + } } ``` diff --git a/doc/models/component-price-point-item.md b/doc/models/component-price-point-item.md index e46ceefb..8b42ebdb 100644 --- a/doc/models/component-price-point-item.md +++ b/doc/models/component-price-point-item.md @@ -12,19 +12,25 @@ | `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. | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | | `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name6", - "handle": "handle2", - "pricing_scheme": "per_unit", - "interval": 196, - "interval_unit": "day" -} +## Example + +```ts +import { + ComponentPricePointItem, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointItem: ComponentPricePointItem = { + name: 'name8', + handle: 'handle4', + pricingScheme: PricingScheme.Stairstep, + interval: 138, + intervalUnit: IntervalUnit.Day, +}; ``` diff --git a/doc/models/component-price-point-response.md b/doc/models/component-price-point-response.md index afb04130..0f7589a4 100644 --- a/doc/models/component-price-point-response.md +++ b/doc/models/component-price-point-response.md @@ -11,17 +11,23 @@ | --- | --- | --- | --- | | `pricePoint` | [`ComponentPricePoint`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "type": "default", - "default": false, - "name": "name0", - "pricing_scheme": "per_unit" - } -} +## Example + +```ts +import { + ComponentPricePointResponse, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointResponse: ComponentPricePointResponse = { + pricePoint: { + id: 248, + type: PricePointType.Default, + mDefault: false, + name: 'name0', + pricingScheme: PricingScheme.PerUnit, + }, +}; ``` diff --git a/doc/models/component-price-point.md b/doc/models/component-price-point.md index c76c7007..21390608 100644 --- a/doc/models/component-price-point.md +++ b/doc/models/component-price-point.md @@ -11,7 +11,7 @@ | --- | --- | --- | --- | | `id` | `number \| undefined` | Optional | - | | `type` | [`PricePointType \| undefined`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `mDefault` | `boolean \| undefined` | Optional | Note: Refer to type attribute instead | +| `mDefault` | `boolean \| undefined` | Optional | Note: Refer to type attribute instead. | | `name` | `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. | | `componentId` | `number \| undefined` | Optional | - | @@ -23,7 +23,7 @@ | `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. Defaults to true during creation. | | `subscriptionId` | `number \| undefined` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `taxIncluded` | `boolean \| undefined` | Optional | - | -| `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. | +| `interval` | `number \| null \| undefined` | Optional | The numerical interval. e.g., 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. The clone endpoint always returns currency prices if they are present. | | `overagePrices` | [`ComponentPrice[] \| undefined`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -33,15 +33,21 @@ | `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) - -```json -{ - "id": 190, - "type": "custom", - "default": false, - "name": "name2", - "pricing_scheme": "stairstep" -} +## Example + +```ts +import { + ComponentPricePoint, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePoint: ComponentPricePoint = { + id: 122, + type: PricePointType.Catalog, + mDefault: false, + name: 'name2', + pricingScheme: PricingScheme.Stairstep, +}; ``` diff --git a/doc/models/component-price-points-response.md b/doc/models/component-price-points-response.md index c6a28e0d..6e495aae 100644 --- a/doc/models/component-price-points-response.md +++ b/doc/models/component-price-points-response.md @@ -12,32 +12,45 @@ | `pricePoints` | [`ComponentPricePoint[] \| undefined`](../../doc/models/component-price-point.md) | Optional | - | | `meta` | [`ListPublicKeysMeta \| undefined`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "price_points": [ +```ts +import { + ComponentPricePointsResponse, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentPricePointsResponse: ComponentPricePointsResponse = { + pricePoints: [ + { + id: 40, + type: PricePointType.Default, + mDefault: false, + name: 'name2', + pricingScheme: PricingScheme.PerUnit, + }, { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" + id: 40, + type: PricePointType.Default, + mDefault: false, + name: 'name2', + pricingScheme: PricingScheme.PerUnit, }, { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" + id: 40, + type: PricePointType.Default, + mDefault: false, + name: 'name2', + pricingScheme: PricingScheme.PerUnit, } ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: { + totalCount: 150, + currentPage: 126, + totalPages: 138, + perPage: 152, + }, +}; ``` diff --git a/doc/models/component-price.md b/doc/models/component-price.md index 034fcdce..b04d4fc2 100644 --- a/doc/models/component-price.md +++ b/doc/models/component-price.md @@ -18,15 +18,17 @@ | `formattedUnitPrice` | `string \| undefined` | Optional | - | | `segmentId` | `number \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 234, - "component_id": 88, - "starting_quantity": 104, - "ending_quantity": 78, - "unit_price": "unit_price0" -} +## Example + +```ts +import { ComponentPrice } from '@maxio-com/advanced-billing-sdk'; + +const componentPrice: ComponentPrice = { + id: 18, + componentId: 128, + startingQuantity: 64, + endingQuantity: 218, + unitPrice: 'unit_price4', +}; ``` diff --git a/doc/models/component-response.md b/doc/models/component-response.md index c322ada8..ad73976b 100644 --- a/doc/models/component-response.md +++ b/doc/models/component-response.md @@ -11,18 +11,24 @@ | --- | --- | --- | --- | | `component` | [`Component`](../../doc/models/component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "id": 80, - "name": "name8", - "handle": "handle4", - "pricing_scheme": "per_unit", - "unit_name": "unit_name0" - } -} +## Example + +```ts +import { + ComponentResponse, + ItemCategory, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const componentResponse: ComponentResponse = { + component: { + id: 80, + name: 'name8', + handle: 'handle4', + pricingScheme: PricingScheme.PerUnit, + unitName: 'unit_name0', + itemCategory: ItemCategory.EnumBusinessSoftware, + }, +}; ``` diff --git a/doc/models/component.md b/doc/models/component.md index 616710ca..b12c07fa 100644 --- a/doc/models/component.md +++ b/doc/models/component.md @@ -10,15 +10,15 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `number \| undefined` | Optional | The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. | -| `name` | `string \| undefined` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `string \| undefined` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `handle` | `string \| null \| undefined` | Optional | The component API handle | | `pricingScheme` | [`PricingScheme \| null \| undefined`](../../doc/models/pricing-scheme.md) | Optional | - | -| `unitName` | `string \| undefined` | Optional | The name of the unit that the component’s usage is measured in. i.e. message | +| `unitName` | `string \| undefined` | Optional | The name of the unit that the component’s usage is measured in. e.g., message | | `unitPrice` | `string \| null \| undefined` | Optional | The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. | | `productFamilyId` | `number \| undefined` | Optional | The id of the Product Family to which the Component belongs | | `productFamilyName` | `string \| undefined` | Optional | The name of the Product Family to which the Component belongs | | `productFamilyHandle` | `string \| undefined` | Optional | The handle of the Product Family to which the Component belongs | -| `pricePerUnitInCents` | `bigint \| null \| undefined` | Optional | deprecated - use unit_price instead | +| `pricePerUnitInCents` | `bigint \| null \| undefined` | Optional | deprecated - use unit_price instead. | | `kind` | [`ComponentKind \| undefined`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `archived` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is archived or not. | | `description` | `string \| null \| undefined` | Optional | The description of the component. | @@ -42,19 +42,26 @@ | `useSiteExchangeRate` | `boolean \| null \| undefined` | Optional | - | | `accountingCode` | `string \| null \| undefined` | Optional | E.g. Internal ID or SKU Number | | `eventBasedBillingMetricId` | `number \| undefined` | Optional | (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. | -| `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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "id": 24, - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "unit_name": "unit_name4" -} +## Example + +```ts +import { + Component, + ItemCategory, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const component: Component = { + id: 80, + name: 'name8', + handle: 'handle4', + pricingScheme: PricingScheme.PerUnit, + unitName: 'unit_name0', + itemCategory: ItemCategory.EnumBusinessSoftware, +}; ``` diff --git a/doc/models/compounding-strategy.md b/doc/models/compounding-strategy.md index 2bb80c64..6d5490f3 100644 --- a/doc/models/compounding-strategy.md +++ b/doc/models/compounding-strategy.md @@ -14,3 +14,11 @@ Applicable only to stackable coupons. For `compound`, Percentage-based discounts | `Compound` | | `Fullprice` | +## Example + +```ts +import { CompoundingStrategy } from '@maxio-com/advanced-billing-sdk'; + +const compoundingStrategy = CompoundingStrategy.Compound; +``` + diff --git a/doc/models/consolidated-invoice.md b/doc/models/consolidated-invoice.md index f754debb..61681beb 100644 --- a/doc/models/consolidated-invoice.md +++ b/doc/models/consolidated-invoice.md @@ -11,26 +11,35 @@ | --- | --- | --- | --- | | `invoices` | [`Invoice[] \| undefined`](../../doc/models/invoice.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "invoices": [ +```ts +import { ConsolidatedInvoice } from '@maxio-com/advanced-billing-sdk'; + +const consolidatedInvoice: ConsolidatedInvoice = { + invoices: [ + { + id: BigInt(196), + uid: 'uid6', + siteId: 122, + customerId: 234, + subscriptionId: 50, + }, { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 + id: BigInt(196), + uid: 'uid6', + siteId: 122, + customerId: 234, + subscriptionId: 50, }, { - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 + id: BigInt(196), + uid: 'uid6', + siteId: 122, + customerId: 234, + subscriptionId: 50, } - ] -} + ], +}; ``` diff --git a/doc/models/containers/create-subscription-component-unit-balance.md b/doc/models/containers/create-subscription-component-unit-balance.md new file mode 100644 index 00000000..6e629d4e --- /dev/null +++ b/doc/models/containers/create-subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Create Subscription Component Unit Balance + +## Class Name + +`CreateSubscriptionComponentUnitBalance` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: CreateSubscriptionComponentUnitBalance = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: CreateSubscriptionComponentUnitBalance = 'String0'; +``` + diff --git a/doc/models/containers/event-event-specific-data.md b/doc/models/containers/event-event-specific-data.md index 27d5db1a..6fc127dc 100644 --- a/doc/models/containers/event-event-specific-data.md +++ b/doc/models/containers/event-event-specific-data.md @@ -109,7 +109,7 @@ const value: EventEventSpecificData = { ```ts const value: EventEventSpecificData = { previousUnitBalance: 'previous_unit_balance6', - newUnitBalance: 80, + newUnitBalance: 2, usageQuantity: 42, componentId: 4, componentHandle: 'component_handle8', @@ -127,8 +127,8 @@ const value: EventEventSpecificData = { const value: EventEventSpecificData = { previousUnitBalance: 'previous_unit_balance0', previousOverageUnitBalance: 'previous_overage_unit_balance4', - newUnitBalance: 252, - newOverageUnitBalance: 224, + newUnitBalance: 174, + newOverageUnitBalance: 146, usageQuantity: 214, overageUsageQuantity: 106, componentId: 176, diff --git a/doc/models/containers/get-one-time-token-request-payment-profile.md b/doc/models/containers/get-one-time-token-request-payment-profile.md new file mode 100644 index 00000000..312799b4 --- /dev/null +++ b/doc/models/containers/get-one-time-token-request-payment-profile.md @@ -0,0 +1,69 @@ + +# Get One Time Token Request Payment Profile + +## Class Name + +`GetOneTimeTokenRequestPaymentProfile` + +## Cases + +| Type | +| --- | +| [`GetOneTimeTokenPaymentProfile`](../../../doc/models/get-one-time-token-payment-profile.md) | +| [`GetOneTimeTokenBankAccountPaymentProfile`](../../../doc/models/get-one-time-token-bank-account-payment-profile.md) | + +## GetOneTimeTokenPaymentProfile + +### Initialization Code + +#### Example + +```ts +const value: GetOneTimeTokenRequestPaymentProfile = { + firstName: 'first_name2', + lastName: 'last_name0', + maskedCardNumber: 'masked_card_number0', + cardType: CardType.Routex, + expirationMonth: 187.78, + expirationYear: 164.44, + currentVault: CreditCardVault.BraintreeBlue, + vaultToken: 'vault_token4', + billingAddress: 'billing_address4', + billingCity: 'billing_city0', + billingCountry: 'billing_country6', + billingState: 'billing_state6', + billingZip: 'billing_zip0', + paymentType: 'payment_type2', + disabled: false, + siteGatewaySettingId: 232, +}; +``` + +## GetOneTimeTokenBankAccountPaymentProfile + +### Initialization Code + +#### Example + +```ts +const value: GetOneTimeTokenRequestPaymentProfile = { + firstName: 'first_name8', + lastName: 'last_name6', + currentVault: BankAccountVault.Maxp, + vaultToken: 'vault_token0', + billingAddress: 'billing_address0', + billingCity: 'billing_city4', + billingCountry: 'billing_country2', + billingState: 'billing_state8', + billingZip: 'billing_zip6', + bankName: 'bank_name6', + maskedBankRoutingNumber: 'masked_bank_routing_number6', + maskedBankAccountNumber: 'masked_bank_account_number0', + bankAccountType: BankAccountType.Checking, + bankAccountHolderType: BankAccountHolderType.Personal, + paymentType: 'payment_type2', + disabled: false, + siteGatewaySettingId: 254, +}; +``` + diff --git a/doc/models/containers/list-subscriptions-input-product.md b/doc/models/containers/list-subscriptions-input-product.md new file mode 100644 index 00000000..2f8dc6bc --- /dev/null +++ b/doc/models/containers/list-subscriptions-input-product.md @@ -0,0 +1,34 @@ + +# List Subscriptions Input Product + +## Class Name + +`ListSubscriptionsInputProduct` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: ListSubscriptionsInputProduct = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: ListSubscriptionsInputProduct = 'String0'; +``` + diff --git a/doc/models/containers/metered-usage-new-unit-balance.md b/doc/models/containers/metered-usage-new-unit-balance.md new file mode 100644 index 00000000..add940ab --- /dev/null +++ b/doc/models/containers/metered-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Metered Usage New Unit Balance + +## Class Name + +`MeteredUsageNewUnitBalance` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: MeteredUsageNewUnitBalance = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: MeteredUsageNewUnitBalance = 'String0'; +``` + diff --git a/doc/models/containers/prepaid-usage-new-overage-unit-balance.md b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md new file mode 100644 index 00000000..40f49b09 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-overage-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Overage Unit Balance + +## Class Name + +`PrepaidUsageNewOverageUnitBalance` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: PrepaidUsageNewOverageUnitBalance = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: PrepaidUsageNewOverageUnitBalance = 'String0'; +``` + diff --git a/doc/models/containers/prepaid-usage-new-unit-balance.md b/doc/models/containers/prepaid-usage-new-unit-balance.md new file mode 100644 index 00000000..cc6cb6a0 --- /dev/null +++ b/doc/models/containers/prepaid-usage-new-unit-balance.md @@ -0,0 +1,34 @@ + +# Prepaid Usage New Unit Balance + +## Class Name + +`PrepaidUsageNewUnitBalance` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: PrepaidUsageNewUnitBalance = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: PrepaidUsageNewUnitBalance = 'String0'; +``` + diff --git a/doc/models/containers/subscription-component-unit-balance.md b/doc/models/containers/subscription-component-unit-balance.md new file mode 100644 index 00000000..65b77c19 --- /dev/null +++ b/doc/models/containers/subscription-component-unit-balance.md @@ -0,0 +1,34 @@ + +# Subscription Component Unit Balance + +## Class Name + +`SubscriptionComponentUnitBalance` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: SubscriptionComponentUnitBalance = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: SubscriptionComponentUnitBalance = 'String0'; +``` + diff --git a/doc/models/containers/update-invoice-item-component-id.md b/doc/models/containers/update-invoice-item-component-id.md new file mode 100644 index 00000000..ce5d4f2b --- /dev/null +++ b/doc/models/containers/update-invoice-item-component-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Component Id + +## Class Name + +`UpdateInvoiceItemComponentId` + +## Cases + +| Type | +| --- | +| `string` | +| `number` | + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemComponentId = 'String0'; +``` + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemComponentId = 0; +``` + diff --git a/doc/models/containers/update-invoice-item-price-point-id.md b/doc/models/containers/update-invoice-item-price-point-id.md new file mode 100644 index 00000000..bdcf2f96 --- /dev/null +++ b/doc/models/containers/update-invoice-item-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Price Point Id + +## Class Name + +`UpdateInvoiceItemPricePointId` + +## Cases + +| Type | +| --- | +| `string` | +| `number` | + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemPricePointId = 'String0'; +``` + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemPricePointId = 0; +``` + diff --git a/doc/models/containers/update-invoice-item-product-id.md b/doc/models/containers/update-invoice-item-product-id.md new file mode 100644 index 00000000..57eaabdd --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Id + +## Class Name + +`UpdateInvoiceItemProductId` + +## Cases + +| Type | +| --- | +| `string` | +| `number` | + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemProductId = 'String0'; +``` + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemProductId = 0; +``` + diff --git a/doc/models/containers/update-invoice-item-product-price-point-id.md b/doc/models/containers/update-invoice-item-product-price-point-id.md new file mode 100644 index 00000000..fad7f179 --- /dev/null +++ b/doc/models/containers/update-invoice-item-product-price-point-id.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Product Price Point Id + +## Class Name + +`UpdateInvoiceItemProductPricePointId` + +## Cases + +| Type | +| --- | +| `string` | +| `number` | + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemProductPricePointId = 'String0'; +``` + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemProductPricePointId = 0; +``` + diff --git a/doc/models/containers/update-invoice-item-quantity.md b/doc/models/containers/update-invoice-item-quantity.md new file mode 100644 index 00000000..e6694192 --- /dev/null +++ b/doc/models/containers/update-invoice-item-quantity.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Quantity + +## Class Name + +`UpdateInvoiceItemQuantity` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemQuantity = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemQuantity = 'String0'; +``` + diff --git a/doc/models/containers/update-invoice-item-unit-price.md b/doc/models/containers/update-invoice-item-unit-price.md new file mode 100644 index 00000000..21a780f8 --- /dev/null +++ b/doc/models/containers/update-invoice-item-unit-price.md @@ -0,0 +1,34 @@ + +# Update Invoice Item Unit Price + +## Class Name + +`UpdateInvoiceItemUnitPrice` + +## Cases + +| Type | +| --- | +| `number` | +| `string` | + +## number + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemUnitPrice = 0; +``` + +## string + +### Initialization Code + +#### Example + +```ts +const value: UpdateInvoiceItemUnitPrice = 'String0'; +``` + diff --git a/doc/models/contract.md b/doc/models/contract.md index fc0f6484..5e5d1e63 100644 --- a/doc/models/contract.md +++ b/doc/models/contract.md @@ -16,19 +16,21 @@ Contract linked to the scheduled renewal configuration. | `number` | `string \| null \| undefined` | Optional | - | | `register` | [`Register \| undefined`](../../doc/models/register.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 136, - "maxio_id": "maxio_id8", - "number": "number6", - "register": { - "id": 54, - "maxio_id": "maxio_id4", - "name": "name2", - "currency_code": "currency_code2" - } -} +## Example + +```ts +import { Contract } from '@maxio-com/advanced-billing-sdk'; + +const contract: Contract = { + id: 112, + maxioId: 'maxio_id6', + number: 'number2', + register: { + id: 54, + maxioId: 'maxio_id4', + name: 'name2', + currencyCode: 'currency_code2', + }, +}; ``` diff --git a/doc/models/count-response.md b/doc/models/count-response.md index c21c187c..e36a7001 100644 --- a/doc/models/count-response.md +++ b/doc/models/count-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `count` | `number \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "count": 60 -} +```ts +import { CountResponse } from '@maxio-com/advanced-billing-sdk'; + +const countResponse: CountResponse = { + count: 56, +}; ``` diff --git a/doc/models/coupon-currency-request.md b/doc/models/coupon-currency-request.md index 881bda83..e1499622 100644 --- a/doc/models/coupon-currency-request.md +++ b/doc/models/coupon-currency-request.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `currencyPrices` | [`UpdateCouponCurrency[]`](../../doc/models/update-coupon-currency.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { CouponCurrencyRequest } from '@maxio-com/advanced-billing-sdk'; + +const couponCurrencyRequest: CouponCurrencyRequest = { + currencyPrices: [ { - "currency": "currency8", - "price": 78 + currency: 'currency8', + price: 78, } - ] -} + ], +}; ``` diff --git a/doc/models/coupon-currency-response.md b/doc/models/coupon-currency-response.md index a04acad8..6f7dc3d0 100644 --- a/doc/models/coupon-currency-response.md +++ b/doc/models/coupon-currency-response.md @@ -11,30 +11,20 @@ | --- | --- | --- | --- | | `currencyPrices` | [`CouponCurrency[] \| undefined`](../../doc/models/coupon-currency.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, - { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 - }, +```ts +import { CouponCurrencyResponse } from '@maxio-com/advanced-billing-sdk'; + +const couponCurrencyResponse: CouponCurrencyResponse = { + currencyPrices: [ { - "id": 50, - "currency": "currency8", - "price": 233.74, - "coupon_id": 224 + id: 50, + currency: 'currency8', + price: 233.74, + couponId: 224, } - ] -} + ], +}; ``` diff --git a/doc/models/coupon-currency.md b/doc/models/coupon-currency.md index bff71ecb..4f15f6e4 100644 --- a/doc/models/coupon-currency.md +++ b/doc/models/coupon-currency.md @@ -14,14 +14,16 @@ | `price` | `number \| null \| undefined` | Optional | - | | `couponId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 228, - "currency": "currency8", - "price": 169.96, - "coupon_id": 210 -} +## Example + +```ts +import { CouponCurrency } from '@maxio-com/advanced-billing-sdk'; + +const couponCurrency: CouponCurrency = { + id: 202, + currency: 'currency0', + price: 14.62, + couponId: 184, +}; ``` diff --git a/doc/models/coupon-payload.md b/doc/models/coupon-payload.md index 7ff0f441..c0c9ac22 100644 --- a/doc/models/coupon-payload.md +++ b/doc/models/coupon-payload.md @@ -10,10 +10,10 @@ | 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 “.” | +| `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 | +| `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. | @@ -24,15 +24,17 @@ | `applyOnCancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | | `applyOnSubscriptionExpiration` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name8", - "code": "code6", - "description": "description8", - "percentage": "String7", - "amount_in_cents": 110 -} +```ts +import { CouponPayload } from '@maxio-com/advanced-billing-sdk'; + +const couponPayload: CouponPayload = { + name: 'name8', + code: 'code6', + description: 'description2', + percentage: 'String7', + amountInCents: BigInt(124), +}; ``` diff --git a/doc/models/coupon-request.md b/doc/models/coupon-request.md index e6d542ca..2aea2a23 100644 --- a/doc/models/coupon-request.md +++ b/doc/models/coupon-request.md @@ -10,26 +10,30 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `coupon` | [`CouponPayload \| undefined`](../../doc/models/coupon-payload.md) | Optional | - | -| `restrictedProducts` | `Record \| undefined` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), 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 or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component | - -## Example (as JSON) - -```json -{ - "coupon": { - "name": "name4", - "code": "code2", - "description": "description6", - "percentage": "String3", - "amount_in_cents": 230 +| `restrictedProducts` | `Record \| undefined` | Optional | An object where the keys are product IDs or handles (prefixed with 'handle:'), 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 or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component. | + +## Example + +```ts +import { CouponRequest } from '@maxio-com/advanced-billing-sdk'; + +const couponRequest: CouponRequest = { + coupon: { + name: 'name4', + code: 'code2', + description: 'description6', + percentage: 'String3', + amountInCents: BigInt(230), + }, + restrictedProducts: { + 'key0': true, + 'key1': false }, - "restricted_products": { - "key0": true + restrictedComponents: { + 'key0': true, + 'key1': false }, - "restricted_components": { - "key0": true - } -} +}; ``` diff --git a/doc/models/coupon-response.md b/doc/models/coupon-response.md index b8daae83..853e8c14 100644 --- a/doc/models/coupon-response.md +++ b/doc/models/coupon-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `coupon` | [`Coupon \| undefined`](../../doc/models/coupon.md) | Optional | - | -## Example (as JSON) - -```json -{ - "coupon": { - "id": 196, - "name": "name4", - "code": "code2", - "description": "description6", - "amount": 97.66 - } -} +## Example + +```ts +import { CouponResponse } from '@maxio-com/advanced-billing-sdk'; + +const couponResponse: CouponResponse = { + coupon: { + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66, + }, +}; ``` diff --git a/doc/models/coupon-restriction.md b/doc/models/coupon-restriction.md index ce3b8f87..1279bc49 100644 --- a/doc/models/coupon-restriction.md +++ b/doc/models/coupon-restriction.md @@ -15,15 +15,20 @@ | `name` | `string \| undefined` | Optional | - | | `handle` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 180, - "item_type": "Component", - "item_id": 184, - "name": "name4", - "handle": "handle0" -} +## Example + +```ts +import { + CouponRestriction, + RestrictionType, +} from '@maxio-com/advanced-billing-sdk'; + +const couponRestriction: CouponRestriction = { + id: 66, + itemType: RestrictionType.Component, + itemId: 214, + name: 'name0', + handle: 'handle6', +}; ``` diff --git a/doc/models/coupon-subcodes-response.md b/doc/models/coupon-subcodes-response.md index 4044cab8..9e9a6a50 100644 --- a/doc/models/coupon-subcodes-response.md +++ b/doc/models/coupon-subcodes-response.md @@ -13,23 +13,22 @@ | `duplicateCodes` | `string[] \| undefined` | Optional | - | | `invalidCodes` | `string[] \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "created_codes": [ - "created_codes1", - "created_codes2" +```ts +import { CouponSubcodesResponse } from '@maxio-com/advanced-billing-sdk'; + +const couponSubcodesResponse: CouponSubcodesResponse = { + createdCodes: [ + 'created_codes7' + ], + duplicateCodes: [ + 'duplicate_codes8' ], - "duplicate_codes": [ - "duplicate_codes8", - "duplicate_codes7" + invalidCodes: [ + 'invalid_codes4', + 'invalid_codes3' ], - "invalid_codes": [ - "invalid_codes0", - "invalid_codes9", - "invalid_codes8" - ] -} +}; ``` diff --git a/doc/models/coupon-subcodes.md b/doc/models/coupon-subcodes.md index 81623573..e01d6d0e 100644 --- a/doc/models/coupon-subcodes.md +++ b/doc/models/coupon-subcodes.md @@ -11,13 +11,16 @@ | --- | --- | --- | --- | | `codes` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes8" - ] -} +## Example + +```ts +import { CouponSubcodes } from '@maxio-com/advanced-billing-sdk'; + +const couponSubcodes: CouponSubcodes = { + codes: [ + 'codes8', + 'codes9' + ], +}; ``` diff --git a/doc/models/coupon-usage.md b/doc/models/coupon-usage.md index 3f7ed180..d2aa6019 100644 --- a/doc/models/coupon-usage.md +++ b/doc/models/coupon-usage.md @@ -14,18 +14,20 @@ | `signups` | `number \| undefined` | Optional | Number of times the coupon has been applied | | `savings` | `number \| null \| undefined` | Optional | Dollar amount of customer savings as a result of the coupon. | | `savingsInCents` | `bigint \| null \| undefined` | Optional | Dollar amount of customer savings as a result of the coupon. | -| `revenue` | `number \| null \| undefined` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | -| `revenueInCents` | `bigint \| undefined` | Optional | Total revenue of the all subscriptions that have received a discount from this coupon. | - -## Example (as JSON) - -```json -{ - "id": 14, - "name": "name0", - "signups": 34, - "savings": 52, - "savings_in_cents": 138 -} +| `revenue` | `number \| null \| undefined` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | +| `revenueInCents` | `bigint \| undefined` | Optional | Total revenue of all subscriptions that have received a discount from this coupon. | + +## Example + +```ts +import { CouponUsage } from '@maxio-com/advanced-billing-sdk'; + +const couponUsage: CouponUsage = { + id: 240, + name: 'name8', + signups: 4, + savings: 22, + savingsInCents: BigInt(108), +}; ``` diff --git a/doc/models/coupon.md b/doc/models/coupon.md index 40298bf9..5bf95f64 100644 --- a/doc/models/coupon.md +++ b/doc/models/coupon.md @@ -41,15 +41,17 @@ | `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) - -```json -{ - "id": 22, - "name": "name2", - "code": "code0", - "description": "description2", - "amount": 62.64 -} +## Example + +```ts +import { Coupon } from '@maxio-com/advanced-billing-sdk'; + +const coupon: Coupon = { + id: 196, + name: 'name4', + code: 'code2', + description: 'description6', + amount: 97.66, +}; ``` diff --git a/doc/models/create-allocation-request.md b/doc/models/create-allocation-request.md index e94dd765..06e2677b 100644 --- a/doc/models/create-allocation-request.md +++ b/doc/models/create-allocation-request.md @@ -11,18 +11,20 @@ | --- | --- | --- | --- | | `allocation` | [`CreateAllocation`](../../doc/models/create-allocation.md) | Required | - | -## Example (as JSON) - -```json -{ - "allocation": { - "quantity": 228.94, - "decimal_quantity": "decimal_quantity6", - "previous_quantity": 254.04, - "decimal_previous_quantity": "decimal_previous_quantity8", - "component_id": 8, - "memo": "memo2" - } -} +## Example + +```ts +import { CreateAllocationRequest } from '@maxio-com/advanced-billing-sdk'; + +const createAllocationRequest: CreateAllocationRequest = { + allocation: { + quantity: 228.94, + decimalQuantity: 'decimal_quantity6', + previousQuantity: 254.04, + decimalPreviousQuantity: 'decimal_previous_quantity8', + componentId: 8, + memo: 'memo2', + }, +}; ``` diff --git a/doc/models/create-allocation.md b/doc/models/create-allocation.md index 5e5ec823..7c37a41c 100644 --- a/doc/models/create-allocation.md +++ b/doc/models/create-allocation.md @@ -9,7 +9,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `quantity` | `number` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. | +| `quantity` | `number` | Required | The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1 for on and 0 for off. | | `decimalQuantity` | `string \| undefined` | Optional | Decimal representation of the allocated quantity. Only valid when decimal
allocations are enabled for the component. | | `previousQuantity` | `number \| undefined` | Optional | The quantity that was in effect before this allocation. Responses always
include this value; it may be supplied on preview requests to ensure the
expected change is evaluated. | | `decimalPreviousQuantity` | `string \| undefined` | Optional | Decimal representation of `previous_quantity`. Only valid when decimal
allocations are enabled for the component. | @@ -25,16 +25,18 @@ | `billingSchedule` | [`BillingSchedule \| undefined`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `customPrice` | [`ComponentCustomPrice \| undefined`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 8.06, - "decimal_quantity": "decimal_quantity4", - "previous_quantity": 218.92, - "decimal_previous_quantity": "decimal_previous_quantity0", - "component_id": 192, - "memo": "memo4" -} +## Example + +```ts +import { CreateAllocation } from '@maxio-com/advanced-billing-sdk'; + +const createAllocation: CreateAllocation = { + quantity: 6.56, + decimalQuantity: 'decimal_quantity6', + previousQuantity: 35.58, + decimalPreviousQuantity: 'decimal_previous_quantity0', + componentId: 42, + memo: 'memo4', +}; ``` diff --git a/doc/models/create-component-price-point-request.md b/doc/models/create-component-price-point-request.md index 191b876d..1c543c51 100644 --- a/doc/models/create-component-price-point-request.md +++ b/doc/models/create-component-price-point-request.md @@ -11,26 +11,32 @@ | --- | --- | --- | --- | | `pricePoint` | [`CreateComponentPricePointRequestPricePoint`](../../doc/models/containers/create-component-price-point-request-price-point.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ +## Example + +```ts +import { + CreateComponentPricePointRequest, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createComponentPricePointRequest: CreateComponentPricePointRequest = { + pricePoint: { + name: 'name0', + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" - } -} + handle: 'handle6', + useSiteExchangeRate: true, + taxIncluded: false, + interval: 24, + intervalUnit: IntervalUnit.Day, + }, +}; ``` diff --git a/doc/models/create-component-price-point.md b/doc/models/create-component-price-point.md index a5a26ab3..3efecdd0 100644 --- a/doc/models/create-component-price-point.md +++ b/doc/models/create-component-price-point.md @@ -15,27 +15,33 @@ | `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. 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | -## Example (as JSON) +## Example -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ +```ts +import { + CreateComponentPricePoint, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createComponentPricePoint: CreateComponentPricePoint = { + name: 'name4', + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "use_site_exchange_rate": true, - "handle": "handle6", - "tax_included": false, - "interval": 24, - "interval_unit": "day" -} + handle: 'handle0', + useSiteExchangeRate: true, + taxIncluded: false, + interval: 140, + intervalUnit: IntervalUnit.Day, +}; ``` diff --git a/doc/models/create-component-price-points-request.md b/doc/models/create-component-price-points-request.md index 7ef03aeb..444890e2 100644 --- a/doc/models/create-component-price-points-request.md +++ b/doc/models/create-component-price-points-request.md @@ -11,64 +11,44 @@ | --- | --- | --- | --- | | `pricePoints` | [`CreateComponentPricePointsRequestPricePoints[]`](../../doc/models/containers/create-component-price-points-request-price-points.md) | Required | This is Array of a container for any-of cases. | -## Example (as JSON) +## Example -```json -{ - "price_points": [ - { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "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 - } - ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" - }, +```ts +import { + CreateComponentPricePointsRequest, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createComponentPricePointsRequest: CreateComponentPricePointsRequest = { + pricePoints: [ { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "prices": [ + name: 'name0', + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "use_site_exchange_rate": false, - "tax_included": false, - "interval": 24, - "interval_unit": "day" + handle: 'handle6', + useSiteExchangeRate: false, + taxIncluded: false, + interval: 24, + intervalUnit: IntervalUnit.Day, } - ] -} + ], +}; ``` diff --git a/doc/models/create-credit-note-event.md b/doc/models/create-credit-note-event.md index cec82d35..0f6125ff 100644 --- a/doc/models/create-credit-note-event.md +++ b/doc/models/create-credit-note-event.md @@ -15,31 +15,36 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CreateCreditNote` | | `eventData` | [`CreditNote`](../../doc/models/credit-note.md) | Required | Example schema for an `create_credit_note` event | -## Example (as JSON) - -```json -{ - "id": 28, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + CreateCreditNoteEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const createCreditNoteEvent: CreateCreditNoteEvent = { + id: BigInt(82), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "create_credit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": "number6" - } -} + eventType: InvoiceEventType.CreateCreditNote, + eventData: { + uid: 'uid6', + siteId: 132, + customerId: 244, + subscriptionId: 60, + number: 'number6', + }, +}; ``` diff --git a/doc/models/create-currency-price.md b/doc/models/create-currency-price.md index 8188532a..63a2eefc 100644 --- a/doc/models/create-currency-price.md +++ b/doc/models/create-currency-price.md @@ -13,13 +13,15 @@ | `price` | `number \| undefined` | Optional | Price for the price level in this currency | | `priceId` | `number \| undefined` | Optional | ID of the price that this corresponds with | -## Example (as JSON) - -```json -{ - "currency": "currency2", - "price": 10.4, - "price_id": 54 -} +## Example + +```ts +import { CreateCurrencyPrice } from '@maxio-com/advanced-billing-sdk'; + +const createCurrencyPrice: CreateCurrencyPrice = { + currency: 'currency2', + price: 54.8, + priceId: 142, +}; ``` diff --git a/doc/models/create-currency-prices-request.md b/doc/models/create-currency-prices-request.md index 63a2dc75..080582be 100644 --- a/doc/models/create-currency-prices-request.md +++ b/doc/models/create-currency-prices-request.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `currencyPrices` | [`CreateCurrencyPrice[]`](../../doc/models/create-currency-price.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { CreateCurrencyPricesRequest } from '@maxio-com/advanced-billing-sdk'; + +const createCurrencyPricesRequest: CreateCurrencyPricesRequest = { + currencyPrices: [ { - "currency": "currency8", - "price": 233.74, - "price_id": 116 + currency: 'currency8', + price: 233.74, + priceId: 116, } - ] -} + ], +}; ``` diff --git a/doc/models/create-customer-request.md b/doc/models/create-customer-request.md index c1f23bfb..0086fd47 100644 --- a/doc/models/create-customer-request.md +++ b/doc/models/create-customer-request.md @@ -11,20 +11,22 @@ | --- | --- | --- | --- | | `customer` | [`CreateCustomer`](../../doc/models/create-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6", - "reference": "reference4", - "address": "address6", - "address_2": "address_24" - } -} +## Example + +```ts +import { CreateCustomerRequest } from '@maxio-com/advanced-billing-sdk'; + +const createCustomerRequest: CreateCustomerRequest = { + customer: { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address2: 'address_24', + }, +}; ``` diff --git a/doc/models/create-customer.md b/doc/models/create-customer.md index 3dc7c97d..fcf5d46f 100644 --- a/doc/models/create-customer.md +++ b/doc/models/create-customer.md @@ -25,22 +25,26 @@ | `locale` | `string \| undefined` | Optional | Set a specific language on a customer record. | | `vatNumber` | `string \| undefined` | Optional | - | | `taxExempt` | `boolean \| undefined` | Optional | - | +| `surcharging` | `boolean \| undefined` | Optional | Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | | `taxExemptReason` | `string \| undefined` | Optional | - | | `parentId` | `number \| null \| undefined` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforceId` | `string \| null \| undefined` | Optional | The Salesforce ID of the customer | - -## Example (as JSON) - -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails8", - "organization": "organization2", - "reference": "reference4", - "address": "address4", - "address_2": "address_22" -} +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | + +## Example + +```ts +import { CreateCustomer } from '@maxio-com/advanced-billing-sdk'; + +const createCustomer: CreateCustomer = { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', + reference: 'reference4', + address: 'address6', + address2: 'address_24', +}; ``` diff --git a/doc/models/create-debit-note-event.md b/doc/models/create-debit-note-event.md index 469cf138..e08e92cf 100644 --- a/doc/models/create-debit-note-event.md +++ b/doc/models/create-debit-note-event.md @@ -15,31 +15,36 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.CreateDebitNote` | | `eventData` | [`DebitNote`](../../doc/models/debit-note.md) | Required | Example schema for an `create_debit_note` event | -## Example (as JSON) - -```json -{ - "id": 98, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + CreateDebitNoteEvent, + InvoiceEventType, +} from '@maxio-com/advanced-billing-sdk'; + +const createDebitNoteEvent: CreateDebitNoteEvent = { + id: BigInt(176), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "create_debit_note", - "event_data": { - "uid": "uid6", - "site_id": 132, - "customer_id": 244, - "subscription_id": 60, - "number": 64 - } -} + eventType: InvoiceEventType.CreateDebitNote, + eventData: { + uid: 'uid6', + siteId: 132, + customerId: 244, + subscriptionId: 60, + number: 64, + }, +}; ``` diff --git a/doc/models/create-ebb-component.md b/doc/models/create-ebb-component.md index 662425cf..e5048e64 100644 --- a/doc/models/create-ebb-component.md +++ b/doc/models/create-ebb-component.md @@ -11,35 +11,41 @@ | --- | --- | --- | --- | | `eventBasedComponent` | [`EBBComponent`](../../doc/models/ebb-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "event_based_component": { - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + CreateEBBComponent, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createEBBComponent: CreateEBBComponent = { + eventBasedComponent: { + name: 'name8', + unitName: 'unit_name0', + pricingScheme: PricingScheme.Stairstep, + eventBasedBillingMetricId: 68, + description: 'description8', + handle: 'handle4', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "price_points": [ + pricePoints: [ { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, } ], - "event_based_billing_metric_id": 68 - } -} + }, +}; ``` diff --git a/doc/models/create-invoice-address.md b/doc/models/create-invoice-address.md index e3f62f88..2d7a7507 100644 --- a/doc/models/create-invoice-address.md +++ b/doc/models/create-invoice-address.md @@ -21,15 +21,17 @@ Overrides the default address. | `zip` | `string \| undefined` | Optional | - | | `country` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "phone": "phone6", - "address": "address0", - "address_2": "address_28" -} +## Example + +```ts +import { CreateInvoiceAddress } from '@maxio-com/advanced-billing-sdk'; + +const createInvoiceAddress: CreateInvoiceAddress = { + firstName: 'first_name6', + lastName: 'last_name4', + phone: 'phone4', + address: 'address2', + address2: 'address_20', +}; ``` diff --git a/doc/models/create-invoice-coupon.md b/doc/models/create-invoice-coupon.md index ebb7cb43..d88af2a4 100644 --- a/doc/models/create-invoice-coupon.md +++ b/doc/models/create-invoice-coupon.md @@ -17,15 +17,17 @@ | `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 | 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) - -```json -{ - "percentage": 50.0, - "code": "code4", - "subcode": "subcode8", - "amount": "String9", - "description": "description4" -} +## Example + +```ts +import { CreateInvoiceCoupon } from '@maxio-com/advanced-billing-sdk'; + +const createInvoiceCoupon: CreateInvoiceCoupon = { + code: 'code8', + subcode: 'subcode4', + percentage: 50, + amount: 'String9', + description: 'description0', +}; ``` diff --git a/doc/models/create-invoice-item.md b/doc/models/create-invoice-item.md index 624d9c27..dd0cdc6e 100644 --- a/doc/models/create-invoice-item.md +++ b/doc/models/create-invoice-item.md @@ -22,15 +22,17 @@ | `productPricePointId` | [`CreateInvoiceItemProductPricePointId \| undefined`](../../doc/models/containers/create-invoice-item-product-price-point-id.md) | Optional | This is a container for one-of cases. | | `description` | `string \| undefined` | Optional | **Constraints**: *Maximum Length*: `255` | -## Example (as JSON) - -```json -{ - "title": "title2", - "quantity": 154.86, - "unit_price": 138.08, - "taxable": false, - "tax_code": "tax_code4" -} +## Example + +```ts +import { CreateInvoiceItem } from '@maxio-com/advanced-billing-sdk'; + +const createInvoiceItem: CreateInvoiceItem = { + title: 'title8', + quantity: 107.22, + unitPrice: 90.44, + taxable: false, + taxCode: 'tax_code0', +}; ``` diff --git a/doc/models/create-invoice-payment-application.md b/doc/models/create-invoice-payment-application.md index dd104a85..85e19f2f 100644 --- a/doc/models/create-invoice-payment-application.md +++ b/doc/models/create-invoice-payment-application.md @@ -12,12 +12,16 @@ | `invoiceUid` | `string` | Required | Unique identifier for the invoice. It has the prefix "inv_" followed by alphanumeric characters. | | `amount` | `string` | Required | Dollar amount of the invoice payment (eg. "10.50" => $10.50). | -## Example (as JSON) +## Example -```json -{ - "invoice_uid": "invoice_uid4", - "amount": "amount6" -} +```ts +import { + CreateInvoicePaymentApplication, +} from '@maxio-com/advanced-billing-sdk'; + +const createInvoicePaymentApplication: CreateInvoicePaymentApplication = { + invoiceUid: 'invoice_uid6', + amount: 'amount8', +}; ``` diff --git a/doc/models/create-invoice-payment-request.md b/doc/models/create-invoice-payment-request.md index 1d697d11..94e4b6ec 100644 --- a/doc/models/create-invoice-payment-request.md +++ b/doc/models/create-invoice-payment-request.md @@ -12,18 +12,24 @@ | `payment` | [`CreateInvoicePayment`](../../doc/models/create-invoice-payment.md) | Required | - | | `type` | [`InvoicePaymentType \| undefined`](../../doc/models/invoice-payment-type.md) | Optional | The type of payment to be applied to an Invoice. Defaults to external. | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "memo": "memo0", - "method": "ach", - "details": "details6", - "payment_profile_id": 42 +## Example + +```ts +import { + CreateInvoicePaymentRequest, + InvoicePaymentMethodType, + InvoicePaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const createInvoicePaymentRequest: CreateInvoicePaymentRequest = { + payment: { + amount: 'String9', + memo: 'memo0', + method: InvoicePaymentMethodType.Ach, + details: 'details6', + paymentProfileId: 42, }, - "type": "external" -} + type: InvoicePaymentType.External, +}; ``` diff --git a/doc/models/create-invoice-payment.md b/doc/models/create-invoice-payment.md index 42869cc8..f5004230 100644 --- a/doc/models/create-invoice-payment.md +++ b/doc/models/create-invoice-payment.md @@ -16,15 +16,20 @@ | `paymentProfileId` | `number \| undefined` | Optional | The ID of the payment profile to be used for the payment. | | `receivedOn` | `string \| undefined` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | -## Example (as JSON) - -```json -{ - "amount": "String9", - "memo": "memo0", - "method": "cash", - "details": "details6", - "payment_profile_id": 122 -} +## Example + +```ts +import { + CreateInvoicePayment, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const createInvoicePayment: CreateInvoicePayment = { + amount: 'String7', + memo: 'memo8', + method: InvoicePaymentMethodType.Ach, + details: 'details4', + paymentProfileId: 30, +}; ``` diff --git a/doc/models/create-invoice-request.md b/doc/models/create-invoice-request.md index a74b5075..8b3d4812 100644 --- a/doc/models/create-invoice-request.md +++ b/doc/models/create-invoice-request.md @@ -11,40 +11,45 @@ | --- | --- | --- | --- | | `invoice` | [`CreateInvoice`](../../doc/models/create-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ +## Example + +```ts +import { + CreateInvoiceRequest, + CreateInvoiceStatus, +} from '@maxio-com/advanced-billing-sdk'; + +const createInvoiceRequest: CreateInvoiceRequest = { + invoice: { + lineItems: [ { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', }, { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', }, { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', } ], - "net_terms": 144, - "payment_instructions": "payment_instructions6", - "memo": "memo0" - } -} + issueDate: '2024-01-01', + netTerms: 144, + paymentInstructions: 'payment_instructions6', + memo: 'memo0', + status: CreateInvoiceStatus.Draft, + }, +}; ``` diff --git a/doc/models/create-invoice-status.md b/doc/models/create-invoice-status.md index 6afef48f..cdd0a07b 100644 --- a/doc/models/create-invoice-status.md +++ b/doc/models/create-invoice-status.md @@ -14,7 +14,9 @@ ## Example -``` -draft +```ts +import { CreateInvoiceStatus } from '@maxio-com/advanced-billing-sdk'; + +const createInvoiceStatus = CreateInvoiceStatus.Draft; ``` diff --git a/doc/models/create-invoice.md b/doc/models/create-invoice.md index 14aed863..782dcb8f 100644 --- a/doc/models/create-invoice.md +++ b/doc/models/create-invoice.md @@ -14,30 +14,42 @@ | `netTerms` | `number \| undefined` | Optional | By default, invoices will be created with a due date matching the date of invoice creation. If a different due date is desired, the net_terms parameter can be sent indicating the number of days in advance the due date should be. | | `paymentInstructions` | `string \| undefined` | Optional | - | | `memo` | `string \| undefined` | Optional | A custom memo can be sent to override the site's default. | -| `sellerAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site | -| `billingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | -| `shippingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer | +| `sellerAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the defaults for the site. | +| `billingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | +| `shippingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Overrides the default for the customer. | | `coupons` | [`CreateInvoiceCoupon[] \| undefined`](../../doc/models/create-invoice-coupon.md) | Optional | - | | `status` | [`CreateInvoiceStatus \| undefined`](../../doc/models/create-invoice-status.md) | Optional | **Default**: `CreateInvoiceStatus.Open` | -## Example (as JSON) +## Example -```json -{ - "issue_date": "2024-01-01", - "status": "draft", - "line_items": [ +```ts +import { + CreateInvoice, + CreateInvoiceStatus, +} from '@maxio-com/advanced-billing-sdk'; + +const createInvoice: CreateInvoice = { + lineItems: [ + { + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', + }, { - "title": "title4", - "quantity": 56.68, - "unit_price": 39.9, - "taxable": false, - "tax_code": "tax_code6" + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', } ], - "net_terms": 18, - "payment_instructions": "payment_instructions0", - "memo": "memo6" -} + issueDate: '2024-01-01', + netTerms: 202, + paymentInstructions: 'payment_instructions2', + memo: 'memo8', + status: CreateInvoiceStatus.Draft, +}; ``` diff --git a/doc/models/create-metadata-request.md b/doc/models/create-metadata-request.md index 7adf4773..9b1ebe1c 100644 --- a/doc/models/create-metadata-request.md +++ b/doc/models/create-metadata-request.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `metadata` | [`CreateMetadata[]`](../../doc/models/create-metadata.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "metadata": [ +```ts +import { CreateMetadataRequest } from '@maxio-com/advanced-billing-sdk'; + +const createMetadataRequest: CreateMetadataRequest = { + metadata: [ { - "name": "name6", - "value": "value8" + name: 'name6', + value: 'value8', } - ] -} + ], +}; ``` diff --git a/doc/models/create-metadata.md b/doc/models/create-metadata.md index 4b4b4926..576b636e 100644 --- a/doc/models/create-metadata.md +++ b/doc/models/create-metadata.md @@ -12,12 +12,14 @@ | `name` | `string \| undefined` | Optional | - | | `value` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "name": "name4", - "value": "value6" -} +```ts +import { CreateMetadata } from '@maxio-com/advanced-billing-sdk'; + +const createMetadata: CreateMetadata = { + name: 'name0', + value: 'value2', +}; ``` diff --git a/doc/models/create-metafield.md b/doc/models/create-metafield.md index 94631d97..d6db550b 100644 --- a/doc/models/create-metafield.md +++ b/doc/models/create-metafield.md @@ -11,26 +11,32 @@ | --- | --- | --- | --- | | `name` | `string \| undefined` | Optional | - | | `scope` | [`MetafieldScope \| undefined`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `mEnum` | `string[] \| undefined` | Optional | Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. | -## Example (as JSON) - -```json -{ - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" +## Example + +```ts +import { + CreateMetafield, + IncludeOption, + MetafieldInput, +} from '@maxio-com/advanced-billing-sdk'; + +const createMetafield: CreateMetafield = { + name: 'my_field', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, + publicEdit: IncludeOption.Exclude, }, - "input_type": "text", - "enum": [ - "string" - ] -} + inputType: MetafieldInput.Text, + mEnum: [ + 'string' + ], +}; ``` diff --git a/doc/models/create-metafields-request.md b/doc/models/create-metafields-request.md index 212f233c..f6a92284 100644 --- a/doc/models/create-metafields-request.md +++ b/doc/models/create-metafields-request.md @@ -11,25 +11,31 @@ | --- | --- | --- | --- | | `metafields` | [`CreateMetafieldsRequestMetafields`](../../doc/models/containers/create-metafields-request-metafields.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "name": "my_field", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0", - "public_edit": "0" +## Example + +```ts +import { + CreateMetafieldsRequest, + IncludeOption, + MetafieldInput, +} from '@maxio-com/advanced-billing-sdk'; + +const createMetafieldsRequest: CreateMetafieldsRequest = { + metafields: { + name: 'my_field', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, + publicEdit: IncludeOption.Exclude, }, - "input_type": "text", - "enum": [ - "string" - ] - } -} + inputType: MetafieldInput.Text, + mEnum: [ + 'string' + ], + }, +}; ``` diff --git a/doc/models/create-metered-component.md b/doc/models/create-metered-component.md index 6616a56c..2d6b9dba 100644 --- a/doc/models/create-metered-component.md +++ b/doc/models/create-metered-component.md @@ -11,58 +11,64 @@ | --- | --- | --- | --- | | `meteredComponent` | [`MeteredComponent`](../../doc/models/metered-component.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "metered_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ +```ts +import { + CreateMeteredComponent, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createMeteredComponent: CreateMeteredComponent = { + meteredComponent: { + name: 'name0', + unitName: 'unit_name2', + pricingScheme: PricingScheme.Stairstep, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "price_points": [ + pricePoints: [ { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, }, { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, }, { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/create-multi-invoice-payment-request.md b/doc/models/create-multi-invoice-payment-request.md index 7388e47b..2acca3e9 100644 --- a/doc/models/create-multi-invoice-payment-request.md +++ b/doc/models/create-multi-invoice-payment-request.md @@ -11,23 +11,28 @@ | --- | --- | --- | --- | | `payment` | [`CreateMultiInvoicePayment`](../../doc/models/create-multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "String9", - "applications": [ +## Example + +```ts +import { + CreateMultiInvoicePaymentRequest, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const createMultiInvoicePaymentRequest: CreateMultiInvoicePaymentRequest = { + payment: { + amount: 'String9', + applications: [ { - "invoice_uid": "invoice_uid8", - "amount": "amount0" + invoiceUid: 'invoice_uid8', + amount: 'amount0', } ], - "memo": "memo0", - "details": "details6", - "method": "ach", - "received_on": "received_on8" - } -} + memo: 'memo0', + details: 'details6', + method: InvoicePaymentMethodType.Ach, + receivedOn: 'received_on8', + }, +}; ``` diff --git a/doc/models/create-multi-invoice-payment.md b/doc/models/create-multi-invoice-payment.md index 6a575c0a..a707771c 100644 --- a/doc/models/create-multi-invoice-payment.md +++ b/doc/models/create-multi-invoice-payment.md @@ -16,21 +16,26 @@ | `receivedOn` | `string \| undefined` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. | | `applications` | [`CreateInvoicePaymentApplication[]`](../../doc/models/create-invoice-payment-application.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "amount": "String7", - "applications": [ +```ts +import { + CreateMultiInvoicePayment, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const createMultiInvoicePayment: CreateMultiInvoicePayment = { + amount: 'String9', + applications: [ { - "invoice_uid": "invoice_uid8", - "amount": "amount0" + invoiceUid: 'invoice_uid8', + amount: 'amount0', } ], - "memo": "memo8", - "details": "details4", - "method": "credit_card", - "received_on": "received_on6" -} + memo: 'memo0', + details: 'details6', + method: InvoicePaymentMethodType.Ach, + receivedOn: 'received_on8', +}; ``` diff --git a/doc/models/create-offer-component.md b/doc/models/create-offer-component.md index e62be6e1..2ba8dda5 100644 --- a/doc/models/create-offer-component.md +++ b/doc/models/create-offer-component.md @@ -13,13 +13,15 @@ | `pricePointId` | `number \| undefined` | Optional | - | | `startingQuantity` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "component_id": 242, - "price_point_id": 10, - "starting_quantity": 50 -} +## Example + +```ts +import { CreateOfferComponent } from '@maxio-com/advanced-billing-sdk'; + +const createOfferComponent: CreateOfferComponent = { + componentId: 252, + pricePointId: 20, + startingQuantity: 196, +}; ``` diff --git a/doc/models/create-offer-request.md b/doc/models/create-offer-request.md index add33999..9de354a7 100644 --- a/doc/models/create-offer-request.md +++ b/doc/models/create-offer-request.md @@ -11,32 +11,34 @@ | --- | --- | --- | --- | | `offer` | [`CreateOffer`](../../doc/models/create-offer.md) | Required | - | -## Example (as JSON) - -```json -{ - "offer": { - "name": "name4", - "handle": "handle0", - "description": "description6", - "product_id": 30, - "product_price_point_id": 150, - "components": [ +## Example + +```ts +import { CreateOfferRequest } from '@maxio-com/advanced-billing-sdk'; + +const createOfferRequest: CreateOfferRequest = { + offer: { + name: 'name4', + handle: 'handle0', + productId: 30, + description: 'description6', + productPricePointId: 150, + components: [ { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 + componentId: 108, + pricePointId: 124, + startingQuantity: 84, }, { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 + componentId: 108, + pricePointId: 124, + startingQuantity: 84, } ], - "coupons": [ - "coupons6" - ] - } -} + coupons: [ + 'coupons6' + ], + }, +}; ``` diff --git a/doc/models/create-offer.md b/doc/models/create-offer.md index 35653319..108d502c 100644 --- a/doc/models/create-offer.md +++ b/doc/models/create-offer.md @@ -17,30 +17,39 @@ | `components` | [`CreateOfferComponent[] \| undefined`](../../doc/models/create-offer-component.md) | Optional | - | | `coupons` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "description": "description4", - "product_id": 208, - "product_price_point_id": 132, - "components": [ +## Example + +```ts +import { CreateOffer } from '@maxio-com/advanced-billing-sdk'; + +const createOffer: CreateOffer = { + name: 'name6', + handle: 'handle2', + productId: 66, + description: 'description6', + productPricePointId: 246, + components: [ { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 + componentId: 108, + pricePointId: 124, + startingQuantity: 84, }, { - "component_id": 108, - "price_point_id": 124, - "starting_quantity": 84 + componentId: 108, + pricePointId: 124, + startingQuantity: 84, + }, + { + componentId: 108, + pricePointId: 124, + startingQuantity: 84, } ], - "coupons": [ - "coupons4" - ] -} + coupons: [ + 'coupons6', + 'coupons5', + 'coupons4' + ], +}; ``` diff --git a/doc/models/create-on-off-component.md b/doc/models/create-on-off-component.md index 2634498c..67224bf6 100644 --- a/doc/models/create-on-off-component.md +++ b/doc/models/create-on-off-component.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | | `onOffComponent` | [`OnOffComponent`](../../doc/models/on-off-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "on_off_component": { - "name": "name6", - "description": "description6", - "handle": "handle2", - "taxable": false, - "upgrade_charge": "full", - "downgrade_credit": "full", - "unit_price": "String5" - } -} +## Example + +```ts +import { + CreateOnOffComponent, + CreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const createOnOffComponent: CreateOnOffComponent = { + onOffComponent: { + name: 'name6', + unitPrice: 'String5', + description: 'description6', + handle: 'handle2', + taxable: false, + upgradeCharge: CreditType.Full, + downgradeCredit: CreditType.Full, + }, +}; ``` diff --git a/doc/models/create-or-update-endpoint-request.md b/doc/models/create-or-update-endpoint-request.md index 787658ee..b8714a83 100644 --- a/doc/models/create-or-update-endpoint-request.md +++ b/doc/models/create-or-update-endpoint-request.md @@ -1,7 +1,7 @@ # Create or Update Endpoint Request -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -11,18 +11,23 @@ Used to Create or Update Endpoint | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint | - -## Example (as JSON) - -```json -{ - "endpoint": { - "url": "url2", - "webhook_subscriptions": [ - "subscription_prepayment_account_balance_changed" - ] - } -} +| `endpoint` | [`CreateOrUpdateEndpoint`](../../doc/models/create-or-update-endpoint.md) | Required | Used to Create or Update Endpoint. | + +## Example + +```ts +import { + CreateOrUpdateEndpointRequest, + WebhookSubscription, +} from '@maxio-com/advanced-billing-sdk'; + +const createOrUpdateEndpointRequest: CreateOrUpdateEndpointRequest = { + endpoint: { + url: 'url2', + webhookSubscriptions: [ + WebhookSubscription.StatementClosed + ], + }, +}; ``` diff --git a/doc/models/create-or-update-endpoint.md b/doc/models/create-or-update-endpoint.md index d2a89e04..5e02102a 100644 --- a/doc/models/create-or-update-endpoint.md +++ b/doc/models/create-or-update-endpoint.md @@ -1,7 +1,7 @@ # Create or Update Endpoint -Used to Create or Update Endpoint +Used to Create or Update Endpoint. ## Structure @@ -14,14 +14,21 @@ Used to Create or Update Endpoint | `url` | `string` | Required | - | | `webhookSubscriptions` | [`WebhookSubscription[]`](../../doc/models/webhook-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "url": "url8", - "webhook_subscriptions": [ - "refund_success" - ] -} +## Example + +```ts +import { + CreateOrUpdateEndpoint, + WebhookSubscription, +} from '@maxio-com/advanced-billing-sdk'; + +const createOrUpdateEndpoint: CreateOrUpdateEndpoint = { + url: 'url4', + webhookSubscriptions: [ + WebhookSubscription.TrialEndNotice, + WebhookSubscription.SubscriptionStateChange, + WebhookSubscription.SubscriptionProductChangeScheduled + ], +}; ``` diff --git a/doc/models/create-or-update-product-request.md b/doc/models/create-or-update-product-request.md index 27bf13ae..3020895b 100644 --- a/doc/models/create-or-update-product-request.md +++ b/doc/models/create-or-update-product-request.md @@ -11,22 +11,27 @@ | --- | --- | --- | --- | | `product` | [`CreateOrUpdateProduct`](../../doc/models/create-or-update-product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6", - "require_credit_card": false, - "price_in_cents": 54, - "interval": 186, - "interval_unit": "day", - "trial_price_in_cents": 34, - "trial_interval": 88 - } -} +## Example + +```ts +import { + CreateOrUpdateProductRequest, + IntervalUnit, +} from '@maxio-com/advanced-billing-sdk'; + +const createOrUpdateProductRequest: CreateOrUpdateProductRequest = { + product: { + name: 'name0', + description: 'description0', + priceInCents: BigInt(54), + interval: 186, + intervalUnit: IntervalUnit.Day, + handle: 'handle6', + accountingCode: 'accounting_code6', + requireCreditCard: false, + trialPriceInCents: BigInt(34), + trialInterval: 88, + }, +}; ``` diff --git a/doc/models/create-or-update-product.md b/doc/models/create-or-update-product.md index 09cf274c..6ae75087 100644 --- a/doc/models/create-or-update-product.md +++ b/doc/models/create-or-update-product.md @@ -15,31 +15,37 @@ | `accountingCode` | `string \| undefined` | Optional | E.g. Internal ID or SKU Number | | `requireCreditCard` | `boolean \| undefined` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | | `priceInCents` | `bigint` | Required | The product price, in integer cents | -| `interval` | `number` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `number` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `intervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product, either month or day | | `trialPriceInCents` | `bigint \| undefined` | Optional | The product trial price, in integer cents | -| `trialInterval` | `number \| undefined` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | +| `trialInterval` | `number \| undefined` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. | | `trialIntervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | -| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | -| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | +| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | | `autoCreateSignupPage` | `boolean \| undefined` | Optional | - | | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "handle": "handle4", - "description": "description8", - "accounting_code": "accounting_code4", - "require_credit_card": false, - "price_in_cents": 190, - "interval": 174, - "interval_unit": "day", - "trial_price_in_cents": 22, - "trial_interval": 76 -} +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | + +## Example + +```ts +import { + CreateOrUpdateProduct, + IntervalUnit, +} from '@maxio-com/advanced-billing-sdk'; + +const createOrUpdateProduct: CreateOrUpdateProduct = { + name: 'name6', + description: 'description4', + priceInCents: BigInt(138), + interval: 154, + intervalUnit: IntervalUnit.Day, + handle: 'handle2', + accountingCode: 'accounting_code2', + requireCreditCard: false, + trialPriceInCents: BigInt(50), + trialInterval: 252, +}; ``` diff --git a/doc/models/create-or-update-segment-price.md b/doc/models/create-or-update-segment-price.md index 42927da4..1e9b74c2 100644 --- a/doc/models/create-or-update-segment-price.md +++ b/doc/models/create-or-update-segment-price.md @@ -13,13 +13,15 @@ | `endingQuantity` | `number \| undefined` | Optional | - | | `unitPrice` | [`CreateOrUpdateSegmentPriceUnitPrice`](../../doc/models/containers/create-or-update-segment-price-unit-price.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 78, - "ending_quantity": 52, - "unit_price": "String7" -} +## Example + +```ts +import { CreateOrUpdateSegmentPrice } from '@maxio-com/advanced-billing-sdk'; + +const createOrUpdateSegmentPrice: CreateOrUpdateSegmentPrice = { + unitPrice: 'String9', + startingQuantity: 98, + endingQuantity: 184, +}; ``` diff --git a/doc/models/create-payment-profile-request.md b/doc/models/create-payment-profile-request.md index 48ae386d..7dd102e5 100644 --- a/doc/models/create-payment-profile-request.md +++ b/doc/models/create-payment-profile-request.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | | `paymentProfile` | [`CreatePaymentProfile`](../../doc/models/create-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 44, - "payment_type": "credit_card", - "first_name": "first_name4", - "last_name": "last_name2" - } -} +## Example + +```ts +import { + CreatePaymentProfileRequest, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const createPaymentProfileRequest: CreatePaymentProfileRequest = { + paymentProfile: { + chargifyToken: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 44, + paymentType: PaymentType.CreditCard, + firstName: 'first_name4', + lastName: 'last_name2', + fullNumber: '5424000000000015', + }, +}; ``` diff --git a/doc/models/create-payment-profile.md b/doc/models/create-payment-profile.md index eb6ee547..4c6d0141 100644 --- a/doc/models/create-payment-profile.md +++ b/doc/models/create-payment-profile.md @@ -19,12 +19,12 @@ | `cardType` | [`CardType \| undefined`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expirationMonth` | [`CreatePaymentProfileExpirationMonth \| undefined`](../../doc/models/containers/create-payment-profile-expiration-month.md) | Optional | This is a container for one-of cases. | | `expirationYear` | [`CreatePaymentProfileExpirationYear \| undefined`](../../doc/models/containers/create-payment-profile-expiration-year.md) | Optional | This is a container for one-of cases. | -| `billingAddress` | `string \| undefined` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billingAddress2` | `string \| null \| undefined` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | -| `billingCity` | `string \| undefined` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billingState` | `string \| undefined` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billingCountry` | `string \| undefined` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billingZip` | `string \| undefined` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billingAddress` | `string \| undefined` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billingAddress2` | `string \| null \| undefined` | Optional | Second line of the customer’s billing address e.g., Apt. 100 | +| `billingCity` | `string \| undefined` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billingState` | `string \| undefined` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billingCountry` | `string \| undefined` | Optional | “The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.” | +| `billingZip` | `string \| undefined` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `currentVault` | [`AllVaults \| undefined`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | | `vaultToken` | `string \| undefined` | Optional | The “token” provided by your vault storage for an already stored payment profile | | `customerVaultToken` | `string \| undefined` | Optional | (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -34,24 +34,29 @@ | `gatewayHandle` | `string \| undefined` | Optional | This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `string \| undefined` | Optional | The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | | `bankName` | `string \| undefined` | Optional | (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides | -| `bankIban` | `string \| undefined` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided | -| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | +| `bankIban` | `string \| undefined` | Optional | (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. | | `bankAccountNumber` | `string \| undefined` | Optional | (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs bank account number | -| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided | +| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. | | `bankAccountType` | [`BankAccountType \| undefined`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bankAccountHolderType` | [`BankAccountHolderType \| undefined`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `lastFour` | `string \| undefined` | Optional | (Optional) Used for creating subscription with payment profile imported using vault_token, for proper display in Advanced Billing UI | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_9g6hw85pnpt6knmskpwp4ttt", - "full_number": "5424000000000015", - "id": 76, - "payment_type": "credit_card", - "first_name": "first_name8", - "last_name": "last_name6" -} +## Example + +```ts +import { + CreatePaymentProfile, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const createPaymentProfile: CreatePaymentProfile = { + chargifyToken: 'tok_9g6hw85pnpt6knmskpwp4ttt', + id: 124, + paymentType: PaymentType.CreditCard, + firstName: 'first_name6', + lastName: 'last_name4', + fullNumber: '5424000000000015', +}; ``` diff --git a/doc/models/create-payment.md b/doc/models/create-payment.md index cc35d76a..236517e5 100644 --- a/doc/models/create-payment.md +++ b/doc/models/create-payment.md @@ -14,14 +14,19 @@ | `paymentDetails` | `string` | Required | - | | `paymentMethod` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | The type of payment method used. Defaults to other. | -## Example (as JSON) - -```json -{ - "amount": "amount6", - "memo": "memo8", - "payment_details": "payment_details4", - "payment_method": "cash" -} +## Example + +```ts +import { + CreatePayment, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const createPayment: CreatePayment = { + amount: 'amount6', + memo: 'memo8', + paymentDetails: 'payment_details4', + paymentMethod: InvoicePaymentMethodType.CreditCard, +}; ``` diff --git a/doc/models/create-prepaid-component.md b/doc/models/create-prepaid-component.md index d8d18a2a..9ffc88c9 100644 --- a/doc/models/create-prepaid-component.md +++ b/doc/models/create-prepaid-component.md @@ -11,36 +11,42 @@ | --- | --- | --- | --- | | `prepaidUsageComponent` | [`PrepaidUsageComponent`](../../doc/models/prepaid-usage-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_usage_component": { - "name": "name2", - "unit_name": "unit_name4", - "description": "description2", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ +## Example + +```ts +import { + CreatePrepaidComponent, + CreditType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createPrepaidComponent: CreatePrepaidComponent = { + prepaidUsageComponent: { + name: 'name2', + unitName: 'unit_name4', + pricingScheme: PricingScheme.PerUnit, + overagePricing: { + pricingScheme: PricingScheme.Stairstep, + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + } + ], + }, + description: 'description2', + handle: 'handle8', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "upgrade_charge": "full", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } - } -} + upgradeCharge: CreditType.Full, + }, +}; ``` diff --git a/doc/models/create-prepaid-usage-component-price-point.md b/doc/models/create-prepaid-usage-component-price-point.md index f5a290d6..8d4c63a4 100644 --- a/doc/models/create-prepaid-usage-component-price-point.md +++ b/doc/models/create-prepaid-usage-component-price-point.md @@ -15,39 +15,44 @@ | `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 | (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 | (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) - -```json -{ - "name": "name0", - "pricing_scheme": "per_unit", - "prices": [ +| `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 | (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 + +```ts +import { + CreatePrepaidUsageComponentPricePoint, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createPrepaidUsageComponentPricePoint: CreatePrepaidUsageComponentPricePoint = { + name: 'name2', + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ + overagePricing: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] + ], }, - "use_site_exchange_rate": true, - "handle": "handle6", - "rollover_prepaid_remainder": false, - "renew_prepaid_allocation": false, - "expiration_interval": 101.18 -} + handle: 'handle8', + useSiteExchangeRate: true, + rolloverPrepaidRemainder: false, + renewPrepaidAllocation: false, + expirationInterval: 165.7, +}; ``` diff --git a/doc/models/create-prepayment-method.md b/doc/models/create-prepayment-method.md index 2f15e906..594d9c0a 100644 --- a/doc/models/create-prepayment-method.md +++ b/doc/models/create-prepayment-method.md @@ -1,7 +1,7 @@ # Create Prepayment Method -:- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. +When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. ## Enumeration @@ -20,3 +20,11 @@ | `CreditCardOnFile` | | `Other` | +## Example + +```ts +import { CreatePrepaymentMethod } from '@maxio-com/advanced-billing-sdk'; + +const createPrepaymentMethod = CreatePrepaymentMethod.Check; +``` + diff --git a/doc/models/create-prepayment-request.md b/doc/models/create-prepayment-request.md index 661cec6b..03ebda19 100644 --- a/doc/models/create-prepayment-request.md +++ b/doc/models/create-prepayment-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatePrepayment`](../../doc/models/create-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 11.6, - "details": "details8", - "memo": "memo2", - "method": "money_order", - "payment_profile_id": 240 - } -} +## Example + +```ts +import { + CreatePrepaymentMethod, + CreatePrepaymentRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const createPrepaymentRequest: CreatePrepaymentRequest = { + prepayment: { + amount: 11.6, + details: 'details8', + memo: 'memo2', + method: CreatePrepaymentMethod.MoneyOrder, + paymentProfileId: 240, + }, +}; ``` diff --git a/doc/models/create-prepayment-response.md b/doc/models/create-prepayment-response.md index 7945637d..d4f73e0f 100644 --- a/doc/models/create-prepayment-response.md +++ b/doc/models/create-prepayment-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `prepayment` | [`CreatedPrepayment`](../../doc/models/created-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { CreatePrepaymentResponse } from '@maxio-com/advanced-billing-sdk'; + +const createPrepaymentResponse: CreatePrepaymentResponse = { + prepayment: { + id: BigInt(38), + subscriptionId: 148, + amountInCents: BigInt(124), + memo: 'memo2', + createdAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/create-prepayment.md b/doc/models/create-prepayment.md index b4f667a8..40dc2962 100644 --- a/doc/models/create-prepayment.md +++ b/doc/models/create-prepayment.md @@ -12,18 +12,23 @@ | `amount` | `number` | Required | - | | `details` | `string` | Required | - | | `memo` | `string` | Required | - | -| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | +| `method` | [`CreatePrepaymentMethod`](../../doc/models/create-prepayment-method.md) | Required | When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. | | `paymentProfileId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "amount": 23.92, - "details": "details6", - "memo": "memo0", - "method": "credit_card_on_file", - "payment_profile_id": 240 -} +## Example + +```ts +import { + CreatePrepayment, + CreatePrepaymentMethod, +} from '@maxio-com/advanced-billing-sdk'; + +const createPrepayment: CreatePrepayment = { + amount: 73.78, + details: 'details6', + memo: 'memo0', + method: CreatePrepaymentMethod.PaypalAccount, + paymentProfileId: 58, +}; ``` diff --git a/doc/models/create-product-currency-price.md b/doc/models/create-product-currency-price.md index 381d65a9..bec499c4 100644 --- a/doc/models/create-product-currency-price.md +++ b/doc/models/create-product-currency-price.md @@ -13,13 +13,18 @@ | `price` | `number` | Required | Price for the given role. | | `role` | [`CurrencyPriceRole`](../../doc/models/currency-price-role.md) | Required | Role for the price. | -## Example (as JSON) - -```json -{ - "currency": "currency0", - "price": 222, - "role": "baseline" -} +## Example + +```ts +import { + CreateProductCurrencyPrice, + CurrencyPriceRole, +} from '@maxio-com/advanced-billing-sdk'; + +const createProductCurrencyPrice: CreateProductCurrencyPrice = { + currency: 'currency2', + price: 78, + role: CurrencyPriceRole.Baseline, +}; ``` diff --git a/doc/models/create-product-currency-prices-request.md b/doc/models/create-product-currency-prices-request.md index fed452e8..6d97a888 100644 --- a/doc/models/create-product-currency-prices-request.md +++ b/doc/models/create-product-currency-prices-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `currencyPrices` | [`CreateProductCurrencyPrice[]`](../../doc/models/create-product-currency-price.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { + CreateProductCurrencyPricesRequest, + CurrencyPriceRole, +} from '@maxio-com/advanced-billing-sdk'; + +const createProductCurrencyPricesRequest: CreateProductCurrencyPricesRequest = { + currencyPrices: [ { - "currency": "currency8", - "price": 78, - "role": "initial" + currency: 'currency8', + price: 78, + role: CurrencyPriceRole.Initial, } - ] -} + ], +}; ``` diff --git a/doc/models/create-product-family-request.md b/doc/models/create-product-family-request.md index 8fe1ecc2..98bee857 100644 --- a/doc/models/create-product-family-request.md +++ b/doc/models/create-product-family-request.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | | `productFamily` | [`CreateProductFamily`](../../doc/models/create-product-family.md) | Required | - | -## Example (as JSON) - -```json -{ - "product_family": { - "name": "name0", - "handle": "handle6", - "description": "description0" - } -} +## Example + +```ts +import { CreateProductFamilyRequest } from '@maxio-com/advanced-billing-sdk'; + +const createProductFamilyRequest: CreateProductFamilyRequest = { + productFamily: { + name: 'name0', + handle: 'handle6', + description: 'description0', + surcharging: false, + }, +}; ``` diff --git a/doc/models/create-product-family.md b/doc/models/create-product-family.md index 888ee9ca..0270773e 100644 --- a/doc/models/create-product-family.md +++ b/doc/models/create-product-family.md @@ -12,14 +12,18 @@ | `name` | `string` | Required | - | | `handle` | `string \| null \| undefined` | Optional | - | | `description` | `string \| null \| undefined` | Optional | - | +| `surcharging` | `boolean \| undefined` | Optional | Whether surcharging applies to this product family. Defaults to `true` when omitted. Only applied on sites where surcharging is enabled. | -## Example (as JSON) +## Example -```json -{ - "name": "name6", - "handle": "handle2", - "description": "description6" -} +```ts +import { CreateProductFamily } from '@maxio-com/advanced-billing-sdk'; + +const createProductFamily: CreateProductFamily = { + name: 'name0', + handle: 'handle6', + description: 'description0', + surcharging: false, +}; ``` diff --git a/doc/models/create-product-price-point-request.md b/doc/models/create-product-price-point-request.md index 857c48c3..97a7cb0b 100644 --- a/doc/models/create-product-price-point-request.md +++ b/doc/models/create-product-price-point-request.md @@ -11,22 +11,28 @@ | --- | --- | --- | --- | | `pricePoint` | [`CreateProductPricePoint`](../../doc/models/create-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "price_in_cents": 196, - "interval": 44, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle6", - "trial_price_in_cents": 108, - "trial_interval": 202, - "trial_interval_unit": "day", - "trial_type": "no_obligation" - } -} +## Example + +```ts +import { + CreateProductPricePointRequest, + IntervalUnit, + TrialType, +} from '@maxio-com/advanced-billing-sdk'; + +const createProductPricePointRequest: CreateProductPricePointRequest = { + pricePoint: { + name: 'name0', + priceInCents: BigInt(196), + interval: 44, + intervalUnit: IntervalUnit.Day, + handle: 'handle6', + trialPriceInCents: BigInt(108), + trialInterval: 202, + trialIntervalUnit: IntervalUnit.Day, + trialType: TrialType.NoObligation, + useSiteExchangeRate: true, + }, +}; ``` diff --git a/doc/models/create-product-price-point.md b/doc/models/create-product-price-point.md index 0ffe27b3..ba6fbbb4 100644 --- a/doc/models/create-product-price-point.md +++ b/doc/models/create-product-price-point.md @@ -12,32 +12,38 @@ | `name` | `string` | Required | The product price point name | | `handle` | `string \| undefined` | Optional | The product price point API handle | | `priceInCents` | `bigint` | Required | The product price point price, in integer cents | -| `interval` | `number` | Required | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `number` | Required | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `intervalUnit` | [`IntervalUnit`](../../doc/models/interval-unit.md) | Required | A string representing the interval unit for this product price point, either month or day | | `trialPriceInCents` | `bigint \| undefined` | Optional | The product price point trial price, in integer cents | -| `trialInterval` | `number \| undefined` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | +| `trialInterval` | `number \| undefined` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trialIntervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initialChargeInCents` | `bigint \| undefined` | Optional | The product price point initial charge, in integer cents | | `initialChargeAfterTrial` | `boolean \| undefined` | Optional | - | -| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | +| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Whether or not to use the site's exchange rate or define your own pricing when your site has multiple currencies defined.

**Default**: `true` | -## Example (as JSON) - -```json -{ - "name": "name6", - "price_in_cents": 216, - "interval": 200, - "interval_unit": "day", - "use_site_exchange_rate": true, - "handle": "handle2", - "trial_price_in_cents": 48, - "trial_interval": 102, - "trial_interval_unit": "day", - "trial_type": "no_obligation" -} +## Example + +```ts +import { + CreateProductPricePoint, + IntervalUnit, + TrialType, +} from '@maxio-com/advanced-billing-sdk'; + +const createProductPricePoint: CreateProductPricePoint = { + name: 'name6', + priceInCents: BigInt(180), + interval: 60, + intervalUnit: IntervalUnit.Day, + handle: 'handle2', + trialPriceInCents: BigInt(92), + trialInterval: 218, + trialIntervalUnit: IntervalUnit.Day, + trialType: TrialType.NoObligation, + useSiteExchangeRate: true, +}; ``` diff --git a/doc/models/create-quantity-based-component.md b/doc/models/create-quantity-based-component.md index c3247b0d..76cb46f3 100644 --- a/doc/models/create-quantity-based-component.md +++ b/doc/models/create-quantity-based-component.md @@ -11,31 +11,37 @@ | --- | --- | --- | --- | | `quantityBasedComponent` | [`QuantityBasedComponent`](../../doc/models/quantity-based-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "quantity_based_component": { - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + CreateQuantityBasedComponent, + CreditType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createQuantityBasedComponent: CreateQuantityBasedComponent = { + quantityBasedComponent: { + name: 'name0', + unitName: 'unit_name2', + pricingScheme: PricingScheme.Stairstep, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "upgrade_charge": "prorated" - } -} + upgradeCharge: CreditType.Prorated, + }, +}; ``` diff --git a/doc/models/create-reason-code-request.md b/doc/models/create-reason-code-request.md index 19d3a10b..b68431b8 100644 --- a/doc/models/create-reason-code-request.md +++ b/doc/models/create-reason-code-request.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `reasonCode` | [`CreateReasonCode`](../../doc/models/create-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ts +import { CreateReasonCodeRequest } from '@maxio-com/advanced-billing-sdk'; + +const createReasonCodeRequest: CreateReasonCodeRequest = { + reasonCode: { + code: 'code4', + description: 'description6', + position: 14, + }, +}; ``` diff --git a/doc/models/create-reason-code.md b/doc/models/create-reason-code.md index a36ee240..67ae0c04 100644 --- a/doc/models/create-reason-code.md +++ b/doc/models/create-reason-code.md @@ -13,13 +13,15 @@ | `description` | `string` | Required | The friendly summary of what the code signifies | | `position` | `number \| undefined` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code4", - "description": "description6", - "position": 86 -} +## Example + +```ts +import { CreateReasonCode } from '@maxio-com/advanced-billing-sdk'; + +const createReasonCode: CreateReasonCode = { + code: 'code4', + description: 'description6', + position: 40, +}; ``` diff --git a/doc/models/create-segment-request.md b/doc/models/create-segment-request.md index d41bef0e..e5dc3263 100644 --- a/doc/models/create-segment-request.md +++ b/doc/models/create-segment-request.md @@ -11,34 +11,39 @@ | --- | --- | --- | --- | | `segment` | [`CreateSegment`](../../doc/models/create-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "segment_property_1_value": "String1", - "segment_property_2_value": "String3", - "segment_property_3_value": "String1", - "segment_property_4_value": "String5", - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + CreateSegmentRequest, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createSegmentRequest: CreateSegmentRequest = { + segment: { + pricingScheme: PricingScheme.Stairstep, + segmentProperty1Value: 'String1', + segmentProperty2Value: 'String3', + segmentProperty3Value: 'String1', + segmentProperty4Value: 'String5', + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/create-segment.md b/doc/models/create-segment.md index 0bdf2319..0f109b9d 100644 --- a/doc/models/create-segment.md +++ b/doc/models/create-segment.md @@ -16,32 +16,32 @@ | `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` | [`CreateOrUpdateSegmentPrice[] \| undefined`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "String9", - "segment_property_2_value": "String1", - "segment_property_3_value": "String3", - "segment_property_4_value": "String3", - "pricing_scheme": "per_unit", - "prices": [ +## Example + +```ts +import { + CreateSegment, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createSegment: CreateSegment = { + pricingScheme: PricingScheme.Stairstep, + segmentProperty1Value: 'String7', + segmentProperty2Value: 'String9', + segmentProperty3Value: 'String5', + segmentProperty4Value: 'String1', + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" - }, - { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] -} + ], +}; ``` diff --git a/doc/models/create-signup-proforma-preview-include.md b/doc/models/create-signup-proforma-preview-include.md index 5330e39c..135998d0 100644 --- a/doc/models/create-signup-proforma-preview-include.md +++ b/doc/models/create-signup-proforma-preview-include.md @@ -13,7 +13,11 @@ ## Example -``` -next_proforma_invoice +```ts +import { + CreateSignupProformaPreviewInclude, +} from '@maxio-com/advanced-billing-sdk'; + +const createSignupProformaPreviewInclude = CreateSignupProformaPreviewInclude.NextProformaInvoice; ``` diff --git a/doc/models/create-subscription-component.md b/doc/models/create-subscription-component.md index cc7f8799..3f70cc16 100644 --- a/doc/models/create-subscription-component.md +++ b/doc/models/create-subscription-component.md @@ -11,21 +11,23 @@ | --- | --- | --- | --- | | `componentId` | [`CreateSubscriptionComponentComponentId \| undefined`](../../doc/models/containers/create-subscription-component-component-id.md) | Optional | This is a container for one-of cases. | | `enabled` | `boolean \| undefined` | Optional | Used for on/off components only. | -| `unitBalance` | `number \| undefined` | Optional | Used for metered and events based components. | +| `unitBalance` | [`CreateSubscriptionComponentUnitBalance \| undefined`](../../doc/models/containers/create-subscription-component-unit-balance.md) | Optional | This is a container for one-of cases. | | `allocatedQuantity` | [`CreateSubscriptionComponentAllocatedQuantity \| undefined`](../../doc/models/containers/create-subscription-component-allocated-quantity.md) | Optional | This is a container for one-of cases. | | `quantity` | `number \| undefined` | Optional | Deprecated. Use `allocated_quantity` instead. | | `pricePointId` | [`CreateSubscriptionComponentPricePointId \| undefined`](../../doc/models/containers/create-subscription-component-price-point-id.md) | Optional | This is a container for one-of cases. | | `customPrice` | [`ComponentCustomPrice \| undefined`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": 8, - "enabled": false, - "unit_balance": 144, - "allocated_quantity": 102, - "quantity": 188 -} +```ts +import { CreateSubscriptionComponent } from '@maxio-com/advanced-billing-sdk'; + +const createSubscriptionComponent: CreateSubscriptionComponent = { + componentId: 210, + enabled: false, + unitBalance: 12, + allocatedQuantity: 48, + quantity: 134, +}; ``` diff --git a/doc/models/create-subscription-group-request.md b/doc/models/create-subscription-group-request.md index fa23c795..43018fed 100644 --- a/doc/models/create-subscription-group-request.md +++ b/doc/models/create-subscription-group-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `subscriptionGroup` | [`CreateSubscriptionGroup`](../../doc/models/create-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "subscription_id": 36, - "member_ids": [ +```ts +import { + CreateSubscriptionGroupRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const createSubscriptionGroupRequest: CreateSubscriptionGroupRequest = { + subscriptionGroup: { + subscriptionId: 36, + memberIds: [ 164, 165 - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/create-subscription-group.md b/doc/models/create-subscription-group.md index 270c0755..c23f5fcd 100644 --- a/doc/models/create-subscription-group.md +++ b/doc/models/create-subscription-group.md @@ -12,14 +12,16 @@ | `subscriptionId` | `number` | Required | - | | `memberIds` | `number[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_id": 38, - "member_ids": [ - 162 - ] -} +## Example + +```ts +import { CreateSubscriptionGroup } from '@maxio-com/advanced-billing-sdk'; + +const createSubscriptionGroup: CreateSubscriptionGroup = { + subscriptionId: 204, + memberIds: [ + 48 + ], +}; ``` diff --git a/doc/models/create-subscription-request.md b/doc/models/create-subscription-request.md index 3c5137ba..4d4a1196 100644 --- a/doc/models/create-subscription-request.md +++ b/doc/models/create-subscription-request.md @@ -11,33 +11,38 @@ | --- | --- | --- | --- | | `subscription` | [`CreateSubscription`](../../doc/models/create-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +## Example + +```ts +import { + CreateSubscriptionRequest, + IntervalUnit, +} from '@maxio-com/advanced-billing-sdk'; + +const createSubscriptionRequest: CreateSubscriptionRequest = { + subscription: { + productHandle: 'product_handle6', + productId: 206, + productPricePointHandle: 'product_price_point_handle2', + productPricePointId: 130, + customPrice: { + priceInCents: 'String3', + interval: 'String3', + intervalUnit: IntervalUnit.Day, + name: 'name4', + handle: 'handle0', + trialPriceInCents: 'String3', + trialInterval: 'String5', + trialIntervalUnit: IntervalUnit.Day, }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 206, - "product_price_point_handle": "product_price_point_handle2", - "product_price_point_id": 130, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } - } -} + deferSignup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' + }, + dunningCommunicationDelayEnabled: false, + dunningCommunicationDelayTimeZone: '"Eastern Time (US & Canada)"', + }, +}; ``` diff --git a/doc/models/create-subscription.md b/doc/models/create-subscription.md index f5fc3c7a..16891084 100644 --- a/doc/models/create-subscription.md +++ b/doc/models/create-subscription.md @@ -20,19 +20,20 @@ | `receivesInvoiceEmails` | `string \| undefined` | Optional | (Optional) Default: True - Whether or not this subscription is set to receive emails related to this subscription. | | `netTerms` | `string \| undefined` | Optional | (Optional) Default: null The number of days after renewal (on invoice billing) that a subscription is due. A value between 0 (due immediately) and 180. | | `customerId` | `number \| undefined` | Optional | The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. | +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `nextBillingAt` | `string \| undefined` | Optional | (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. | | `initialBillingAt` | `string \| undefined` | Optional | (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. | -| `deferSignup` | `boolean \| undefined` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | +| `deferSignup` | `boolean \| undefined` | Optional | (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `storedCredentialTransactionId` | `number \| undefined` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | | `salesRepId` | `number \| undefined` | Optional | - | -| `paymentProfileId` | `number \| undefined` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) | +| `paymentProfileId` | `number \| undefined` | Optional | The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id.) | | `reference` | `string \| undefined` | Optional | The reference value (provided by your app) for the subscription itself. | | `customerAttributes` | [`CustomerAttributes \| undefined`](../../doc/models/customer-attributes.md) | Optional | - | | `paymentProfileAttributes` | [`PaymentProfileAttributes \| undefined`](../../doc/models/payment-profile-attributes.md) | Optional | alias to credit_card_attributes | | `creditCardAttributes` | [`PaymentProfileAttributes \| undefined`](../../doc/models/payment-profile-attributes.md) | Optional | Credit Card data to create a new Subscription. Interchangeable with `payment_profile_attributes` property. | | `bankAccountAttributes` | [`BankAccountAttributes \| undefined`](../../doc/models/bank-account-attributes.md) | Optional | - | | `components` | [`CreateSubscriptionComponent[] \| undefined`](../../doc/models/create-subscription-component.md) | Optional | (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview) for more information. | -| `calendarBilling` | [`CalendarBilling \| undefined`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendarBilling` | [`CalendarBilling \| undefined`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Record \| undefined` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `customerReference` | `string \| undefined` | Optional | The reference value (provided by your app) of an existing customer within Chargify. Required, unless a `customer_id` or a set of `customer_attributes` is given. | | `group` | [`GroupSettings \| undefined`](../../doc/models/group-settings.md) | Optional | - | @@ -60,31 +61,36 @@ | `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. Defaults to `false` when not provided. | -## Example (as JSON) +## Example -```json -{ - "defer_signup": false, - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +```ts +import { + CreateSubscription, + IntervalUnit, +} from '@maxio-com/advanced-billing-sdk'; + +const createSubscription: CreateSubscription = { + productHandle: 'product_handle4', + productId: 82, + productPricePointHandle: 'product_price_point_handle2', + productPricePointId: 6, + customPrice: { + priceInCents: 'String3', + interval: 'String3', + intervalUnit: IntervalUnit.Day, + name: 'name4', + handle: 'handle0', + trialPriceInCents: 'String3', + trialInterval: 'String5', + trialIntervalUnit: IntervalUnit.Day, + }, + deferSignup: false, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "dunning_communication_delay_enabled": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "product_handle": "product_handle6", - "product_id": 212, - "product_price_point_handle": "product_price_point_handle0", - "product_price_point_id": 136, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" - } -} + dunningCommunicationDelayEnabled: false, + dunningCommunicationDelayTimeZone: '"Eastern Time (US & Canada)"', +}; ``` diff --git a/doc/models/create-usage-request.md b/doc/models/create-usage-request.md index 10fcde84..9f5868d3 100644 --- a/doc/models/create-usage-request.md +++ b/doc/models/create-usage-request.md @@ -11,37 +11,43 @@ | --- | --- | --- | --- | | `usage` | [`CreateUsage`](../../doc/models/create-usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "quantity": 162.34, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13T12:52:32.123Z" +## Example + +```ts +import { + CreateUsageRequest, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createUsageRequest: CreateUsageRequest = { + usage: { + quantity: 162.34, + pricePointId: 'price_point_id0', + memo: 'memo2', + billingSchedule: { + initialBillingAt: '2016-03-13T12:52:32.123Z', }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ + customPrice: { + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } - } -} + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 66, + intervalUnit: IntervalUnit.Day, + listPricePointId: 174, + }, + }, +}; ``` diff --git a/doc/models/create-usage.md b/doc/models/create-usage.md index 565d67a4..6f7d5fec 100644 --- a/doc/models/create-usage.md +++ b/doc/models/create-usage.md @@ -15,35 +15,41 @@ | `billingSchedule` | [`BillingSchedule \| undefined`](../../doc/models/billing-schedule.md) | Optional | Billing schedule settings for component allocations or usages on multi-frequency subscriptions. Use this to start a component's billing period on a custom date instead of aligning with the product charge schedule. | | `customPrice` | [`ComponentCustomPrice \| undefined`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "quantity": 23.44, - "price_point_id": "price_point_id0", - "memo": "memo2", - "billing_schedule": { - "initial_billing_at": "2016-03-13T12:52:32.123Z" +## Example + +```ts +import { + CreateUsage, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const createUsage: CreateUsage = { + quantity: 204.7, + pricePointId: 'price_point_id4', + memo: 'memo8', + billingSchedule: { + initialBillingAt: '2016-03-13T12:52:32.123Z', }, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ + customPrice: { + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } -} + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 66, + intervalUnit: IntervalUnit.Day, + listPricePointId: 174, + }, +}; ``` diff --git a/doc/models/created-prepayment.md b/doc/models/created-prepayment.md index 51e96fed..2e0c2665 100644 --- a/doc/models/created-prepayment.md +++ b/doc/models/created-prepayment.md @@ -17,15 +17,17 @@ | `startingBalanceInCents` | `bigint \| undefined` | Optional | **Constraints**: `>= 0` | | `endingBalanceInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 110, - "subscription_id": 220, - "amount_in_cents": 196, - "memo": "memo6", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { CreatedPrepayment } from '@maxio-com/advanced-billing-sdk'; + +const createdPrepayment: CreatedPrepayment = { + id: BigInt(186), + subscriptionId: 40, + amountInCents: BigInt(240), + memo: 'memo6', + createdAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/credit-account-balance-changed.md b/doc/models/credit-account-balance-changed.md index 94c1e9a7..fed4315f 100644 --- a/doc/models/credit-account-balance-changed.md +++ b/doc/models/credit-account-balance-changed.md @@ -15,15 +15,17 @@ | `currencyCode` | `string` | Required | - | | `atTime` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "service_credit_account_balance_in_cents": 10, - "service_credit_balance_change_in_cents": 116, - "currency_code": "currency_code8", - "at_time": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { CreditAccountBalanceChanged } from '@maxio-com/advanced-billing-sdk'; + +const creditAccountBalanceChanged: CreditAccountBalanceChanged = { + reason: 'reason4', + serviceCreditAccountBalanceInCents: BigInt(216), + serviceCreditBalanceChangeInCents: BigInt(166), + currencyCode: 'currency_code6', + atTime: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/credit-card-attributes.md b/doc/models/credit-card-attributes.md index 0c76241f..60215c23 100644 --- a/doc/models/credit-card-attributes.md +++ b/doc/models/credit-card-attributes.md @@ -13,13 +13,15 @@ | `expirationMonth` | `string \| undefined` | Optional | - | | `expirationYear` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "full_number": "full_number0", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year0" -} +## Example + +```ts +import { CreditCardAttributes } from '@maxio-com/advanced-billing-sdk'; + +const creditCardAttributes: CreditCardAttributes = { + fullNumber: 'full_number8', + expirationMonth: 'expiration_month8', + expirationYear: 'expiration_year2', +}; ``` diff --git a/doc/models/credit-card-payment-profile.md b/doc/models/credit-card-payment-profile.md index fbc88488..4fcd2b6a 100644 --- a/doc/models/credit-card-payment-profile.md +++ b/doc/models/credit-card-payment-profile.md @@ -12,10 +12,10 @@ | `id` | `number \| undefined` | Optional | The Chargify-assigned ID of the stored card. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. | | `firstName` | `string \| undefined` | Optional | The first name of the card holder. | | `lastName` | `string \| undefined` | Optional | The last name of the card holder. | -| `maskedCardNumber` | `string \| undefined` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (i.e. ‘XXXX-XXXX-XXXX-1234’). | -| `cardType` | [`CardType \| undefined`](../../doc/models/card-type.md) | Optional | The type of card used. | +| `maskedCardNumber` | `string \| undefined` | Optional | A string representation of the credit card number with all but the last 4 digits masked with X’s (e.g., ‘XXXX-XXXX-XXXX-1234’). | +| `cardType` | [`CardType \| null \| undefined`](../../doc/models/card-type.md) | Optional | The type of card used. | | `expirationMonth` | `number \| undefined` | Optional | An integer representing the expiration month of the card(1 – 12). | -| `expirationYear` | `number \| undefined` | Optional | An integer representing the 4-digit expiration year of the card(i.e. ‘2012’). | +| `expirationYear` | `number \| undefined` | Optional | An integer representing the 4-digit expiration year of the card(e.g., ‘2012’). | | `customerId` | `number \| undefined` | Optional | The Chargify-assigned id for the customer record to which the card belongs. | | `currentVault` | [`CreditCardVault \| undefined`](../../doc/models/credit-card-vault.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | | `vaultToken` | `string \| null \| undefined` | Optional | The “token” provided by your vault storage for an already stored payment profile. | @@ -28,36 +28,43 @@ | `billingAddress2` | `string \| null \| undefined` | Optional | The current billing street address, second line, for the card. | | `paymentType` | [`PaymentType`](../../doc/models/payment-type.md) | Required | **Default**: `PaymentType.CreditCard` | | `disabled` | `boolean \| undefined` | Optional | - | -| `chargifyToken` | `string \| undefined` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargifyToken` | `string \| undefined` | Optional | Token received after sending billing information using Maxio.js (formerly Chargify.js). This token will only be received if passed as a sole attribute of credit_card_attributes (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | | `siteGatewaySettingId` | `number \| null \| undefined` | Optional | - | | `gatewayHandle` | `string \| null \| undefined` | Optional | An identifier of connected gateway. | | `createdAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was created | | `updatedAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null -} +## Example + +```ts +import { + CardType, + CreditCardPaymentProfile, + CreditCardVault, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const creditCardPaymentProfile: CreditCardPaymentProfile = { + paymentType: PaymentType.CreditCard, + id: 10088716, + firstName: 'Test', + lastName: 'Subscription', + maskedCardNumber: 'XXXX-XXXX-XXXX-1', + cardType: CardType.Bogus, + expirationMonth: 1, + expirationYear: 2022, + customerId: 14543792, + currentVault: CreditCardVault.Bogus, + vaultToken: '1', + billingAddress: '123 Montana Way', + billingCity: 'Billings', + billingState: 'MT', + billingZip: '59101', + billingCountry: 'US', + customerVaultToken: 'customer_vault_token2', + billingAddress2: '', + siteGatewaySettingId: 1, + gatewayHandle: 'gateway_handle8', +}; ``` diff --git a/doc/models/credit-card-vault.md b/doc/models/credit-card-vault.md index e2156056..a943ddff 100644 --- a/doc/models/credit-card-vault.md +++ b/doc/models/credit-card-vault.md @@ -45,3 +45,11 @@ The vault that stores the payment profile with the provided `vault_token`. Use ` | `Unipaas` | | `Wirecard` | +## Example + +```ts +import { CreditCardVault } from '@maxio-com/advanced-billing-sdk'; + +const creditCardVault = CreditCardVault.Unipaas; +``` + diff --git a/doc/models/credit-note-application.md b/doc/models/credit-note-application.md index b0912e46..f428d0a5 100644 --- a/doc/models/credit-note-application.md +++ b/doc/models/credit-note-application.md @@ -15,15 +15,17 @@ | `memo` | `string \| undefined` | Optional | - | | `appliedAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "invoice_uid": "invoice_uid0", - "memo": "memo4", - "applied_amount": "applied_amount8" -} +## Example + +```ts +import { CreditNoteApplication } from '@maxio-com/advanced-billing-sdk'; + +const creditNoteApplication: CreditNoteApplication = { + uid: 'uid0', + transactionTime: '2016-03-13T12:52:32.123Z', + invoiceUid: 'invoice_uid0', + memo: 'memo4', + appliedAmount: 'applied_amount8', +}; ``` diff --git a/doc/models/credit-note-line-item.md b/doc/models/credit-note-line-item.md index 4d1e195f..2d9017f0 100644 --- a/doc/models/credit-note-line-item.md +++ b/doc/models/credit-note-line-item.md @@ -13,7 +13,7 @@ | `title` | `string \| undefined` | Optional | A short descriptor for the credit given by this line. | | `description` | `string \| undefined` | Optional | Detailed description for the credit given by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the credit note. | | `quantity` | `string \| undefined` | Optional | The quantity or count of units credited by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unitPrice` | `string \| undefined` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unitPrice` | `string \| undefined` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotalAmount` | `string \| undefined` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discountAmount` | `string \| undefined` | Optional | The approximate discount of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `taxAmount` | `string \| undefined` | Optional | The approximate tax of just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | @@ -30,15 +30,17 @@ | `customItem` | `boolean \| undefined` | Optional | - | | `prepaidAllocationExpiresAt` | `string \| null \| undefined` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ts +import { CreditNoteLineItem } from '@maxio-com/advanced-billing-sdk'; + +const creditNoteLineItem: CreditNoteLineItem = { + uid: 'uid0', + title: 'title6', + description: 'description0', + quantity: 'quantity6', + unitPrice: 'unit_price8', +}; ``` diff --git a/doc/models/credit-note-status.md b/doc/models/credit-note-status.md index 45f47344..9457855a 100644 --- a/doc/models/credit-note-status.md +++ b/doc/models/credit-note-status.md @@ -14,3 +14,11 @@ Current status of the credit note. | `Open` | | `Applied` | +## Example + +```ts +import { CreditNoteStatus } from '@maxio-com/advanced-billing-sdk'; + +const creditNoteStatus = CreditNoteStatus.Open; +``` + diff --git a/doc/models/credit-note.md b/doc/models/credit-note.md index c533c436..75c57936 100644 --- a/doc/models/credit-note.md +++ b/doc/models/credit-note.md @@ -21,13 +21,13 @@ | `currency` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `memo` | `string \| undefined` | Optional | The memo printed on credit note, which is a description of the reason for the credit. | | `seller` | [`InvoiceSeller \| undefined`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the credit note. | -| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the credited subscription. | +| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the credited subscription. | | `billingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The billing address of the credit subscription. | | `shippingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The shipping address of the credited subscription. | | `subtotalAmount` | `string \| undefined` | Optional | Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. | -| `discountAmount` | `string \| undefined` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | -| `taxAmount` | `string \| undefined` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | -| `totalAmount` | `string \| undefined` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `discountAmount` | `string \| undefined` | Optional | Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e., a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). | +| `taxAmount` | `string \| undefined` | Optional | Total tax of the credit note. Note that this is a positive amount representing a previously taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). | +| `totalAmount` | `string \| undefined` | Optional | The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. | | `appliedAmount` | `string \| undefined` | Optional | The amount of the credit note that has already been applied to invoices. | | `remainingAmount` | `string \| undefined` | Optional | The amount of the credit note remaining to be applied to invoices, which is `total_amount - applied_amount`. | | `lineItems` | [`CreditNoteLineItem[] \| undefined`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the credit note. | @@ -35,17 +35,19 @@ | `taxes` | [`InvoiceTax[] \| undefined`](../../doc/models/invoice-tax.md) | Optional | - | | `applications` | [`CreditNoteApplication[] \| undefined`](../../doc/models/credit-note-application.md) | Optional | - | | `refunds` | [`InvoiceRefund[] \| undefined`](../../doc/models/invoice-refund.md) | Optional | - | -| `originInvoices` | [`OriginInvoice[] \| undefined`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) | - -## Example (as JSON) - -```json -{ - "uid": "uid2", - "site_id": 218, - "customer_id": 74, - "subscription_id": 146, - "number": "number0" -} +| `originInvoices` | [`OriginInvoice[] \| undefined`](../../doc/models/origin-invoice.md) | Optional | An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). | + +## Example + +```ts +import { CreditNote } from '@maxio-com/advanced-billing-sdk'; + +const creditNote: CreditNote = { + uid: 'uid6', + siteId: 20, + customerId: 132, + subscriptionId: 204, + number: 'number4', +}; ``` diff --git a/doc/models/credit-scheme-request.md b/doc/models/credit-scheme-request.md index 2b01b70b..165afd82 100644 --- a/doc/models/credit-scheme-request.md +++ b/doc/models/credit-scheme-request.md @@ -11,11 +11,16 @@ | --- | --- | --- | --- | | `creditScheme` | [`CreditScheme`](../../doc/models/credit-scheme.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "credit_scheme": "credit" -} +```ts +import { + CreditScheme, + CreditSchemeRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const creditSchemeRequest: CreditSchemeRequest = { + creditScheme: CreditScheme.Credit, +}; ``` diff --git a/doc/models/credit-scheme.md b/doc/models/credit-scheme.md index 1e2e746f..082e346c 100644 --- a/doc/models/credit-scheme.md +++ b/doc/models/credit-scheme.md @@ -13,3 +13,11 @@ | `Credit` | | `Refund` | +## Example + +```ts +import { CreditScheme } from '@maxio-com/advanced-billing-sdk'; + +const creditScheme = CreditScheme.None; +``` + diff --git a/doc/models/credit-type.md b/doc/models/credit-type.md index 3fc68dda..057ca9a4 100644 --- a/doc/models/credit-type.md +++ b/doc/models/credit-type.md @@ -15,3 +15,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `Prorated` | | `None` | +## Example + +```ts +import { CreditType } from '@maxio-com/advanced-billing-sdk'; + +const creditType = CreditType.Prorated; +``` + diff --git a/doc/models/currency-overage-prices.md b/doc/models/currency-overage-prices.md index fcde8c13..302ec86e 100644 --- a/doc/models/currency-overage-prices.md +++ b/doc/models/currency-overage-prices.md @@ -13,7 +13,7 @@ Extends a component price point with currency overage prices. | --- | --- | --- | --- | | `id` | `number \| undefined` | Optional | - | | `type` | [`PricePointType \| undefined`](../../doc/models/price-point-type.md) | Optional | Price point type. We expose the following types:

1. **default**: a price point that is marked as a default price for a certain product.
2. **custom**: a custom price point.
3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. | -| `mDefault` | `boolean \| undefined` | Optional | Note: Refer to type attribute instead | +| `mDefault` | `boolean \| undefined` | Optional | Note: Refer to type attribute instead. | | `name` | `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. | | `componentId` | `number \| undefined` | Optional | - | @@ -25,7 +25,7 @@ Extends a component price point with currency overage prices. | `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. Defaults to true during creation. | | `subscriptionId` | `number \| undefined` | Optional | (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. | | `taxIncluded` | `boolean \| undefined` | Optional | - | -| `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. | +| `interval` | `number \| null \| undefined` | Optional | The numerical interval. e.g., 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. The clone endpoint always returns currency prices if they are present. | | `overagePrices` | [`ComponentPrice[] \| undefined`](../../doc/models/component-price.md) | Optional | Applicable only to prepaid usage components. An array of overage price brackets. | @@ -36,15 +36,21 @@ Extends a component price point with currency overage prices. | `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. | | `currencyOveragePrices` | [`ComponentCurrencyPrice[] \| undefined`](../../doc/models/component-currency-price.md) | Optional | Applicable only to prepaid usage components. An array of currency pricing data for overage prices. | -## Example (as JSON) - -```json -{ - "id": 50, - "type": "catalog", - "default": false, - "name": "name8", - "pricing_scheme": "stairstep" -} +## Example + +```ts +import { + CurrencyOveragePrices, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const currencyOveragePrices: CurrencyOveragePrices = { + id: 96, + type: PricePointType.Catalog, + mDefault: false, + name: 'name0', + pricingScheme: PricingScheme.PerUnit, +}; ``` diff --git a/doc/models/currency-price-role.md b/doc/models/currency-price-role.md index 91332999..14bf93f3 100644 --- a/doc/models/currency-price-role.md +++ b/doc/models/currency-price-role.md @@ -15,3 +15,11 @@ Role for the price. | `Trial` | | `Initial` | +## Example + +```ts +import { CurrencyPriceRole } from '@maxio-com/advanced-billing-sdk'; + +const currencyPriceRole = CurrencyPriceRole.Initial; +``` + diff --git a/doc/models/currency-price.md b/doc/models/currency-price.md index b0694fc9..d0d187dc 100644 --- a/doc/models/currency-price.md +++ b/doc/models/currency-price.md @@ -18,15 +18,17 @@ | `productPricePointId` | `number \| undefined` | Optional | - | | `role` | [`CurrencyPriceRole \| undefined`](../../doc/models/currency-price-role.md) | Optional | Role for the price. | -## Example (as JSON) - -```json -{ - "id": 88, - "currency": "currency6", - "price": 41.36, - "formatted_price": "formatted_price4", - "price_id": 178 -} +## Example + +```ts +import { CurrencyPrice } from '@maxio-com/advanced-billing-sdk'; + +const currencyPrice: CurrencyPrice = { + id: 208, + currency: 'currency4', + price: 70.88, + formattedPrice: 'formatted_price2', + priceId: 214, +}; ``` diff --git a/doc/models/currency-prices-response.md b/doc/models/currency-prices-response.md index 56f98519..4b6a6485 100644 --- a/doc/models/currency-prices-response.md +++ b/doc/models/currency-prices-response.md @@ -11,19 +11,21 @@ | --- | --- | --- | --- | | `currencyPrices` | [`CurrencyPrice[]`](../../doc/models/currency-price.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { CurrencyPricesResponse } from '@maxio-com/advanced-billing-sdk'; + +const currencyPricesResponse: CurrencyPricesResponse = { + currencyPrices: [ { - "id": 50, - "currency": "currency8", - "price": 233.74, - "formatted_price": "formatted_price6", - "price_id": 116 + id: 50, + currency: 'currency8', + price: 233.74, + formattedPrice: 'formatted_price6', + priceId: 116, } - ] -} + ], +}; ``` diff --git a/doc/models/custom-field-owner.md b/doc/models/custom-field-owner.md index 4fbe607e..405cadbd 100644 --- a/doc/models/custom-field-owner.md +++ b/doc/models/custom-field-owner.md @@ -12,3 +12,11 @@ | `Customer` | | `Subscription` | +## Example + +```ts +import { CustomFieldOwner } from '@maxio-com/advanced-billing-sdk'; + +const customFieldOwner = CustomFieldOwner.Customer; +``` + diff --git a/doc/models/custom-field-value-change.md b/doc/models/custom-field-value-change.md index 62b542b1..5d2695c6 100644 --- a/doc/models/custom-field-value-change.md +++ b/doc/models/custom-field-value-change.md @@ -17,17 +17,19 @@ | `resourceType` | `string` | Required | - | | `resourceId` | `number` | Required | - | -## Example (as JSON) - -```json -{ - "event_type": "event_type2", - "metafield_name": "metafield_name6", - "metafield_id": 78, - "old_value": "old_value2", - "new_value": "new_value8", - "resource_type": "resource_type2", - "resource_id": 74 -} +## Example + +```ts +import { CustomFieldValueChange } from '@maxio-com/advanced-billing-sdk'; + +const customFieldValueChange: CustomFieldValueChange = { + eventType: 'event_type8', + metafieldName: 'metafield_name2', + metafieldId: 138, + oldValue: 'old_value6', + newValue: 'new_value2', + resourceType: 'resource_type6', + resourceId: 14, +}; ``` diff --git a/doc/models/customer-attributes.md b/doc/models/customer-attributes.md index 57401900..4185e257 100644 --- a/doc/models/customer-attributes.md +++ b/doc/models/customer-attributes.md @@ -12,37 +12,40 @@ | `firstName` | `string \| undefined` | Optional | The first name of the customer. Required when creating a customer via attributes. | | `lastName` | `string \| undefined` | Optional | The last name of the customer. Required when creating a customer via attributes. | | `email` | `string \| undefined` | Optional | The email address of the customer. Required when creating a customer via attributes. | -| `ccEmails` | `string \| undefined` | Optional | A list of emails that should be cc’d on all customer communications. Optional. | -| `organization` | `string \| undefined` | Optional | The organization/company of the customer. Optional. | -| `reference` | `string \| undefined` | Optional | A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. | -| `address` | `string \| undefined` | Optional | (Optional) The customer’s shipping street address (i.e. “123 Main St.”). | -| `address2` | `string \| null \| undefined` | Optional | (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `string \| undefined` | Optional | (Optional) The customer’s shipping address city (i.e. “Boston”). | -| `state` | `string \| undefined` | Optional | (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `zip` | `string \| undefined` | Optional | (Optional) The customer’s shipping address zip code (i.e. “12345”). | -| `country` | `string \| undefined` | Optional | (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). | +| `ccEmails` | `string \| undefined` | Optional | (Optional) A list of emails that should be cc’d on all customer communications. | +| `organization` | `string \| undefined` | Optional | (Optional) The organization/company of the customer. | +| `reference` | `string \| undefined` | Optional | (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. | +| `address` | `string \| undefined` | Optional | (Optional) The customer’s shipping street address (e.g., “123 Main St.”). | +| `address2` | `string \| null \| undefined` | Optional | (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `string \| undefined` | Optional | (Optional) The customer’s shipping address city (e.g., “Boston”). | +| `state` | `string \| undefined` | Optional | “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.” | +| `zip` | `string \| undefined` | Optional | (Optional) The customer’s shipping address zip code (e.g., “12345”). | +| `country` | `string \| undefined` | Optional | “(Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” | | `phone` | `string \| undefined` | Optional | (Optional) The phone number of the customer. | | `verified` | `boolean \| undefined` | Optional | - | | `taxExempt` | `boolean \| undefined` | Optional | (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. | -| `vatNumber` | `string \| undefined` | Optional | (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | +| `surcharging` | `boolean \| undefined` | Optional | (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. | +| `vatNumber` | `string \| undefined` | Optional | (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. | | `metafields` | `Record \| undefined` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | | `parentId` | `number \| null \| undefined` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `salesforceId` | `string \| null \| undefined` | Optional | (Optional) The Salesforce ID of the customer. | | `defaultAutoRenewalProfileId` | `number \| null \| undefined` | Optional | (Optional) The default auto-renewal profile ID for the customer | -## Example (as JSON) +## Example -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +```ts +import { CustomerAttributes } from '@maxio-com/advanced-billing-sdk'; + +const customerAttributes: CustomerAttributes = { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails2', + organization: 'organization6', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails6", - "organization": "organization8" -} +}; ``` diff --git a/doc/models/customer-change.md b/doc/models/customer-change.md index cca05c82..20889261 100644 --- a/doc/models/customer-change.md +++ b/doc/models/customer-change.md @@ -14,97 +14,102 @@ | `billingAddress` | [`AddressChange \| null \| undefined`](../../doc/models/address-change.md) | Optional | - | | `customFields` | [`CustomerCustomFieldsChange \| null \| undefined`](../../doc/models/customer-custom-fields-change.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" +```ts +import { + CustomFieldOwner, + CustomerChange, +} from '@maxio-com/advanced-billing-sdk'; + +const customerChange: CustomerChange = { + payer: { + before: { + firstName: 'first_name0', + lastName: 'last_name8', + organization: 'organization4', + email: 'email6', + }, + after: { + firstName: 'first_name2', + lastName: 'last_name0', + organization: 'organization4', + email: 'email4', }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" + shippingAddress: { + before: { + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4', + }, + after: { + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4', }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" + billingAddress: { + before: { + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4', + }, + after: { + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4', }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } }, - "custom_fields": { - "before": [ + customFields: { + before: [ { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 + ownerId: 26, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 26, }, { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 + ownerId: 26, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 26, } ], - "after": [ + after: [ { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, }, { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, }, { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/customer-changes-preview-response.md b/doc/models/customer-changes-preview-response.md index f96e12f8..0da86842 100644 --- a/doc/models/customer-changes-preview-response.md +++ b/doc/models/customer-changes-preview-response.md @@ -11,99 +11,104 @@ | --- | --- | --- | --- | | `changes` | [`CustomerChange`](../../doc/models/customer-change.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "changes": { - "payer": { - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" +```ts +import { + CustomFieldOwner, + CustomerChangesPreviewResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const customerChangesPreviewResponse: CustomerChangesPreviewResponse = { + changes: { + payer: { + before: { + firstName: 'first_name0', + lastName: 'last_name8', + organization: 'organization4', + email: 'email6', + }, + after: { + firstName: 'first_name2', + lastName: 'last_name0', + organization: 'organization4', + email: 'email4', }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } }, - "shipping_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" + shippingAddress: { + before: { + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4', + }, + after: { + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4', }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } }, - "billing_address": { - "before": { - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" + billingAddress: { + before: { + street: 'street0', + line2: 'line24', + city: 'city0', + state: 'state6', + zip: 'zip4', + }, + after: { + street: 'street2', + line2: 'line26', + city: 'city8', + state: 'state2', + zip: 'zip4', }, - "after": { - "street": "street2", - "line2": "line26", - "city": "city8", - "state": "state2", - "zip": "zip4" - } }, - "custom_fields": { - "before": [ + customFields: { + before: [ { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 + ownerId: 26, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 26, }, { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 + ownerId: 26, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 26, } ], - "after": [ + after: [ { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, }, { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, }, { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, } - ] - } - } -} + ], + }, + }, +}; ``` diff --git a/doc/models/customer-custom-fields-change.md b/doc/models/customer-custom-fields-change.md index 47a7250d..63008257 100644 --- a/doc/models/customer-custom-fields-change.md +++ b/doc/models/customer-custom-fields-change.md @@ -12,28 +12,33 @@ | `before` | [`InvoiceCustomField[]`](../../doc/models/invoice-custom-field.md) | Required | - | | `after` | [`InvoiceCustomField[]`](../../doc/models/invoice-custom-field.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "before": [ +```ts +import { + CustomFieldOwner, + CustomerCustomFieldsChange, +} from '@maxio-com/advanced-billing-sdk'; + +const customerCustomFieldsChange: CustomerCustomFieldsChange = { + before: [ { - "owner_id": 26, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 26 + ownerId: 26, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 26, } ], - "after": [ + after: [ { - "owner_id": 130, - "owner_type": "Customer", - "name": "name2", - "value": "value4", - "metadatum_id": 130 + ownerId: 130, + ownerType: CustomFieldOwner.Customer, + name: 'name2', + value: 'value4', + metadatumId: 130, } - ] -} + ], +}; ``` diff --git a/doc/models/customer-error-response-error.md b/doc/models/customer-error-response-error.md index b9c58ec4..08b35e2e 100644 --- a/doc/models/customer-error-response-error.md +++ b/doc/models/customer-error-response-error.md @@ -11,12 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`CustomerErrorResponseErrors \| undefined`](../../doc/models/containers/customer-error-response-errors.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "customer": "customer8" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof CustomerErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/customer-error.md b/doc/models/customer-error.md index 1185e3e4..9f7006bc 100644 --- a/doc/models/customer-error.md +++ b/doc/models/customer-error.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `customer` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "customer": "customer8" -} +```ts +import { CustomerError } from '@maxio-com/advanced-billing-sdk'; + +const customerError: CustomerError = { + customer: 'customer8', +}; ``` diff --git a/doc/models/customer-payer-change.md b/doc/models/customer-payer-change.md index e7d2ba8c..00cfe386 100644 --- a/doc/models/customer-payer-change.md +++ b/doc/models/customer-payer-change.md @@ -12,22 +12,24 @@ | `before` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | | `after` | [`InvoicePayerChange`](../../doc/models/invoice-payer-change.md) | Required | - | -## Example (as JSON) - -```json -{ - "before": { - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" +## Example + +```ts +import { CustomerPayerChange } from '@maxio-com/advanced-billing-sdk'; + +const customerPayerChange: CustomerPayerChange = { + before: { + firstName: 'first_name0', + lastName: 'last_name8', + organization: 'organization4', + email: 'email6', + }, + after: { + firstName: 'first_name2', + lastName: 'last_name0', + organization: 'organization4', + email: 'email4', }, - "after": { - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" - } -} +}; ``` diff --git a/doc/models/customer-response.md b/doc/models/customer-response.md index 244270e3..42e1b9d8 100644 --- a/doc/models/customer-response.md +++ b/doc/models/customer-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `customer` | [`Customer`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ts +import { CustomerResponse } from '@maxio-com/advanced-billing-sdk'; + +const customerResponse: CustomerResponse = { + customer: { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', + }, +}; ``` diff --git a/doc/models/customer.md b/doc/models/customer.md index 29d8abcb..c469beb1 100644 --- a/doc/models/customer.md +++ b/doc/models/customer.md @@ -12,18 +12,18 @@ | `firstName` | `string \| undefined` | Optional | The first name of the customer | | `lastName` | `string \| undefined` | Optional | The last name of the customer | | `email` | `string \| undefined` | Optional | The email address of the customer | -| `ccEmails` | `string \| null \| undefined` | Optional | A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) | +| `ccEmails` | `string \| null \| undefined` | Optional | “A comma-separated list of emails that should be cc’d on all customer communications (e.g., “joe@example.com, sue@example.com”)” | | `organization` | `string \| null \| undefined` | Optional | The organization of the customer. If no value, `null` or empty string is provided, `organization` will be populated with the customer's first and last name, separated with a space. | | `reference` | `string \| null \| undefined` | Optional | The unique identifier used within your own application for this customer | | `id` | `number \| undefined` | Optional | The customer ID in Chargify | | `createdAt` | `string \| undefined` | Optional | The timestamp in which the customer object was created in Chargify | | `updatedAt` | `string \| undefined` | Optional | The timestamp in which the customer object was last edited | -| `address` | `string \| null \| undefined` | Optional | The customer’s shipping street address (i.e. “123 Main St.”) | -| `address2` | `string \| null \| undefined` | Optional | Second line of the customer’s shipping address i.e. “Apt. 100” | -| `city` | `string \| null \| undefined` | Optional | The customer’s shipping address city (i.e. “Boston”) | -| `state` | `string \| null \| undefined` | Optional | The customer’s shipping address state (i.e. “MA”) | +| `address` | `string \| null \| undefined` | Optional | The customer’s shipping street address (e.g., “123 Main St.”) | +| `address2` | `string \| null \| undefined` | Optional | Second line of the customer’s shipping address e.g., “Apt. 100” | +| `city` | `string \| null \| undefined` | Optional | The customer’s shipping address city (e.g., “Boston”) | +| `state` | `string \| null \| undefined` | Optional | The customer’s shipping address state (e.g., “MA”) | | `stateName` | `string \| null \| undefined` | Optional | The customer's full name of state | -| `zip` | `string \| null \| undefined` | Optional | The customer’s shipping address zip code (i.e. “12345”) | +| `zip` | `string \| null \| undefined` | Optional | The customer’s shipping address zip code (e.g., “12345”) | | `country` | `string \| null \| undefined` | Optional | The customer shipping address country | | `countryName` | `string \| null \| undefined` | Optional | The customer's full name of country | | `phone` | `string \| null \| undefined` | Optional | The phone number of the customer | @@ -32,6 +32,7 @@ | `portalInviteLastSentAt` | `string \| null \| undefined` | Optional | The timestamp of when the Billing Portal invite was last sent at | | `portalInviteLastAcceptedAt` | `string \| null \| undefined` | Optional | The timestamp of when the Billing Portal invite was last accepted | | `taxExempt` | `boolean \| undefined` | Optional | The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. | +| `surcharging` | `boolean \| undefined` | Optional | Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. | | `vatNumber` | `string \| null \| undefined` | Optional | The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. | | `parentId` | `number \| null \| undefined` | Optional | The parent ID in Chargify if applicable. Parent is another Customer object. | | `locale` | `string \| null \| undefined` | Optional | The locale for the customer to identify language-region | @@ -40,16 +41,19 @@ | `taxExemptReason` | `string \| null \| undefined` | Optional | The Tax Exemption Reason Code for the customer | | `defaultAutoRenewalProfileId` | `number \| null \| undefined` | Optional | The default auto-renewal profile ID for the customer | | `maxioid` | `string \| null \| undefined` | Optional | The Maxio-generated unique identifier for the customer. | +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | -## Example (as JSON) +## Example -```json -{ - "first_name": "first_name8", - "last_name": "last_name6", - "email": "email8", - "cc_emails": "cc_emails2", - "organization": "organization8" -} +```ts +import { Customer } from '@maxio-com/advanced-billing-sdk'; + +const customer: Customer = { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', +}; ``` diff --git a/doc/models/debit-note-role.md b/doc/models/debit-note-role.md index d4bc83dd..e8d08a50 100644 --- a/doc/models/debit-note-role.md +++ b/doc/models/debit-note-role.md @@ -14,3 +14,11 @@ The role of the debit note. | `Chargeback` | | `Refund` | +## Example + +```ts +import { DebitNoteRole } from '@maxio-com/advanced-billing-sdk'; + +const debitNoteRole = DebitNoteRole.Chargeback; +``` + diff --git a/doc/models/debit-note-status.md b/doc/models/debit-note-status.md index 42e4a81c..b28616a4 100644 --- a/doc/models/debit-note-status.md +++ b/doc/models/debit-note-status.md @@ -16,3 +16,11 @@ Current status of the debit note. | `Banished` | | `Paid` | +## Example + +```ts +import { DebitNoteStatus } from '@maxio-com/advanced-billing-sdk'; + +const debitNoteStatus = DebitNoteStatus.Open; +``` + diff --git a/doc/models/debit-note.md b/doc/models/debit-note.md index 38488c0a..5145870a 100644 --- a/doc/models/debit-note.md +++ b/doc/models/debit-note.md @@ -13,10 +13,10 @@ | `siteId` | `number \| undefined` | Optional | ID of the site to which the debit note belongs. | | `customerId` | `number \| undefined` | Optional | ID of the customer to which the debit note belongs. | | `subscriptionId` | `number \| undefined` | Optional | ID of the subscription that generated the debit note. | -| `number` | `number \| undefined` | Optional | A unique, identifier that appears on the debit note and in places it is referenced. | +| `number` | `number \| undefined` | Optional | A unique identifier that appears on the debit note and in places it is referenced. | | `sequenceNumber` | `number \| undefined` | Optional | A monotonically increasing number assigned to debit notes as they are created. | | `originCreditNoteUid` | `string \| undefined` | Optional | Unique identifier for the connected credit note. It is generated automatically by Chargify and has the prefix "cn_" followed by alphanumeric characters.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `originCreditNoteNumber` | `string \| undefined` | Optional | A unique, identifying string of the connected credit note. | +| `originCreditNoteNumber` | `string \| undefined` | Optional | A unique identifying string of the connected credit note. | | `issueDate` | `string \| undefined` | Optional | Date the document was issued to the customer. This is the date that the document was made available for payment.

The format is "YYYY-MM-DD". | | `appliedDate` | `string \| undefined` | Optional | Debit notes are applied to invoices to offset invoiced amounts - they adjust the amount due. This field is the date the debit note document became fully applied to the invoice.

The format is "YYYY-MM-DD". | | `dueDate` | `string \| undefined` | Optional | Date the document is due for payment. The format is "YYYY-MM-DD". | @@ -25,7 +25,7 @@ | `role` | [`DebitNoteRole \| undefined`](../../doc/models/debit-note-role.md) | Optional | The role of the debit note. | | `currency` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of the credit note amount fields. | | `seller` | [`InvoiceSeller \| undefined`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the debit note. | -| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the debited subscription. | +| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is the owner or recipient of the debited subscription. | | `billingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The billing address of the debited subscription. | | `shippingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The shipping address of the debited subscription. | | `lineItems` | [`CreditNoteLineItem[] \| undefined`](../../doc/models/credit-note-line-item.md) | Optional | Line items on the debit note. | @@ -33,15 +33,17 @@ | `taxes` | [`InvoiceTax[] \| undefined`](../../doc/models/invoice-tax.md) | Optional | - | | `refunds` | [`InvoiceRefund[] \| undefined`](../../doc/models/invoice-refund.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": 172 -} +```ts +import { DebitNote } from '@maxio-com/advanced-billing-sdk'; + +const debitNote: DebitNote = { + uid: 'uid2', + siteId: 196, + customerId: 52, + subscriptionId: 124, + number: 0, +}; ``` diff --git a/doc/models/deduct-service-credit-request.md b/doc/models/deduct-service-credit-request.md index 4f93ce7f..2d8e02ff 100644 --- a/doc/models/deduct-service-credit-request.md +++ b/doc/models/deduct-service-credit-request.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `deduction` | [`DeductServiceCredit`](../../doc/models/deduct-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "deduction": { - "amount": "String9", - "memo": "memo0" - } -} +## Example + +```ts +import { DeductServiceCreditRequest } from '@maxio-com/advanced-billing-sdk'; + +const deductServiceCreditRequest: DeductServiceCreditRequest = { + deduction: { + amount: 'String9', + memo: 'memo0', + }, +}; ``` diff --git a/doc/models/deduct-service-credit.md b/doc/models/deduct-service-credit.md index 19782103..77cb001f 100644 --- a/doc/models/deduct-service-credit.md +++ b/doc/models/deduct-service-credit.md @@ -12,12 +12,14 @@ | `amount` | [`DeductServiceCreditAmount`](../../doc/models/containers/deduct-service-credit-amount.md) | Required | This is a container for one-of cases. | | `memo` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": "String1", - "memo": "memo2" -} +```ts +import { DeductServiceCredit } from '@maxio-com/advanced-billing-sdk'; + +const deductServiceCredit: DeductServiceCredit = { + amount: 'String5', + memo: 'memo6', +}; ``` diff --git a/doc/models/delayed-cancellation-response.md b/doc/models/delayed-cancellation-response.md index bcb94069..89a72cae 100644 --- a/doc/models/delayed-cancellation-response.md +++ b/doc/models/delayed-cancellation-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `message` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "message": "message8" -} +```ts +import { DelayedCancellationResponse } from '@maxio-com/advanced-billing-sdk'; + +const delayedCancellationResponse: DelayedCancellationResponse = { + message: 'message4', +}; ``` diff --git a/doc/models/delete-subscription-group-response.md b/doc/models/delete-subscription-group-response.md index 08c87591..bf3a3b2a 100644 --- a/doc/models/delete-subscription-group-response.md +++ b/doc/models/delete-subscription-group-response.md @@ -12,12 +12,16 @@ | `uid` | `string \| undefined` | Optional | - | | `deleted` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "deleted": false -} +```ts +import { + DeleteSubscriptionGroupResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const deleteSubscriptionGroupResponse: DeleteSubscriptionGroupResponse = { + uid: 'uid0', + deleted: false, +}; ``` diff --git a/doc/models/deliver-proforma-invoice-request.md b/doc/models/deliver-proforma-invoice-request.md index c1c73500..caeafe1d 100644 --- a/doc/models/deliver-proforma-invoice-request.md +++ b/doc/models/deliver-proforma-invoice-request.md @@ -13,21 +13,26 @@ | `ccRecipientEmails` | `string[] \| undefined` | Optional | - | | `bccRecipientEmails` | `string[] \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "recipient_emails": [ - "recipient_emails9" +```ts +import { + DeliverProformaInvoiceRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const deliverProformaInvoiceRequest: DeliverProformaInvoiceRequest = { + recipientEmails: [ + 'recipient_emails3', + 'recipient_emails4' + ], + ccRecipientEmails: [ + 'cc_recipient_emails2', + 'cc_recipient_emails1', + 'cc_recipient_emails0' ], - "cc_recipient_emails": [ - "cc_recipient_emails8" + bccRecipientEmails: [ + 'bcc_recipient_emails6' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails2", - "bcc_recipient_emails3", - "bcc_recipient_emails4" - ] -} +}; ``` diff --git a/doc/models/direction.md b/doc/models/direction.md index 356aa18f..b2139f21 100644 --- a/doc/models/direction.md +++ b/doc/models/direction.md @@ -12,3 +12,11 @@ | `Asc` | | `Desc` | +## Example + +```ts +import { Direction } from '@maxio-com/advanced-billing-sdk'; + +const direction = Direction.Asc; +``` + diff --git a/doc/models/discount-type.md b/doc/models/discount-type.md index b08252c9..eaa17fdc 100644 --- a/doc/models/discount-type.md +++ b/doc/models/discount-type.md @@ -12,3 +12,11 @@ | `Amount` | | `Percent` | +## Example + +```ts +import { DiscountType } from '@maxio-com/advanced-billing-sdk'; + +const discountType = DiscountType.Amount; +``` + diff --git a/doc/models/downgrade-credit-credit-type.md b/doc/models/downgrade-credit-credit-type.md index 3b0e9c92..547e2338 100644 --- a/doc/models/downgrade-credit-credit-type.md +++ b/doc/models/downgrade-credit-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `Prorated` | | `None` | +## Example + +```ts +import { DowngradeCreditCreditType } from '@maxio-com/advanced-billing-sdk'; + +const downgradeCreditCreditType = DowngradeCreditCreditType.Full; +``` + diff --git a/doc/models/dunner-data.md b/doc/models/dunner-data.md index ea1738f4..1c4525e9 100644 --- a/doc/models/dunner-data.md +++ b/doc/models/dunner-data.md @@ -16,16 +16,18 @@ | `attempts` | `number` | Required | - | | `lastAttemptedAt` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "state": "state4", - "subscription_id": 126, - "revenue_at_risk_in_cents": 30, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 110, - "last_attempted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { DunnerData } from '@maxio-com/advanced-billing-sdk'; + +const dunnerData: DunnerData = { + state: 'state4', + subscriptionId: 230, + revenueAtRiskInCents: BigInt(134), + createdAt: '2016-03-13T12:52:32.123Z', + attempts: 6, + lastAttemptedAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/dunning-step-data.md b/doc/models/dunning-step-data.md index 258e928d..6b276f44 100644 --- a/doc/models/dunning-step-data.md +++ b/doc/models/dunning-step-data.md @@ -18,18 +18,20 @@ | `sendSms` | `boolean` | Required | - | | `smsBody` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "day_threshold": 88, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" -} +## Example + +```ts +import { DunningStepData } from '@maxio-com/advanced-billing-sdk'; + +const dunningStepData: DunningStepData = { + dayThreshold: 206, + action: 'action6', + sendEmail: false, + sendBccEmail: false, + sendSms: false, + emailBody: 'email_body6', + emailSubject: 'email_subject6', + smsBody: 'sms_body8', +}; ``` diff --git a/doc/models/dunning-step-reached.md b/doc/models/dunning-step-reached.md index 5a7204ee..fee13586 100644 --- a/doc/models/dunning-step-reached.md +++ b/doc/models/dunning-step-reached.md @@ -13,38 +13,40 @@ | `currentStep` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | | `nextStep` | [`DunningStepData`](../../doc/models/dunning-step-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "dunner": { - "state": "state8", - "subscription_id": 194, - "revenue_at_risk_in_cents": 98, - "created_at": "2016-03-13T12:52:32.123Z", - "attempts": 42, - "last_attempted_at": "2016-03-13T12:52:32.123Z" +## Example + +```ts +import { DunningStepReached } from '@maxio-com/advanced-billing-sdk'; + +const dunningStepReached: DunningStepReached = { + dunner: { + state: 'state8', + subscriptionId: 194, + revenueAtRiskInCents: BigInt(98), + createdAt: '2016-03-13T12:52:32.123Z', + attempts: 42, + lastAttemptedAt: '2016-03-13T12:52:32.123Z', }, - "current_step": { - "day_threshold": 198, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject6", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" + currentStep: { + dayThreshold: 198, + action: 'action4', + sendEmail: false, + sendBccEmail: false, + sendSms: false, + emailBody: 'email_body4', + emailSubject: 'email_subject6', + smsBody: 'sms_body0', }, - "next_step": { - "day_threshold": 30, - "action": "action4", - "email_body": "email_body4", - "email_subject": "email_subject4", - "send_email": false, - "send_bcc_email": false, - "send_sms": false, - "sms_body": "sms_body0" - } -} + nextStep: { + dayThreshold: 30, + action: 'action4', + sendEmail: false, + sendBccEmail: false, + sendSms: false, + emailBody: 'email_body4', + emailSubject: 'email_subject4', + smsBody: 'sms_body0', + }, +}; ``` diff --git a/doc/models/ebb-component.md b/doc/models/ebb-component.md index 186bf30e..66cbb959 100644 --- a/doc/models/ebb-component.md +++ b/doc/models/ebb-component.md @@ -9,10 +9,10 @@ | 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` | 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 | +| `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "Minutes". | +| `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\-_:.]*$` | +| `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component in 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://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. | @@ -21,36 +21,62 @@ | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 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. | | `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. | +| `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. | +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name0", - "unit_name": "unit_name2", - "description": "description0", - "handle": "handle6", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ +## Example + +```ts +import { + EBBComponent, + IntervalUnit, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const eBBComponent: EBBComponent = { + name: 'name0', + unitName: 'unit_name2', + pricingScheme: PricingScheme.Stairstep, + eventBasedBillingMetricId: 36, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "price_points": [ + pricePoints: [ + { + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, + }, + { + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, + }, { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, } ], - "event_based_billing_metric_id": 190 -} +}; ``` diff --git a/doc/models/ebb-event.md b/doc/models/ebb-event.md index e3ca90fc..3cbfb837 100644 --- a/doc/models/ebb-event.md +++ b/doc/models/ebb-event.md @@ -11,28 +11,16 @@ | --- | --- | --- | --- | | `chargify` | [`ChargifyEBB \| undefined`](../../doc/models/chargify-ebb.md) | Optional | - | -## Example (as JSON) - -```json -{ - "chargify": { - "subscription_id": 1, - "timestamp": "2020-02-27T17:45:50-05:00", - "id": "id6", - "created_at": "2016-03-13T12:52:32.123Z", - "uniqueness_token": "uniqueness_token2" +## Example + +```ts +import { EBBEvent } from '@maxio-com/advanced-billing-sdk'; + +const eBBEvent: EBBEvent = { + chargify: { + timestamp: '2020-02-27T17:45:50-05:00', + subscriptionId: 1, }, - "messages": 150, - "country": "US", - "customer": { - "name": "John", - "lastName": "Doe", - "address": { - "street": "Maple Street", - "zip": 4888, - "state": "MA" - } - } -} +}; ``` diff --git a/doc/models/enable-webhooks-request.md b/doc/models/enable-webhooks-request.md index c7ad0b52..9230de52 100644 --- a/doc/models/enable-webhooks-request.md +++ b/doc/models/enable-webhooks-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `webhooksEnabled` | `boolean` | Required | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ts +import { EnableWebhooksRequest } from '@maxio-com/advanced-billing-sdk'; + +const enableWebhooksRequest: EnableWebhooksRequest = { + webhooksEnabled: false, +}; ``` diff --git a/doc/models/enable-webhooks-response.md b/doc/models/enable-webhooks-response.md index fc03c423..7a4837a4 100644 --- a/doc/models/enable-webhooks-response.md +++ b/doc/models/enable-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `webhooksEnabled` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "webhooks_enabled": false -} +```ts +import { EnableWebhooksResponse } from '@maxio-com/advanced-billing-sdk'; + +const enableWebhooksResponse: EnableWebhooksResponse = { + webhooksEnabled: false, +}; ``` diff --git a/doc/models/endpoint-response.md b/doc/models/endpoint-response.md index af7dc6e9..58816127 100644 --- a/doc/models/endpoint-response.md +++ b/doc/models/endpoint-response.md @@ -11,19 +11,21 @@ | --- | --- | --- | --- | | `endpoint` | [`Endpoint \| undefined`](../../doc/models/endpoint.md) | Optional | - | -## Example (as JSON) - -```json -{ - "endpoint": { - "id": 202, - "url": "url2", - "site_id": 128, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4" - ] - } -} +## Example + +```ts +import { EndpointResponse } from '@maxio-com/advanced-billing-sdk'; + +const endpointResponse: EndpointResponse = { + endpoint: { + id: 202, + url: 'url2', + siteId: 128, + status: 'status0', + webhookSubscriptions: [ + 'webhook_subscriptions4' + ], + }, +}; ``` diff --git a/doc/models/endpoint.md b/doc/models/endpoint.md index 0fa25fec..bbe124d9 100644 --- a/doc/models/endpoint.md +++ b/doc/models/endpoint.md @@ -15,18 +15,19 @@ | `status` | `string \| undefined` | Optional | - | | `webhookSubscriptions` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 196, - "url": "url2", - "site_id": 122, - "status": "status0", - "webhook_subscriptions": [ - "webhook_subscriptions4", - "webhook_subscriptions3" - ] -} +## Example + +```ts +import { Endpoint } from '@maxio-com/advanced-billing-sdk'; + +const endpoint: Endpoint = { + id: 202, + url: 'url2', + siteId: 128, + status: 'status0', + webhookSubscriptions: [ + 'webhook_subscriptions4' + ], +}; ``` diff --git a/doc/models/error-array-map-response-error.md b/doc/models/error-array-map-response-error.md index c4f8993b..25ebb3bd 100644 --- a/doc/models/error-array-map-response-error.md +++ b/doc/models/error-array-map-response-error.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Record \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - } +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ErrorArrayMapResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/error-list-response-error.md b/doc/models/error-list-response-error.md index d5d5dd1b..1408c11a 100644 --- a/doc/models/error-list-response-error.md +++ b/doc/models/error-list-response-error.md @@ -13,15 +13,15 @@ Error which contains list of messages. | --- | --- | --- | --- | | `errors` | `string[]` | Required | - | -## Example (as JSON) - -```json -{ - "errors": [ - "errors5", - "errors6", - "errors7" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ErrorListResponseError) { + console.log(error.result); + } } ``` diff --git a/doc/models/error-string-map-response-error.md b/doc/models/error-string-map-response-error.md index a607c86b..a2e7690f 100644 --- a/doc/models/error-string-map-response-error.md +++ b/doc/models/error-string-map-response-error.md @@ -11,13 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Record \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "key0": "errors3", - "key1": "errors4" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ErrorStringMapResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/errors.md b/doc/models/errors.md index 9b489e6f..6207e78d 100644 --- a/doc/models/errors.md +++ b/doc/models/errors.md @@ -12,18 +12,22 @@ | `perPage` | `string[] \| undefined` | Optional | - | | `pricePoint` | `string[] \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "per_page": [ - "per_page7", - "per_page8" +```ts +import { Errors } from '@maxio-com/advanced-billing-sdk'; + +const errors: Errors = { + perPage: [ + 'per_page1', + 'per_page2', + 'per_page3' + ], + pricePoint: [ + 'price_point0', + 'price_point9', + 'price_point8' ], - "price_point": [ - "price_point6", - "price_point7" - ] -} +}; ``` diff --git a/doc/models/event-based-billing-list-segments-errors-error.md b/doc/models/event-based-billing-list-segments-errors-error.md index 7a2388d8..fb0ae92a 100644 --- a/doc/models/event-based-billing-list-segments-errors-error.md +++ b/doc/models/event-based-billing-list-segments-errors-error.md @@ -11,21 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`Errors \| undefined`](../../doc/models/errors.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "per_page": [ - "per_page1", - "per_page2", - "per_page3" - ], - "price_point": [ - "price_point0", - "price_point9", - "price_point8" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof EventBasedBillingListSegmentsErrorsError) { + console.log(error.result); } } ``` diff --git a/doc/models/event-based-billing-segment-error-1.md b/doc/models/event-based-billing-segment-error-1.md index 42011f65..54552287 100644 --- a/doc/models/event-based-billing-segment-error-1.md +++ b/doc/models/event-based-billing-segment-error-1.md @@ -11,17 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - } - } +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof EventBasedBillingSegmentError) { + console.log(error.result); } } ``` diff --git a/doc/models/event-based-billing-segment-error.md b/doc/models/event-based-billing-segment-error.md index d6e608f4..ba5e1cda 100644 --- a/doc/models/event-based-billing-segment-error.md +++ b/doc/models/event-based-billing-segment-error.md @@ -11,20 +11,18 @@ | --- | --- | --- | --- | | `segments` | `Record` | Required | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "segments": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - } - } -} +## Example + +```ts +import { + EventBasedBillingSegmentError, +} from '@maxio-com/advanced-billing-sdk'; + +const eventBasedBillingSegmentError: EventBasedBillingSegmentError = { + segments: { + 'key0': { 'key1': 'val1', 'key2': 'val2' }, + 'key1': { 'key1': 'val1', 'key2': 'val2' } + }, +}; ``` diff --git a/doc/models/event-based-billing-segment-errors-error.md b/doc/models/event-based-billing-segment-errors-error.md index 60e95cd3..f3793c2b 100644 --- a/doc/models/event-based-billing-segment-errors-error.md +++ b/doc/models/event-based-billing-segment-errors-error.md @@ -11,23 +11,14 @@ | --- | --- | --- | --- | | `errors` | `Record \| undefined` | Optional | The key of the object would be a number (an index in the request array) where the error occurred. In the value object, the key represents the field and the value is an array with error messages. In most cases, this object would contain just one key. | -## Example (as JSON) - -```json -{ - "errors": { - "key0": { - "key1": "val1", - "key2": "val2" - }, - "key1": { - "key1": "val1", - "key2": "val2" - }, - "key2": { - "key1": "val1", - "key2": "val2" - } +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof EventBasedBillingSegmentErrorsError) { + console.log(error.result); } } ``` diff --git a/doc/models/event-key.md b/doc/models/event-key.md index 351618c0..39c7751b 100644 --- a/doc/models/event-key.md +++ b/doc/models/event-key.md @@ -21,6 +21,7 @@ | `RenewalFailure` | | `SubscriptionStateChange` | | `SubscriptionProductChange` | +| `SubscriptionProductChangeScheduled` | | `PendingCancellationChange` | | `ExpiringCard` | | `CustomerUpdate` | @@ -93,3 +94,11 @@ | `SubscriptionTermRenewalActivated` | | `SubscriptionTermRenewalRemoved` | +## Example + +```ts +import { EventKey } from '@maxio-com/advanced-billing-sdk'; + +const eventKey = EventKey.SubscriptionGroupSignupSuccess; +``` + diff --git a/doc/models/event-response.md b/doc/models/event-response.md index 1c4163af..cff3223e 100644 --- a/doc/models/event-response.md +++ b/doc/models/event-response.md @@ -11,34 +11,27 @@ | --- | --- | --- | --- | | `event` | [`Event`](../../doc/models/event.md) | Required | - | -## Example (as JSON) - -```json -{ - "event": { - "id": 242, - "key": "maxio_payments_direct_debit_payment_rejected", - "message": "message0", - "subscription_id": 96, - "customer_id": 24, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } - } -} +## Example + +```ts +import { EventKey, EventResponse } from '@maxio-com/advanced-billing-sdk'; + +const eventResponse: EventResponse = { + event: { + id: BigInt(242), + key: EventKey.SubscriptionRemovedFromGroup, + message: 'message0', + subscriptionId: 96, + customerId: 24, + createdAt: '2016-03-13T12:52:32.123Z', + eventSpecificData: { + previousProductId: 126, + newProductId: 12, + previousProductPricePointId: 250, + newProductPricePointId: 244, + effectiveAt: '2016-03-13T12:52:32.123Z', + }, + }, +}; ``` diff --git a/doc/models/event.md b/doc/models/event.md index 5b9fa1eb..04fff9cf 100644 --- a/doc/models/event.md +++ b/doc/models/event.md @@ -17,32 +17,25 @@ | `createdAt` | `string` | Required | - | | `eventSpecificData` | [`EventEventSpecificData \| null`](../../doc/models/containers/event-event-specific-data.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 40, - "key": "subscription_group_signup_success", - "message": "message8", - "subscription_id": 150, - "customer_id": 78, - "created_at": "2016-03-13T12:52:32.123Z", - "event_specific_data": { - "previous_unit_balance": null, - "previous_overage_unit_balance": null, - "new_unit_balance": null, - "new_overage_unit_balance": null, - "usage_quantity": null, - "overage_usage_quantity": null, - "component_id": null, - "component_handle": null, - "memo": null, - "allocation_details": [ - null - ], - "previous_product_id": 126, - "new_product_id": 12 - } -} +## Example + +```ts +import { Event, EventKey } from '@maxio-com/advanced-billing-sdk'; + +const event: Event = { + id: BigInt(242), + key: EventKey.SubscriptionRemovedFromGroup, + message: 'message0', + subscriptionId: 96, + customerId: 24, + createdAt: '2016-03-13T12:52:32.123Z', + eventSpecificData: { + previousProductId: 126, + newProductId: 12, + previousProductPricePointId: 250, + newProductPricePointId: 244, + effectiveAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/expiration-interval-unit.md b/doc/models/expiration-interval-unit.md index c0ee210b..bd8caceb 100644 --- a/doc/models/expiration-interval-unit.md +++ b/doc/models/expiration-interval-unit.md @@ -13,3 +13,11 @@ | `Month` | | `Never` | +## Example + +```ts +import { ExpirationIntervalUnit } from '@maxio-com/advanced-billing-sdk'; + +const expirationIntervalUnit = ExpirationIntervalUnit.Never; +``` + diff --git a/doc/models/failed-payment-action.md b/doc/models/failed-payment-action.md index 9a6a809b..d8331bb3 100644 --- a/doc/models/failed-payment-action.md +++ b/doc/models/failed-payment-action.md @@ -5,7 +5,7 @@ Action taken when payment for an invoice fails: - `leave_open_invoice` - prepayments and credits applied to 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. This is the default option. - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history. -- `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). +- `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). ## Enumeration @@ -19,3 +19,11 @@ Action taken when payment for an invoice fails: | `RollbackToPending` | | `InitiateDunning` | +## Example + +```ts +import { FailedPaymentAction } from '@maxio-com/advanced-billing-sdk'; + +const failedPaymentAction = FailedPaymentAction.LeaveOpenInvoice; +``` + diff --git a/doc/models/failed-payment-event-data.md b/doc/models/failed-payment-event-data.md index 1c9b613d..01981c6a 100644 --- a/doc/models/failed-payment-event-data.md +++ b/doc/models/failed-payment-event-data.md @@ -17,15 +17,20 @@ Example schema for an `failed_payment` event | `paymentMethod` | [`InvoicePaymentMethodType`](../../doc/models/invoice-payment-method-type.md) | Required | - | | `transactionId` | `number` | Required | The transaction ID of the failed payment. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 128, - "applied_amount": 154, - "memo": "memo2", - "payment_method": "credit_card", - "transaction_id": 170 -} +## Example + +```ts +import { + FailedPaymentEventData, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const failedPaymentEventData: FailedPaymentEventData = { + amountInCents: 34, + appliedAmount: 196, + paymentMethod: InvoicePaymentMethodType.Ach, + transactionId: 76, + memo: 'memo0', +}; ``` diff --git a/doc/models/failed-payment-event.md b/doc/models/failed-payment-event.md index 681d1259..98dbb324 100644 --- a/doc/models/failed-payment-event.md +++ b/doc/models/failed-payment-event.md @@ -15,31 +15,37 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.FailedPayment` | | `eventData` | [`FailedPaymentEventData`](../../doc/models/failed-payment-event-data.md) | Required | Example schema for an `failed_payment` event | -## Example (as JSON) - -```json -{ - "id": 120, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + FailedPaymentEvent, + InvoiceEventType, + InvoicePaymentMethodType, +} from '@maxio-com/advanced-billing-sdk'; + +const failedPaymentEvent: FailedPaymentEvent = { + id: BigInt(186), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "failed_payment", - "event_data": { - "amount_in_cents": 220, - "applied_amount": 194, - "memo": "memo0", - "payment_method": "cash", - "transaction_id": 78 - } -} + eventType: InvoiceEventType.FailedPayment, + eventData: { + amountInCents: 220, + appliedAmount: 194, + paymentMethod: InvoicePaymentMethodType.Cash, + transactionId: 78, + memo: 'memo0', + }, +}; ``` diff --git a/doc/models/first-charge-type.md b/doc/models/first-charge-type.md index c35a7c93..d74b1259 100644 --- a/doc/models/first-charge-type.md +++ b/doc/models/first-charge-type.md @@ -13,3 +13,11 @@ | `Immediate` | | `Delayed` | +## Example + +```ts +import { FirstChargeType } from '@maxio-com/advanced-billing-sdk'; + +const firstChargeType = FirstChargeType.Delayed; +``` + diff --git a/doc/models/full-subscription-group-response.md b/doc/models/full-subscription-group-response.md index 72838daf..0bbc95bf 100644 --- a/doc/models/full-subscription-group-response.md +++ b/doc/models/full-subscription-group-response.md @@ -22,19 +22,23 @@ | `customer` | [`SubscriptionGroupCustomer \| undefined`](../../doc/models/subscription-group-customer.md) | Optional | - | | `accountBalances` | [`SubscriptionGroupBalances \| undefined`](../../doc/models/subscription-group-balances.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 90, - "customer_id": 110, - "payment_profile_id": 18, - "subscription_ids": [ - 220, - 221, - 222 - ] -} +## Example + +```ts +import { + FullSubscriptionGroupResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const fullSubscriptionGroupResponse: FullSubscriptionGroupResponse = { + uid: 'uid6', + scheme: 80, + customerId: 100, + paymentProfileId: 8, + subscriptionIds: [ + 210, + 211, + 212 + ], +}; ``` diff --git a/doc/models/get-one-time-token-bank-account-payment-profile.md b/doc/models/get-one-time-token-bank-account-payment-profile.md new file mode 100644 index 00000000..f187fe30 --- /dev/null +++ b/doc/models/get-one-time-token-bank-account-payment-profile.md @@ -0,0 +1,71 @@ + +# Get One Time Token Bank Account Payment Profile + +## Structure + +`GetOneTimeTokenBankAccountPaymentProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| null \| undefined` | Optional | - | +| `firstName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `lastName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `customerId` | `string \| null \| undefined` | Optional | - | +| `currentVault` | [`BankAccountVault`](../../doc/models/bank-account-vault.md) | Required | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | +| `vaultToken` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `billingAddress` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `billingAddress2` | `string \| undefined` | Optional | - | +| `billingCity` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `billingCountry` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `billingState` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `billingZip` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `bankName` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `maskedBankRoutingNumber` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `maskedBankAccountNumber` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `bankAccountType` | [`BankAccountType`](../../doc/models/bank-account-type.md) | Required | Defaults to checking | +| `bankAccountHolderType` | [`BankAccountHolderType`](../../doc/models/bank-account-holder-type.md) | Required | Defaults to personal | +| `paymentType` | `string` | Required | **Constraints**: *Minimum Length*: `1` | +| `disabled` | `boolean` | Required | - | +| `siteGatewaySettingId` | `number` | Required | - | +| `customerVaultToken` | `string \| null \| undefined` | Optional | - | +| `gatewayHandle` | `string \| null \| undefined` | Optional | - | +| `verified` | `boolean \| null \| undefined` | Optional | - | + +## Example + +```ts +import { + BankAccountHolderType, + BankAccountType, + BankAccountVault, + GetOneTimeTokenBankAccountPaymentProfile, +} from '@maxio-com/advanced-billing-sdk'; + +const getOneTimeTokenBankAccountPaymentProfile: GetOneTimeTokenBankAccountPaymentProfile = { + firstName: 'first_name0', + lastName: 'last_name8', + currentVault: BankAccountVault.Maxp, + vaultToken: 'vault_token2', + billingAddress: 'billing_address2', + billingCity: 'billing_city8', + billingCountry: 'billing_country4', + billingState: 'billing_state6', + billingZip: 'billing_zip8', + bankName: 'bank_name4', + maskedBankRoutingNumber: 'masked_bank_routing_number4', + maskedBankAccountNumber: 'masked_bank_account_number2', + bankAccountType: BankAccountType.Checking, + bankAccountHolderType: BankAccountHolderType.Personal, + paymentType: 'payment_type0', + disabled: false, + siteGatewaySettingId: 246, + id: 'id0', + customerId: 'customer_id8', + billingAddress2: 'billing_address_22', + customerVaultToken: 'customer_vault_token8', + gatewayHandle: 'gateway_handle2', +}; +``` + diff --git a/doc/models/get-one-time-token-payment-profile.md b/doc/models/get-one-time-token-payment-profile.md index eb5fcee9..56aabc1d 100644 --- a/doc/models/get-one-time-token-payment-profile.md +++ b/doc/models/get-one-time-token-payment-profile.md @@ -31,31 +31,37 @@ | `customerVaultToken` | `string \| null \| undefined` | Optional | - | | `gatewayHandle` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": "id2", - "first_name": "first_name2", - "last_name": "last_name0", - "masked_card_number": "masked_card_number0", - "card_type": "routex", - "expiration_month": 187.78, - "expiration_year": 164.44, - "customer_id": "customer_id0", - "current_vault": "braintree_blue", - "vault_token": "vault_token4", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_24", - "billing_city": "billing_city0", - "billing_country": "billing_country6", - "billing_state": "billing_state6", - "billing_zip": "billing_zip0", - "payment_type": "payment_type2", - "disabled": false, - "site_gateway_setting_id": 232, - "customer_vault_token": "customer_vault_token0", - "gateway_handle": "gateway_handle4" -} +## Example + +```ts +import { + CardType, + CreditCardVault, + GetOneTimeTokenPaymentProfile, +} from '@maxio-com/advanced-billing-sdk'; + +const getOneTimeTokenPaymentProfile: GetOneTimeTokenPaymentProfile = { + firstName: 'first_name4', + lastName: 'last_name2', + maskedCardNumber: 'masked_card_number2', + cardType: CardType.MaestroNoLuhn, + expirationMonth: 28.3, + expirationYear: 4.96, + currentVault: CreditCardVault.TrustCommerce, + vaultToken: 'vault_token6', + billingAddress: 'billing_address6', + billingCity: 'billing_city2', + billingCountry: 'billing_country8', + billingState: 'billing_state2', + billingZip: 'billing_zip2', + paymentType: 'payment_type6', + disabled: false, + siteGatewaySettingId: 156, + id: 'id4', + customerId: 'customer_id2', + billingAddress2: 'billing_address_26', + customerVaultToken: 'customer_vault_token2', + gatewayHandle: 'gateway_handle6', +}; ``` diff --git a/doc/models/get-one-time-token-request.md b/doc/models/get-one-time-token-request.md index 67390908..1ffbf0fd 100644 --- a/doc/models/get-one-time-token-request.md +++ b/doc/models/get-one-time-token-request.md @@ -9,35 +9,41 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `paymentProfile` | [`GetOneTimeTokenPaymentProfile`](../../doc/models/get-one-time-token-payment-profile.md) | Required | - | - -## Example (as JSON) - -```json -{ - "payment_profile": { - "id": "id4", - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2", - "card_type": "bogus", - "expiration_month": 133.5, - "expiration_year": 156.84, - "customer_id": "customer_id2", - "current_vault": "stripe", - "vault_token": "vault_token6", - "billing_address": "billing_address4", - "billing_address_2": "billing_address_26", - "billing_city": "billing_city8", - "billing_country": "billing_country2", - "billing_state": "billing_state2", - "billing_zip": "billing_zip2", - "payment_type": "payment_type6", - "disabled": false, - "site_gateway_setting_id": 104, - "customer_vault_token": "customer_vault_token2", - "gateway_handle": "gateway_handle4" - } -} +| `paymentProfile` | [`GetOneTimeTokenRequestPaymentProfile`](../../doc/models/containers/get-one-time-token-request-payment-profile.md) | Required | This is a container for any-of cases. | + +## Example + +```ts +import { + CardType, + CreditCardVault, + GetOneTimeTokenRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const getOneTimeTokenRequest: GetOneTimeTokenRequest = { + paymentProfile: { + firstName: 'first_name2', + lastName: 'last_name0', + maskedCardNumber: 'masked_card_number0', + cardType: CardType.Routex, + expirationMonth: 187.78, + expirationYear: 164.44, + currentVault: CreditCardVault.BraintreeBlue, + vaultToken: 'vault_token4', + billingAddress: 'billing_address4', + billingCity: 'billing_city0', + billingCountry: 'billing_country6', + billingState: 'billing_state6', + billingZip: 'billing_zip0', + paymentType: 'payment_type2', + disabled: false, + siteGatewaySettingId: 232, + id: 'id2', + customerId: 'customer_id0', + billingAddress2: 'billing_address_24', + customerVaultToken: 'customer_vault_token0', + gatewayHandle: 'gateway_handle4', + }, +}; ``` diff --git a/doc/models/group-billing.md b/doc/models/group-billing.md index 0e6aeb31..e1ccd2be 100644 --- a/doc/models/group-billing.md +++ b/doc/models/group-billing.md @@ -1,7 +1,7 @@ # Group Billing -Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. +(Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. ## Structure @@ -15,13 +15,15 @@ Optional attributes related to billing date and accrual. Note: Only applicable f | `alignDate` | `boolean \| undefined` | Optional | A flag indicating whether or not to align the billing date of the new subscription with the billing date of the primary subscription of the hierarchy's default subscription group. Required to be true if prorate is also true.

**Default**: `false` | | `prorate` | `boolean \| undefined` | Optional | A flag indicating whether or not to prorate billing of the new subscription for the current period. A value of true is ignored unless align_date is also true.

**Default**: `false` | -## Example (as JSON) +## Example -```json -{ - "accrue": false, - "align_date": false, - "prorate": false -} +```ts +import { GroupBilling } from '@maxio-com/advanced-billing-sdk'; + +const groupBilling: GroupBilling = { + accrue: false, + alignDate: false, + prorate: false, +}; ``` diff --git a/doc/models/group-settings.md b/doc/models/group-settings.md index 2fbe7621..31e567ca 100644 --- a/doc/models/group-settings.md +++ b/doc/models/group-settings.md @@ -10,21 +10,26 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `target` | [`GroupTarget`](../../doc/models/group-target.md) | Required | Attributes of the target customer who will be the responsible payer of the created subscription. Required. | -| `billing` | [`GroupBilling \| undefined`](../../doc/models/group-billing.md) | Optional | Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | +| `billing` | [`GroupBilling \| undefined`](../../doc/models/group-billing.md) | Optional | (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. | -## Example (as JSON) +## Example -```json -{ - "target": { - "type": "parent", - "id": 236 +```ts +import { + GroupSettings, + GroupTargetType, +} from '@maxio-com/advanced-billing-sdk'; + +const groupSettings: GroupSettings = { + target: { + type: GroupTargetType.Parent, + id: 236, + }, + billing: { + accrue: false, + alignDate: false, + prorate: false, }, - "billing": { - "accrue": false, - "align_date": false, - "prorate": false - } -} +}; ``` diff --git a/doc/models/group-status.md b/doc/models/group-status.md new file mode 100644 index 00000000..c5687198 --- /dev/null +++ b/doc/models/group-status.md @@ -0,0 +1,22 @@ + +# Group Status + +## Enumeration + +`GroupStatus` + +## Fields + +| Name | +| --- | +| `Ungrouped` | +| `Grouped` | + +## Example + +```ts +import { GroupStatus } from '@maxio-com/advanced-billing-sdk'; + +const groupStatus = GroupStatus.Ungrouped; +``` + diff --git a/doc/models/group-target-type.md b/doc/models/group-target-type.md index bce9ce84..079da60c 100644 --- a/doc/models/group-target-type.md +++ b/doc/models/group-target-type.md @@ -17,3 +17,11 @@ The type of object indicated by the id attribute. | `Parent` | | `Eldest` | +## Example + +```ts +import { GroupTargetType } from '@maxio-com/advanced-billing-sdk'; + +const groupTargetType = GroupTargetType.Self; +``` + diff --git a/doc/models/group-target.md b/doc/models/group-target.md index b6ba289e..2061f007 100644 --- a/doc/models/group-target.md +++ b/doc/models/group-target.md @@ -12,14 +12,19 @@ Attributes of the target customer who will be the responsible payer of the creat | Name | Type | Tags | Description | | --- | --- | --- | --- | | `type` | [`GroupTargetType`](../../doc/models/group-target-type.md) | Required | The type of object indicated by the id attribute. | -| `id` | `number \| undefined` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" | +| `id` | `number \| undefined` | Optional | The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self", "parent", or "eldest". | -## Example (as JSON) +## Example -```json -{ - "type": "self", - "id": 134 -} +```ts +import { + GroupTarget, + GroupTargetType, +} from '@maxio-com/advanced-billing-sdk'; + +const groupTarget: GroupTarget = { + type: GroupTargetType.Parent, + id: 234, +}; ``` diff --git a/doc/models/group-type.md b/doc/models/group-type.md index 97c0dfbc..d0fa2d45 100644 --- a/doc/models/group-type.md +++ b/doc/models/group-type.md @@ -12,3 +12,11 @@ | `SingleCustomer` | | `MultipleCustomers` | +## Example + +```ts +import { GroupType } from '@maxio-com/advanced-billing-sdk'; + +const groupType = GroupType.SingleCustomer; +``` + diff --git a/doc/models/historic-usage.md b/doc/models/historic-usage.md index cc925a6f..74fe7493 100644 --- a/doc/models/historic-usage.md +++ b/doc/models/historic-usage.md @@ -1,7 +1,7 @@ # Historic Usage -Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. +(Optional) For Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. ## Structure @@ -15,13 +15,15 @@ Optional for Event Based Components. If the `include=historic_usages` query para | `billingPeriodStartsAt` | `string \| undefined` | Optional | Start date of billing period | | `billingPeriodEndsAt` | `string \| undefined` | Optional | End date of billing period | -## Example (as JSON) +## Example -```json -{ - "total_usage_quantity": 26.6, - "billing_period_starts_at": "2016-03-13T12:52:32.123Z", - "billing_period_ends_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { HistoricUsage } from '@maxio-com/advanced-billing-sdk'; + +const historicUsage: HistoricUsage = { + totalUsageQuantity: 140.74, + billingPeriodStartsAt: '2016-03-13T12:52:32.123Z', + billingPeriodEndsAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/include-not-null.md b/doc/models/include-not-null.md index 3b297da0..77bb8435 100644 --- a/doc/models/include-not-null.md +++ b/doc/models/include-not-null.md @@ -15,7 +15,9 @@ Passed as a parameter to list methods to return only non null values. ## Example -``` -not_null +```ts +import { IncludeNotNull } from '@maxio-com/advanced-billing-sdk'; + +const includeNotNull = IncludeNotNull.NotNull; ``` diff --git a/doc/models/include-null-or-not-null.md b/doc/models/include-null-or-not-null.md index c9209811..6e8a94e6 100644 --- a/doc/models/include-null-or-not-null.md +++ b/doc/models/include-null-or-not-null.md @@ -16,7 +16,9 @@ Allows to filter by `not_null` or `null`. ## Example -``` -not_null +```ts +import { IncludeNullOrNotNull } from '@maxio-com/advanced-billing-sdk'; + +const includeNullOrNotNull = IncludeNullOrNotNull.NotNull; ``` diff --git a/doc/models/include-option.md b/doc/models/include-option.md index 41d05156..56ffb861 100644 --- a/doc/models/include-option.md +++ b/doc/models/include-option.md @@ -12,3 +12,11 @@ | `Exclude` | | `Include` | +## Example + +```ts +import { IncludeOption } from '@maxio-com/advanced-billing-sdk'; + +const includeOption = IncludeOption.Exclude; +``` + diff --git a/doc/models/interval-unit.md b/doc/models/interval-unit.md index 94829529..fbdca03b 100644 --- a/doc/models/interval-unit.md +++ b/doc/models/interval-unit.md @@ -12,3 +12,11 @@ | `Day` | | `Month` | +## Example + +```ts +import { IntervalUnit } from '@maxio-com/advanced-billing-sdk'; + +const intervalUnit = IntervalUnit.Day; +``` + diff --git a/doc/models/invoice-address.md b/doc/models/invoice-address.md index 430d8bef..58c19b4b 100644 --- a/doc/models/invoice-address.md +++ b/doc/models/invoice-address.md @@ -16,15 +16,17 @@ | `zip` | `string \| null \| undefined` | Optional | - | | `country` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street0", - "line2": "line24", - "city": "city0", - "state": "state6", - "zip": "zip4" -} +## Example + +```ts +import { InvoiceAddress } from '@maxio-com/advanced-billing-sdk'; + +const invoiceAddress: InvoiceAddress = { + street: 'street2', + line2: 'line26', + city: 'city2', + state: 'state8', + zip: 'zip6', +}; ``` diff --git a/doc/models/invoice-avatax-details.md b/doc/models/invoice-avatax-details.md index da49c5b9..9d90ba1b 100644 --- a/doc/models/invoice-avatax-details.md +++ b/doc/models/invoice-avatax-details.md @@ -15,15 +15,17 @@ | `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" -} +## Example + +```ts +import { InvoiceAvataxDetails } from '@maxio-com/advanced-billing-sdk'; + +const invoiceAvataxDetails: InvoiceAvataxDetails = { + id: BigInt(184), + status: 'status2', + documentCode: 'document_code4', + commitDate: '2016-03-13T12:52:32.123Z', + modifyDate: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/invoice-balance-item.md b/doc/models/invoice-balance-item.md index 563bbdbe..6f924403 100644 --- a/doc/models/invoice-balance-item.md +++ b/doc/models/invoice-balance-item.md @@ -13,13 +13,15 @@ | `number` | `string \| undefined` | Optional | - | | `outstandingAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "number": "number6", - "outstanding_amount": "outstanding_amount6" -} +## Example + +```ts +import { InvoiceBalanceItem } from '@maxio-com/advanced-billing-sdk'; + +const invoiceBalanceItem: InvoiceBalanceItem = { + uid: 'uid8', + number: 'number6', + outstandingAmount: 'outstanding_amount6', +}; ``` diff --git a/doc/models/invoice-consolidation-level.md b/doc/models/invoice-consolidation-level.md index 9afb1551..ae74da55 100644 --- a/doc/models/invoice-consolidation-level.md +++ b/doc/models/invoice-consolidation-level.md @@ -1,7 +1,7 @@ # Invoice Consolidation Level -Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: +Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * "none": A normal invoice with no consolidation. * "child": An invoice segment which has been combined into a consolidated invoice. @@ -23,3 +23,11 @@ See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/ | `Child` | | `Parent` | +## Example + +```ts +import { InvoiceConsolidationLevel } from '@maxio-com/advanced-billing-sdk'; + +const invoiceConsolidationLevel = InvoiceConsolidationLevel.None; +``` + diff --git a/doc/models/invoice-credit.md b/doc/models/invoice-credit.md index 9b32eb7b..94f7117f 100644 --- a/doc/models/invoice-credit.md +++ b/doc/models/invoice-credit.md @@ -17,15 +17,17 @@ | `originalAmount` | `string \| undefined` | Optional | - | | `appliedAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0" -} +## Example + +```ts +import { InvoiceCredit } from '@maxio-com/advanced-billing-sdk'; + +const invoiceCredit: InvoiceCredit = { + uid: 'uid8', + creditNoteNumber: 'credit_note_number2', + creditNoteUid: 'credit_note_uid2', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo2', +}; ``` diff --git a/doc/models/invoice-custom-field.md b/doc/models/invoice-custom-field.md index feacc565..c338c2a7 100644 --- a/doc/models/invoice-custom-field.md +++ b/doc/models/invoice-custom-field.md @@ -15,15 +15,20 @@ | `value` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | | `metadatumId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "owner_id": 142, - "owner_type": "Customer", - "name": "name0", - "value": "value2", - "metadatum_id": 142 -} +## Example + +```ts +import { + CustomFieldOwner, + InvoiceCustomField, +} from '@maxio-com/advanced-billing-sdk'; + +const invoiceCustomField: InvoiceCustomField = { + ownerId: 14, + ownerType: CustomFieldOwner.Customer, + name: 'name0', + value: 'value2', + metadatumId: 14, +}; ``` diff --git a/doc/models/invoice-customer.md b/doc/models/invoice-customer.md index a43a5207..fea28173 100644 --- a/doc/models/invoice-customer.md +++ b/doc/models/invoice-customer.md @@ -1,7 +1,7 @@ # Invoice Customer -Information about the customer who is owner or recipient the invoiced subscription. +Information about the customer who is owner or recipient of the invoiced subscription. ## Structure @@ -19,15 +19,17 @@ Information about the customer who is owner or recipient the invoiced subscripti | `vatNumber` | `string \| null \| undefined` | Optional | - | | `reference` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "chargify_id": 236, - "first_name": "first_name0", - "last_name": "last_name8", - "organization": "organization4", - "email": "email6" -} +```ts +import { InvoiceCustomer } from '@maxio-com/advanced-billing-sdk'; + +const invoiceCustomer: InvoiceCustomer = { + chargifyId: 82, + firstName: 'first_name2', + lastName: 'last_name0', + organization: 'organization6', + email: 'email4', +}; ``` diff --git a/doc/models/invoice-date-field.md b/doc/models/invoice-date-field.md index 350228c9..c64ae123 100644 --- a/doc/models/invoice-date-field.md +++ b/doc/models/invoice-date-field.md @@ -17,7 +17,9 @@ ## Example -``` -issue_date +```ts +import { InvoiceDateField } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDateField = InvoiceDateField.UpdatedAt; ``` diff --git a/doc/models/invoice-debit.md b/doc/models/invoice-debit.md index 72363245..2a2b1d51 100644 --- a/doc/models/invoice-debit.md +++ b/doc/models/invoice-debit.md @@ -18,15 +18,17 @@ | `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" -} +## Example + +```ts +import { DebitNoteRole, InvoiceDebit } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDebit: InvoiceDebit = { + uid: 'uid8', + debitNoteNumber: 'debit_note_number8', + debitNoteUid: 'debit_note_uid4', + role: DebitNoteRole.Chargeback, + transactionTime: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/invoice-discount-breakout.md b/doc/models/invoice-discount-breakout.md index d52f2bba..c85ba537 100644 --- a/doc/models/invoice-discount-breakout.md +++ b/doc/models/invoice-discount-breakout.md @@ -13,13 +13,15 @@ | `eligibleAmount` | `string \| undefined` | Optional | - | | `discountAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "eligible_amount": "eligible_amount0", - "discount_amount": "discount_amount8" -} +## Example + +```ts +import { InvoiceDiscountBreakout } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDiscountBreakout: InvoiceDiscountBreakout = { + uid: 'uid0', + eligibleAmount: 'eligible_amount2', + discountAmount: 'discount_amount4', +}; ``` diff --git a/doc/models/invoice-discount-source-type.md b/doc/models/invoice-discount-source-type.md index fe7f4087..f0a95c08 100644 --- a/doc/models/invoice-discount-source-type.md +++ b/doc/models/invoice-discount-source-type.md @@ -13,3 +13,11 @@ | `Referral` | | `EnumAdHocCoupon` | +## Example + +```ts +import { InvoiceDiscountSourceType } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDiscountSourceType = InvoiceDiscountSourceType.Referral; +``` + diff --git a/doc/models/invoice-discount-type.md b/doc/models/invoice-discount-type.md index 186af0a5..27f1568c 100644 --- a/doc/models/invoice-discount-type.md +++ b/doc/models/invoice-discount-type.md @@ -13,3 +13,11 @@ | `FlatAmount` | | `Rollover` | +## Example + +```ts +import { InvoiceDiscountType } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDiscountType = InvoiceDiscountType.Percentage; +``` + diff --git a/doc/models/invoice-discount.md b/doc/models/invoice-discount.md index 497d6e59..620126c1 100644 --- a/doc/models/invoice-discount.md +++ b/doc/models/invoice-discount.md @@ -22,15 +22,20 @@ | `transactionId` | `number \| undefined` | Optional | - | | `lineItemBreakouts` | [`InvoiceDiscountBreakout[] \| undefined`](../../doc/models/invoice-discount-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "title": "title4", - "description": "description0", - "code": "code8", - "source_type": "Coupon" -} +## Example + +```ts +import { + InvoiceDiscount, + InvoiceDiscountSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const invoiceDiscount: InvoiceDiscount = { + uid: 'uid4', + title: 'title0', + description: 'description6', + code: 'code2', + sourceType: InvoiceDiscountSourceType.Coupon, +}; ``` diff --git a/doc/models/invoice-display-settings.md b/doc/models/invoice-display-settings.md index 5dff6c46..e0829170 100644 --- a/doc/models/invoice-display-settings.md +++ b/doc/models/invoice-display-settings.md @@ -12,12 +12,14 @@ | `hideZeroSubtotalLines` | `boolean \| undefined` | Optional | - | | `includeDiscountsOnLines` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hide_zero_subtotal_lines": false, - "include_discounts_on_lines": false -} +```ts +import { InvoiceDisplaySettings } from '@maxio-com/advanced-billing-sdk'; + +const invoiceDisplaySettings: InvoiceDisplaySettings = { + hideZeroSubtotalLines: false, + includeDiscountsOnLines: false, +}; ``` diff --git a/doc/models/invoice-event-payment-method.md b/doc/models/invoice-event-payment-method.md index 56503b33..ea90f4e6 100644 --- a/doc/models/invoice-event-payment-method.md +++ b/doc/models/invoice-event-payment-method.md @@ -15,3 +15,11 @@ | `External` | | `PaypalAccount` | +## Example + +```ts +import { InvoiceEventPaymentMethod } from '@maxio-com/advanced-billing-sdk'; + +const invoiceEventPaymentMethod = InvoiceEventPaymentMethod.CreditCard; +``` + diff --git a/doc/models/invoice-event-type.md b/doc/models/invoice-event-type.md index a6318ab4..c5c5634f 100644 --- a/doc/models/invoice-event-type.md +++ b/doc/models/invoice-event-type.md @@ -27,3 +27,11 @@ Invoice Event Type | `FailedPayment` | | `ChangeChargebackStatus` | +## Example + +```ts +import { InvoiceEventType } from '@maxio-com/advanced-billing-sdk'; + +const invoiceEventType = InvoiceEventType.CreateCreditNote; +``` + diff --git a/doc/models/invoice-issued.md b/doc/models/invoice-issued.md index 68696629..7da8cd1c 100644 --- a/doc/models/invoice-issued.md +++ b/doc/models/invoice-issued.md @@ -25,33 +25,35 @@ | `consolidationLevel` | `string` | Required | - | | `lineItems` | [`InvoiceLineItemEventData[]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "number": "number8", - "role": "role2", - "due_date": "2016-03-13T12:52:32.123Z", - "issue_date": "issue_date0", - "paid_date": "paid_date6", - "due_amount": "due_amount6", - "paid_amount": "paid_amount4", - "tax_amount": "tax_amount2", - "refund_amount": "refund_amount0", - "total_amount": "total_amount0", - "status_amount": "status_amount4", - "product_name": "product_name0", - "consolidation_level": "consolidation_level4", - "line_items": [ +## Example + +```ts +import { InvoiceIssued } from '@maxio-com/advanced-billing-sdk'; + +const invoiceIssued: InvoiceIssued = { + uid: 'uid8', + number: 'number4', + role: 'role8', + dueDate: '2016-03-13T12:52:32.123Z', + issueDate: 'issue_date4', + paidDate: 'paid_date8', + dueAmount: 'due_amount0', + paidAmount: 'paid_amount0', + taxAmount: 'tax_amount8', + refundAmount: 'refund_amount6', + totalAmount: 'total_amount4', + statusAmount: 'status_amount8', + productName: 'product_name4', + consolidationLevel: 'consolidation_level0', + lineItems: [ { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantityDelta: 204, } - ] -} + ], +}; ``` diff --git a/doc/models/invoice-line-item-component-cost-data.md b/doc/models/invoice-line-item-component-cost-data.md index 81fbeb49..9e4bbc71 100644 --- a/doc/models/invoice-line-item-component-cost-data.md +++ b/doc/models/invoice-line-item-component-cost-data.md @@ -11,33 +11,30 @@ | --- | --- | --- | --- | | `rates` | [`ComponentCostData[] \| undefined`](../../doc/models/component-cost-data.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "rates": [ - { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" - }, +```ts +import { + InvoiceLineItemComponentCostData, +} from '@maxio-com/advanced-billing-sdk'; + +const invoiceLineItemComponentCostData: InvoiceLineItemComponentCostData = { + rates: [ { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" + componentCodeId: 116, + pricePointId: 226, + productId: 94, + quantity: 'quantity0', + amount: 'amount6', }, { - "component_code_id": 116, - "price_point_id": 226, - "product_id": 94, - "quantity": "quantity0", - "amount": "amount6" + componentCodeId: 116, + pricePointId: 226, + productId: 94, + quantity: 'quantity0', + amount: 'amount6', } - ] -} + ], +}; ``` diff --git a/doc/models/invoice-line-item-event-data.md b/doc/models/invoice-line-item-event-data.md index f08a5435..33c86438 100644 --- a/doc/models/invoice-line-item-event-data.md +++ b/doc/models/invoice-line-item-event-data.md @@ -30,15 +30,17 @@ | `billingScheduleItemId` | `number \| null \| undefined` | Optional | - | | `customItem` | `boolean \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description6", - "quantity": 40, - "quantity_delta": 114 -} +## Example + +```ts +import { InvoiceLineItemEventData } from '@maxio-com/advanced-billing-sdk'; + +const invoiceLineItemEventData: InvoiceLineItemEventData = { + uid: 'uid4', + title: 'title0', + description: 'description4', + quantity: 190, + quantityDelta: 36, +}; ``` diff --git a/doc/models/invoice-line-item-pricing-detail.md b/doc/models/invoice-line-item-pricing-detail.md index 7939e353..c96d7cb4 100644 --- a/doc/models/invoice-line-item-pricing-detail.md +++ b/doc/models/invoice-line-item-pricing-detail.md @@ -12,12 +12,16 @@ | `label` | `string \| undefined` | Optional | - | | `amount` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "label": "label0", - "amount": "amount2" -} +```ts +import { + InvoiceLineItemPricingDetail, +} from '@maxio-com/advanced-billing-sdk'; + +const invoiceLineItemPricingDetail: InvoiceLineItemPricingDetail = { + label: 'label4', + amount: 'amount6', +}; ``` diff --git a/doc/models/invoice-line-item.md b/doc/models/invoice-line-item.md index f310b2c7..c468c51c 100644 --- a/doc/models/invoice-line-item.md +++ b/doc/models/invoice-line-item.md @@ -9,19 +9,19 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `uid` | `string \| undefined` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | +| `uid` | `string \| undefined` | Optional | Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. | | `title` | `string \| undefined` | Optional | A short descriptor for the charge or item represented by this line. | -| `description` | `string \| undefined` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | +| `description` | `string \| undefined` | Optional | Detailed description for the charge or item represented by this line. May include proration details in plain text.

Note: this string may contain line breaks that are hints for the best display format on the invoice. | | `quantity` | `string \| undefined` | Optional | The quantity or count of units billed by the line item.

This is a decimal number represented as a string. (See "About Decimal Numbers".) | -| `unitPrice` | `string \| undefined` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | +| `unitPrice` | `string \| undefined` | Optional | The price per unit for the line item.

When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. | | `subtotalAmount` | `string \| undefined` | Optional | The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). | | `discountAmount` | `string \| undefined` | Optional | The approximate discount applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total discount among many lines. Several lines may have been summed prior to applying the discount to arrive at `discount_amount` for the invoice - backing that out to the discount on a single line may introduce rounding or precision errors. | | `taxAmount` | `string \| undefined` | Optional | The approximate tax applied to just this line.

The value is approximated in cases where rounding errors make it difficult to apportion exactly a total tax among many lines. Several lines may have been summed prior to applying the tax rate to arrive at `tax_amount` for the invoice - backing that out to the tax on a single line may introduce rounding or precision errors. | | `taxIncluded` | `boolean \| undefined` | Optional | Whether the unit price for this line item is tax-inclusive.

When `true`, `unit_price` already includes tax and `tax_amount` represents the portion of the price attributable to tax. When `false`, any applicable tax is added on top of the price.

The value is inherited from the source price point's `tax_included` setting. Custom or ad-hoc line items (which have no associated price point) always return `false`. | -| `totalAmount` | `string \| undefined` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | +| `totalAmount` | `string \| undefined` | Optional | The non-canonical total amount for the line.

`subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. | | `tieredUnitPrice` | `boolean \| undefined` | Optional | When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. | -| `periodRangeStart` | `string \| undefined` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | -| `periodRangeEnd` | `string \| undefined` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | +| `periodRangeStart` | `string \| undefined` | Optional | Start date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the previous billing, and the end date will be the current billing date.
* For non-periodic charges, this date and the end date will match. | +| `periodRangeEnd` | `string \| undefined` | Optional | End date for the period covered by this line. The format is `"YYYY-MM-DD"`.

* For periodic charges paid in advance, this date will match the next (future) billing date.
* For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the current billing date.
* For non-periodic charges, this date and the start date will match. | | `transactionId` | `number \| undefined` | Optional | - | | `productId` | `number \| null \| undefined` | Optional | The ID of the product subscribed when the charge was made.

This may be set even for component charges, so true product-only (non-component) charges will also have a nil `component_id`. | | `productVersion` | `number \| null \| undefined` | Optional | The version of the product subscribed when the charge was made. | @@ -35,15 +35,17 @@ | `kind` | `string \| undefined` | Optional | - | | `prepaidAllocationExpiresAt` | `string \| null \| undefined` | Optional | The date a prepaid allocation is set to expire. Only present on line items representing prepaid component allocations. The format is `"YYYY-MM-DD"`. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid4", - "title": "title0", - "description": "description4", - "quantity": "quantity0", - "unit_price": "unit_price2" -} +```ts +import { InvoiceLineItem } from '@maxio-com/advanced-billing-sdk'; + +const invoiceLineItem: InvoiceLineItem = { + uid: 'uid6', + title: 'title2', + description: 'description6', + quantity: 'quantity2', + unitPrice: 'unit_price4', +}; ``` diff --git a/doc/models/invoice-payer-change.md b/doc/models/invoice-payer-change.md index 0cc04b44..0af21237 100644 --- a/doc/models/invoice-payer-change.md +++ b/doc/models/invoice-payer-change.md @@ -14,14 +14,16 @@ | `organization` | `string \| undefined` | Optional | - | | `email` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "organization": "organization4", - "email": "email4" -} +## Example + +```ts +import { InvoicePayerChange } from '@maxio-com/advanced-billing-sdk'; + +const invoicePayerChange: InvoicePayerChange = { + firstName: 'first_name4', + lastName: 'last_name2', + organization: 'organization2', + email: 'email2', +}; ``` diff --git a/doc/models/invoice-payer.md b/doc/models/invoice-payer.md index 637bca09..ecf555c6 100644 --- a/doc/models/invoice-payer.md +++ b/doc/models/invoice-payer.md @@ -16,15 +16,17 @@ | `email` | `string \| undefined` | Optional | - | | `vatNumber` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_id": 46, - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization8", - "email": "email2" -} +## Example + +```ts +import { InvoicePayer } from '@maxio-com/advanced-billing-sdk'; + +const invoicePayer: InvoicePayer = { + chargifyId: 198, + firstName: 'first_name2', + lastName: 'last_name0', + organization: 'organization4', + email: 'email4', +}; ``` diff --git a/doc/models/invoice-payment-application.md b/doc/models/invoice-payment-application.md index 7415a65b..6217fcdb 100644 --- a/doc/models/invoice-payment-application.md +++ b/doc/models/invoice-payment-application.md @@ -13,13 +13,15 @@ | `applicationUid` | `string \| undefined` | Optional | Unique identifier for the payment. It has the prefix "pmt_" followed by alphanumeric characters. | | `appliedAmount` | `string \| undefined` | Optional | Dollar amount of the paid invoice. | -## Example (as JSON) - -```json -{ - "invoice_uid": "invoice_uid2", - "application_uid": "application_uid4", - "applied_amount": "applied_amount6" -} +## Example + +```ts +import { InvoicePaymentApplication } from '@maxio-com/advanced-billing-sdk'; + +const invoicePaymentApplication: InvoicePaymentApplication = { + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', +}; ``` diff --git a/doc/models/invoice-payment-method-type.md b/doc/models/invoice-payment-method-type.md index 5b3c3461..5463a855 100644 --- a/doc/models/invoice-payment-method-type.md +++ b/doc/models/invoice-payment-method-type.md @@ -18,3 +18,11 @@ The type of payment method used. Defaults to other. | `Ach` | | `Other` | +## Example + +```ts +import { InvoicePaymentMethodType } from '@maxio-com/advanced-billing-sdk'; + +const invoicePaymentMethodType = InvoicePaymentMethodType.Cash; +``` + diff --git a/doc/models/invoice-payment-method.md b/doc/models/invoice-payment-method.md index e7c97ef8..c6d99774 100644 --- a/doc/models/invoice-payment-method.md +++ b/doc/models/invoice-payment-method.md @@ -18,15 +18,17 @@ | `lastFour` | `string \| null \| undefined` | Optional | - | | `maskedCardNumber` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "details": "details8", - "kind": "kind6", - "memo": "memo2", - "type": "type8", - "card_brand": "card_brand8" -} +## Example + +```ts +import { InvoicePaymentMethod } from '@maxio-com/advanced-billing-sdk'; + +const invoicePaymentMethod: InvoicePaymentMethod = { + details: 'details2', + kind: 'kind0', + memo: 'memo6', + type: 'type8', + cardBrand: 'card_brand4', +}; ``` diff --git a/doc/models/invoice-payment-type.md b/doc/models/invoice-payment-type.md index 1547e4f9..a672f376 100644 --- a/doc/models/invoice-payment-type.md +++ b/doc/models/invoice-payment-type.md @@ -16,3 +16,11 @@ The type of payment to be applied to an Invoice. Defaults to external. | `ServiceCredit` | | `Payment` | +## Example + +```ts +import { InvoicePaymentType } from '@maxio-com/advanced-billing-sdk'; + +const invoicePaymentType = InvoicePaymentType.External; +``` + diff --git a/doc/models/invoice-payment.md b/doc/models/invoice-payment.md index 3a94a619..7655ce18 100644 --- a/doc/models/invoice-payment.md +++ b/doc/models/invoice-payment.md @@ -22,21 +22,23 @@ | `receivedOn` | `string \| null \| undefined` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
`external` payments. | | `uid` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6", - "payment_method": { - "details": "details0", - "kind": "kind8", - "memo": "memo4", - "type": "type0", - "card_brand": "card_brand6" - } -} +## Example + +```ts +import { InvoicePayment } from '@maxio-com/advanced-billing-sdk'; + +const invoicePayment: InvoicePayment = { + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo6', + originalAmount: 'original_amount6', + appliedAmount: 'applied_amount6', + paymentMethod: { + details: 'details0', + kind: 'kind8', + memo: 'memo4', + type: 'type0', + cardBrand: 'card_brand6', + }, +}; ``` diff --git a/doc/models/invoice-pre-payment.md b/doc/models/invoice-pre-payment.md index 9c07fe8e..46e364f4 100644 --- a/doc/models/invoice-pre-payment.md +++ b/doc/models/invoice-pre-payment.md @@ -13,13 +13,15 @@ | `amountInCents` | `bigint \| undefined` | Optional | The amount in cents of the prepayment that was created as a result of this payment. | | `endingBalanceInCents` | `bigint \| undefined` | Optional | The total balance of the prepayment account for this subscription including any prior prepayments | -## Example (as JSON) - -```json -{ - "subscription_id": 180, - "amount_in_cents": 100, - "ending_balance_in_cents": 60 -} +## Example + +```ts +import { InvoicePrePayment } from '@maxio-com/advanced-billing-sdk'; + +const invoicePrePayment: InvoicePrePayment = { + subscriptionId: 252, + amountInCents: BigInt(28), + endingBalanceInCents: BigInt(244), +}; ``` diff --git a/doc/models/invoice-previous-balance.md b/doc/models/invoice-previous-balance.md index ab13ae66..a0396b8e 100644 --- a/doc/models/invoice-previous-balance.md +++ b/doc/models/invoice-previous-balance.md @@ -12,18 +12,30 @@ | `capturedAt` | `string \| undefined` | Optional | - | | `invoices` | [`InvoiceBalanceItem[] \| undefined`](../../doc/models/invoice-balance-item.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "captured_at": "2016-03-13T12:52:32.123Z", - "invoices": [ +```ts +import { InvoicePreviousBalance } from '@maxio-com/advanced-billing-sdk'; + +const invoicePreviousBalance: InvoicePreviousBalance = { + capturedAt: '2016-03-13T12:52:32.123Z', + invoices: [ + { + uid: 'uid6', + number: 'number6', + outstandingAmount: 'outstanding_amount8', + }, + { + uid: 'uid6', + number: 'number6', + outstandingAmount: 'outstanding_amount8', + }, { - "uid": "uid6", - "number": "number6", - "outstanding_amount": "outstanding_amount8" + uid: 'uid6', + number: 'number6', + outstandingAmount: 'outstanding_amount8', } - ] -} + ], +}; ``` diff --git a/doc/models/invoice-refund.md b/doc/models/invoice-refund.md index 13ba1bd4..722809bc 100644 --- a/doc/models/invoice-refund.md +++ b/doc/models/invoice-refund.md @@ -19,15 +19,17 @@ | `gatewayHandle` | `string \| null \| undefined` | Optional | - | | `achLateReject` | `boolean \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 172, - "payment_id": 42, - "memo": "memo6", - "original_amount": "original_amount6", - "applied_amount": "applied_amount6" -} +## Example + +```ts +import { InvoiceRefund } from '@maxio-com/advanced-billing-sdk'; + +const invoiceRefund: InvoiceRefund = { + transactionId: 166, + paymentId: 36, + memo: 'memo6', + originalAmount: 'original_amount6', + appliedAmount: 'applied_amount6', +}; ``` diff --git a/doc/models/invoice-response.md b/doc/models/invoice-response.md index 1f4ba040..9b177b77 100644 --- a/doc/models/invoice-response.md +++ b/doc/models/invoice-response.md @@ -11,21 +11,23 @@ | --- | --- | --- | --- | | `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 - } -} +## Example + +```ts +import { InvoiceResponse } from '@maxio-com/advanced-billing-sdk'; + +const invoiceResponse: InvoiceResponse = { + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', + }, +}; ``` diff --git a/doc/models/invoice-role.md b/doc/models/invoice-role.md index 0fb77224..6ce8fcb8 100644 --- a/doc/models/invoice-role.md +++ b/doc/models/invoice-role.md @@ -20,3 +20,11 @@ | `Backport` | | `Backportbalancereconciliation` | +## Example + +```ts +import { InvoiceRole } from '@maxio-com/advanced-billing-sdk'; + +const invoiceRole = InvoiceRole.Renewal; +``` + diff --git a/doc/models/invoice-seller.md b/doc/models/invoice-seller.md index 297071ed..d0af1869 100644 --- a/doc/models/invoice-seller.md +++ b/doc/models/invoice-seller.md @@ -16,20 +16,22 @@ Information about the seller (merchant) listed on the masthead of the invoice. | `phone` | `string \| undefined` | Optional | - | | `logoUrl` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name0", - "address": { - "street": "street6", - "line2": "line20", - "city": "city6", - "state": "state2", - "zip": "zip0" +## Example + +```ts +import { InvoiceSeller } from '@maxio-com/advanced-billing-sdk'; + +const invoiceSeller: InvoiceSeller = { + name: 'name4', + address: { + street: 'street6', + line2: 'line20', + city: 'city6', + state: 'state2', + zip: 'zip0', }, - "phone": "phone0", - "logo_url": "logo_url0" -} + phone: 'phone6', + logoUrl: 'logo_url6', +}; ``` diff --git a/doc/models/invoice-sort-field.md b/doc/models/invoice-sort-field.md index 030ebb64..91ebabe8 100644 --- a/doc/models/invoice-sort-field.md +++ b/doc/models/invoice-sort-field.md @@ -20,7 +20,9 @@ ## Example -``` -total_amount +```ts +import { InvoiceSortField } from '@maxio-com/advanced-billing-sdk'; + +const invoiceSortField = InvoiceSortField.UpdatedAt; ``` diff --git a/doc/models/invoice-status.md b/doc/models/invoice-status.md index 43da5bc4..5a4aacf8 100644 --- a/doc/models/invoice-status.md +++ b/doc/models/invoice-status.md @@ -19,3 +19,11 @@ The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk. | `Canceled` | | `Processing` | +## Example + +```ts +import { InvoiceStatus } from '@maxio-com/advanced-billing-sdk'; + +const invoiceStatus = InvoiceStatus.Paid; +``` + diff --git a/doc/models/invoice-tax-breakout.md b/doc/models/invoice-tax-breakout.md index 34c5c17d..e1a3dd10 100644 --- a/doc/models/invoice-tax-breakout.md +++ b/doc/models/invoice-tax-breakout.md @@ -14,14 +14,16 @@ | `taxAmount` | `string \| undefined` | Optional | - | | `taxExemptAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "taxable_amount": "taxable_amount6", - "tax_amount": "tax_amount6", - "tax_exempt_amount": "tax_exempt_amount2" -} +## Example + +```ts +import { InvoiceTaxBreakout } from '@maxio-com/advanced-billing-sdk'; + +const invoiceTaxBreakout: InvoiceTaxBreakout = { + uid: 'uid4', + taxableAmount: 'taxable_amount8', + taxAmount: 'tax_amount2', + taxExemptAmount: 'tax_exempt_amount4', +}; ``` diff --git a/doc/models/invoice-tax-component-breakout.md b/doc/models/invoice-tax-component-breakout.md index 3624509a..cc7acdf9 100644 --- a/doc/models/invoice-tax-component-breakout.md +++ b/doc/models/invoice-tax-component-breakout.md @@ -24,15 +24,17 @@ | `stateAssignedNo` | `string \| undefined` | Optional | - | | `taxSubType` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "tax_rule_id": 226, - "percentage": "percentage0", - "country_code": "country_code8", - "subdivision_code": "subdivision_code6", - "tax_amount": "tax_amount4" -} +## Example + +```ts +import { InvoiceTaxComponentBreakout } from '@maxio-com/advanced-billing-sdk'; + +const invoiceTaxComponentBreakout: InvoiceTaxComponentBreakout = { + taxRuleId: 66, + percentage: 'percentage0', + countryCode: 'country_code2', + subdivisionCode: 'subdivision_code6', + taxAmount: 'tax_amount4', +}; ``` diff --git a/doc/models/invoice-tax.md b/doc/models/invoice-tax.md index 9ba63956..70551328 100644 --- a/doc/models/invoice-tax.md +++ b/doc/models/invoice-tax.md @@ -24,15 +24,20 @@ | `type` | `string \| undefined` | Optional | - | | `taxExemptAmount` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title6", - "description": "description2", - "source_type": "Tax", - "source_id": 164 -} +## Example + +```ts +import { + InvoiceTax, + ProformaInvoiceTaxSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const invoiceTax: InvoiceTax = { + uid: 'uid2', + title: 'title8', + description: 'description2', + sourceType: ProformaInvoiceTaxSourceType.Tax, + sourceId: 86, +}; ``` diff --git a/doc/models/invoice.md b/doc/models/invoice.md index e987764e..f1c11e3e 100644 --- a/doc/models/invoice.md +++ b/doc/models/invoice.md @@ -15,11 +15,11 @@ | `customerId` | `number \| undefined` | Optional | ID of the customer to which the invoice belongs. | | `subscriptionId` | `number \| undefined` | Optional | ID of the subscription that generated the invoice. | | `number` | `string \| undefined` | Optional | A unique, identifying string that appears on the invoice and in places the invoice is referenced.

While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. | -| `sequenceNumber` | `number \| undefined` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | +| `sequenceNumber` | `number \| undefined` | Optional | A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. | | `transactionTime` | `string \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | | `updatedAt` | `string \| undefined` | Optional | - | -| `issueDate` | `string \| undefined` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | +| `issueDate` | `string \| undefined` | Optional | Date the invoice was issued to the customer. This is the date that the invoice was made available for payment.

The format is `"YYYY-MM-DD"`. | | `dueDate` | `string \| undefined` | Optional | Date the invoice is due.

The format is `"YYYY-MM-DD"`. | | `paidDate` | `string \| null \| undefined` | Optional | Date the invoice became fully paid.

If partial payments are applied to the invoice, this date will not be present until payment has been made in full.

The format is `"YYYY-MM-DD"`. | | `status` | [`InvoiceStatus \| undefined`](../../doc/models/invoice-status.md) | Optional | The current status of the invoice. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | @@ -28,7 +28,7 @@ | `collectionMethod` | [`CollectionMethod \| undefined`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `paymentInstructions` | `string \| undefined` | Optional | A message that is printed on the invoice when it is marked for remittance collection. It is intended to describe to the customer how they may make payment, and is configured by the merchant. | | `currency` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | -| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `parentInvoiceUid` | `string \| null \| undefined` | Optional | For invoices with `consolidation_level` of `child`, this specifies the UID of the parent (consolidated) invoice. | | `subscriptionGroupId` | `number \| null \| undefined` | Optional | - | | `parentInvoiceNumber` | `number \| null \| undefined` | Optional | For invoices with `consolidation_level` of `child`, this specifies the number of the parent (consolidated) invoice. | @@ -36,17 +36,17 @@ | `productName` | `string \| undefined` | Optional | The name of the product subscribed when the invoice was generated. | | `productFamilyName` | `string \| undefined` | Optional | The name of the product family subscribed when the invoice was generated. | | `seller` | [`InvoiceSeller \| undefined`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `payer` | [`InvoicePayer \| undefined`](../../doc/models/invoice-payer.md) | Optional | - | | `recipientEmails` | `string[] \| undefined` | Optional | **Constraints**: *Maximum Items*: `5` | | `netTerms` | `number \| undefined` | Optional | - | -| `memo` | `string \| undefined` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | +| `memo` | `string \| undefined` | Optional | The memo printed on invoices of any collection type. This message is in control of the merchant. | | `billingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The invoice billing address. | | `shippingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | The invoice shipping address. | | `subtotalAmount` | `string \| undefined` | Optional | Subtotal of the invoice, which is the sum of all line items before discounts or taxes. | | `discountAmount` | `string \| undefined` | Optional | Total discount applied to the invoice. | | `taxAmount` | `string \| undefined` | Optional | Total tax on the invoice. | -| `totalAmount` | `string \| undefined` | Optional | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | +| `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 | - | @@ -65,20 +65,23 @@ | `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"`. | +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme associated with this invoice. This value represents the Branding Theme used for invoice theming, such as themed invoice rendering. Available only when Branding Themes are enabled for the site. | -## Example (as JSON) +## Example -```json -{ - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 252, - "uid": "uid0", - "site_id": 178, - "customer_id": 34, - "subscription_id": 106 -} +```ts +import { Invoice } from '@maxio-com/advanced-billing-sdk'; + +const invoice: Invoice = { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', +}; ``` diff --git a/doc/models/issue-advance-invoice-request.md b/doc/models/issue-advance-invoice-request.md index 48b6bc22..6096b9d1 100644 --- a/doc/models/issue-advance-invoice-request.md +++ b/doc/models/issue-advance-invoice-request.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `force` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "force": false -} +```ts +import { IssueAdvanceInvoiceRequest } from '@maxio-com/advanced-billing-sdk'; + +const issueAdvanceInvoiceRequest: IssueAdvanceInvoiceRequest = { + force: false, +}; ``` diff --git a/doc/models/issue-invoice-event-data.md b/doc/models/issue-invoice-event-data.md index 6d22fcb7..34e56bc5 100644 --- a/doc/models/issue-invoice-event-data.md +++ b/doc/models/issue-invoice-event-data.md @@ -11,21 +11,27 @@ Example schema for an `issue_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `consolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidationLevel` | [`InvoiceConsolidationLevel`](../../doc/models/invoice-consolidation-level.md) | Required | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `fromStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice before event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `toStatus` | [`InvoiceStatus`](../../doc/models/invoice-status.md) | Required | The status of the invoice after event occurrence. See [Invoice Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanced-Billing-Invoices-Overview#invoice-statuses) for more. | | `dueAmount` | `string` | Required | Amount due on the invoice, which is `total_amount - credit_amount - paid_amount`. | | `totalAmount` | `string` | Required | The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' | -## Example (as JSON) - -```json -{ - "consolidation_level": "none", - "from_status": "voided", - "to_status": "draft", - "due_amount": "due_amount6", - "total_amount": "total_amount0" -} +## Example + +```ts +import { + InvoiceConsolidationLevel, + InvoiceStatus, + IssueInvoiceEventData, +} from '@maxio-com/advanced-billing-sdk'; + +const issueInvoiceEventData: IssueInvoiceEventData = { + consolidationLevel: InvoiceConsolidationLevel.Child, + fromStatus: InvoiceStatus.Draft, + toStatus: InvoiceStatus.Voided, + dueAmount: 'due_amount6', + totalAmount: 'total_amount0', +}; ``` diff --git a/doc/models/issue-invoice-event.md b/doc/models/issue-invoice-event.md index 9c175e08..3500a1c8 100644 --- a/doc/models/issue-invoice-event.md +++ b/doc/models/issue-invoice-event.md @@ -15,31 +15,38 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.IssueInvoice` | | `eventData` | [`IssueInvoiceEventData`](../../doc/models/issue-invoice-event-data.md) | Required | Example schema for an `issue_invoice` event | -## Example (as JSON) - -```json -{ - "id": 130, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + InvoiceConsolidationLevel, + InvoiceEventType, + InvoiceStatus, + IssueInvoiceEvent, +} from '@maxio-com/advanced-billing-sdk'; + +const issueInvoiceEvent: IssueInvoiceEvent = { + id: BigInt(144), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "issue_invoice", - "event_data": { - "consolidation_level": "child", - "from_status": "open", - "to_status": "pending", - "due_amount": "due_amount8", - "total_amount": "total_amount2" - } -} + eventType: InvoiceEventType.IssueInvoice, + eventData: { + consolidationLevel: InvoiceConsolidationLevel.Child, + fromStatus: InvoiceStatus.Open, + toStatus: InvoiceStatus.Pending, + dueAmount: 'due_amount8', + totalAmount: 'total_amount2', + }, +}; ``` diff --git a/doc/models/issue-invoice-request.md b/doc/models/issue-invoice-request.md index e08017f8..1e0a1c52 100644 --- a/doc/models/issue-invoice-request.md +++ b/doc/models/issue-invoice-request.md @@ -9,13 +9,18 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `onFailedPayment` | [`FailedPaymentAction \| undefined`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to 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. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `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).

**Default**: `FailedPaymentAction.LeaveOpenInvoice` | +| `onFailedPayment` | [`FailedPaymentAction \| undefined`](../../doc/models/failed-payment-action.md) | Optional | Action taken when payment for an invoice fails:

- `leave_open_invoice` - prepayments and credits applied to 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. This is the default option.
- `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history.
- `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).

**Default**: `FailedPaymentAction.LeaveOpenInvoice` | -## Example (as JSON) +## Example -```json -{ - "on_failed_payment": "leave_open_invoice" -} +```ts +import { + FailedPaymentAction, + IssueInvoiceRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const issueInvoiceRequest: IssueInvoiceRequest = { + onFailedPayment: FailedPaymentAction.LeaveOpenInvoice, +}; ``` diff --git a/doc/models/issue-service-credit-request.md b/doc/models/issue-service-credit-request.md index dc3d56bb..bd91bda9 100644 --- a/doc/models/issue-service-credit-request.md +++ b/doc/models/issue-service-credit-request.md @@ -11,14 +11,16 @@ | --- | --- | --- | --- | | `serviceCredit` | [`IssueServiceCredit`](../../doc/models/issue-service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "amount": 31.42, - "memo": "memo0" - } -} +## Example + +```ts +import { IssueServiceCreditRequest } from '@maxio-com/advanced-billing-sdk'; + +const issueServiceCreditRequest: IssueServiceCreditRequest = { + serviceCredit: { + amount: 31.42, + memo: 'memo0', + }, +}; ``` diff --git a/doc/models/issue-service-credit.md b/doc/models/issue-service-credit.md index 97bef18f..40846099 100644 --- a/doc/models/issue-service-credit.md +++ b/doc/models/issue-service-credit.md @@ -12,12 +12,14 @@ | `amount` | [`IssueServiceCreditAmount`](../../doc/models/containers/issue-service-credit-amount.md) | Required | This is a container for one-of cases. | | `memo` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "amount": 5.82, - "memo": "memo4" -} +```ts +import { IssueServiceCredit } from '@maxio-com/advanced-billing-sdk'; + +const issueServiceCredit: IssueServiceCredit = { + amount: 44.88, + memo: 'memo6', +}; ``` diff --git a/doc/models/item-category.md b/doc/models/item-category.md index 3d882ad3..4314590a 100644 --- a/doc/models/item-category.md +++ b/doc/models/item-category.md @@ -19,7 +19,9 @@ One of the following: Business Software, Consumer Software, Digital Services, Ph ## Example -``` -Business Software +```ts +import { ItemCategory } from '@maxio-com/advanced-billing-sdk'; + +const itemCategory = ItemCategory.Other; ``` diff --git a/doc/models/item-price-point-changed.md b/doc/models/item-price-point-changed.md index ddaf1d30..7fdfd2e9 100644 --- a/doc/models/item-price-point-changed.md +++ b/doc/models/item-price-point-changed.md @@ -16,24 +16,26 @@ | `previousPricePoint` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | | `currentPricePoint` | [`ItemPricePointData`](../../doc/models/item-price-point-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "item_id": 66, - "item_type": "item_type6", - "item_handle": "item_handle4", - "item_name": "item_name8", - "previous_price_point": { - "id": 216, - "handle": "handle6", - "name": "name0" +## Example + +```ts +import { ItemPricePointChanged } from '@maxio-com/advanced-billing-sdk'; + +const itemPricePointChanged: ItemPricePointChanged = { + itemId: 30, + itemType: 'item_type6', + itemHandle: 'item_handle4', + itemName: 'item_name8', + previousPricePoint: { + id: 216, + handle: 'handle6', + name: 'name0', }, - "current_price_point": { - "id": 218, - "handle": "handle6", - "name": "name0" - } -} + currentPricePoint: { + id: 218, + handle: 'handle6', + name: 'name0', + }, +}; ``` diff --git a/doc/models/item-price-point-data.md b/doc/models/item-price-point-data.md index f1c42922..1417a0aa 100644 --- a/doc/models/item-price-point-data.md +++ b/doc/models/item-price-point-data.md @@ -13,13 +13,15 @@ | `handle` | `string \| undefined` | Optional | - | | `name` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 192, - "handle": "handle6", - "name": "name0" -} +## Example + +```ts +import { ItemPricePointData } from '@maxio-com/advanced-billing-sdk'; + +const itemPricePointData: ItemPricePointData = { + id: 80, + handle: 'handle8', + name: 'name2', +}; ``` diff --git a/doc/models/line-item-kind.md b/doc/models/line-item-kind.md index 3e5e5d1d..d0de4962 100644 --- a/doc/models/line-item-kind.md +++ b/doc/models/line-item-kind.md @@ -22,3 +22,11 @@ A handle for the line item kind | `Coupon` | | `Tax` | +## Example + +```ts +import { LineItemKind } from '@maxio-com/advanced-billing-sdk'; + +const lineItemKind = LineItemKind.PrepaidUsageComponent; +``` + diff --git a/doc/models/line-item-transaction-type.md b/doc/models/line-item-transaction-type.md index 64e30b89..9e346d93 100644 --- a/doc/models/line-item-transaction-type.md +++ b/doc/models/line-item-transaction-type.md @@ -19,3 +19,11 @@ A handle for the line item transaction type | `InfoTransaction` | | `PaymentAuthorization` | +## Example + +```ts +import { LineItemTransactionType } from '@maxio-com/advanced-billing-sdk'; + +const lineItemTransactionType = LineItemTransactionType.Payment; +``` + diff --git a/doc/models/list-components-filter.md b/doc/models/list-components-filter.md index 659bd1f6..977515ea 100644 --- a/doc/models/list-components-filter.md +++ b/doc/models/list-components-filter.md @@ -12,16 +12,18 @@ | `ids` | `number[] \| undefined` | Optional | Allows fetching components with matching id based on provided value. Use in query `filter[ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Allows fetching components with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "ids": [ +```ts +import { ListComponentsFilter } from '@maxio-com/advanced-billing-sdk'; + +const listComponentsFilter: ListComponentsFilter = { + ids: [ 1, 2, 3 ], - "use_site_exchange_rate": false -} + useSiteExchangeRate: false, +}; ``` diff --git a/doc/models/list-components-price-points-include.md b/doc/models/list-components-price-points-include.md index 78039a91..23fe8c23 100644 --- a/doc/models/list-components-price-points-include.md +++ b/doc/models/list-components-price-points-include.md @@ -13,7 +13,11 @@ ## Example -``` -currency_prices +```ts +import { + ListComponentsPricePointsInclude, +} from '@maxio-com/advanced-billing-sdk'; + +const listComponentsPricePointsInclude = ListComponentsPricePointsInclude.CurrencyPrices; ``` diff --git a/doc/models/list-components-price-points-response.md b/doc/models/list-components-price-points-response.md index e93ec7a2..96e181d0 100644 --- a/doc/models/list-components-price-points-response.md +++ b/doc/models/list-components-price-points-response.md @@ -11,19 +11,25 @@ | --- | --- | --- | --- | | `pricePoints` | [`ComponentPricePoint[]`](../../doc/models/component-price-point.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "price_points": [ +```ts +import { + ListComponentsPricePointsResponse, + PricePointType, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const listComponentsPricePointsResponse: ListComponentsPricePointsResponse = { + pricePoints: [ { - "id": 40, - "type": "default", - "default": false, - "name": "name2", - "pricing_scheme": "per_unit" + id: 40, + type: PricePointType.Default, + mDefault: false, + name: 'name2', + pricingScheme: PricingScheme.PerUnit, } - ] -} + ], +}; ``` diff --git a/doc/models/list-coupons-filter.md b/doc/models/list-coupons-filter.md index cd4a23df..aac86ef8 100644 --- a/doc/models/list-coupons-filter.md +++ b/doc/models/list-coupons-filter.md @@ -19,24 +19,29 @@ | `useSiteExchangeRate` | `boolean \| undefined` | Optional | If true, restricts the list to coupons whose pricing is recalculated from the site’s current exchange rates, so their currency_prices array contains on-the-fly conversions rather than stored price records. If false, restricts the list to coupons that have manually defined amounts for each currency, ensuring the response includes the saved currency_prices entries instead of exchange-rate-derived values. Use in query `filter[use_site_exchange_rate]=true`. | | `includeArchived` | `boolean \| undefined` | Optional | Controls returning archived coupons. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "ids": [ +## Example + +```ts +import { + BasicDateField, + ListCouponsFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const listCouponsFilter: ListCouponsFilter = { + dateField: BasicDateField.UpdatedAt, + startDate: '2011-12-17', + endDate: '2011-12-15', + startDatetime: '2011-12-19T09:15:30+00:00', + endDatetime: '2019-06-07T17:20:06Z', + ids: [ 1, 2, 3 ], - "codes": [ - "free", - "free_trial" + codes: [ + 'free', + 'free_trial' ], - "date_field": "updated_at" -} +}; ``` diff --git a/doc/models/list-credit-notes-response.md b/doc/models/list-credit-notes-response.md index 3e8dd3ef..ae4f6b57 100644 --- a/doc/models/list-credit-notes-response.md +++ b/doc/models/list-credit-notes-response.md @@ -11,19 +11,21 @@ | --- | --- | --- | --- | | `creditNotes` | [`CreditNote[]`](../../doc/models/credit-note.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "credit_notes": [ +```ts +import { ListCreditNotesResponse } from '@maxio-com/advanced-billing-sdk'; + +const listCreditNotesResponse: ListCreditNotesResponse = { + creditNotes: [ { - "uid": "uid2", - "site_id": 112, - "customer_id": 224, - "subscription_id": 40, - "number": "number0" + uid: 'uid2', + siteId: 112, + customerId: 224, + subscriptionId: 40, + number: 'number0', } - ] -} + ], +}; ``` diff --git a/doc/models/list-events-date-field.md b/doc/models/list-events-date-field.md index d6364419..205f9b79 100644 --- a/doc/models/list-events-date-field.md +++ b/doc/models/list-events-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -created_at +```ts +import { ListEventsDateField } from '@maxio-com/advanced-billing-sdk'; + +const listEventsDateField = ListEventsDateField.CreatedAt; ``` diff --git a/doc/models/list-invoice-events-response.md b/doc/models/list-invoice-events-response.md index 0f307369..c8ecbb00 100644 --- a/doc/models/list-invoice-events-response.md +++ b/doc/models/list-invoice-events-response.md @@ -14,52 +14,131 @@ | `perPage` | `number \| undefined` | Optional | - | | `totalPages` | `number \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "events": [ +```ts +import { + InvoiceEventType, + ListInvoiceEventsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listInvoiceEventsResponse: ListInvoiceEventsResponse = { + events: [ + { + id: BigInt(214), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + }, + eventType: InvoiceEventType.ApplyCreditNote, + eventData: { + uid: 'uid6', + creditNoteNumber: 'credit_note_number0', + creditNoteUid: 'credit_note_uid0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo0', + role: 'role0', + consolidatedInvoice: false, + appliedCreditNotes: [ + { + uid: 'uid4', + number: 'number8', + }, + { + uid: 'uid4', + number: 'number8', + }, + { + uid: 'uid4', + number: 'number8', + } + ], + }, + }, { - "event_type": "apply_credit_note", - "id": 214, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 + id: BigInt(214), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, }, - "event_data": { - "uid": "uid6", - "credit_note_number": "credit_note_number0", - "credit_note_uid": "credit_note_uid0", - "original_amount": "original_amount0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "memo": "memo0", - "role": "role0", - "consolidated_invoice": false, - "applied_credit_notes": [ + eventType: InvoiceEventType.ApplyCreditNote, + eventData: { + uid: 'uid6', + creditNoteNumber: 'credit_note_number0', + creditNoteUid: 'credit_note_uid0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo0', + role: 'role0', + consolidatedInvoice: false, + appliedCreditNotes: [ { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', }, { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', }, { - "uid": "uid4", - "number": "number8" + uid: 'uid4', + number: 'number8', } - ] - } + ], + }, + }, + { + id: BigInt(214), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + }, + eventType: InvoiceEventType.ApplyCreditNote, + eventData: { + uid: 'uid6', + creditNoteNumber: 'credit_note_number0', + creditNoteUid: 'credit_note_uid0', + originalAmount: 'original_amount0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + memo: 'memo0', + role: 'role0', + consolidatedInvoice: false, + appliedCreditNotes: [ + { + uid: 'uid4', + number: 'number8', + }, + { + uid: 'uid4', + number: 'number8', + }, + { + uid: 'uid4', + number: 'number8', + } + ], + }, } ], - "page": 184, - "per_page": 96, - "total_pages": 194 -} + page: 28, + perPage: 196, + totalPages: 94, +}; ``` diff --git a/doc/models/list-invoices-response.md b/doc/models/list-invoices-response.md index 55ca4b8f..86d2ec6b 100644 --- a/doc/models/list-invoices-response.md +++ b/doc/models/list-invoices-response.md @@ -11,23 +11,25 @@ | --- | --- | --- | --- | | `invoices` | [`Invoice[]`](../../doc/models/invoice.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "invoices": [ +```ts +import { ListInvoicesResponse } from '@maxio-com/advanced-billing-sdk'; + +const listInvoicesResponse: ListInvoicesResponse = { + invoices: [ { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 196, - "uid": "uid6", - "site_id": 122, - "customer_id": 234, - "subscription_id": 50 + id: BigInt(196), + uid: 'uid6', + siteId: 122, + customerId: 234, + subscriptionId: 50, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', } - ] -} + ], +}; ``` diff --git a/doc/models/list-metafields-response.md b/doc/models/list-metafields-response.md index dbe5b1ed..7a345b28 100644 --- a/doc/models/list-metafields-response.md +++ b/doc/models/list-metafields-response.md @@ -15,29 +15,61 @@ | `perPage` | `number \| undefined` | Optional | - | | `metafields` | [`Metafield[] \| undefined`](../../doc/models/metafield.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 210, - "current_page": 186, - "total_pages": 198, - "per_page": 92, - "metafields": [ +## Example + +```ts +import { + IncludeOption, + ListMetafieldsResponse, + MetafieldInput, +} from '@maxio-com/advanced-billing-sdk'; + +const listMetafieldsResponse: ListMetafieldsResponse = { + totalCount: 228, + currentPage: 204, + totalPages: 216, + perPage: 74, + metafields: [ + { + id: 22, + name: 'name2', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, + }, + dataCount: 10, + inputType: MetafieldInput.BalanceTracker, + }, + { + id: 22, + name: 'name2', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, + }, + dataCount: 10, + inputType: MetafieldInput.BalanceTracker, + }, { - "id": 22, - "name": "name2", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" + id: 22, + name: 'name2', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, }, - "data_count": 10, - "input_type": "balance_tracker" + dataCount: 10, + inputType: MetafieldInput.BalanceTracker, } - ] -} + ], +}; ``` diff --git a/doc/models/list-mrr-filter.md b/doc/models/list-mrr-filter.md index 3be79d30..693e7fc6 100644 --- a/doc/models/list-mrr-filter.md +++ b/doc/models/list-mrr-filter.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `subscriptionIds` | `number[] \| undefined` | Optional | Submit ids in order to limit results. Use in query: `filter[subscription_ids]=1,2,3`.

**Constraints**: *Minimum Items*: `1` | -## Example (as JSON) +## Example -```json -{ - "subscription_ids": [ +```ts +import { ListMrrFilter } from '@maxio-com/advanced-billing-sdk'; + +const listMrrFilter: ListMrrFilter = { + subscriptionIds: [ 1, 2, 3 - ] -} + ], +}; ``` diff --git a/doc/models/list-mrr-response-result.md b/doc/models/list-mrr-response-result.md index 0d81f3f4..45b9db04 100644 --- a/doc/models/list-mrr-response-result.md +++ b/doc/models/list-mrr-response-result.md @@ -17,15 +17,17 @@ | `currencySymbol` | `string \| undefined` | Optional | - | | `movements` | [`Movement[] \| undefined`](../../doc/models/movement.md) | Optional | - | -## Example (as JSON) - -```json -{ - "page": 150, - "per_page": 238, - "total_pages": 16, - "total_entries": 112, - "currency": "currency8" -} +## Example + +```ts +import { ListMRRResponseResult } from '@maxio-com/advanced-billing-sdk'; + +const listMRRResponseResult: ListMRRResponseResult = { + page: 40, + perPage: 208, + totalPages: 82, + totalEntries: 78, + currency: 'currency6', +}; ``` diff --git a/doc/models/list-mrr-response.md b/doc/models/list-mrr-response.md index dc0cbd64..826e2ba8 100644 --- a/doc/models/list-mrr-response.md +++ b/doc/models/list-mrr-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `mrr` | [`ListMRRResponseResult`](../../doc/models/list-mrr-response-result.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "page": 30, - "per_page": 198, - "total_pages": 92, - "total_entries": 188, - "currency": "currency4" - } -} +## Example + +```ts +import { ListMRRResponse } from '@maxio-com/advanced-billing-sdk'; + +const listMRRResponse: ListMRRResponse = { + mrr: { + page: 30, + perPage: 198, + totalPages: 92, + totalEntries: 188, + currency: 'currency4', + }, +}; ``` diff --git a/doc/models/list-offers-response.md b/doc/models/list-offers-response.md index fc0c3048..965b3bf3 100644 --- a/doc/models/list-offers-response.md +++ b/doc/models/list-offers-response.md @@ -11,33 +11,21 @@ | --- | --- | --- | --- | | `offers` | [`Offer[] \| undefined`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "offers": [ - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, - { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 - }, +```ts +import { ListOffersResponse } from '@maxio-com/advanced-billing-sdk'; + +const listOffersResponse: ListOffersResponse = { + offers: [ { - "id": 12, - "site_id": 194, - "product_family_id": 16, - "product_id": 210, - "product_price_point_id": 134 + id: 12, + siteId: 194, + productFamilyId: 16, + productId: 210, + productPricePointId: 134, } - ] -} + ], +}; ``` diff --git a/doc/models/list-prepayment-date-field.md b/doc/models/list-prepayment-date-field.md index a143aa4d..83d918ea 100644 --- a/doc/models/list-prepayment-date-field.md +++ b/doc/models/list-prepayment-date-field.md @@ -14,7 +14,9 @@ ## Example -``` -created_at +```ts +import { ListPrepaymentDateField } from '@maxio-com/advanced-billing-sdk'; + +const listPrepaymentDateField = ListPrepaymentDateField.CreatedAt; ``` diff --git a/doc/models/list-prepayments-filter.md b/doc/models/list-prepayments-filter.md index fccad640..409f8ced 100644 --- a/doc/models/list-prepayments-filter.md +++ b/doc/models/list-prepayments-filter.md @@ -13,13 +13,18 @@ | `startDate` | `string \| undefined` | Optional | The start date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp at or after midnight (12:00:00 AM) in your site's time zone on the date specified. Use in query: `filter[start_date]=2011-12-15`. | | `endDate` | `string \| undefined` | Optional | The end date (format YYYY-MM-DD) with which to filter the date_field. Returns prepayments with a timestamp up to and including 11:59:59PM in your site's time zone on the date specified. Use in query: `filter[end_date]=2011-12-15`. | -## Example (as JSON) - -```json -{ - "date_field": "created_at", - "start_date": "2024-01-01", - "end_date": "2024-01-31" -} +## Example + +```ts +import { + ListPrepaymentDateField, + ListPrepaymentsFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const listPrepaymentsFilter: ListPrepaymentsFilter = { + dateField: ListPrepaymentDateField.CreatedAt, + startDate: '2024-01-01', + endDate: '2024-01-31', +}; ``` diff --git a/doc/models/list-price-points-filter.md b/doc/models/list-price-points-filter.md index 88d79200..0499ee99 100644 --- a/doc/models/list-price-points-filter.md +++ b/doc/models/list-price-points-filter.md @@ -18,25 +18,31 @@ | `ids` | `number[] \| undefined` | Optional | Allows fetching price points with matching id based on provided values. Use in query: `filter[ids]=1,2,3`. | | `archivedAt` | [`IncludeNullOrNotNull \| undefined`](../../doc/models/include-null-or-not-null.md) | Optional | Allows fetching price points only if archived_at is present or not. Use in query: `filter[archived_at]=not_null`. | -## Example (as JSON) - -```json -{ - "start_date": "2011-12-17", - "end_date": "2011-12-15", - "start_datetime": "12/19/2011 09:15:30", - "end_datetime": "06/07/2019 17:20:06", - "type": [ - "catalog", - "default", - "custom" +## Example + +```ts +import { + BasicDateField, + ListPricePointsFilter, + PricePointType, +} from '@maxio-com/advanced-billing-sdk'; + +const listPricePointsFilter: ListPricePointsFilter = { + dateField: BasicDateField.UpdatedAt, + startDate: '2011-12-17', + endDate: '2011-12-15', + startDatetime: '2011-12-19T09:15:30+00:00', + endDatetime: '2019-06-07T17:20:06Z', + type: [ + PricePointType.Catalog, + PricePointType.Default, + PricePointType.Custom ], - "ids": [ + ids: [ 1, 2, 3 ], - "date_field": "updated_at" -} +}; ``` diff --git a/doc/models/list-product-price-points-response.md b/doc/models/list-product-price-points-response.md index 01bff861..3f433650 100644 --- a/doc/models/list-product-price-points-response.md +++ b/doc/models/list-product-price-points-response.md @@ -11,19 +11,23 @@ | --- | --- | --- | --- | | `pricePoints` | [`ProductPricePoint[]`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "price_points": [ +```ts +import { + ListProductPricePointsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listProductPricePointsResponse: ListProductPricePointsResponse = { + pricePoints: [ { - "id": 40, - "name": "name2", - "handle": "handle8", - "price_in_cents": 108, - "interval": 92 + id: 40, + name: 'name2', + handle: 'handle8', + priceInCents: BigInt(108), + interval: 92, } - ] -} + ], +}; ``` diff --git a/doc/models/list-products-filter.md b/doc/models/list-products-filter.md index 10f111aa..cf48e6a9 100644 --- a/doc/models/list-products-filter.md +++ b/doc/models/list-products-filter.md @@ -13,19 +13,21 @@ | `prepaidProductPricePoint` | [`PrepaidProductPricePointFilter \| undefined`](../../doc/models/prepaid-product-price-point-filter.md) | Optional | Allows fetching products only if a prepaid product price point is present or not. To use this filter you also have to include the following param in the request `include=prepaid_product_price_point`. Use in query `filter[prepaid_product_price_point][product_price_point_id]=not_null`. | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Allows fetching products with matching use_site_exchange_rate based on provided value (refers to default price point). Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "ids": [ +```ts +import { ListProductsFilter } from '@maxio-com/advanced-billing-sdk'; + +const listProductsFilter: ListProductsFilter = { + ids: [ 1, 2, 3 ], - "prepaid_product_price_point": { - "product_price_point_id": "product_price_point_id2" + prepaidProductPricePoint: { + productPricePointId: 'product_price_point_id2', }, - "use_site_exchange_rate": false -} + useSiteExchangeRate: false, +}; ``` diff --git a/doc/models/list-products-include.md b/doc/models/list-products-include.md index 9cfc57b4..cb7aad2e 100644 --- a/doc/models/list-products-include.md +++ b/doc/models/list-products-include.md @@ -13,7 +13,9 @@ ## Example -``` -prepaid_product_price_point +```ts +import { ListProductsInclude } from '@maxio-com/advanced-billing-sdk'; + +const listProductsInclude = ListProductsInclude.PrepaidProductPricePoint; ``` diff --git a/doc/models/list-products-price-points-include.md b/doc/models/list-products-price-points-include.md index 45aaf37f..81001d6e 100644 --- a/doc/models/list-products-price-points-include.md +++ b/doc/models/list-products-price-points-include.md @@ -13,7 +13,11 @@ ## Example -``` -currency_prices +```ts +import { + ListProductsPricePointsInclude, +} from '@maxio-com/advanced-billing-sdk'; + +const listProductsPricePointsInclude = ListProductsPricePointsInclude.CurrencyPrices; ``` diff --git a/doc/models/list-proforma-invoices-meta.md b/doc/models/list-proforma-invoices-meta.md index 555843ee..a9221a4e 100644 --- a/doc/models/list-proforma-invoices-meta.md +++ b/doc/models/list-proforma-invoices-meta.md @@ -14,14 +14,16 @@ | `totalPages` | `number \| undefined` | Optional | - | | `statusCode` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 226, - "current_page": 202, - "total_pages": 214, - "status_code": 244 -} +## Example + +```ts +import { ListProformaInvoicesMeta } from '@maxio-com/advanced-billing-sdk'; + +const listProformaInvoicesMeta: ListProformaInvoicesMeta = { + totalCount: 50, + currentPage: 26, + totalPages: 38, + statusCode: 68, +}; ``` diff --git a/doc/models/list-proforma-invoices-response.md b/doc/models/list-proforma-invoices-response.md index 2e41cfe3..6f8629c0 100644 --- a/doc/models/list-proforma-invoices-response.md +++ b/doc/models/list-proforma-invoices-response.md @@ -12,39 +12,43 @@ | `proformaInvoices` | [`ProformaInvoice[] \| undefined`](../../doc/models/proforma-invoice.md) | Optional | - | | `meta` | [`ListProformaInvoicesMeta \| undefined`](../../doc/models/list-proforma-invoices-meta.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "proforma_invoices": [ +```ts +import { + ListProformaInvoicesResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listProformaInvoicesResponse: ListProformaInvoicesResponse = { + proformaInvoices: [ { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 + uid: 'uid0', + siteId: 140, + customerId: 252, + subscriptionId: 68, + number: 56, }, { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 + uid: 'uid0', + siteId: 140, + customerId: 252, + subscriptionId: 68, + number: 56, }, { - "uid": "uid0", - "site_id": 140, - "customer_id": 252, - "subscription_id": 68, - "number": 56 + uid: 'uid0', + siteId: 140, + customerId: 252, + subscriptionId: 68, + number: 56, } ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "status_code": 168 - } -} + meta: { + totalCount: 150, + currentPage: 126, + totalPages: 138, + statusCode: 168, + }, +}; ``` diff --git a/doc/models/list-public-keys-meta.md b/doc/models/list-public-keys-meta.md index 8daa7e3c..cb9cf61e 100644 --- a/doc/models/list-public-keys-meta.md +++ b/doc/models/list-public-keys-meta.md @@ -14,14 +14,16 @@ | `totalPages` | `number \| undefined` | Optional | - | | `perPage` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 22, - "current_page": 254, - "total_pages": 10, - "per_page": 24 -} +## Example + +```ts +import { ListPublicKeysMeta } from '@maxio-com/advanced-billing-sdk'; + +const listPublicKeysMeta: ListPublicKeysMeta = { + totalCount: 232, + currentPage: 208, + totalPages: 220, + perPage: 70, +}; ``` diff --git a/doc/models/list-public-keys-response.md b/doc/models/list-public-keys-response.md index a3dbc151..f79e20d2 100644 --- a/doc/models/list-public-keys-response.md +++ b/doc/models/list-public-keys-response.md @@ -12,28 +12,25 @@ | `chargifyJsKeys` | [`PublicKey[] \| undefined`](../../doc/models/public-key.md) | Optional | - | | `meta` | [`ListPublicKeysMeta \| undefined`](../../doc/models/list-public-keys-meta.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "chargify_js_keys": [ - { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" - }, +```ts +import { ListPublicKeysResponse } from '@maxio-com/advanced-billing-sdk'; + +const listPublicKeysResponse: ListPublicKeysResponse = { + chargifyJsKeys: [ { - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" + publicKey: 'public_key8', + requiresSecurityToken: false, + createdAt: '2016-03-13T12:52:32.123Z', } ], - "meta": { - "total_count": 150, - "current_page": 126, - "total_pages": 138, - "per_page": 152 - } -} + meta: { + totalCount: 150, + currentPage: 126, + totalPages: 138, + perPage: 152, + }, +}; ``` diff --git a/doc/models/list-sale-rep-item.md b/doc/models/list-sale-rep-item.md index 051b63af..b630b98f 100644 --- a/doc/models/list-sale-rep-item.md +++ b/doc/models/list-sale-rep-item.md @@ -15,31 +15,33 @@ | `mrrData` | [`Record \| undefined`](../../doc/models/sale-rep-item-mrr.md) | Optional | - | | `testMode` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr_data": { - "november_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" +## Example + +```ts +import { ListSaleRepItem } from '@maxio-com/advanced-billing-sdk'; + +const listSaleRepItem: ListSaleRepItem = { + id: 54, + fullName: 'full_name2', + subscriptionsCount: 126, + mrrData: { + 'november_2019': { + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00', }, - "december_2019": { - "mrr": "$0.00", - "usage": "$0.00", - "recurring": "$0.00" + 'december_2019': { + mrr: '$0.00', + usage: '$0.00', + recurring: '$0.00', }, - "january_2020": { - "mrr": "$400.00", - "usage": "$0.00", - "recurring": "$400.00" + 'january_2020': { + mrr: '$400.00', + usage: '$0.00', + recurring: '$400.00', } }, - "id": 26, - "full_name": "full_name8", - "subscriptions_count": 154, - "test_mode": false -} + testMode: false, +}; ``` diff --git a/doc/models/list-segments-filter.md b/doc/models/list-segments-filter.md index 31313499..ae6cfa27 100644 --- a/doc/models/list-segments-filter.md +++ b/doc/models/list-segments-filter.md @@ -14,14 +14,16 @@ | `segmentProperty3Value` | `string \| undefined` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_3` on attached Metric. If empty string is passed, this filter would be rejected. | | `segmentProperty4Value` | `string \| undefined` | Optional | The value passed here would be used to filter segments. Pass a value related to `segment_property_4` on attached Metric. If empty string is passed, this filter would be rejected. | -## Example (as JSON) - -```json -{ - "segment_property_1_value": "EU", - "segment_property_2_value": "segment_property_2_value4", - "segment_property_3_value": "segment_property_3_value2", - "segment_property_4_value": "segment_property_4_value6" -} +## Example + +```ts +import { ListSegmentsFilter } from '@maxio-com/advanced-billing-sdk'; + +const listSegmentsFilter: ListSegmentsFilter = { + segmentProperty1Value: 'EU', + segmentProperty2Value: 'segment_property_2_value6', + segmentProperty3Value: 'segment_property_3_value6', + segmentProperty4Value: 'segment_property_4_value8', +}; ``` diff --git a/doc/models/list-segments-response.md b/doc/models/list-segments-response.md index 33875a78..ca8e55cc 100644 --- a/doc/models/list-segments-response.md +++ b/doc/models/list-segments-response.md @@ -11,19 +11,31 @@ | --- | --- | --- | --- | | `segments` | [`Segment[] \| undefined`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "segments": [ +```ts +import { + ListSegmentsResponse, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const listSegmentsResponse: ListSegmentsResponse = { + segments: [ + { + id: 50, + componentId: 160, + pricePointId: 184, + eventBasedBillingMetricId: 244, + pricingScheme: PricingScheme.Stairstep, + }, { - "id": 50, - "component_id": 160, - "price_point_id": 184, - "event_based_billing_metric_id": 244, - "pricing_scheme": "stairstep" + id: 50, + componentId: 160, + pricePointId: 184, + eventBasedBillingMetricId: 244, + pricingScheme: PricingScheme.Stairstep, } - ] -} + ], +}; ``` diff --git a/doc/models/list-service-credits-response.md b/doc/models/list-service-credits-response.md index b7dd7254..c2d4e889 100644 --- a/doc/models/list-service-credits-response.md +++ b/doc/models/list-service-credits-response.md @@ -11,26 +11,38 @@ | --- | --- | --- | --- | | `serviceCredits` | [`ServiceCredit1[] \| undefined`](../../doc/models/service-credit-1.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "service_credits": [ +```ts +import { + ListServiceCreditsResponse, + ServiceCreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const listServiceCreditsResponse: ListServiceCreditsResponse = { + serviceCredits: [ + { + id: 224, + amountInCents: BigInt(54), + endingBalanceInCents: BigInt(94), + entryType: ServiceCreditType.Credit, + memo: 'memo2', + }, { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" + id: 224, + amountInCents: BigInt(54), + endingBalanceInCents: BigInt(94), + entryType: ServiceCreditType.Credit, + memo: 'memo2', }, { - "id": 224, - "amount_in_cents": 54, - "ending_balance_in_cents": 94, - "entry_type": "Credit", - "memo": "memo2" + id: 224, + amountInCents: BigInt(54), + endingBalanceInCents: BigInt(94), + entryType: ServiceCreditType.Credit, + memo: 'memo2', } - ] -} + ], +}; ``` diff --git a/doc/models/list-subscription-components-filter.md b/doc/models/list-subscription-components-filter.md index 30383bce..39ac50aa 100644 --- a/doc/models/list-subscription-components-filter.md +++ b/doc/models/list-subscription-components-filter.md @@ -12,15 +12,19 @@ | `currencies` | `string[] \| undefined` | Optional | Allows fetching components allocation with matching currency based on provided values. Use in query `filter[currencies]=EUR,USD`.

**Constraints**: *Minimum Items*: `1` | | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | -## Example (as JSON) +## Example -```json -{ - "currencies": [ - "EUR", - "USD" +```ts +import { + ListSubscriptionComponentsFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionComponentsFilter: ListSubscriptionComponentsFilter = { + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false -} + useSiteExchangeRate: false, +}; ``` diff --git a/doc/models/list-subscription-components-for-site-filter.md b/doc/models/list-subscription-components-for-site-filter.md index 0c4fb592..3a94d10d 100644 --- a/doc/models/list-subscription-components-for-site-filter.md +++ b/doc/models/list-subscription-components-for-site-filter.md @@ -13,26 +13,32 @@ | `useSiteExchangeRate` | `boolean \| undefined` | Optional | Allows fetching components allocation with matching use_site_exchange_rate based on provided value. Use in query `filter[use_site_exchange_rate]=true`. | | `subscription` | [`SubscriptionFilter \| undefined`](../../doc/models/subscription-filter.md) | Optional | Nested filter used for List Subscription Components For Site Filter | -## Example (as JSON) - -```json -{ - "currencies": [ - "EUR", - "USD" +## Example + +```ts +import { + ListSubscriptionComponentsForSiteFilter, + SubscriptionListDateField, + SubscriptionStateFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionComponentsForSiteFilter: ListSubscriptionComponentsForSiteFilter = { + currencies: [ + 'EUR', + 'USD' ], - "use_site_exchange_rate": false, - "subscription": { - "states": [ - "active", - "canceled", - "expired" + useSiteExchangeRate: false, + subscription: { + states: [ + SubscriptionStateFilter.Trialing, + SubscriptionStateFilter.Unpaid, + SubscriptionStateFilter.Active ], - "date_field": "updated_at", - "start_date": "2016-03-13T12:52:32.123Z", - "end_date": "2016-03-13T12:52:32.123Z", - "start_datetime": "2016-03-13T12:52:32.123Z" - } -} + dateField: SubscriptionListDateField.UpdatedAt, + startDate: '2016-03-13T12:52:32.123Z', + endDate: '2016-03-13T12:52:32.123Z', + startDatetime: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/list-subscription-components-include.md b/doc/models/list-subscription-components-include.md index 2f68f49e..124a33f5 100644 --- a/doc/models/list-subscription-components-include.md +++ b/doc/models/list-subscription-components-include.md @@ -14,7 +14,11 @@ ## Example -``` -subscription +```ts +import { + ListSubscriptionComponentsInclude, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionComponentsInclude = ListSubscriptionComponentsInclude.Subscription; ``` diff --git a/doc/models/list-subscription-components-response.md b/doc/models/list-subscription-components-response.md index 34a74250..7dbfc750 100644 --- a/doc/models/list-subscription-components-response.md +++ b/doc/models/list-subscription-components-response.md @@ -11,19 +11,24 @@ | --- | --- | --- | --- | | `subscriptionsComponents` | [`SubscriptionComponent[]`](../../doc/models/subscription-component.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions_components": [ +```ts +import { + ComponentKind, + ListSubscriptionComponentsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionComponentsResponse: ListSubscriptionComponentsResponse = { + subscriptionsComponents: [ { - "id": 138, - "name": "name2", - "kind": "metered_component", - "unit_name": "unit_name4", - "enabled": false + id: 138, + name: 'name2', + kind: ComponentKind.MeteredComponent, + unitName: 'unit_name4', + enabled: false, } - ] -} + ], +}; ``` diff --git a/doc/models/list-subscription-components-sort.md b/doc/models/list-subscription-components-sort.md index d0d59aed..8505e054 100644 --- a/doc/models/list-subscription-components-sort.md +++ b/doc/models/list-subscription-components-sort.md @@ -14,7 +14,11 @@ ## Example -``` -updated_at +```ts +import { + ListSubscriptionComponentsSort, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionComponentsSort = ListSubscriptionComponentsSort.Id; ``` diff --git a/doc/models/list-subcription-group-prepayment-item.md b/doc/models/list-subscription-group-prepayment-item.md similarity index 60% rename from doc/models/list-subcription-group-prepayment-item.md rename to doc/models/list-subscription-group-prepayment-item.md index 9f92e51b..946e9b13 100644 --- a/doc/models/list-subcription-group-prepayment-item.md +++ b/doc/models/list-subscription-group-prepayment-item.md @@ -1,9 +1,9 @@ -# List Subcription Group Prepayment Item +# List Subscription Group Prepayment Item ## Structure -`ListSubcriptionGroupPrepaymentItem` +`ListSubscriptionGroupPrepaymentItem` ## Fields @@ -19,15 +19,19 @@ | `paymentType` | [`PrepaymentMethod \| undefined`](../../doc/models/prepayment-method.md) | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "id": 254, - "subscription_group_uid": "subscription_group_uid6", - "amount_in_cents": 172, - "remaining_amount_in_cents": 142, - "details": "details2" -} +```ts +import { + ListSubscriptionGroupPrepaymentItem, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupPrepaymentItem: ListSubscriptionGroupPrepaymentItem = { + id: 72, + subscriptionGroupUid: 'subscription_group_uid6', + amountInCents: BigInt(98), + remainingAmountInCents: BigInt(216), + details: 'details2', +}; ``` diff --git a/doc/models/list-subscription-group-prepayment-response.md b/doc/models/list-subscription-group-prepayment-response.md index 4e3e9434..fb763eee 100644 --- a/doc/models/list-subscription-group-prepayment-response.md +++ b/doc/models/list-subscription-group-prepayment-response.md @@ -11,21 +11,25 @@ | --- | --- | --- | --- | | `prepayments` | [`ListSubscriptionGroupPrepayment[]`](../../doc/models/list-subscription-group-prepayment.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "prepayments": [ +```ts +import { + ListSubscriptionGroupPrepaymentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupPrepaymentResponse: ListSubscriptionGroupPrepaymentResponse = { + prepayments: [ { - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } + prepayment: { + id: 38, + subscriptionGroupUid: 'subscription_group_uid2', + amountInCents: BigInt(124), + remainingAmountInCents: BigInt(182), + details: 'details8', + }, } - ] -} + ], +}; ``` diff --git a/doc/models/list-subscription-group-prepayment.md b/doc/models/list-subscription-group-prepayment.md index efcb4788..a8f4e4f0 100644 --- a/doc/models/list-subscription-group-prepayment.md +++ b/doc/models/list-subscription-group-prepayment.md @@ -9,19 +9,23 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `prepayment` | [`ListSubcriptionGroupPrepaymentItem`](../../doc/models/list-subcription-group-prepayment-item.md) | Required | - | - -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_group_uid": "subscription_group_uid2", - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "details": "details8" - } -} +| `prepayment` | [`ListSubscriptionGroupPrepaymentItem`](../../doc/models/list-subscription-group-prepayment-item.md) | Required | - | + +## Example + +```ts +import { + ListSubscriptionGroupPrepayment, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupPrepayment: ListSubscriptionGroupPrepayment = { + prepayment: { + id: 38, + subscriptionGroupUid: 'subscription_group_uid2', + amountInCents: BigInt(124), + remainingAmountInCents: BigInt(182), + details: 'details8', + }, +}; ``` diff --git a/doc/models/list-subscription-groups-item.md b/doc/models/list-subscription-groups-item.md index 67534494..de447a9b 100644 --- a/doc/models/list-subscription-groups-item.md +++ b/doc/models/list-subscription-groups-item.md @@ -21,17 +21,20 @@ | `accountBalances` | [`SubscriptionGroupBalances \| undefined`](../../doc/models/subscription-group-balances.md) | Optional | - | | `groupType` | [`GroupType \| undefined`](../../doc/models/group-type.md) | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "scheme": 124, - "customer_id": 144, - "payment_profile_id": 52, - "subscription_ids": [ - 254 - ] -} +## Example + +```ts +import { ListSubscriptionGroupsItem } from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupsItem: ListSubscriptionGroupsItem = { + uid: 'uid0', + scheme: 228, + customerId: 248, + paymentProfileId: 100, + subscriptionIds: [ + 102, + 103 + ], +}; ``` diff --git a/doc/models/list-subscription-groups-meta.md b/doc/models/list-subscription-groups-meta.md index ae53b445..7394dd5d 100644 --- a/doc/models/list-subscription-groups-meta.md +++ b/doc/models/list-subscription-groups-meta.md @@ -12,12 +12,14 @@ | `currentPage` | `number \| undefined` | Optional | - | | `totalCount` | `number \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_page": 14, - "total_count": 38 -} +```ts +import { ListSubscriptionGroupsMeta } from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupsMeta: ListSubscriptionGroupsMeta = { + currentPage: 104, + totalCount: 128, +}; ``` diff --git a/doc/models/list-subscription-groups-response.md b/doc/models/list-subscription-groups-response.md index f52e9ad5..82e0a1f7 100644 --- a/doc/models/list-subscription-groups-response.md +++ b/doc/models/list-subscription-groups-response.md @@ -12,43 +12,29 @@ | `subscriptionGroups` | [`ListSubscriptionGroupsItem[] \| undefined`](../../doc/models/list-subscription-groups-item.md) | Optional | - | | `meta` | [`ListSubscriptionGroupsMeta \| undefined`](../../doc/models/list-subscription-groups-meta.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscription_groups": [ - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - }, - { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ - 40 - ] - }, +```ts +import { + ListSubscriptionGroupsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const listSubscriptionGroupsResponse: ListSubscriptionGroupsResponse = { + subscriptionGroups: [ { - "uid": "uid2", - "scheme": 166, - "customer_id": 186, - "payment_profile_id": 162, - "subscription_ids": [ + uid: 'uid2', + scheme: 166, + customerId: 186, + paymentProfileId: 162, + subscriptionIds: [ 40 - ] + ], } ], - "meta": { - "current_page": 126, - "total_count": 150 - } -} + meta: { + currentPage: 126, + totalCount: 150, + }, +}; ``` diff --git a/doc/models/metadata.md b/doc/models/metadata.md index eaa37481..fdd05bec 100644 --- a/doc/models/metadata.md +++ b/doc/models/metadata.md @@ -16,15 +16,17 @@ | `deletedAt` | `string \| null \| undefined` | Optional | - | | `metafieldId` | `number \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 12, - "value": "value0", - "resource_id": 96, - "name": "name8", - "deleted_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { Metadata } from '@maxio-com/advanced-billing-sdk'; + +const metadata: Metadata = { + id: 50, + value: 'value8', + resourceId: 134, + name: 'name6', + deletedAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/metafield-input.md b/doc/models/metafield-input.md index 74bf0d5b..1acfa162 100644 --- a/doc/models/metafield-input.md +++ b/doc/models/metafield-input.md @@ -1,7 +1,7 @@ # Metafield Input -Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. +Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. ## Enumeration @@ -16,3 +16,11 @@ Indicates the type of metafield. A text metafield allows any string value. Dropd | `Radio` | | `Dropdown` | +## Example + +```ts +import { MetafieldInput } from '@maxio-com/advanced-billing-sdk'; + +const metafieldInput = MetafieldInput.BalanceTracker; +``` + diff --git a/doc/models/metafield-scope.md b/doc/models/metafield-scope.md index e2939ded..24d40aaf 100644 --- a/doc/models/metafield-scope.md +++ b/doc/models/metafield-scope.md @@ -19,15 +19,20 @@ Warning: When updating a metafield's scope attribute, all scope attributes must | `publicEdit` | [`IncludeOption \| undefined`](../../doc/models/include-option.md) | Optional | Include (1) or exclude (0) metafields used in [Embeddable Components](page:development-tools/embeddable-components/overview) from being editable by your ecosystem. | | `hosted` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" -} +## Example + +```ts +import { + IncludeOption, + MetafieldScope, +} from '@maxio-com/advanced-billing-sdk'; + +const metafieldScope: MetafieldScope = { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, +}; ``` diff --git a/doc/models/metafield.md b/doc/models/metafield.md index 2dfe7fe0..35991b43 100644 --- a/doc/models/metafield.md +++ b/doc/models/metafield.md @@ -13,24 +13,30 @@ | `name` | `string \| undefined` | Optional | - | | `scope` | [`MetafieldScope \| undefined`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | | `dataCount` | `number \| undefined` | Optional | The amount of subscriptions this metafield has been applied to in Advanced Billing. | -| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `mEnum` | [`MetafieldEnum \| null \| undefined`](../../doc/models/containers/metafield-enum.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 52, - "name": "name8", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" +## Example + +```ts +import { + IncludeOption, + Metafield, + MetafieldInput, +} from '@maxio-com/advanced-billing-sdk'; + +const metafield: Metafield = { + id: 242, + name: 'name4', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, }, - "data_count": 216, - "input_type": "radio" -} + dataCount: 26, + inputType: MetafieldInput.BalanceTracker, +}; ``` diff --git a/doc/models/metered-component.md b/doc/models/metered-component.md index f6fd46c7..663555ff 100644 --- a/doc/models/metered-component.md +++ b/doc/models/metered-component.md @@ -9,10 +9,10 @@ | 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` | 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 | +| `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `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. e.g., “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\-_:.]*$` | +| `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component in 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://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. | @@ -23,35 +23,59 @@ | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | -| `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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) - -```json -{ - "name": "name4", - "unit_name": "unit_name6", - "description": "description6", - "handle": "handle0", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + IntervalUnit, + MeteredComponent, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const meteredComponent: MeteredComponent = { + name: 'name6', + unitName: 'unit_name8', + pricingScheme: PricingScheme.Stairstep, + description: 'description4', + handle: 'handle2', + taxable: false, + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + }, + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "price_points": [ + pricePoints: [ + { + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, + }, { - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "interval": 92, - "interval_unit": "day" + name: 'name2', + handle: 'handle8', + pricingScheme: PricingScheme.PerUnit, + interval: 92, + intervalUnit: IntervalUnit.Day, } - ] -} + ], +}; ``` diff --git a/doc/models/metered-usage.md b/doc/models/metered-usage.md index 50f5bbe6..3fb86a46 100644 --- a/doc/models/metered-usage.md +++ b/doc/models/metered-usage.md @@ -10,22 +10,24 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `previousUnitBalance` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `newUnitBalance` | `number` | Required | - | +| `newUnitBalance` | [`MeteredUsageNewUnitBalance`](../../doc/models/containers/metered-usage-new-unit-balance.md) | Required | This is a container for one-of cases. | | `usageQuantity` | `number` | Required | - | | `componentId` | `number` | Required | - | | `componentHandle` | `string` | Required | - | | `memo` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance6", - "new_unit_balance": 80, - "usage_quantity": 42, - "component_id": 4, - "component_handle": "component_handle8", - "memo": "memo2" -} +## Example + +```ts +import { MeteredUsage } from '@maxio-com/advanced-billing-sdk'; + +const meteredUsage: MeteredUsage = { + previousUnitBalance: 'previous_unit_balance6', + newUnitBalance: 66, + usageQuantity: 106, + componentId: 68, + componentHandle: 'component_handle0', + memo: 'memo4', +}; ``` diff --git a/doc/models/movement-line-item.md b/doc/models/movement-line-item.md index 8c672c41..2f0bc1d2 100644 --- a/doc/models/movement-line-item.md +++ b/doc/models/movement-line-item.md @@ -19,15 +19,17 @@ | `prevQuantity` | `number \| undefined` | Optional | - | | `recurring` | `boolean \| undefined` | Optional | When `true`, the line item's MRR value will contribute to the `plan` breakout. When `false`, the line item contributes to the `usage` breakout. | -## Example (as JSON) - -```json -{ - "product_id": 156, - "component_id": 68, - "price_point_id": 164, - "name": "name6", - "mrr": 154 -} +## Example + +```ts +import { MovementLineItem } from '@maxio-com/advanced-billing-sdk'; + +const movementLineItem: MovementLineItem = { + productId: 146, + componentId: 58, + pricePointId: 82, + name: 'name8', + mrr: 92, +}; ``` diff --git a/doc/models/movement.md b/doc/models/movement.md index 5d8d1f36..4187f6c8 100644 --- a/doc/models/movement.md +++ b/doc/models/movement.md @@ -19,15 +19,17 @@ | `subscriptionId` | `number \| undefined` | Optional | - | | `subscriberName` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "timestamp": "2016-03-13T12:52:32.123Z", - "amount_in_cents": 174, - "amount_formatted": "amount_formatted4", - "description": "description2", - "category": "category0" -} +## Example + +```ts +import { Movement } from '@maxio-com/advanced-billing-sdk'; + +const movement: Movement = { + timestamp: '2016-03-13T12:52:32.123Z', + amountInCents: BigInt(34), + amountFormatted: 'amount_formatted6', + description: 'description4', + category: 'category2', +}; ``` diff --git a/doc/models/mrr-movement.md b/doc/models/mrr-movement.md index 45f45285..d471ebd4 100644 --- a/doc/models/mrr-movement.md +++ b/doc/models/mrr-movement.md @@ -14,14 +14,16 @@ | `subscriberDelta` | `number \| undefined` | Optional | - | | `leadDelta` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "amount": 210, - "category": "category0", - "subscriber_delta": 170, - "lead_delta": 198 -} +## Example + +```ts +import { MRRMovement } from '@maxio-com/advanced-billing-sdk'; + +const mRRMovement: MRRMovement = { + amount: 116, + category: 'category4', + subscriberDelta: 100, + leadDelta: 128, +}; ``` diff --git a/doc/models/mrr-response.md b/doc/models/mrr-response.md index ff4f7ddd..a61f7e80 100644 --- a/doc/models/mrr-response.md +++ b/doc/models/mrr-response.md @@ -11,22 +11,24 @@ | --- | --- | --- | --- | | `mrr` | [`MRR`](../../doc/models/mrr.md) | Required | - | -## Example (as JSON) - -```json -{ - "mrr": { - "amount_in_cents": 198, - "amount_formatted": "amount_formatted6", - "currency": "currency4", - "currency_symbol": "currency_symbol2", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } - } -} +## Example + +```ts +import { MRRResponse } from '@maxio-com/advanced-billing-sdk'; + +const mRRResponse: MRRResponse = { + mrr: { + amountInCents: BigInt(198), + amountFormatted: 'amount_formatted6', + currency: 'currency4', + currencySymbol: 'currency_symbol2', + breakouts: { + planAmountInCents: BigInt(254), + planAmountFormatted: 'plan_amount_formatted0', + usageAmountInCents: BigInt(106), + usageAmountFormatted: 'usage_amount_formatted8', + }, + }, +}; ``` diff --git a/doc/models/mrr.md b/doc/models/mrr.md index 5fb581f4..49bcdebb 100644 --- a/doc/models/mrr.md +++ b/doc/models/mrr.md @@ -16,20 +16,22 @@ | `breakouts` | [`Breakouts \| undefined`](../../doc/models/breakouts.md) | Optional | - | | `atTime` | `string \| undefined` | Optional | ISO8601 timestamp | -## Example (as JSON) - -```json -{ - "amount_in_cents": 208, - "amount_formatted": "amount_formatted2", - "currency": "currency0", - "currency_symbol": "currency_symbol8", - "breakouts": { - "plan_amount_in_cents": 254, - "plan_amount_formatted": "plan_amount_formatted0", - "usage_amount_in_cents": 106, - "usage_amount_formatted": "usage_amount_formatted8" - } -} +## Example + +```ts +import { MRR } from '@maxio-com/advanced-billing-sdk'; + +const mRR: MRR = { + amountInCents: BigInt(122), + amountFormatted: 'amount_formatted4', + currency: 'currency2', + currencySymbol: 'currency_symbol0', + breakouts: { + planAmountInCents: BigInt(254), + planAmountFormatted: 'plan_amount_formatted0', + usageAmountInCents: BigInt(106), + usageAmountFormatted: 'usage_amount_formatted8', + }, +}; ``` diff --git a/doc/models/multi-invoice-payment-response.md b/doc/models/multi-invoice-payment-response.md index 6d917ff1..ad3c6583 100644 --- a/doc/models/multi-invoice-payment-response.md +++ b/doc/models/multi-invoice-payment-response.md @@ -11,32 +11,34 @@ | --- | --- | --- | --- | | `payment` | [`MultiInvoicePayment`](../../doc/models/multi-invoice-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "transaction_id": 224, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ +## Example + +```ts +import { MultiInvoicePaymentResponse } from '@maxio-com/advanced-billing-sdk'; + +const multiInvoicePaymentResponse: MultiInvoicePaymentResponse = { + payment: { + transactionId: 224, + totalAmount: 'total_amount2', + currencyCode: 'currency_code2', + applications: [ { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', }, { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', }, { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/multi-invoice-payment.md b/doc/models/multi-invoice-payment.md index a434c438..0f296142 100644 --- a/doc/models/multi-invoice-payment.md +++ b/doc/models/multi-invoice-payment.md @@ -14,20 +14,27 @@ | `currencyCode` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | | `applications` | [`InvoicePaymentApplication[] \| undefined`](../../doc/models/invoice-payment-application.md) | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_id": 144, - "total_amount": "total_amount2", - "currency_code": "currency_code2", - "applications": [ +## Example + +```ts +import { MultiInvoicePayment } from '@maxio-com/advanced-billing-sdk'; + +const multiInvoicePayment: MultiInvoicePayment = { + transactionId: 246, + totalAmount: 'total_amount0', + currencyCode: 'currency_code0', + applications: [ + { + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', + }, { - "invoice_uid": "invoice_uid8", - "application_uid": "application_uid8", - "applied_amount": "applied_amount0" + invoiceUid: 'invoice_uid8', + applicationUid: 'application_uid8', + appliedAmount: 'applied_amount0', } - ] -} + ], +}; ``` diff --git a/doc/models/nested-subscription-group.md b/doc/models/nested-subscription-group.md index 1523845f..9ab70965 100644 --- a/doc/models/nested-subscription-group.md +++ b/doc/models/nested-subscription-group.md @@ -14,14 +14,16 @@ | `primarySubscriptionId` | `number \| undefined` | Optional | The subscription ID of the primary within the group. Applicable to scheme 1. | | `primary` | `boolean \| undefined` | Optional | A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1. | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "scheme": 62, - "primary_subscription_id": 10, - "primary": false -} +## Example + +```ts +import { NestedSubscriptionGroup } from '@maxio-com/advanced-billing-sdk'; + +const nestedSubscriptionGroup: NestedSubscriptionGroup = { + uid: 'uid6', + scheme: 106, + primarySubscriptionId: 54, + primary: false, +}; ``` diff --git a/doc/models/net-terms.md b/doc/models/net-terms.md index 5149a922..bf45e40a 100644 --- a/doc/models/net-terms.md +++ b/doc/models/net-terms.md @@ -15,15 +15,17 @@ | `netTermsOnRemittanceSignupsEnabled` | `boolean \| undefined` | Optional | **Default**: `false` | | `customNetTermsEnabled` | `boolean \| undefined` | Optional | **Default**: `false` | -## Example (as JSON) - -```json -{ - "default_net_terms": 0, - "automatic_net_terms": 0, - "remittance_net_terms": 0, - "net_terms_on_remittance_signups_enabled": false, - "custom_net_terms_enabled": false -} +## Example + +```ts +import { NetTerms } from '@maxio-com/advanced-billing-sdk'; + +const netTerms: NetTerms = { + defaultNetTerms: 0, + automaticNetTerms: 0, + remittanceNetTerms: 0, + netTermsOnRemittanceSignupsEnabled: false, + customNetTermsEnabled: false, +}; ``` diff --git a/doc/models/offer-discount.md b/doc/models/offer-discount.md index f77d7170..fb593533 100644 --- a/doc/models/offer-discount.md +++ b/doc/models/offer-discount.md @@ -13,13 +13,15 @@ | `couponId` | `number \| undefined` | Optional | - | | `couponName` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "coupon_code": "coupon_code8", - "coupon_id": 86, - "coupon_name": "coupon_name4" -} +## Example + +```ts +import { OfferDiscount } from '@maxio-com/advanced-billing-sdk'; + +const offerDiscount: OfferDiscount = { + couponCode: 'coupon_code6', + couponId: 202, + couponName: 'coupon_name6', +}; ``` diff --git a/doc/models/offer-item.md b/doc/models/offer-item.md index 81698eb8..b07b8325 100644 --- a/doc/models/offer-item.md +++ b/doc/models/offer-item.md @@ -17,18 +17,20 @@ | `componentName` | `string \| undefined` | Optional | - | | `pricePointName` | `string \| undefined` | Optional | - | | `currencyPrices` | [`CurrencyPrice[] \| undefined`](../../doc/models/currency-price.md) | Optional | - | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | -## Example (as JSON) +## Example -```json -{ - "component_id": 216, - "price_point_id": 16, - "starting_quantity": "starting_quantity0", - "editable": false, - "component_unit_price": "component_unit_price8" -} +```ts +import { OfferItem } from '@maxio-com/advanced-billing-sdk'; + +const offerItem: OfferItem = { + componentId: 234, + pricePointId: 254, + startingQuantity: 'starting_quantity6', + editable: false, + componentUnitPrice: 'component_unit_price2', +}; ``` diff --git a/doc/models/offer-response.md b/doc/models/offer-response.md index 6c57e7e3..88f39b78 100644 --- a/doc/models/offer-response.md +++ b/doc/models/offer-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `offer` | [`Offer \| undefined`](../../doc/models/offer.md) | Optional | - | -## Example (as JSON) - -```json -{ - "offer": { - "id": 28, - "site_id": 210, - "product_family_id": 224, - "product_id": 30, - "product_price_point_id": 150 - } -} +## Example + +```ts +import { OfferResponse } from '@maxio-com/advanced-billing-sdk'; + +const offerResponse: OfferResponse = { + offer: { + id: 28, + siteId: 210, + productFamilyId: 224, + productId: 30, + productPricePointId: 150, + }, +}; ``` diff --git a/doc/models/offer-signup-page.md b/doc/models/offer-signup-page.md index b867d148..9b59e73f 100644 --- a/doc/models/offer-signup-page.md +++ b/doc/models/offer-signup-page.md @@ -16,15 +16,17 @@ | `returnParams` | `string \| undefined` | Optional | - | | `url` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 50, - "nickname": "nickname8", - "enabled": false, - "return_url": "return_url2", - "return_params": "return_params0" -} +## Example + +```ts +import { OfferSignupPage } from '@maxio-com/advanced-billing-sdk'; + +const offerSignupPage: OfferSignupPage = { + id: 102, + nickname: 'nickname6', + enabled: false, + returnUrl: 'return_url6', + returnParams: 'return_params8', +}; ``` diff --git a/doc/models/offer.md b/doc/models/offer.md index be7de105..7afce2d8 100644 --- a/doc/models/offer.md +++ b/doc/models/offer.md @@ -29,15 +29,17 @@ | `productPriceInCents` | `bigint \| undefined` | Optional | - | | `offerSignupPages` | [`OfferSignupPage[] \| undefined`](../../doc/models/offer-signup-page.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 154, - "site_id": 80, - "product_family_id": 158, - "product_id": 96, - "product_price_point_id": 20 -} +## Example + +```ts +import { Offer } from '@maxio-com/advanced-billing-sdk'; + +const offer: Offer = { + id: 28, + siteId: 210, + productFamilyId: 224, + productId: 30, + productPricePointId: 150, +}; ``` diff --git a/doc/models/ok-response.md b/doc/models/ok-response.md index 1b73006b..34e341b5 100644 --- a/doc/models/ok-response.md +++ b/doc/models/ok-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `ok` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "ok": "ok4" -} +```ts +import { OkResponse } from '@maxio-com/advanced-billing-sdk'; + +const okResponse: OkResponse = { + ok: 'ok8', +}; ``` diff --git a/doc/models/on-off-component.md b/doc/models/on-off-component.md index 904b30c8..f9fa1d3b 100644 --- a/doc/models/on-off-component.md +++ b/doc/models/on-off-component.md @@ -9,9 +9,9 @@ | 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". | +| `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | | `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\-_:.]*$` | +| `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component in 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. | | `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. | | `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. | @@ -22,20 +22,23 @@ | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | -| `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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | - -## Example (as JSON) - -```json -{ - "name": "name2", - "description": "description2", - "handle": "handle8", - "taxable": false, - "upgrade_charge": "prorated", - "downgrade_credit": "prorated", - "unit_price": "String1" -} +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ts +import { CreditType, OnOffComponent } from '@maxio-com/advanced-billing-sdk'; + +const onOffComponent: OnOffComponent = { + name: 'name0', + unitPrice: 'String9', + description: 'description0', + handle: 'handle6', + taxable: false, + upgradeCharge: CreditType.Full, + downgradeCredit: CreditType.Full, +}; ``` diff --git a/doc/models/organization-address.md b/doc/models/organization-address.md index d3d4f683..a76c466c 100644 --- a/doc/models/organization-address.md +++ b/doc/models/organization-address.md @@ -18,15 +18,17 @@ | `name` | `string \| null \| undefined` | Optional | - | | `phone` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "street": "street4", - "line2": "line28", - "city": "city4", - "state": "state0", - "zip": "zip2" -} +## Example + +```ts +import { OrganizationAddress } from '@maxio-com/advanced-billing-sdk'; + +const organizationAddress: OrganizationAddress = { + street: 'street2', + line2: 'line26', + city: 'city2', + state: 'state8', + zip: 'zip6', +}; ``` diff --git a/doc/models/origin-invoice.md b/doc/models/origin-invoice.md index b0f98bbb..94b6d75b 100644 --- a/doc/models/origin-invoice.md +++ b/doc/models/origin-invoice.md @@ -12,12 +12,14 @@ | `uid` | `string \| undefined` | Optional | The UID of the invoice serving as an origin invoice. | | `number` | `string \| undefined` | Optional | The number of the invoice serving as an origin invoice. | -## Example (as JSON) +## Example -```json -{ - "uid": "uid0", - "number": "number8" -} +```ts +import { OriginInvoice } from '@maxio-com/advanced-billing-sdk'; + +const originInvoice: OriginInvoice = { + uid: 'uid8', + number: 'number4', +}; ``` diff --git a/doc/models/overage-pricing.md b/doc/models/overage-pricing.md index ef35249c..e9ddd9b2 100644 --- a/doc/models/overage-pricing.md +++ b/doc/models/overage-pricing.md @@ -12,28 +12,28 @@ | `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 | - | -## Example (as JSON) +## Example -```json -{ - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - }, +```ts +import { + OveragePricing, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const overagePricing: OveragePricing = { + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] -} + ], +}; ``` diff --git a/doc/models/override-subscription-request.md b/doc/models/override-subscription-request.md index 7666cf01..80016b76 100644 --- a/doc/models/override-subscription-request.md +++ b/doc/models/override-subscription-request.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `subscription` | [`OverrideSubscription`](../../doc/models/override-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message2", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { OverrideSubscriptionRequest } from '@maxio-com/advanced-billing-sdk'; + +const overrideSubscriptionRequest: OverrideSubscriptionRequest = { + subscription: { + activatedAt: '2016-03-13T12:52:32.123Z', + canceledAt: '2016-03-13T12:52:32.123Z', + cancellationMessage: 'cancellation_message2', + expiresAt: '2016-03-13T12:52:32.123Z', + currentPeriodStartsAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/override-subscription.md b/doc/models/override-subscription.md index ce35aae1..184c98c3 100644 --- a/doc/models/override-subscription.md +++ b/doc/models/override-subscription.md @@ -15,15 +15,17 @@ | `expiresAt` | `string \| undefined` | Optional | Can be used to record an external expiration date. Chargify sets this field automatically when a subscription expires (ceases billing) after a prescribed amount of time. Only ISO8601 format is supported. This field is not supported when Multi-frequency is enabled for the Site. To change the Term End of a Subscription, use the Update Subscription endpoint. | | `currentPeriodStartsAt` | `string \| undefined` | Optional | Can only be used when a subscription is unbilled, which happens when a future initial billing date is passed at subscription creation. The value passed must be before the current date and time. Allows you to set when the period started so mid period component allocations have the correct proration. Only ISO8601 format is supported. | -## Example (as JSON) - -```json -{ - "activated_at": "2016-03-13T12:52:32.123Z", - "canceled_at": "2016-03-13T12:52:32.123Z", - "cancellation_message": "cancellation_message4", - "expires_at": "2016-03-13T12:52:32.123Z", - "current_period_starts_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { OverrideSubscription } from '@maxio-com/advanced-billing-sdk'; + +const overrideSubscription: OverrideSubscription = { + activatedAt: '2016-03-13T12:52:32.123Z', + canceledAt: '2016-03-13T12:52:32.123Z', + cancellationMessage: 'cancellation_message8', + expiresAt: '2016-03-13T12:52:32.123Z', + currentPeriodStartsAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/paginated-metadata.md b/doc/models/paginated-metadata.md index 91c88e0d..b45cb6ae 100644 --- a/doc/models/paginated-metadata.md +++ b/doc/models/paginated-metadata.md @@ -15,30 +15,25 @@ | `perPage` | `number \| undefined` | Optional | - | | `metadata` | [`Metadata[] \| undefined`](../../doc/models/metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "total_count": 26, - "current_page": 2, - "total_pages": 14, - "per_page": 20, - "metadata": [ - { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" - }, +## Example + +```ts +import { PaginatedMetadata } from '@maxio-com/advanced-billing-sdk'; + +const paginatedMetadata: PaginatedMetadata = { + totalCount: 166, + currentPage: 142, + totalPages: 154, + perPage: 136, + metadata: [ { - "id": 50, - "value": "value8", - "resource_id": 134, - "name": "name6", - "deleted_at": "2016-03-13T12:52:32.123Z" + id: 50, + value: 'value8', + resourceId: 134, + name: 'name6', + deletedAt: '2016-03-13T12:52:32.123Z', } - ] -} + ], +}; ``` diff --git a/doc/models/paid-invoice.md b/doc/models/paid-invoice.md index f61f3b88..dd04532a 100644 --- a/doc/models/paid-invoice.md +++ b/doc/models/paid-invoice.md @@ -14,14 +14,16 @@ | `dueAmount` | `string \| undefined` | Optional | The remaining due amount on the invoice | | `paidAmount` | `string \| undefined` | Optional | The total amount paid on this invoice (including any prior payments) | -## Example (as JSON) - -```json -{ - "invoice_id": "invoice_id6", - "status": "open", - "due_amount": "due_amount8", - "paid_amount": "paid_amount8" -} +## Example + +```ts +import { InvoiceStatus, PaidInvoice } from '@maxio-com/advanced-billing-sdk'; + +const paidInvoice: PaidInvoice = { + invoiceId: 'invoice_id2', + status: InvoiceStatus.Canceled, + dueAmount: 'due_amount4', + paidAmount: 'paid_amount6', +}; ``` diff --git a/doc/models/pause-request.md b/doc/models/pause-request.md index 21129410..ff471f95 100644 --- a/doc/models/pause-request.md +++ b/doc/models/pause-request.md @@ -1,7 +1,7 @@ # Pause Request -Allows to pause a Subscription +Allows you to pause a Subscription. ## Structure @@ -13,13 +13,15 @@ Allows to pause a Subscription | --- | --- | --- | --- | | `hold` | [`AutoResume \| undefined`](../../doc/models/auto-resume.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "hold": { - "automatically_resume_at": "2016-03-13T12:52:32.123Z" - } -} +```ts +import { PauseRequest } from '@maxio-com/advanced-billing-sdk'; + +const pauseRequest: PauseRequest = { + hold: { + automaticallyResumeAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/pay-pal-vault.md b/doc/models/pay-pal-vault.md index fc7462f6..2e13e43c 100644 --- a/doc/models/pay-pal-vault.md +++ b/doc/models/pay-pal-vault.md @@ -16,3 +16,11 @@ The vault that stores the payment profile with the provided vault_token. | `Moduslink` | | `PaypalComplete` | +## Example + +```ts +import { PayPalVault } from '@maxio-com/advanced-billing-sdk'; + +const payPalVault = PayPalVault.Moduslink; +``` + diff --git a/doc/models/payer-attributes.md b/doc/models/payer-attributes.md index 6594bc8f..101738c4 100644 --- a/doc/models/payer-attributes.md +++ b/doc/models/payer-attributes.md @@ -28,19 +28,21 @@ | `taxExemptReason` | `string \| undefined` | Optional | - | | `metafields` | `Record \| undefined` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) - -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +## Example + +```ts +import { PayerAttributes } from '@maxio-com/advanced-billing-sdk'; + +const payerAttributes: PayerAttributes = { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails8', + organization: 'organization4', + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "first_name": "first_name4", - "last_name": "last_name2", - "email": "email2", - "cc_emails": "cc_emails4", - "organization": "organization8" -} +}; ``` diff --git a/doc/models/payer-error.md b/doc/models/payer-error.md index d7a696c2..6a57848d 100644 --- a/doc/models/payer-error.md +++ b/doc/models/payer-error.md @@ -13,22 +13,25 @@ | `firstName` | `string[] \| undefined` | Optional | - | | `email` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "last_name": [ - "last_name1", - "last_name2", - "last_name3" +## Example + +```ts +import { PayerError } from '@maxio-com/advanced-billing-sdk'; + +const payerError: PayerError = { + lastName: [ + 'last_name9' + ], + firstName: [ + 'first_name2', + 'first_name3', + 'first_name4' ], - "first_name": [ - "first_name4", - "first_name5" + email: [ + 'email6', + 'email7', + 'email8' ], - "email": [ - "email4" - ] -} +}; ``` diff --git a/doc/models/payment-collection-method-changed.md b/doc/models/payment-collection-method-changed.md index 8f754b60..efd1c757 100644 --- a/doc/models/payment-collection-method-changed.md +++ b/doc/models/payment-collection-method-changed.md @@ -12,12 +12,16 @@ | `previousValue` | `string` | Required | - | | `currentValue` | `string` | Required | - | -## Example (as JSON) +## Example -```json -{ - "previous_value": "previous_value4", - "current_value": "current_value2" -} +```ts +import { + PaymentCollectionMethodChanged, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentCollectionMethodChanged: PaymentCollectionMethodChanged = { + previousValue: 'previous_value4', + currentValue: 'current_value2', +}; ``` diff --git a/doc/models/payment-for-allocation.md b/doc/models/payment-for-allocation.md index ea879ce1..f629f493 100644 --- a/doc/models/payment-for-allocation.md +++ b/doc/models/payment-for-allocation.md @@ -16,14 +16,16 @@ Information for captured payment, if applicable | `success` | `boolean \| undefined` | Optional | - | | `memo` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "amount_in_cents": 158, - "success": false, - "memo": "memo6" -} +## Example + +```ts +import { PaymentForAllocation } from '@maxio-com/advanced-billing-sdk'; + +const paymentForAllocation: PaymentForAllocation = { + id: 68, + amountInCents: BigInt(102), + success: false, + memo: 'memo6', +}; ``` diff --git a/doc/models/payment-method-apple-pay.md b/doc/models/payment-method-apple-pay.md index a7bd9027..f37f6221 100644 --- a/doc/models/payment-method-apple-pay.md +++ b/doc/models/payment-method-apple-pay.md @@ -11,11 +11,16 @@ | --- | --- | --- | --- | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "type": "apple_pay" -} +```ts +import { + InvoiceEventPaymentMethod, + PaymentMethodApplePay, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentMethodApplePay: PaymentMethodApplePay = { + type: InvoiceEventPaymentMethod.ApplePay, +}; ``` diff --git a/doc/models/payment-method-bank-account.md b/doc/models/payment-method-bank-account.md index 55e87fea..e10e6d0b 100644 --- a/doc/models/payment-method-bank-account.md +++ b/doc/models/payment-method-bank-account.md @@ -13,13 +13,18 @@ | `maskedRoutingNumber` | `string` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "masked_account_number": "masked_account_number2", - "masked_routing_number": "masked_routing_number2", - "type": "bank_account" -} +## Example + +```ts +import { + InvoiceEventPaymentMethod, + PaymentMethodBankAccount, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentMethodBankAccount: PaymentMethodBankAccount = { + maskedAccountNumber: 'masked_account_number4', + maskedRoutingNumber: 'masked_routing_number4', + type: InvoiceEventPaymentMethod.BankAccount, +}; ``` diff --git a/doc/models/payment-method-credit-card.md b/doc/models/payment-method-credit-card.md index 723830ab..34a42523 100644 --- a/doc/models/payment-method-credit-card.md +++ b/doc/models/payment-method-credit-card.md @@ -15,15 +15,20 @@ | `maskedCardNumber` | `string` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "card_brand": "card_brand4", - "masked_card_number": "masked_card_number0", - "type": "credit_card", - "card_expiration": "card_expiration2", - "last_four": "last_four4" -} +## Example + +```ts +import { + InvoiceEventPaymentMethod, + PaymentMethodCreditCard, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentMethodCreditCard: PaymentMethodCreditCard = { + cardBrand: 'card_brand4', + maskedCardNumber: 'masked_card_number0', + type: InvoiceEventPaymentMethod.CreditCard, + cardExpiration: 'card_expiration2', + lastFour: 'last_four6', +}; ``` diff --git a/doc/models/payment-method-external.md b/doc/models/payment-method-external.md index 9246f741..17031fd7 100644 --- a/doc/models/payment-method-external.md +++ b/doc/models/payment-method-external.md @@ -14,14 +14,19 @@ | `memo` | `string \| null` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "details": "details4", - "kind": "kind2", - "memo": "memo8", - "type": "external" -} +## Example + +```ts +import { + InvoiceEventPaymentMethod, + PaymentMethodExternal, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentMethodExternal: PaymentMethodExternal = { + details: 'details0', + kind: 'kind8', + memo: 'memo4', + type: InvoiceEventPaymentMethod.External, +}; ``` diff --git a/doc/models/payment-method-paypal.md b/doc/models/payment-method-paypal.md index 0ab6d72b..9332489c 100644 --- a/doc/models/payment-method-paypal.md +++ b/doc/models/payment-method-paypal.md @@ -12,12 +12,17 @@ | `email` | `string` | Required | - | | `type` | [`InvoiceEventPaymentMethod`](../../doc/models/invoice-event-payment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "email": "email2", - "type": "paypal_account" -} +## Example + +```ts +import { + InvoiceEventPaymentMethod, + PaymentMethodPaypal, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentMethodPaypal: PaymentMethodPaypal = { + email: 'email8', + type: InvoiceEventPaymentMethod.PaypalAccount, +}; ``` diff --git a/doc/models/payment-profile-attributes.md b/doc/models/payment-profile-attributes.md index 3d8073e3..3763b371 100644 --- a/doc/models/payment-profile-attributes.md +++ b/doc/models/payment-profile-attributes.md @@ -11,22 +11,22 @@ alias to credit_card_attributes | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `chargifyToken` | `string \| undefined` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) | +| `chargifyToken` | `string \| undefined` | Optional | (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). | | `id` | `number \| undefined` | Optional | - | | `paymentType` | [`PaymentType \| undefined`](../../doc/models/payment-type.md) | Optional | - | | `firstName` | `string \| undefined` | Optional | (Optional) First name on card or bank account. If omitted, the first_name from customer attributes will be used. | | `lastName` | `string \| undefined` | Optional | (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. | | `maskedCardNumber` | `string \| undefined` | Optional | - | -| `fullNumber` | `string \| undefined` | Optional | The full credit card number (string representation, i.e. 5424000000000015) | -| `cardType` | [`CardType \| undefined`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. | +| `fullNumber` | `string \| undefined` | Optional | The full credit card number (string representation, e.g., 5424000000000015) | +| `cardType` | [`CardType \| undefined`](../../doc/models/card-type.md) | Optional | (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, etc.) you may supply it here so that we may display the card type in the UI. | | `expirationMonth` | [`PaymentProfileAttributesExpirationMonth \| undefined`](../../doc/models/containers/payment-profile-attributes-expiration-month.md) | Optional | This is a container for one-of cases. | | `expirationYear` | [`PaymentProfileAttributesExpirationYear \| undefined`](../../doc/models/containers/payment-profile-attributes-expiration-year.md) | Optional | This is a container for one-of cases. | -| `billingAddress` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billingAddress2` | `string \| null \| undefined` | Optional | (Optional) Second line of the customer’s billing address i.e. Apt. 100 | -| `billingCity` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billingState` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billingCountry` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billingZip` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | +| `billingAddress` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billingAddress2` | `string \| null \| undefined` | Optional | (Optional) Second line of the customer’s billing address, e.g., Apt. 100 | +| `billingCity` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billingState` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billingCountry` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billingZip` | `string \| undefined` | Optional | (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | | `currentVault` | [`AllVaults \| undefined`](../../doc/models/all-vaults.md) | Optional | (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. | | `vaultToken` | `string \| undefined` | Optional | (Optional, used only for Subscription Import) The “token” provided by your vault storage for an already stored payment profile | | `customerVaultToken` | `string \| undefined` | Optional | (Optional, used only for Subscription Import) (only for Authorize.Net CIM storage or Square) The customerProfileId for the owner of the customerPaymentProfileId provided as the vault_token | @@ -35,17 +35,22 @@ alias to credit_card_attributes | `paymentMethodNonce` | `string \| undefined` | Optional | (Required for Square unless importing with vault_token and customer_vault_token) The nonce generated by the Square Javascript library (SqPaymentForm) | | `gatewayHandle` | `string \| undefined` | Optional | (Optional) This attribute is only available if MultiGateway feature is enabled for your Site. This feature is in the Private Beta currently. gateway_handle is used to directly select a gateway where a payment profile will be stored in. Every connected gateway must have a unique gateway handle specified. Read [Multigateway description](https://chargify.zendesk.com/hc/en-us/articles/4407761759643#connecting-with-multiple-gateways) to learn more about new concepts that MultiGateway introduces and the default behavior when this attribute is not passed. | | `cvv` | `string \| undefined` | Optional | (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. | -| `lastFour` | `string \| undefined` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | - -## Example (as JSON) - -```json -{ - "chargify_token": "chargify_token8", - "id": 80, - "payment_type": "credit_card", - "first_name": "first_name0", - "last_name": "last_name8" -} +| `lastFour` | `string \| undefined` | Optional | (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. | + +## Example + +```ts +import { + PaymentProfileAttributes, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentProfileAttributes: PaymentProfileAttributes = { + chargifyToken: 'chargify_token8', + id: 14, + paymentType: PaymentType.PaypalAccount, + firstName: 'first_name0', + lastName: 'last_name8', +}; ``` diff --git a/doc/models/payment-profile-params.md b/doc/models/payment-profile-params.md index d1b510aa..54bf4096 100644 --- a/doc/models/payment-profile-params.md +++ b/doc/models/payment-profile-params.md @@ -15,13 +15,15 @@ PCI-safe cardholder fields only. Full card numbers, CVV, and billing address are | `lastName` | `string \| undefined` | Optional | - | | `cardType` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "card_type8" -} +## Example + +```ts +import { PaymentProfileParams } from '@maxio-com/advanced-billing-sdk'; + +const paymentProfileParams: PaymentProfileParams = { + firstName: 'first_name2', + lastName: 'last_name0', + cardType: 'card_type2', +}; ``` diff --git a/doc/models/payment-profile-response.md b/doc/models/payment-profile-response.md index ac022105..31f4444a 100644 --- a/doc/models/payment-profile-response.md +++ b/doc/models/payment-profile-response.md @@ -11,18 +11,24 @@ | --- | --- | --- | --- | | `paymentProfile` | [`PaymentProfile`](../../doc/models/containers/payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "payment_type": "apple_pay", - "id": 60, - "first_name": "first_name2", - "last_name": "last_name0", - "customer_id": 98, - "current_vault": "braintree_blue" - } -} +## Example + +```ts +import { + ApplePayVault, + PaymentProfileResponse, + PaymentType, +} from '@maxio-com/advanced-billing-sdk'; + +const paymentProfileResponse: PaymentProfileResponse = { + paymentProfile: { + paymentType: PaymentType.ApplePay, + id: 60, + firstName: 'first_name2', + lastName: 'last_name0', + customerId: 98, + currentVault: ApplePayVault.BraintreeBlue, + }, +}; ``` diff --git a/doc/models/payment-related-events.md b/doc/models/payment-related-events.md index 96f0b652..fe126454 100644 --- a/doc/models/payment-related-events.md +++ b/doc/models/payment-related-events.md @@ -12,12 +12,14 @@ | `productId` | `number` | Required | - | | `accountTransactionId` | `number` | Required | - | -## Example (as JSON) +## Example -```json -{ - "product_id": 42, - "account_transaction_id": 58 -} +```ts +import { PaymentRelatedEvents } from '@maxio-com/advanced-billing-sdk'; + +const paymentRelatedEvents: PaymentRelatedEvents = { + productId: 186, + accountTransactionId: 170, +}; ``` diff --git a/doc/models/payment-type.md b/doc/models/payment-type.md index 8b72290f..3a8dd597 100644 --- a/doc/models/payment-type.md +++ b/doc/models/payment-type.md @@ -14,3 +14,11 @@ | `PaypalAccount` | | `ApplePay` | +## Example + +```ts +import { PaymentType } from '@maxio-com/advanced-billing-sdk'; + +const paymentType = PaymentType.CreditCard; +``` + diff --git a/doc/models/paypal-payment-profile.md b/doc/models/paypal-payment-profile.md index 8a2a359e..db2cf39e 100644 --- a/doc/models/paypal-payment-profile.md +++ b/doc/models/paypal-payment-profile.md @@ -29,16 +29,22 @@ | `createdAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was created | | `updatedAt` | `string \| undefined` | Optional | A timestamp indicating when this payment profile was last updated | -## Example (as JSON) - -```json -{ - "payment_type": "paypal_account", - "id": 10, - "first_name": "first_name0", - "last_name": "last_name8", - "customer_id": 48, - "current_vault": "moduslink" -} +## Example + +```ts +import { + PayPalVault, + PaymentType, + PaypalPaymentProfile, +} from '@maxio-com/advanced-billing-sdk'; + +const paypalPaymentProfile: PaypalPaymentProfile = { + paymentType: PaymentType.PaypalAccount, + id: 214, + firstName: 'first_name0', + lastName: 'last_name8', + customerId: 252, + currentVault: PayPalVault.Moduslink, +}; ``` diff --git a/doc/models/pending-cancellation-change.md b/doc/models/pending-cancellation-change.md index 8eb7869d..58cb8ff9 100644 --- a/doc/models/pending-cancellation-change.md +++ b/doc/models/pending-cancellation-change.md @@ -12,12 +12,14 @@ | `cancellationState` | `string` | Required | - | | `cancelsAt` | `string` | Required | - | -## Example (as JSON) +## Example -```json -{ - "cancellation_state": "cancellation_state8", - "cancels_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { PendingCancellationChange } from '@maxio-com/advanced-billing-sdk'; + +const pendingCancellationChange: PendingCancellationChange = { + cancellationState: 'cancellation_state0', + cancelsAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/portal-management-link.md b/doc/models/portal-management-link.md index 95fef9fb..9b8e5b9e 100644 --- a/doc/models/portal-management-link.md +++ b/doc/models/portal-management-link.md @@ -16,15 +16,17 @@ | `expiresAt` | `string \| undefined` | Optional | - | | `lastInviteSentAt` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "url": "url0", - "fetch_count": 222, - "created_at": "2016-03-13T12:52:32.123Z", - "new_link_available_at": "2016-03-13T12:52:32.123Z", - "expires_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { PortalManagementLink } from '@maxio-com/advanced-billing-sdk'; + +const portalManagementLink: PortalManagementLink = { + url: 'url8', + fetchCount: 88, + createdAt: '2016-03-13T12:52:32.123Z', + newLinkAvailableAt: '2016-03-13T12:52:32.123Z', + expiresAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/prepaid-configuration-response.md b/doc/models/prepaid-configuration-response.md index 6db2d1ca..b70280a9 100644 --- a/doc/models/prepaid-configuration-response.md +++ b/doc/models/prepaid-configuration-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `prepaidConfiguration` | [`PrepaidConfiguration`](../../doc/models/prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "id": 142, - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ts +import { + PrepaidConfigurationResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaidConfigurationResponse: PrepaidConfigurationResponse = { + prepaidConfiguration: { + id: 142, + initialFundingAmountInCents: BigInt(74), + replenishToAmountInCents: BigInt(76), + autoReplenish: false, + replenishThresholdAmountInCents: BigInt(20), + }, +}; ``` diff --git a/doc/models/prepaid-configuration.md b/doc/models/prepaid-configuration.md index 5161e46a..3af195df 100644 --- a/doc/models/prepaid-configuration.md +++ b/doc/models/prepaid-configuration.md @@ -15,15 +15,17 @@ | `autoReplenish` | `boolean \| undefined` | Optional | - | | `replenishThresholdAmountInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 156, - "initial_funding_amount_in_cents": 88, - "replenish_to_amount_in_cents": 166, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 222 -} +## Example + +```ts +import { PrepaidConfiguration } from '@maxio-com/advanced-billing-sdk'; + +const prepaidConfiguration: PrepaidConfiguration = { + id: 146, + initialFundingAmountInCents: BigInt(78), + replenishToAmountInCents: BigInt(80), + autoReplenish: false, + replenishThresholdAmountInCents: BigInt(232), +}; ``` diff --git a/doc/models/prepaid-product-price-point-filter.md b/doc/models/prepaid-product-price-point-filter.md index dba54f79..e0ae2d72 100644 --- a/doc/models/prepaid-product-price-point-filter.md +++ b/doc/models/prepaid-product-price-point-filter.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `productPricePointId` | `string` | Required, Constant | Passed as a parameter to list methods to return only non null values.

**Value**: `'not_null'` | -## Example (as JSON) +## Example -```json -{ - "product_price_point_id": "not_null" -} +```ts +import { + PrepaidProductPricePointFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaidProductPricePointFilter: PrepaidProductPricePointFilter = { + productPricePointId: 'not_null', +}; ``` diff --git a/doc/models/prepaid-subscription-balance-changed.md b/doc/models/prepaid-subscription-balance-changed.md index c35f1091..b85749e4 100644 --- a/doc/models/prepaid-subscription-balance-changed.md +++ b/doc/models/prepaid-subscription-balance-changed.md @@ -14,14 +14,18 @@ | `prepaymentAccountBalanceInCents` | `bigint` | Required | - | | `currentUsageAmountInCents` | `bigint` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason8", - "current_account_balance_in_cents": 250, - "prepayment_account_balance_in_cents": 44, - "current_usage_amount_in_cents": 242 -} +## Example + +```ts +import { + PrepaidSubscriptionBalanceChanged, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaidSubscriptionBalanceChanged: PrepaidSubscriptionBalanceChanged = { + reason: 'reason6', + currentAccountBalanceInCents: BigInt(194), + prepaymentAccountBalanceInCents: BigInt(100), + currentUsageAmountInCents: BigInt(186), +}; ``` diff --git a/doc/models/prepaid-usage-allocation-detail.md b/doc/models/prepaid-usage-allocation-detail.md index d667e463..d671528e 100644 --- a/doc/models/prepaid-usage-allocation-detail.md +++ b/doc/models/prepaid-usage-allocation-detail.md @@ -13,13 +13,17 @@ | `chargeId` | `number \| undefined` | Optional | - | | `usageQuantity` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "allocation_id": 72, - "charge_id": 30, - "usage_quantity": 212 -} +## Example + +```ts +import { + PrepaidUsageAllocationDetail, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaidUsageAllocationDetail: PrepaidUsageAllocationDetail = { + allocationId: 144, + chargeId: 214, + usageQuantity: 140, +}; ``` diff --git a/doc/models/prepaid-usage-component.md b/doc/models/prepaid-usage-component.md index 5d7dcdbd..22d3a104 100644 --- a/doc/models/prepaid-usage-component.md +++ b/doc/models/prepaid-usage-component.md @@ -9,10 +9,10 @@ | 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` | 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 | +| `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `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. e.g., “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\-_:.]*$` | +| `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component in 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://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. | @@ -23,47 +23,59 @@ | `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 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. | | `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 | +| `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 | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | - | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | -## Example (as JSON) +## Example -```json -{ - "name": "name2", - "unit_name": "unit_name4", - "description": "description8", - "handle": "handle8", - "taxable": false, - "pricing_scheme": "stairstep", - "prices": [ +```ts +import { + CreditType, + PrepaidUsageComponent, + PricingScheme, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaidUsageComponent: PrepaidUsageComponent = { + name: 'name2', + unitName: 'unit_name4', + pricingScheme: PricingScheme.PerUnit, + overagePricing: { + pricingScheme: PricingScheme.Stairstep, + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + } + ], + }, + description: 'description8', + handle: 'handle8', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + }, + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "upgrade_charge": "prorated", - "overage_pricing": { - "pricing_scheme": "stairstep", - "prices": [ - { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 - } - ] - } -} + upgradeCharge: CreditType.None, +}; ``` diff --git a/doc/models/prepaid-usage.md b/doc/models/prepaid-usage.md index eedf517a..25e68de8 100644 --- a/doc/models/prepaid-usage.md +++ b/doc/models/prepaid-usage.md @@ -11,8 +11,8 @@ | --- | --- | --- | --- | | `previousUnitBalance` | `string` | Required | **Constraints**: *Minimum Length*: `1` | | `previousOverageUnitBalance` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -| `newUnitBalance` | `number` | Required | - | -| `newOverageUnitBalance` | `number` | Required | - | +| `newUnitBalance` | [`PrepaidUsageNewUnitBalance`](../../doc/models/containers/prepaid-usage-new-unit-balance.md) | Required | This is a container for one-of cases. | +| `newOverageUnitBalance` | [`PrepaidUsageNewOverageUnitBalance`](../../doc/models/containers/prepaid-usage-new-overage-unit-balance.md) | Required | This is a container for one-of cases. | | `usageQuantity` | `number` | Required | - | | `overageUsageQuantity` | `number` | Required | - | | `componentId` | `number` | Required | - | @@ -20,26 +20,28 @@ | `memo` | `string` | Required | - | | `allocationDetails` | [`PrepaidUsageAllocationDetail[]`](../../doc/models/prepaid-usage-allocation-detail.md) | Required | - | -## Example (as JSON) - -```json -{ - "previous_unit_balance": "previous_unit_balance0", - "previous_overage_unit_balance": "previous_overage_unit_balance4", - "new_unit_balance": 252, - "new_overage_unit_balance": 224, - "usage_quantity": 214, - "overage_usage_quantity": 106, - "component_id": 176, - "component_handle": "component_handle4", - "memo": "memo8", - "allocation_details": [ +## Example + +```ts +import { PrepaidUsage } from '@maxio-com/advanced-billing-sdk'; + +const prepaidUsage: PrepaidUsage = { + previousUnitBalance: 'previous_unit_balance4', + previousOverageUnitBalance: 'previous_overage_unit_balance0', + newUnitBalance: 206, + newOverageUnitBalance: 78, + usageQuantity: 246, + overageUsageQuantity: 138, + componentId: 208, + componentHandle: 'component_handle0', + memo: 'memo4', + allocationDetails: [ { - "allocation_id": 18, - "charge_id": 84, - "usage_quantity": 10 + allocationId: 18, + chargeId: 84, + usageQuantity: 10, } - ] -} + ], +}; ``` diff --git a/doc/models/prepayment-account-balance-changed.md b/doc/models/prepayment-account-balance-changed.md index ce386d37..cd097bce 100644 --- a/doc/models/prepayment-account-balance-changed.md +++ b/doc/models/prepayment-account-balance-changed.md @@ -14,14 +14,18 @@ | `prepaymentBalanceChangeInCents` | `bigint` | Required | - | | `currencyCode` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "reason": "reason4", - "prepayment_account_balance_in_cents": 182, - "prepayment_balance_change_in_cents": 206, - "currency_code": "currency_code4" -} +## Example + +```ts +import { + PrepaymentAccountBalanceChanged, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaymentAccountBalanceChanged: PrepaymentAccountBalanceChanged = { + reason: 'reason8', + prepaymentAccountBalanceInCents: BigInt(134), + prepaymentBalanceChangeInCents: BigInt(158), + currencyCode: 'currency_code8', +}; ``` diff --git a/doc/models/prepayment-method.md b/doc/models/prepayment-method.md index 10b58a6e..5d9eaad9 100644 --- a/doc/models/prepayment-method.md +++ b/doc/models/prepayment-method.md @@ -17,3 +17,11 @@ | `CreditCard` | | `Other` | +## Example + +```ts +import { PrepaymentMethod } from '@maxio-com/advanced-billing-sdk'; + +const prepaymentMethod = PrepaymentMethod.Other; +``` + diff --git a/doc/models/prepayment-response.md b/doc/models/prepayment-response.md index f0b045af..a8f0be2c 100644 --- a/doc/models/prepayment-response.md +++ b/doc/models/prepayment-response.md @@ -11,22 +11,27 @@ | --- | --- | --- | --- | | `prepayment` | [`Prepayment`](../../doc/models/prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "id": 38, - "subscription_id": 148, - "amount_in_cents": 124, - "remaining_amount_in_cents": 182, - "refunded_amount_in_cents": 132, - "details": "details8", - "external": false, - "memo": "memo2", - "payment_type": "credit_card", - "created_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { + PrepaymentMethod, + PrepaymentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaymentResponse: PrepaymentResponse = { + prepayment: { + id: 38, + subscriptionId: 148, + amountInCents: BigInt(124), + remainingAmountInCents: BigInt(182), + external: false, + memo: 'memo2', + createdAt: '2016-03-13T12:52:32.123Z', + refundedAmountInCents: BigInt(132), + details: 'details8', + paymentType: PrepaymentMethod.CreditCard, + }, +}; ``` diff --git a/doc/models/prepayment.md b/doc/models/prepayment.md index 4825e27e..39471d0c 100644 --- a/doc/models/prepayment.md +++ b/doc/models/prepayment.md @@ -20,20 +20,25 @@ | `paymentType` | [`PrepaymentMethod \| undefined`](../../doc/models/prepayment-method.md) | Optional | The payment type of the prepayment. | | `createdAt` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "id": 50, - "subscription_id": 160, - "amount_in_cents": 120, - "remaining_amount_in_cents": 194, - "refunded_amount_in_cents": 144, - "details": "details4", - "external": false, - "memo": "memo8", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { + Prepayment, + PrepaymentMethod, +} from '@maxio-com/advanced-billing-sdk'; + +const prepayment: Prepayment = { + id: 38, + subscriptionId: 148, + amountInCents: BigInt(124), + remainingAmountInCents: BigInt(182), + external: false, + memo: 'memo2', + createdAt: '2016-03-13T12:52:32.123Z', + refundedAmountInCents: BigInt(132), + details: 'details8', + paymentType: PrepaymentMethod.CreditCard, +}; ``` diff --git a/doc/models/prepayments-response.md b/doc/models/prepayments-response.md index 163da0c0..1210b73c 100644 --- a/doc/models/prepayments-response.md +++ b/doc/models/prepayments-response.md @@ -11,36 +11,29 @@ | --- | --- | --- | --- | | `prepayments` | [`Prepayment[] \| undefined`](../../doc/models/prepayment.md) | Optional | **Constraints**: *Unique Items Required* | -## Example (as JSON) +## Example -```json -{ - "prepayments": [ - { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" - }, +```ts +import { + PrepaymentMethod, + PrepaymentsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const prepaymentsResponse: PrepaymentsResponse = { + prepayments: [ { - "id": 76, - "subscription_id": 186, - "amount_in_cents": 94, - "remaining_amount_in_cents": 220, - "refunded_amount_in_cents": 170, - "details": "details6", - "external": false, - "memo": "memo0", - "payment_type": "cash", - "created_at": "2016-03-13T12:52:32.123Z" + id: 76, + subscriptionId: 186, + amountInCents: BigInt(94), + remainingAmountInCents: BigInt(220), + external: false, + memo: 'memo0', + createdAt: '2016-03-13T12:52:32.123Z', + refundedAmountInCents: BigInt(170), + details: 'details6', + paymentType: PrepaymentMethod.Cash, } - ] -} + ], +}; ``` diff --git a/doc/models/preview-allocations-request.md b/doc/models/preview-allocations-request.md index 31185fa3..d5c99e83 100644 --- a/doc/models/preview-allocations-request.md +++ b/doc/models/preview-allocations-request.md @@ -14,23 +14,28 @@ | `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. | | `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. | -## Example (as JSON) +## Example -```json -{ - "allocations": [ +```ts +import { + CreditType, + PreviewAllocationsRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const previewAllocationsRequest: PreviewAllocationsRequest = { + allocations: [ { - "quantity": 26.48, - "decimal_quantity": "decimal_quantity8", - "previous_quantity": 55.5, - "decimal_previous_quantity": "decimal_previous_quantity2", - "component_id": 242, - "memo": "memo6" + quantity: 26.48, + decimalQuantity: 'decimal_quantity8', + previousQuantity: 55.5, + decimalPreviousQuantity: 'decimal_previous_quantity2', + componentId: 242, + memo: 'memo6', } ], - "effective_proration_date": "2023-12-01", - "upgrade_charge": "none", - "downgrade_credit": "prorated" -} + effectiveProrationDate: '2023-12-01', + upgradeCharge: CreditType.None, + downgradeCredit: CreditType.None, +}; ``` diff --git a/doc/models/price-point-type.md b/doc/models/price-point-type.md index aa976681..6f81065c 100644 --- a/doc/models/price-point-type.md +++ b/doc/models/price-point-type.md @@ -19,3 +19,11 @@ Price point type. We expose the following types: | `Default` | | `Custom` | +## Example + +```ts +import { PricePointType } from '@maxio-com/advanced-billing-sdk'; + +const pricePointType = PricePointType.Default; +``` + diff --git a/doc/models/price.md b/doc/models/price.md index 83b20c10..71aeac5a 100644 --- a/doc/models/price.md +++ b/doc/models/price.md @@ -13,13 +13,15 @@ | `endingQuantity` | [`PriceEndingQuantity \| null \| undefined`](../../doc/models/containers/price-ending-quantity.md) | Optional | This is a container for one-of cases. | | `unitPrice` | [`PriceUnitPrice`](../../doc/models/containers/price-unit-price.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "starting_quantity": 40, - "ending_quantity": 14, - "unit_price": 125.12 -} +## Example + +```ts +import { Price } from '@maxio-com/advanced-billing-sdk'; + +const price: Price = { + startingQuantity: 132, + unitPrice: 70.44, + endingQuantity: 6, +}; ``` diff --git a/doc/models/pricing-scheme.md b/doc/models/pricing-scheme.md index 2d4daff3..dfca6460 100644 --- a/doc/models/pricing-scheme.md +++ b/doc/models/pricing-scheme.md @@ -16,3 +16,11 @@ The identifier for the pricing scheme. See [Product Components](https://help.cha | `PerUnit` | | `Tiered` | +## Example + +```ts +import { PricingScheme } from '@maxio-com/advanced-billing-sdk'; + +const pricingScheme = PricingScheme.Stairstep; +``` + diff --git a/doc/models/product-family-response.md b/doc/models/product-family-response.md index ee528950..0a0a1d2f 100644 --- a/doc/models/product-family-response.md +++ b/doc/models/product-family-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `productFamily` | [`ProductFamily \| undefined`](../../doc/models/product-family.md) | Optional | - | -## Example (as JSON) - -```json -{ - "product_family": { - "id": 14, - "name": "name0", - "handle": "handle6", - "accounting_code": "accounting_code6", - "description": "description0" - } -} +## Example + +```ts +import { ProductFamilyResponse } from '@maxio-com/advanced-billing-sdk'; + +const productFamilyResponse: ProductFamilyResponse = { + productFamily: { + id: 14, + name: 'name0', + handle: 'handle6', + accountingCode: 'accounting_code6', + description: 'description0', + }, +}; ``` diff --git a/doc/models/product-family.md b/doc/models/product-family.md index b11cea81..2e69a97b 100644 --- a/doc/models/product-family.md +++ b/doc/models/product-family.md @@ -14,19 +14,22 @@ | `handle` | `string \| undefined` | Optional | - | | `accountingCode` | `string \| null \| undefined` | Optional | - | | `description` | `string \| null \| undefined` | Optional | - | +| `surcharging` | `boolean \| undefined` | Optional | Whether surcharging applies to this product family. Only included on sites where surcharging is enabled. | | `createdAt` | `string \| undefined` | Optional | - | | `updatedAt` | `string \| undefined` | Optional | - | | `archivedAt` | `string \| null \| undefined` | Optional | Timestamp indicating when this product family was archived. `null` if the product family is not archived. | -## Example (as JSON) +## Example -```json -{ - "id": 194, - "name": "name2", - "handle": "handle8", - "accounting_code": "accounting_code8", - "description": "description8" -} +```ts +import { ProductFamily } from '@maxio-com/advanced-billing-sdk'; + +const productFamily: ProductFamily = { + id: 134, + name: 'name4', + handle: 'handle0', + accountingCode: 'accounting_code0', + description: 'description4', +}; ``` diff --git a/doc/models/product-price-point-error-response-error.md b/doc/models/product-price-point-error-response-error.md index 0940f654..d898b64c 100644 --- a/doc/models/product-price-point-error-response-error.md +++ b/doc/models/product-price-point-error-response-error.md @@ -11,30 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`ProductPricePointErrors`](../../doc/models/product-price-point-errors.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." - ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." - ], - "name": [ - "Name: cannot be blank." - ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." - ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ProductPricePointErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/product-price-point-errors.md b/doc/models/product-price-point-errors.md index 5db6564a..c2ebf5f6 100644 --- a/doc/models/product-price-point-errors.md +++ b/doc/models/product-price-point-errors.md @@ -16,29 +16,31 @@ | `price` | `string[] \| undefined` | Optional | - | | `priceInCents` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": "can't be blank", - "interval": [ - "Recurring Interval: cannot be blank.", - "Recurring Interval: must be greater than or equal to 1." +## Example + +```ts +import { ProductPricePointErrors } from '@maxio-com/advanced-billing-sdk'; + +const productPricePointErrors: ProductPricePointErrors = { + pricePoint: 'can\'t be blank', + interval: [ + 'Recurring Interval: cannot be blank.', + 'Recurring Interval: must be greater than or equal to 1.' + ], + intervalUnit: [ + 'Interval unit: cannot be blank.', + 'Interval unit: must be \'month\' or \'day\'.' ], - "interval_unit": [ - "Interval unit: cannot be blank.", - "Interval unit: must be 'month' or 'day'." + name: [ + 'Name: cannot be blank.' ], - "name": [ - "Name: cannot be blank." + price: [ + 'Price: is not a number.', + 'Price: must be greater than or equal to 0.' ], - "price": [ - "Price: is not a number.", - "Price: must be greater than or equal to 0." + priceInCents: [ + 'Price in cents: cannot be blank.' ], - "price_in_cents": [ - "Price in cents: cannot be blank." - ] -} +}; ``` diff --git a/doc/models/product-price-point-response.md b/doc/models/product-price-point-response.md index 37df577f..5c988ca7 100644 --- a/doc/models/product-price-point-response.md +++ b/doc/models/product-price-point-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `pricePoint` | [`ProductPricePoint`](../../doc/models/product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "id": 248, - "name": "name0", - "handle": "handle6", - "price_in_cents": 196, - "interval": 44 - } -} +## Example + +```ts +import { ProductPricePointResponse } from '@maxio-com/advanced-billing-sdk'; + +const productPricePointResponse: ProductPricePointResponse = { + pricePoint: { + id: 248, + name: 'name0', + handle: 'handle6', + priceInCents: BigInt(196), + interval: 44, + }, +}; ``` diff --git a/doc/models/product-price-point.md b/doc/models/product-price-point.md index 1a718e87..8d7e1ddd 100644 --- a/doc/models/product-price-point.md +++ b/doc/models/product-price-point.md @@ -13,16 +13,16 @@ | `name` | `string \| undefined` | Optional | The product price point name | | `handle` | `string \| null \| undefined` | Optional | The product price point API handle | | `priceInCents` | `bigint \| undefined` | Optional | The product price point price, in integer cents | -| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. | | `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product price point, either month or day | | `trialPriceInCents` | `bigint \| null \| undefined` | Optional | The product price point trial price, in integer cents | -| `trialInterval` | `number \| null \| undefined` | Optional | The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days | +| `trialInterval` | `number \| null \| undefined` | Optional | The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. | | `trialIntervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product price point, either month or day | -| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `introductoryOffer` | `boolean \| null \| undefined` | Optional | reserved for future use | | `initialChargeInCents` | `bigint \| null \| undefined` | Optional | The product price point initial charge, in integer cents | | `initialChargeAfterTrial` | `boolean \| null \| undefined` | Optional | - | -| `expirationInterval` | `number \| null \| undefined` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days | +| `expirationInterval` | `number \| null \| undefined` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | | `productId` | `number \| undefined` | Optional | The product id this price point belongs to | | `archivedAt` | `string \| null \| undefined` | Optional | Timestamp indicating when this price point was archived | @@ -34,15 +34,17 @@ | `subscriptionId` | `number \| null \| undefined` | Optional | The subscription id this price point belongs to | | `currencyPrices` | [`CurrencyPrice[] \| undefined`](../../doc/models/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. | -## Example (as JSON) +## Example -```json -{ - "id": 196, - "name": "name6", - "handle": "handle2", - "price_in_cents": 248, - "interval": 8 -} +```ts +import { ProductPricePoint } from '@maxio-com/advanced-billing-sdk'; + +const productPricePoint: ProductPricePoint = { + id: 10, + name: 'name0', + handle: 'handle6', + priceInCents: BigInt(178), + interval: 194, +}; ``` diff --git a/doc/models/product-response.md b/doc/models/product-response.md index a0e513ed..2d67ed4a 100644 --- a/doc/models/product-response.md +++ b/doc/models/product-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `product` | [`Product`](../../doc/models/product.md) | Required | - | -## Example (as JSON) - -```json -{ - "product": { - "id": 134, - "name": "name0", - "handle": "handle6", - "description": "description0", - "accounting_code": "accounting_code6" - } -} +## Example + +```ts +import { ProductResponse } from '@maxio-com/advanced-billing-sdk'; + +const productResponse: ProductResponse = { + product: { + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accountingCode: 'accounting_code6', + }, +}; ``` diff --git a/doc/models/product.md b/doc/models/product.md index f1ceeea5..60cc25b0 100644 --- a/doc/models/product.md +++ b/doc/models/product.md @@ -13,18 +13,18 @@ | `name` | `string \| undefined` | Optional | The product name | | `handle` | `string \| null \| undefined` | Optional | The product API handle | | `description` | `string \| null \| undefined` | Optional | The product description | -| `accountingCode` | `string \| null \| undefined` | Optional | E.g. Internal ID or SKU Number | +| `accountingCode` | `string \| null \| undefined` | Optional | E.g., Internal ID or SKU Number | | `requestCreditCard` | `boolean \| undefined` | Optional | Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. | -| `expirationInterval` | `number \| null \| undefined` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `expirationInterval` | `number \| null \| undefined` | Optional | A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product, either month, day or never | | `createdAt` | `string \| undefined` | Optional | Timestamp indicating when this product was created | | `updatedAt` | `string \| undefined` | Optional | Timestamp indicating when this product was last updated | | `priceInCents` | `bigint \| undefined` | Optional | The product price, in integer cents | -| `interval` | `number \| undefined` | Optional | The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. | | `intervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the interval unit for this product, either month or day | | `initialChargeInCents` | `bigint \| null \| undefined` | Optional | The up front charge you have specified. | | `trialPriceInCents` | `bigint \| null \| undefined` | Optional | The price of the trial period for a subscription to this product, in integer cents. | -| `trialInterval` | `number \| null \| undefined` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval | +| `trialInterval` | `number \| null \| undefined` | Optional | A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. | | `trialIntervalUnit` | [`IntervalUnit \| null \| undefined`](../../doc/models/interval-unit.md) | Optional | A string representing the trial interval unit for this product, either month or day | | `archivedAt` | `string \| null \| undefined` | Optional | Timestamp indicating when this product was archived | | `requireCreditCard` | `boolean \| undefined` | Optional | Boolean that controls whether a payment profile is required to be entered for customers wishing to sign up on this product. | @@ -33,7 +33,7 @@ | `updateReturnUrl` | `string \| null \| undefined` | Optional | The url to which a customer will be returned after a successful account update | | `initialChargeAfterTrial` | `boolean \| null \| undefined` | Optional | - | | `versionNumber` | `number \| undefined` | Optional | The version of the product | -| `updateReturnParams` | `string \| null \| undefined` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) | +| `updateReturnParams` | `string \| null \| undefined` | Optional | The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). | | `productFamily` | [`ProductFamily \| undefined`](../../doc/models/product-family.md) | Optional | - | | `publicSignupPages` | [`PublicSignupPage[] \| undefined`](../../doc/models/public-signup-page.md) | Optional | - | | `productPricePointName` | `string \| undefined` | Optional | - | @@ -46,16 +46,19 @@ | `itemCategory` | `string \| null \| undefined` | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `productPricePointId` | `number \| undefined` | Optional | - | | `productPricePointHandle` | `string \| null \| undefined` | Optional | - | +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. | -## Example (as JSON) +## Example -```json -{ - "id": 180, - "name": "name4", - "handle": "handle0", - "description": "description4", - "accounting_code": "accounting_code0" -} +```ts +import { Product } from '@maxio-com/advanced-billing-sdk'; + +const product: Product = { + id: 134, + name: 'name0', + handle: 'handle6', + description: 'description0', + accountingCode: 'accounting_code6', +}; ``` diff --git a/doc/models/proforma-bad-request-error-response-error.md b/doc/models/proforma-bad-request-error-response-error.md index 26bba148..b5daa9f6 100644 --- a/doc/models/proforma-bad-request-error-response-error.md +++ b/doc/models/proforma-bad-request-error-response-error.md @@ -11,17 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`ProformaError \| undefined`](../../doc/models/proforma-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscription": { - "base": [ - "base3", - "base4" - ] - } +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof ProformaBadRequestErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/proforma-error.md b/doc/models/proforma-error.md index d4b54f47..c4f78a0a 100644 --- a/doc/models/proforma-error.md +++ b/doc/models/proforma-error.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `subscription` | [`BaseStringError \| undefined`](../../doc/models/base-string-error.md) | Optional | The error is base if it is not directly associated with a single attribute. | -## Example (as JSON) - -```json -{ - "subscription": { - "base": [ - "base3", - "base4" - ] - } -} +## Example + +```ts +import { ProformaError } from '@maxio-com/advanced-billing-sdk'; + +const proformaError: ProformaError = { + subscription: { + base: [ + 'base3', + 'base4' + ], + }, +}; ``` diff --git a/doc/models/proforma-invoice-credit.md b/doc/models/proforma-invoice-credit.md index 632d56e5..03752c49 100644 --- a/doc/models/proforma-invoice-credit.md +++ b/doc/models/proforma-invoice-credit.md @@ -14,14 +14,16 @@ | `originalAmount` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | | `appliedAmount` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "memo": "memo2", - "original_amount": "original_amount2", - "applied_amount": "applied_amount0" -} +## Example + +```ts +import { ProformaInvoiceCredit } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceCredit: ProformaInvoiceCredit = { + uid: 'uid4', + memo: 'memo8', + originalAmount: 'original_amount8', + appliedAmount: 'applied_amount4', +}; ``` diff --git a/doc/models/proforma-invoice-discount-source-type.md b/doc/models/proforma-invoice-discount-source-type.md index 4618f4f7..294e937c 100644 --- a/doc/models/proforma-invoice-discount-source-type.md +++ b/doc/models/proforma-invoice-discount-source-type.md @@ -12,3 +12,13 @@ | `Coupon` | | `Referral` | +## Example + +```ts +import { + ProformaInvoiceDiscountSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceDiscountSourceType = ProformaInvoiceDiscountSourceType.Coupon; +``` + diff --git a/doc/models/proforma-invoice-discount.md b/doc/models/proforma-invoice-discount.md index 27802b87..413e5cd4 100644 --- a/doc/models/proforma-invoice-discount.md +++ b/doc/models/proforma-invoice-discount.md @@ -18,15 +18,21 @@ | `discountAmount` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | | `lineItemBreakouts` | [`InvoiceDiscountBreakout[] \| undefined`](../../doc/models/invoice-discount-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid2", - "title": "title8", - "code": "code0", - "source_type": "Coupon", - "discount_type": "percentage" -} +## Example + +```ts +import { + InvoiceDiscountType, + ProformaInvoiceDiscount, + ProformaInvoiceDiscountSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceDiscount: ProformaInvoiceDiscount = { + uid: 'uid2', + title: 'title8', + code: 'code0', + sourceType: ProformaInvoiceDiscountSourceType.Coupon, + discountType: InvoiceDiscountType.Percentage, +}; ``` diff --git a/doc/models/proforma-invoice-issued.md b/doc/models/proforma-invoice-issued.md index 8dd3906b..670af5cd 100644 --- a/doc/models/proforma-invoice-issued.md +++ b/doc/models/proforma-invoice-issued.md @@ -21,29 +21,31 @@ | `productName` | `string` | Required | - | | `lineItems` | [`InvoiceLineItemEventData[]`](../../doc/models/invoice-line-item-event-data.md) | Required | - | -## Example (as JSON) - -```json -{ - "uid": "uid0", - "number": "number2", - "role": "role6", - "delivery_date": "2016-03-13T12:52:32.123Z", - "created_at": "2016-03-13T12:52:32.123Z", - "due_amount": "due_amount2", - "paid_amount": "paid_amount8", - "tax_amount": "tax_amount6", - "total_amount": "total_amount6", - "product_name": "product_name6", - "line_items": [ +## Example + +```ts +import { ProformaInvoiceIssued } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceIssued: ProformaInvoiceIssued = { + uid: 'uid6', + number: 'number4', + role: 'role0', + deliveryDate: '2016-03-13T12:52:32.123Z', + createdAt: '2016-03-13T12:52:32.123Z', + dueAmount: 'due_amount8', + paidAmount: 'paid_amount8', + taxAmount: 'tax_amount0', + totalAmount: 'total_amount2', + productName: 'product_name2', + lineItems: [ { - "uid": "uid8", - "title": "title4", - "description": "description8", - "quantity": 102, - "quantity_delta": 204 + uid: 'uid8', + title: 'title4', + description: 'description8', + quantity: 102, + quantityDelta: 204, } - ] -} + ], +}; ``` diff --git a/doc/models/proforma-invoice-payment.md b/doc/models/proforma-invoice-payment.md index f8f934be..ece005c5 100644 --- a/doc/models/proforma-invoice-payment.md +++ b/doc/models/proforma-invoice-payment.md @@ -14,14 +14,16 @@ | `appliedAmount` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | | `prepayment` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "memo": "memo4", - "original_amount": "original_amount4", - "applied_amount": "applied_amount8", - "prepayment": false -} +## Example + +```ts +import { ProformaInvoicePayment } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoicePayment: ProformaInvoicePayment = { + memo: 'memo2', + originalAmount: 'original_amount2', + appliedAmount: 'applied_amount0', + prepayment: false, +}; ``` diff --git a/doc/models/proforma-invoice-role.md b/doc/models/proforma-invoice-role.md index 21f1d26b..1c5c97e9 100644 --- a/doc/models/proforma-invoice-role.md +++ b/doc/models/proforma-invoice-role.md @@ -1,7 +1,7 @@ # Proforma Invoice Role -'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic +'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. ## Enumeration @@ -16,3 +16,11 @@ | `ProformaAdhoc` | | `ProformaAutomatic` | +## Example + +```ts +import { ProformaInvoiceRole } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceRole = ProformaInvoiceRole.Unset; +``` + diff --git a/doc/models/proforma-invoice-status.md b/doc/models/proforma-invoice-status.md index 95854de9..134873b1 100644 --- a/doc/models/proforma-invoice-status.md +++ b/doc/models/proforma-invoice-status.md @@ -13,3 +13,11 @@ | `Voided` | | `Archived` | +## Example + +```ts +import { ProformaInvoiceStatus } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceStatus = ProformaInvoiceStatus.Draft; +``` + diff --git a/doc/models/proforma-invoice-tax-source-type.md b/doc/models/proforma-invoice-tax-source-type.md index 4bd4e3ee..b828104b 100644 --- a/doc/models/proforma-invoice-tax-source-type.md +++ b/doc/models/proforma-invoice-tax-source-type.md @@ -12,3 +12,13 @@ | `Tax` | | `Avalara` | +## Example + +```ts +import { + ProformaInvoiceTaxSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceTaxSourceType = ProformaInvoiceTaxSourceType.Tax; +``` + diff --git a/doc/models/proforma-invoice-tax.md b/doc/models/proforma-invoice-tax.md index 1b93bae6..be97baf0 100644 --- a/doc/models/proforma-invoice-tax.md +++ b/doc/models/proforma-invoice-tax.md @@ -17,15 +17,20 @@ | `taxAmount` | `string \| undefined` | Optional | **Constraints**: *Minimum Length*: `1` | | `lineItemBreakouts` | [`InvoiceTaxBreakout[] \| undefined`](../../doc/models/invoice-tax-breakout.md) | Optional | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "title": "title4", - "source_type": "Tax", - "percentage": "percentage6", - "taxable_amount": "taxable_amount2" -} +## Example + +```ts +import { + ProformaInvoiceTax, + ProformaInvoiceTaxSourceType, +} from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoiceTax: ProformaInvoiceTax = { + uid: 'uid4', + title: 'title0', + sourceType: ProformaInvoiceTaxSourceType.Tax, + percentage: 'percentage2', + taxableAmount: 'taxable_amount8', +}; ``` diff --git a/doc/models/proforma-invoice.md b/doc/models/proforma-invoice.md index 8d5eeb8e..9761419b 100644 --- a/doc/models/proforma-invoice.md +++ b/doc/models/proforma-invoice.md @@ -21,12 +21,12 @@ | `collectionMethod` | [`CollectionMethod \| undefined`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | | `paymentInstructions` | `string \| undefined` | Optional | - | | `currency` | `string \| undefined` | Optional | - | -| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `productName` | `string \| undefined` | Optional | - | | `productFamilyName` | `string \| undefined` | Optional | - | -| `role` | [`ProformaInvoiceRole \| undefined`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic | +| `role` | [`ProformaInvoiceRole \| undefined`](../../doc/models/proforma-invoice-role.md) | Optional | 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. | | `seller` | [`InvoiceSeller \| undefined`](../../doc/models/invoice-seller.md) | Optional | Information about the seller (merchant) listed on the masthead of the invoice. | -| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient the invoiced subscription. | +| `customer` | [`InvoiceCustomer \| undefined`](../../doc/models/invoice-customer.md) | Optional | Information about the customer who is owner or recipient of the invoiced subscription. | | `memo` | `string \| undefined` | Optional | - | | `billingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | - | | `shippingAddress` | [`InvoiceAddress \| undefined`](../../doc/models/invoice-address.md) | Optional | - | @@ -47,15 +47,17 @@ | `publicUrl` | `string \| null \| undefined` | Optional | - | | `availableActions` | [`AvailableActions \| undefined`](../../doc/models/available-actions.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "uid": "uid6", - "site_id": 196, - "customer_id": 52, - "subscription_id": 124, - "number": 0 -} +```ts +import { ProformaInvoice } from '@maxio-com/advanced-billing-sdk'; + +const proformaInvoice: ProformaInvoice = { + uid: 'uid8', + siteId: 94, + customerId: 206, + subscriptionId: 22, + number: 102, +}; ``` diff --git a/doc/models/proration.md b/doc/models/proration.md index f6c0250f..246d4922 100644 --- a/doc/models/proration.md +++ b/doc/models/proration.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `preservePeriod` | `boolean \| undefined` | Optional | The alternative to sending preserve_period as a direct attribute to migration | -## Example (as JSON) +## Example -```json -{ - "preserve_period": false -} +```ts +import { Proration } from '@maxio-com/advanced-billing-sdk'; + +const proration: Proration = { + preservePeriod: false, +}; ``` diff --git a/doc/models/public-key.md b/doc/models/public-key.md index f952b9d3..7d0f11dc 100644 --- a/doc/models/public-key.md +++ b/doc/models/public-key.md @@ -13,13 +13,15 @@ | `requiresSecurityToken` | `boolean \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "public_key": "public_key8", - "requires_security_token": false, - "created_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { PublicKey } from '@maxio-com/advanced-billing-sdk'; + +const publicKey: PublicKey = { + publicKey: 'public_key2', + requiresSecurityToken: false, + createdAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/public-signup-page.md b/doc/models/public-signup-page.md index 68a3b59c..0eb0ce9e 100644 --- a/doc/models/public-signup-page.md +++ b/doc/models/public-signup-page.md @@ -10,18 +10,20 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `id` | `number \| undefined` | Optional | The id of the signup page (public_signup_pages only) | -| `returnUrl` | `string \| null \| undefined` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only) | +| `returnUrl` | `string \| null \| undefined` | Optional | The url to which a customer will be returned after a successful signup (public_signup_pages only). | | `returnParams` | `string \| null \| undefined` | Optional | The params to be appended to the return_url (public_signup_pages only) | -| `url` | `string \| undefined` | Optional | The url where the signup page can be viewed (public_signup_pages only) | +| `url` | `string \| undefined` | Optional | The url where the signup page can be viewed (public_signup_pages only). | -## Example (as JSON) +## Example -```json -{ - "id": 6, - "return_url": "return_url0", - "return_params": "return_params2", - "url": "url8" -} +```ts +import { PublicSignupPage } from '@maxio-com/advanced-billing-sdk'; + +const publicSignupPage: PublicSignupPage = { + id: 20, + returnUrl: 'return_url0', + returnParams: 'return_params2', + url: 'url8', +}; ``` diff --git a/doc/models/q-scope.md b/doc/models/q-scope.md new file mode 100644 index 00000000..c92c4d32 --- /dev/null +++ b/doc/models/q-scope.md @@ -0,0 +1,26 @@ + +# Q Scope + +## Enumeration + +`QScope` + +## Fields + +| Name | +| --- | +| `FullName` | +| `FirstName` | +| `LastName` | +| `Organization` | +| `CustomerReference` | +| `SubscriptionReference` | + +## Example + +```ts +import { QScope } from '@maxio-com/advanced-billing-sdk'; + +const qScope = QScope.LastName; +``` + diff --git a/doc/models/quantity-based-component.md b/doc/models/quantity-based-component.md index aee8fcaa..7afda679 100644 --- a/doc/models/quantity-based-component.md +++ b/doc/models/quantity-based-component.md @@ -9,10 +9,10 @@ | 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` | 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 | +| `name` | `string` | Required | A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". | +| `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. e.g., “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\-_:.]*$` | +| `handle` | `string \| undefined` | Optional | A unique identifier for your use that can be used to retrieve this component in 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://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. | @@ -26,27 +26,34 @@ | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | | `publicSignupPageIds` | `number[] \| undefined` | Optional | - | -| `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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | - -## Example (as JSON) - -```json -{ - "name": "name8", - "unit_name": "unit_name0", - "description": "description8", - "handle": "handle4", - "taxable": false, - "pricing_scheme": "per_unit", - "prices": [ +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ts +import { + CreditType, + PricingScheme, + QuantityBasedComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const quantityBasedComponent: QuantityBasedComponent = { + name: 'name0', + unitName: 'unit_name2', + pricingScheme: PricingScheme.PerUnit, + description: 'description0', + handle: 'handle6', + taxable: false, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "upgrade_charge": "full" -} + upgradeCharge: CreditType.Full, +}; ``` diff --git a/doc/models/reactivate-subscription-group-request.md b/doc/models/reactivate-subscription-group-request.md index 9dcb66ac..fba2a301 100644 --- a/doc/models/reactivate-subscription-group-request.md +++ b/doc/models/reactivate-subscription-group-request.md @@ -12,12 +12,16 @@ | `resume` | `boolean \| undefined` | Optional | - | | `resumeMembers` | `boolean \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "resume": false, - "resume_members": false -} +```ts +import { + ReactivateSubscriptionGroupRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const reactivateSubscriptionGroupRequest: ReactivateSubscriptionGroupRequest = { + resume: false, + resumeMembers: false, +}; ``` diff --git a/doc/models/reactivate-subscription-group-response.md b/doc/models/reactivate-subscription-group-response.md index e710bbfa..fd3e7e0f 100644 --- a/doc/models/reactivate-subscription-group-response.md +++ b/doc/models/reactivate-subscription-group-response.md @@ -19,18 +19,23 @@ | `state` | `string \| undefined` | Optional | - | | `cancelAtEndOfPeriod` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "scheme": 66, - "customer_id": 86, - "payment_profile_id": 250, - "subscription_ids": [ - 196, - 197 - ] -} +## Example + +```ts +import { + ReactivateSubscriptionGroupResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const reactivateSubscriptionGroupResponse: ReactivateSubscriptionGroupResponse = { + uid: 'uid0', + scheme: 10, + customerId: 30, + paymentProfileId: 62, + subscriptionIds: [ + 140, + 141, + 142 + ], +}; ``` diff --git a/doc/models/reactivate-subscription-request.md b/doc/models/reactivate-subscription-request.md index b9ad1300..fc2c805f 100644 --- a/doc/models/reactivate-subscription-request.md +++ b/doc/models/reactivate-subscription-request.md @@ -9,24 +9,29 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `calendarBilling` | [`ReactivationBilling \| undefined`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing | +| `calendarBilling` | [`ReactivationBilling \| undefined`](../../doc/models/reactivation-billing.md) | Optional | These values are only applicable to subscriptions using calendar billing. | | `includeTrial` | `boolean \| undefined` | Optional | If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. | | `preserveBalance` | `boolean \| undefined` | Optional | If `true` is passed, the existing subscription balance will NOT be cleared/reset before adding the additional reactivation charges. | | `couponCode` | `string \| undefined` | Optional | The coupon code to be applied during reactivation. | | `useCreditsAndPrepayments` | `boolean \| undefined` | Optional | If true is sent, Advanced Billing will use service credits and prepayments upon reactivation. If false is sent, the service credits and prepayments will be ignored. | | `resume` | [`ReactivateSubscriptionRequestResume \| undefined`](../../doc/models/containers/reactivate-subscription-request-resume.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) +## Example -```json -{ - "calendar_billing": { - "reactivation_charge": "prorated" +```ts +import { + ReactivateSubscriptionRequest, + ReactivationCharge, +} from '@maxio-com/advanced-billing-sdk'; + +const reactivateSubscriptionRequest: ReactivateSubscriptionRequest = { + calendarBilling: { + reactivationCharge: ReactivationCharge.Prorated, }, - "include_trial": false, - "preserve_balance": false, - "coupon_code": "coupon_code6", - "use_credits_and_prepayments": false -} + includeTrial: false, + preserveBalance: false, + couponCode: 'coupon_code2', + useCreditsAndPrepayments: false, +}; ``` diff --git a/doc/models/reactivation-billing.md b/doc/models/reactivation-billing.md index 7fb48ac3..8ca64b51 100644 --- a/doc/models/reactivation-billing.md +++ b/doc/models/reactivation-billing.md @@ -1,7 +1,7 @@ # Reactivation Billing -These values are only applicable to subscriptions using calendar billing +These values are only applicable to subscriptions using calendar billing. ## Structure @@ -11,13 +11,18 @@ These values are only applicable to subscriptions using calendar billing | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `reactivationCharge` | [`ReactivationCharge \| undefined`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal

**Default**: `ReactivationCharge.Prorated` | +| `reactivationCharge` | [`ReactivationCharge \| undefined`](../../doc/models/reactivation-charge.md) | Optional | You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal.

**Default**: `ReactivationCharge.Prorated` | -## Example (as JSON) +## Example -```json -{ - "reactivation_charge": "prorated" -} +```ts +import { + ReactivationBilling, + ReactivationCharge, +} from '@maxio-com/advanced-billing-sdk'; + +const reactivationBilling: ReactivationBilling = { + reactivationCharge: ReactivationCharge.Prorated, +}; ``` diff --git a/doc/models/reactivation-charge.md b/doc/models/reactivation-charge.md index a661edd3..7d58cc91 100644 --- a/doc/models/reactivation-charge.md +++ b/doc/models/reactivation-charge.md @@ -1,7 +1,7 @@ # Reactivation Charge -You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal +You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal. ## Enumeration @@ -15,3 +15,11 @@ You may choose how to handle the reactivation charge for that subscription: 1) ` | `Immediate` | | `Delayed` | +## Example + +```ts +import { ReactivationCharge } from '@maxio-com/advanced-billing-sdk'; + +const reactivationCharge = ReactivationCharge.Immediate; +``` + diff --git a/doc/models/reason-code-response.md b/doc/models/reason-code-response.md index d958bcf2..c6c3624a 100644 --- a/doc/models/reason-code-response.md +++ b/doc/models/reason-code-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `reasonCode` | [`ReasonCode`](../../doc/models/reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "id": 240, - "site_id": 166, - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ts +import { ReasonCodeResponse } from '@maxio-com/advanced-billing-sdk'; + +const reasonCodeResponse: ReasonCodeResponse = { + reasonCode: { + id: 240, + siteId: 166, + code: 'code4', + description: 'description6', + position: 14, + }, +}; ``` diff --git a/doc/models/reason-code.md b/doc/models/reason-code.md index 04986b4f..cce9d16e 100644 --- a/doc/models/reason-code.md +++ b/doc/models/reason-code.md @@ -17,15 +17,17 @@ | `createdAt` | `string \| undefined` | Optional | - | | `updatedAt` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 164, - "site_id": 90, - "code": "code0", - "description": "description2", - "position": 194 -} +## Example + +```ts +import { ReasonCode } from '@maxio-com/advanced-billing-sdk'; + +const reasonCode: ReasonCode = { + id: 174, + siteId: 100, + code: 'code4', + description: 'description6', + position: 204, +}; ``` diff --git a/doc/models/record-payment-request.md b/doc/models/record-payment-request.md index 897dea4e..f2e81d32 100644 --- a/doc/models/record-payment-request.md +++ b/doc/models/record-payment-request.md @@ -11,16 +11,21 @@ | --- | --- | --- | --- | | `payment` | [`CreatePayment`](../../doc/models/create-payment.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment": { - "amount": "amount8", - "memo": "memo0", - "payment_details": "payment_details6", - "payment_method": "cash" - } -} +## Example + +```ts +import { + InvoicePaymentMethodType, + RecordPaymentRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const recordPaymentRequest: RecordPaymentRequest = { + payment: { + amount: 'amount8', + memo: 'memo0', + paymentDetails: 'payment_details6', + paymentMethod: InvoicePaymentMethodType.Cash, + }, +}; ``` diff --git a/doc/models/record-payment-response.md b/doc/models/record-payment-response.md index 14fac392..cca37c68 100644 --- a/doc/models/record-payment-response.md +++ b/doc/models/record-payment-response.md @@ -12,35 +12,28 @@ | `paidInvoices` | [`PaidInvoice[] \| undefined`](../../doc/models/paid-invoice.md) | Optional | - | | `prepayment` | [`InvoicePrePayment \| null \| undefined`](../../doc/models/invoice-pre-payment.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "paid_invoices": [ - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, - { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" - }, +```ts +import { + InvoiceStatus, + RecordPaymentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const recordPaymentResponse: RecordPaymentResponse = { + paidInvoices: [ { - "invoice_id": "invoice_id8", - "status": "draft", - "due_amount": "due_amount0", - "paid_amount": "paid_amount0" + invoiceId: 'invoice_id8', + status: InvoiceStatus.Draft, + dueAmount: 'due_amount0', + paidAmount: 'paid_amount0', } ], - "prepayment": { - "subscription_id": 148, - "amount_in_cents": 124, - "ending_balance_in_cents": 164 - } -} + prepayment: { + subscriptionId: 148, + amountInCents: BigInt(124), + endingBalanceInCents: BigInt(164), + }, +}; ``` diff --git a/doc/models/recurring-scheme.md b/doc/models/recurring-scheme.md index 547307c3..529328b8 100644 --- a/doc/models/recurring-scheme.md +++ b/doc/models/recurring-scheme.md @@ -13,3 +13,11 @@ | `RecurIndefinitely` | | `RecurWithDuration` | +## Example + +```ts +import { RecurringScheme } from '@maxio-com/advanced-billing-sdk'; + +const recurringScheme = RecurringScheme.RecurIndefinitely; +``` + diff --git a/doc/models/referral-code.md b/doc/models/referral-code.md index 980b2fe7..e37b283a 100644 --- a/doc/models/referral-code.md +++ b/doc/models/referral-code.md @@ -14,14 +14,16 @@ | `subscriptionId` | `number \| undefined` | Optional | - | | `code` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 42, - "site_id": 224, - "subscription_id": 152, - "code": "code6" -} +## Example + +```ts +import { ReferralCode } from '@maxio-com/advanced-billing-sdk'; + +const referralCode: ReferralCode = { + id: 186, + siteId: 112, + subscriptionId: 40, + code: 'code6', +}; ``` diff --git a/doc/models/referral-validation-response.md b/doc/models/referral-validation-response.md index 4aed4f60..40d82951 100644 --- a/doc/models/referral-validation-response.md +++ b/doc/models/referral-validation-response.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `referralCode` | [`ReferralCode \| undefined`](../../doc/models/referral-code.md) | Optional | - | -## Example (as JSON) - -```json -{ - "referral_code": { - "id": 46, - "site_id": 228, - "subscription_id": 156, - "code": "code0" - } -} +## Example + +```ts +import { ReferralValidationResponse } from '@maxio-com/advanced-billing-sdk'; + +const referralValidationResponse: ReferralValidationResponse = { + referralCode: { + id: 46, + siteId: 228, + subscriptionId: 156, + code: 'code0', + }, +}; ``` diff --git a/doc/models/refund-consolidated-invoice.md b/doc/models/refund-consolidated-invoice.md index 166e07aa..8c466b36 100644 --- a/doc/models/refund-consolidated-invoice.md +++ b/doc/models/refund-consolidated-invoice.md @@ -1,7 +1,7 @@ # Refund Consolidated Invoice -Refund consolidated invoice +Refund consolidated invoice. ## Structure @@ -18,19 +18,21 @@ Refund consolidated invoice | `applyCredit` | `boolean \| undefined` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | | `amount` | `string \| undefined` | Optional | The amount of payment to be refunded in decimal format. Example: "10.50". This will default to the full amount of the payment if not provided. | -## Example (as JSON) +## Example -```json -{ - "memo": "memo0", - "payment_id": 46, - "segment_uids": [ - "String0", - "String1" +```ts +import { RefundConsolidatedInvoice } from '@maxio-com/advanced-billing-sdk'; + +const refundConsolidatedInvoice: RefundConsolidatedInvoice = { + memo: 'memo0', + paymentId: 138, + segmentUids: [ + 'String0', + 'String1' ], - "external": false, - "apply_credit": false, - "amount": "amount8" -} + external: false, + applyCredit: false, + amount: 'amount8', +}; ``` diff --git a/doc/models/refund-invoice-event-data.md b/doc/models/refund-invoice-event-data.md index f797ce01..62d61e01 100644 --- a/doc/models/refund-invoice-event-data.md +++ b/doc/models/refund-invoice-event-data.md @@ -12,7 +12,7 @@ Example schema for an `refund_invoice` event | Name | Type | Tags | Description | | --- | --- | --- | --- | | `applyCredit` | `boolean` | Required | If true, credit was created and applied it to the invoice. | -| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | +| `consolidationLevel` | [`InvoiceConsolidationLevel \| undefined`](../../doc/models/invoice-consolidation-level.md) | Optional | Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values:

* "none": A normal invoice with no consolidation.
* "child": An invoice segment which has been combined into a consolidated invoice.
* "parent": A consolidated invoice, whose contents are composed of invoice segments.

"Parent" invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments.

See also the [invoice consolidation documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-Invoice-Consolidation). | | `creditNoteAttributes` | [`CreditNote`](../../doc/models/credit-note.md) | Required | - | | `memo` | `string \| undefined` | Optional | The refund memo. | | `originalAmount` | `string \| undefined` | Optional | The full, original amount of the refund. | @@ -21,25 +21,30 @@ Example schema for an `refund_invoice` event | `refundId` | `number` | Required | The ID of the refund transaction. | | `transactionTime` | `string` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "apply_credit": false, - "consolidation_level": "parent", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" +## Example + +```ts +import { + InvoiceConsolidationLevel, + RefundInvoiceEventData, +} from '@maxio-com/advanced-billing-sdk'; + +const refundInvoiceEventData: RefundInvoiceEventData = { + applyCredit: false, + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 114, - "refund_amount": "refund_amount8", - "refund_id": 158, - "transaction_time": "2016-03-13T12:52:32.123Z" -} + paymentId: 140, + refundAmount: 'refund_amount8', + refundId: 184, + transactionTime: '2016-03-13T12:52:32.123Z', + consolidationLevel: InvoiceConsolidationLevel.Parent, + memo: 'memo0', + originalAmount: 'original_amount0', +}; ``` diff --git a/doc/models/refund-invoice-event.md b/doc/models/refund-invoice-event.md index 937c7865..18098f86 100644 --- a/doc/models/refund-invoice-event.md +++ b/doc/models/refund-invoice-event.md @@ -15,41 +15,47 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.RefundInvoice` | | `eventData` | [`RefundInvoiceEventData`](../../doc/models/refund-invoice-event-data.md) | Required | Example schema for an `refund_invoice` event | -## Example (as JSON) - -```json -{ - "id": 54, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + InvoiceConsolidationLevel, + InvoiceEventType, + RefundInvoiceEvent, +} from '@maxio-com/advanced-billing-sdk'; + +const refundInvoiceEvent: RefundInvoiceEvent = { + id: BigInt(132), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "refund_invoice", - "event_data": { - "apply_credit": false, - "consolidation_level": "child", - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" + eventType: InvoiceEventType.RefundInvoice, + eventData: { + applyCredit: false, + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo0", - "original_amount": "original_amount0", - "payment_id": 204, - "refund_amount": "refund_amount8", - "refund_id": 248, - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} + paymentId: 204, + refundAmount: 'refund_amount8', + refundId: 248, + transactionTime: '2016-03-13T12:52:32.123Z', + consolidationLevel: InvoiceConsolidationLevel.Child, + memo: 'memo0', + originalAmount: 'original_amount0', + }, +}; ``` diff --git a/doc/models/refund-invoice-request.md b/doc/models/refund-invoice-request.md index 0c074b4c..f4fefb4f 100644 --- a/doc/models/refund-invoice-request.md +++ b/doc/models/refund-invoice-request.md @@ -11,18 +11,20 @@ | --- | --- | --- | --- | | `refund` | [`RefundInvoiceRequestRefund`](../../doc/models/containers/refund-invoice-request-refund.md) | Required | This is a container for any-of cases. | -## Example (as JSON) - -```json -{ - "refund": { - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false - } -} +## Example + +```ts +import { RefundInvoiceRequest } from '@maxio-com/advanced-billing-sdk'; + +const refundInvoiceRequest: RefundInvoiceRequest = { + refund: { + amount: 'amount8', + memo: 'memo0', + paymentId: 0, + external: false, + applyCredit: false, + voidInvoice: false, + }, +}; ``` diff --git a/doc/models/refund-invoice.md b/doc/models/refund-invoice.md index b7468bb6..26be035f 100644 --- a/doc/models/refund-invoice.md +++ b/doc/models/refund-invoice.md @@ -16,18 +16,20 @@ Refund an invoice or a segment of a consolidated invoice. | `paymentId` | `number` | Required | The ID of the payment to be refunded | | `external` | `boolean \| undefined` | Optional | Flag that marks refund as external (no money is returned to the customer). Defaults to `false`. | | `applyCredit` | `boolean \| undefined` | Optional | If set to true, creates credit and applies it to an invoice. Defaults to `false`. | -| `voidInvoice` | `boolean \| undefined` | Optional | If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`. | - -## Example (as JSON) - -```json -{ - "amount": "amount8", - "memo": "memo0", - "payment_id": 0, - "external": false, - "apply_credit": false, - "void_invoice": false -} +| `voidInvoice` | `boolean \| undefined` | Optional | If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to true, invoice will be voided after refund. Defaults to `false`. | + +## Example + +```ts +import { RefundInvoice } from '@maxio-com/advanced-billing-sdk'; + +const refundInvoice: RefundInvoice = { + amount: 'amount2', + memo: 'memo4', + paymentId: 36, + external: false, + applyCredit: false, + voidInvoice: false, +}; ``` diff --git a/doc/models/refund-prepayment-base-errors-response-error.md b/doc/models/refund-prepayment-base-errors-response-error.md index d448ec64..fc886b45 100644 --- a/doc/models/refund-prepayment-base-errors-response-error.md +++ b/doc/models/refund-prepayment-base-errors-response-error.md @@ -13,19 +13,14 @@ Errors returned on creating a refund prepayment when bad request | --- | --- | --- | --- | | `errors` | [`RefundPrepaymentBaseRefundError \| undefined`](../../doc/models/refund-prepayment-base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof RefundPrepaymentBaseErrorsResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/refund-prepayment-base-refund-error.md b/doc/models/refund-prepayment-base-refund-error.md index eec8fc17..81a48033 100644 --- a/doc/models/refund-prepayment-base-refund-error.md +++ b/doc/models/refund-prepayment-base-refund-error.md @@ -11,18 +11,19 @@ | --- | --- | --- | --- | | `refund` | [`BaseRefundError \| undefined`](../../doc/models/base-refund-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "refund": { - "base": [ - { - "key1": "val1", - "key2": "val2" - } - ] - } -} +## Example + +```ts +import { + RefundPrepaymentBaseRefundError, +} from '@maxio-com/advanced-billing-sdk'; + +const refundPrepaymentBaseRefundError: RefundPrepaymentBaseRefundError = { + refund: { + base: [ + { 'key1': 'val1', 'key2': 'val2' } + ], + }, +}; ``` diff --git a/doc/models/refund-prepayment-request.md b/doc/models/refund-prepayment-request.md index 2d4ac5a8..930c44b1 100644 --- a/doc/models/refund-prepayment-request.md +++ b/doc/models/refund-prepayment-request.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `refund` | [`RefundPrepayment`](../../doc/models/refund-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "refund": { - "amount_in_cents": 132, - "amount": "String1", - "memo": "memo2", - "external": false - } -} +## Example + +```ts +import { RefundPrepaymentRequest } from '@maxio-com/advanced-billing-sdk'; + +const refundPrepaymentRequest: RefundPrepaymentRequest = { + refund: { + amountInCents: BigInt(132), + amount: 'String1', + memo: 'memo2', + external: false, + }, +}; ``` diff --git a/doc/models/refund-prepayment.md b/doc/models/refund-prepayment.md index 45ca87b1..2a8de73d 100644 --- a/doc/models/refund-prepayment.md +++ b/doc/models/refund-prepayment.md @@ -14,14 +14,16 @@ | `memo` | `string` | Required | **Constraints**: *Minimum Length*: `1` | | `external` | `boolean \| undefined` | Optional | Specify the type of refund you wish to initiate. When the prepayment is external, the `external` flag is optional. But if the prepayment was made through a payment profile, the `external` flag is required. | -## Example (as JSON) - -```json -{ - "amount_in_cents": 110, - "amount": "String3", - "memo": "memo4", - "external": false -} +## Example + +```ts +import { RefundPrepayment } from '@maxio-com/advanced-billing-sdk'; + +const refundPrepayment: RefundPrepayment = { + amountInCents: BigInt(22), + amount: 'String1', + memo: 'memo2', + external: false, +}; ``` diff --git a/doc/models/refund-success.md b/doc/models/refund-success.md index 174b0b2f..bd9f7822 100644 --- a/doc/models/refund-success.md +++ b/doc/models/refund-success.md @@ -13,13 +13,15 @@ | `gatewayTransactionId` | `number` | Required | - | | `productId` | `number` | Required | - | -## Example (as JSON) - -```json -{ - "refund_id": 12, - "gateway_transaction_id": 182, - "product_id": 168 -} +## Example + +```ts +import { RefundSuccess } from '@maxio-com/advanced-billing-sdk'; + +const refundSuccess: RefundSuccess = { + refundId: 34, + gatewayTransactionId: 160, + productId: 190, +}; ``` diff --git a/doc/models/register.md b/doc/models/register.md index e9ea60a0..e932b415 100644 --- a/doc/models/register.md +++ b/doc/models/register.md @@ -12,16 +12,18 @@ | `id` | `number \| undefined` | Optional | - | | `maxioId` | `string \| undefined` | Optional | - | | `name` | `string \| undefined` | Optional | - | -| `currencyCode` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. | +| `currencyCode` | `string \| undefined` | Optional | The ISO 4217 currency code (3 character string) representing the currency of an invoice transaction. | -## Example (as JSON) +## Example -```json -{ - "id": 90, - "maxio_id": "maxio_id0", - "name": "name6", - "currency_code": "currency_code2" -} +```ts +import { Register } from '@maxio-com/advanced-billing-sdk'; + +const register: Register = { + id: 54, + maxioId: 'maxio_id4', + name: 'name2', + currencyCode: 'currency_code2', +}; ``` diff --git a/doc/models/remove-payment-event-data.md b/doc/models/remove-payment-event-data.md index d445c826..6cc9037f 100644 --- a/doc/models/remove-payment-event-data.md +++ b/doc/models/remove-payment-event-data.md @@ -19,19 +19,24 @@ Example schema for an `remove_payment` event | `paymentMethod` | [`InvoiceEventPayment`](../../doc/models/containers/invoice-event-payment.md) | Required | A nested data structure detailing the method of payment | | `prepayment` | `boolean` | Required | The flag that shows whether the original payment was a prepayment or not | -## Example (as JSON) - -```json -{ - "transaction_id": 180, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" +## Example + +```ts +import { + InvoiceEventPaymentMethod, + RemovePaymentEventData, +} from '@maxio-com/advanced-billing-sdk'; + +const removePaymentEventData: RemovePaymentEventData = { + transactionId: 20, + memo: 'memo4', + appliedAmount: 'applied_amount8', + transactionTime: '2016-03-13T12:52:32.123Z', + paymentMethod: { + type: InvoiceEventPaymentMethod.ApplePay, }, - "prepayment": false, - "original_amount": "original_amount0" -} + prepayment: false, + originalAmount: 'original_amount4', +}; ``` diff --git a/doc/models/remove-payment-event.md b/doc/models/remove-payment-event.md index 9d79aff1..eddfc75f 100644 --- a/doc/models/remove-payment-event.md +++ b/doc/models/remove-payment-event.md @@ -15,35 +15,41 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.RemovePayment` | | `eventData` | [`RemovePaymentEventData`](../../doc/models/remove-payment-event-data.md) | Required | Example schema for an `remove_payment` event | -## Example (as JSON) - -```json -{ - "id": 236, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + InvoiceEventPaymentMethod, + InvoiceEventType, + RemovePaymentEvent, +} from '@maxio-com/advanced-billing-sdk'; + +const removePaymentEvent: RemovePaymentEvent = { + id: BigInt(132), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "remove_payment", - "event_data": { - "transaction_id": 78, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "payment_method": { - "type": "apple_pay" + eventType: InvoiceEventType.RemovePayment, + eventData: { + transactionId: 78, + memo: 'memo0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + paymentMethod: { + type: InvoiceEventPaymentMethod.ApplePay, }, - "prepayment": false, - "original_amount": "original_amount0" - } -} + prepayment: false, + originalAmount: 'original_amount0', + }, +}; ``` diff --git a/doc/models/renewal-preview-component.md b/doc/models/renewal-preview-component.md index 54e50e06..b2e39054 100644 --- a/doc/models/renewal-preview-component.md +++ b/doc/models/renewal-preview-component.md @@ -13,13 +13,15 @@ | `quantity` | `number \| undefined` | Optional | The quantity for which you wish to preview billing. This is useful if you want to preview a predicted, higher usage value than is currently present on the subscription.

This quantity represents:

- Whether or not an on/off component is enabled - use 0 for disabled or 1 for enabled
- The desired allocated_quantity for a quantity-based component
- The desired unit_balance for a metered component
- The desired metric quantity for an events-based component | | `pricePointId` | [`RenewalPreviewComponentPricePointId \| undefined`](../../doc/models/containers/renewal-preview-component-price-point-id.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "component_id": "String7", - "quantity": 174, - "price_point_id": "String1" -} +## Example + +```ts +import { RenewalPreviewComponent } from '@maxio-com/advanced-billing-sdk'; + +const renewalPreviewComponent: RenewalPreviewComponent = { + componentId: 'String1', + quantity: 254, + pricePointId: 'String7', +}; ``` diff --git a/doc/models/renewal-preview-line-item.md b/doc/models/renewal-preview-line-item.md index 78e69308..61ec7627 100644 --- a/doc/models/renewal-preview-line-item.md +++ b/doc/models/renewal-preview-line-item.md @@ -24,15 +24,21 @@ | `periodRangeStart` | `string \| undefined` | Optional | - | | `periodRangeEnd` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "transaction_type": "charge", - "kind": "prepaid_usage_component", - "amount_in_cents": 154, - "memo": "memo0", - "discount_amount_in_cents": 214 -} +## Example + +```ts +import { + LineItemKind, + LineItemTransactionType, + RenewalPreviewLineItem, +} from '@maxio-com/advanced-billing-sdk'; + +const renewalPreviewLineItem: RenewalPreviewLineItem = { + transactionType: LineItemTransactionType.Adjustment, + kind: LineItemKind.PrepaidUsageComponent, + amountInCents: BigInt(32), + memo: 'memo0', + discountAmountInCents: BigInt(228), +}; ``` diff --git a/doc/models/renewal-preview-request.md b/doc/models/renewal-preview-request.md index ae6f24d7..a4ae26eb 100644 --- a/doc/models/renewal-preview-request.md +++ b/doc/models/renewal-preview-request.md @@ -9,29 +9,21 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | -| `components` | [`RenewalPreviewComponent[] \| undefined`](../../doc/models/renewal-preview-component.md) | Optional | An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | +| `components` | [`RenewalPreviewComponent[] \| undefined`](../../doc/models/renewal-preview-component.md) | Optional | (Optional) Array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). | -## Example (as JSON) +## Example -```json -{ - "components": [ - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, - { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" - }, +```ts +import { RenewalPreviewRequest } from '@maxio-com/advanced-billing-sdk'; + +const renewalPreviewRequest: RenewalPreviewRequest = { + components: [ { - "component_id": "String5", - "quantity": 210, - "price_point_id": "String3" + componentId: 'String5', + quantity: 210, + pricePointId: 'String3', } - ] -} + ], +}; ``` diff --git a/doc/models/renewal-preview-response.md b/doc/models/renewal-preview-response.md index 0a8fd69f..57b55e5d 100644 --- a/doc/models/renewal-preview-response.md +++ b/doc/models/renewal-preview-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `renewalPreview` | [`RenewalPreview`](../../doc/models/renewal-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_preview": { - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 132, - "total_tax_in_cents": 0, - "total_discount_in_cents": 250, - "total_in_cents": 20 - } -} +## Example + +```ts +import { RenewalPreviewResponse } from '@maxio-com/advanced-billing-sdk'; + +const renewalPreviewResponse: RenewalPreviewResponse = { + renewalPreview: { + nextAssessmentAt: '2016-03-13T12:52:32.123Z', + subtotalInCents: BigInt(132), + totalTaxInCents: BigInt(0), + totalDiscountInCents: BigInt(250), + totalInCents: BigInt(20), + }, +}; ``` diff --git a/doc/models/renewal-preview.md b/doc/models/renewal-preview.md index b3f7e742..a8b05d04 100644 --- a/doc/models/renewal-preview.md +++ b/doc/models/renewal-preview.md @@ -19,15 +19,17 @@ | `uncalculatedTaxes` | `boolean \| undefined` | Optional | A boolean indicating whether or not additional taxes will be calculated at the time of renewal. This will be true if you are using Avalara and the address of the subscription is in one of your defined taxable regions. | | `lineItems` | [`RenewalPreviewLineItem[] \| undefined`](../../doc/models/renewal-preview-line-item.md) | Optional | An array of objects representing the individual transactions that will be created at the next renewal | -## Example (as JSON) - -```json -{ - "next_assessment_at": "2016-03-13T12:52:32.123Z", - "subtotal_in_cents": 160, - "total_tax_in_cents": 28, - "total_discount_in_cents": 34, - "total_in_cents": 48 -} +## Example + +```ts +import { RenewalPreview } from '@maxio-com/advanced-billing-sdk'; + +const renewalPreview: RenewalPreview = { + nextAssessmentAt: '2016-03-13T12:52:32.123Z', + subtotalInCents: BigInt(102), + totalTaxInCents: BigInt(226), + totalDiscountInCents: BigInt(232), + totalInCents: BigInt(246), +}; ``` diff --git a/doc/models/replay-webhooks-request.md b/doc/models/replay-webhooks-request.md index c49d6049..78c3f1f4 100644 --- a/doc/models/replay-webhooks-request.md +++ b/doc/models/replay-webhooks-request.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | | `ids` | `bigint[]` | Required | - | -## Example (as JSON) - -```json -{ - "ids": [ - 15 - ] -} +## Example + +```ts +import { ReplayWebhooksRequest } from '@maxio-com/advanced-billing-sdk'; + +const replayWebhooksRequest: ReplayWebhooksRequest = { + ids: [ + BigInt(209), + BigInt(210), + BigInt(211) + ], +}; ``` diff --git a/doc/models/replay-webhooks-response.md b/doc/models/replay-webhooks-response.md index 0e355069..4d55740c 100644 --- a/doc/models/replay-webhooks-response.md +++ b/doc/models/replay-webhooks-response.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `status` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "status": "status4" -} +```ts +import { ReplayWebhooksResponse } from '@maxio-com/advanced-billing-sdk'; + +const replayWebhooksResponse: ReplayWebhooksResponse = { + status: 'status6', +}; ``` diff --git a/doc/models/resent-invitation.md b/doc/models/resent-invitation.md index 3d60fc66..1d041ef2 100644 --- a/doc/models/resent-invitation.md +++ b/doc/models/resent-invitation.md @@ -16,16 +16,18 @@ | `lastInviteSentAt` | `string \| undefined` | Optional | - | | `lastInviteAcceptedAt` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "last_invite_sent_at": "01/01/2024 04:30:00", - "last_invite_accepted_at": "01/01/2024 04:35:00", - "last_sent_at": "last_sent_at8", - "last_accepted_at": "last_accepted_at8", - "send_invite_link_text": "send_invite_link_text6", - "uninvited_count": 6 -} +## Example + +```ts +import { ResentInvitation } from '@maxio-com/advanced-billing-sdk'; + +const resentInvitation: ResentInvitation = { + lastSentAt: 'last_sent_at0', + lastAcceptedAt: 'last_accepted_at0', + sendInviteLinkText: 'send_invite_link_text8', + uninvitedCount: 178, + lastInviteSentAt: '2024-01-01T04:30:00+00:00', + lastInviteAcceptedAt: '2024-01-01T04:35:00+00:00', +}; ``` diff --git a/doc/models/resource-type.md b/doc/models/resource-type.md index c72afba5..4e0964b9 100644 --- a/doc/models/resource-type.md +++ b/doc/models/resource-type.md @@ -12,3 +12,11 @@ | `Subscriptions` | | `Customers` | +## Example + +```ts +import { ResourceType } from '@maxio-com/advanced-billing-sdk'; + +const resourceType = ResourceType.Subscriptions; +``` + diff --git a/doc/models/restriction-type.md b/doc/models/restriction-type.md index c69ef31a..f8c2ae12 100644 --- a/doc/models/restriction-type.md +++ b/doc/models/restriction-type.md @@ -12,3 +12,11 @@ | `Component` | | `Product` | +## Example + +```ts +import { RestrictionType } from '@maxio-com/advanced-billing-sdk'; + +const restrictionType = RestrictionType.Component; +``` + diff --git a/doc/models/resume-options.md b/doc/models/resume-options.md index 881637b7..52d97ec6 100644 --- a/doc/models/resume-options.md +++ b/doc/models/resume-options.md @@ -12,12 +12,14 @@ | `requireResume` | `boolean \| undefined` | Optional | Chargify will only attempt to resume the subscription's billing period. If not resumable, the subscription will be left in its current state. | | `forgiveBalance` | `boolean \| undefined` | Optional | Indicates whether or not Chargify should clear the subscription's existing balance before attempting to resume the subscription. If subscription cannot be resumed, the balance will remain as it was before the attempt to resume was made. | -## Example (as JSON) +## Example -```json -{ - "require_resume": false, - "forgive_balance": false -} +```ts +import { ResumeOptions } from '@maxio-com/advanced-billing-sdk'; + +const resumeOptions: ResumeOptions = { + requireResume: false, + forgiveBalance: false, +}; ``` diff --git a/doc/models/resumption-charge.md b/doc/models/resumption-charge.md index f3a3fd80..69522204 100644 --- a/doc/models/resumption-charge.md +++ b/doc/models/resumption-charge.md @@ -15,3 +15,11 @@ | `Immediate` | | `Delayed` | +## Example + +```ts +import { ResumptionCharge } from '@maxio-com/advanced-billing-sdk'; + +const resumptionCharge = ResumptionCharge.Immediate; +``` + diff --git a/doc/models/revoked-invitation.md b/doc/models/revoked-invitation.md index 9258358f..1f391fff 100644 --- a/doc/models/revoked-invitation.md +++ b/doc/models/revoked-invitation.md @@ -13,13 +13,15 @@ | `lastAcceptedAt` | `string \| undefined` | Optional | - | | `uninvitedCount` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "last_sent_at": "last_sent_at2", - "last_accepted_at": "last_accepted_at2", - "uninvited_count": 226 -} +## Example + +```ts +import { RevokedInvitation } from '@maxio-com/advanced-billing-sdk'; + +const revokedInvitation: RevokedInvitation = { + lastSentAt: 'last_sent_at8', + lastAcceptedAt: 'last_accepted_at8', + uninvitedCount: 130, +}; ``` diff --git a/doc/models/sale-rep-item-mrr.md b/doc/models/sale-rep-item-mrr.md index 6e475c36..823ca8da 100644 --- a/doc/models/sale-rep-item-mrr.md +++ b/doc/models/sale-rep-item-mrr.md @@ -13,13 +13,15 @@ | `usage` | `string \| undefined` | Optional | - | | `recurring` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "mrr": "mrr2", - "usage": "usage0", - "recurring": "recurring4" -} +## Example + +```ts +import { SaleRepItemMrr } from '@maxio-com/advanced-billing-sdk'; + +const saleRepItemMrr: SaleRepItemMrr = { + mrr: 'mrr8', + usage: 'usage0', + recurring: 'recurring6', +}; ``` diff --git a/doc/models/sale-rep-settings.md b/doc/models/sale-rep-settings.md index c7109185..20d29854 100644 --- a/doc/models/sale-rep-settings.md +++ b/doc/models/sale-rep-settings.md @@ -17,15 +17,17 @@ | `salesRepId` | `number \| undefined` | Optional | - | | `salesRepName` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "customer_name": "customer_name8", - "subscription_id": 200, - "site_link": "site_link4", - "site_name": "site_name8", - "subscription_mrr": "subscription_mrr6" -} +## Example + +```ts +import { SaleRepSettings } from '@maxio-com/advanced-billing-sdk'; + +const saleRepSettings: SaleRepSettings = { + customerName: 'customer_name6', + subscriptionId: 202, + siteLink: 'site_link2', + siteName: 'site_name6', + subscriptionMrr: 'subscription_mrr4', +}; ``` diff --git a/doc/models/sale-rep-subscription.md b/doc/models/sale-rep-subscription.md index 3dbafb57..cccfd4cc 100644 --- a/doc/models/sale-rep-subscription.md +++ b/doc/models/sale-rep-subscription.md @@ -20,15 +20,17 @@ | `lastPayment` | `string \| undefined` | Optional | - | | `churnDate` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "site_name": "site_name2", - "subscription_url": "subscription_url6", - "customer_name": "customer_name2", - "created_at": "created_at8" -} +## Example + +```ts +import { SaleRepSubscription } from '@maxio-com/advanced-billing-sdk'; + +const saleRepSubscription: SaleRepSubscription = { + id: 68, + siteName: 'site_name8', + subscriptionUrl: 'subscription_url2', + customerName: 'customer_name8', + createdAt: 'created_at4', +}; ``` diff --git a/doc/models/sale-rep.md b/doc/models/sale-rep.md index ec9e5b74..e49c8181 100644 --- a/doc/models/sale-rep.md +++ b/doc/models/sale-rep.md @@ -15,30 +15,39 @@ | `testMode` | `boolean \| undefined` | Optional | - | | `subscriptions` | [`SaleRepSubscription[] \| undefined`](../../doc/models/sale-rep-subscription.md) | Optional | - | -## Example (as JSON) - -```json -{ - "id": 18, - "full_name": "full_name0", - "subscriptions_count": 162, - "test_mode": false, - "subscriptions": [ +## Example + +```ts +import { SaleRep } from '@maxio-com/advanced-billing-sdk'; + +const saleRep: SaleRep = { + id: 78, + fullName: 'full_name0', + subscriptionsCount: 102, + testMode: false, + subscriptions: [ + { + id: 202, + siteName: 'site_name8', + subscriptionUrl: 'subscription_url2', + customerName: 'customer_name8', + createdAt: 'created_at4', + }, { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" + id: 202, + siteName: 'site_name8', + subscriptionUrl: 'subscription_url2', + customerName: 'customer_name8', + createdAt: 'created_at4', }, { - "id": 202, - "site_name": "site_name8", - "subscription_url": "subscription_url2", - "customer_name": "customer_name8", - "created_at": "created_at4" + id: 202, + siteName: 'site_name8', + subscriptionUrl: 'subscription_url2', + customerName: 'customer_name8', + createdAt: 'created_at4', } - ] -} + ], +}; ``` diff --git a/doc/models/scheduled-renewal-component-custom-price.md b/doc/models/scheduled-renewal-component-custom-price.md index 5d6dfbef..49696736 100644 --- a/doc/models/scheduled-renewal-component-custom-price.md +++ b/doc/models/scheduled-renewal-component-custom-price.md @@ -12,22 +12,27 @@ Custom pricing for a component within a scheduled renewal. | Name | Type | Tags | Description | | --- | --- | --- | --- | | `taxIncluded` | `boolean \| undefined` | Optional | Whether or not the price point includes tax | -| `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components | +| `pricingScheme` | [`PricingScheme`](../../doc/models/pricing-scheme.md) | Required | Omit for On/Off components. | | `prices` | [`Price[]`](../../doc/models/price.md) | Required | On/off components only need one price bracket starting at 1. | -## Example (as JSON) +## Example -```json -{ - "pricing_scheme": "stairstep", - "prices": [ +```ts +import { + PricingScheme, + ScheduledRenewalComponentCustomPrice, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalComponentCustomPrice: ScheduledRenewalComponentCustomPrice = { + pricingScheme: PricingScheme.PerUnit, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "tax_included": false -} + taxIncluded: false, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-item-request.md b/doc/models/scheduled-renewal-configuration-item-request.md index 35f9b0f7..0dff821c 100644 --- a/doc/models/scheduled-renewal-configuration-item-request.md +++ b/doc/models/scheduled-renewal-configuration-item-request.md @@ -11,32 +11,37 @@ | --- | --- | --- | --- | | `renewalConfigurationItem` | [`ScheduledRenewalConfigurationItemRequestRenewalConfigurationItem`](../../doc/models/containers/scheduled-renewal-configuration-item-request-renewal-configuration-item.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + PricingScheme, + ScheduledRenewalConfigurationItemRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationItemRequest: ScheduledRenewalConfigurationItemRequest = { + renewalConfigurationItem: { + itemType: 'Component', + itemId: 108, + pricePointId: 122, + quantity: 212, + customPrice: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } - } -} + ], + taxIncluded: false, + }, + }, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-item-response.md b/doc/models/scheduled-renewal-configuration-item-response.md index 6054157e..567fb5a2 100644 --- a/doc/models/scheduled-renewal-configuration-item-response.md +++ b/doc/models/scheduled-renewal-configuration-item-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `scheduledRenewalConfigurationItem` | [`ScheduledRenewalConfigurationItem \| undefined`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration_item": { - "id": 98, - "subscription_id": 208, - "subscription_renewal_configuration_id": 108, - "item_id": 246, - "item_type": "item_type2" - } -} +## Example + +```ts +import { + ScheduledRenewalConfigurationItemResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationItemResponse: ScheduledRenewalConfigurationItemResponse = { + scheduledRenewalConfigurationItem: { + id: 98, + subscriptionId: 208, + subscriptionRenewalConfigurationId: 108, + itemId: 246, + itemType: 'item_type2', + }, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-item.md b/doc/models/scheduled-renewal-configuration-item.md index d5613583..df24256e 100644 --- a/doc/models/scheduled-renewal-configuration-item.md +++ b/doc/models/scheduled-renewal-configuration-item.md @@ -21,15 +21,19 @@ | `decimalQuantity` | `string \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 146, - "subscription_id": 0, - "subscription_renewal_configuration_id": 156, - "item_id": 38, - "item_type": "item_type4" -} +## Example + +```ts +import { + ScheduledRenewalConfigurationItem, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationItem: ScheduledRenewalConfigurationItem = { + id: 54, + subscriptionId: 164, + subscriptionRenewalConfigurationId: 64, + itemId: 202, + itemType: 'item_type0', +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-request-body.md b/doc/models/scheduled-renewal-configuration-request-body.md index 5b883954..6daff0da 100644 --- a/doc/models/scheduled-renewal-configuration-request-body.md +++ b/doc/models/scheduled-renewal-configuration-request-body.md @@ -15,15 +15,19 @@ | `contractId` | `number \| undefined` | Optional | (Optional) Existing contract to associate with the scheduled renewal. Contracts must be enabled for your site. | | `createNewContract` | `boolean \| undefined` | Optional | (Optional) Set to true to create a new contract when contracts are enabled. Contracts must be enabled for your site. | -## Example (as JSON) - -```json -{ - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 110, - "create_new_contract": false -} +## Example + +```ts +import { + ScheduledRenewalConfigurationRequestBody, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationRequestBody: ScheduledRenewalConfigurationRequestBody = { + startsAt: '2016-03-13T12:52:32.123Z', + endsAt: '2016-03-13T12:52:32.123Z', + lockInAt: '2016-03-13T12:52:32.123Z', + contractId: 162, + createNewContract: false, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-request.md b/doc/models/scheduled-renewal-configuration-request.md index 338b5a60..f467828c 100644 --- a/doc/models/scheduled-renewal-configuration-request.md +++ b/doc/models/scheduled-renewal-configuration-request.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `renewalConfiguration` | [`ScheduledRenewalConfigurationRequestBody`](../../doc/models/scheduled-renewal-configuration-request-body.md) | Required | - | -## Example (as JSON) - -```json -{ - "renewal_configuration": { - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z", - "lock_in_at": "2016-03-13T12:52:32.123Z", - "contract_id": 244, - "create_new_contract": false - } -} +## Example + +```ts +import { + ScheduledRenewalConfigurationRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationRequest: ScheduledRenewalConfigurationRequest = { + renewalConfiguration: { + startsAt: '2016-03-13T12:52:32.123Z', + endsAt: '2016-03-13T12:52:32.123Z', + lockInAt: '2016-03-13T12:52:32.123Z', + contractId: 244, + createNewContract: false, + }, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration-response.md b/doc/models/scheduled-renewal-configuration-response.md index b034f655..3bbcf12a 100644 --- a/doc/models/scheduled-renewal-configuration-response.md +++ b/doc/models/scheduled-renewal-configuration-response.md @@ -11,17 +11,21 @@ | --- | --- | --- | --- | | `scheduledRenewalConfiguration` | [`ScheduledRenewalConfiguration \| undefined`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "scheduled_renewal_configuration": { - "id": 134, - "site_id": 60, - "subscription_id": 244, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { + ScheduledRenewalConfigurationResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationResponse: ScheduledRenewalConfigurationResponse = { + scheduledRenewalConfiguration: { + id: 134, + siteId: 60, + subscriptionId: 244, + startsAt: '2016-03-13T12:52:32.123Z', + endsAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/scheduled-renewal-configuration.md b/doc/models/scheduled-renewal-configuration.md index 1bafd79c..c067b416 100644 --- a/doc/models/scheduled-renewal-configuration.md +++ b/doc/models/scheduled-renewal-configuration.md @@ -20,15 +20,19 @@ | `scheduledRenewalConfigurationItems` | [`ScheduledRenewalConfigurationItem[] \| undefined`](../../doc/models/scheduled-renewal-configuration-item.md) | Optional | - | | `contract` | [`Contract \| undefined`](../../doc/models/contract.md) | Optional | Contract linked to the scheduled renewal configuration. | -## Example (as JSON) - -```json -{ - "id": 152, - "site_id": 78, - "subscription_id": 6, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { + ScheduledRenewalConfiguration, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfiguration: ScheduledRenewalConfiguration = { + id: 8, + siteId: 190, + subscriptionId: 118, + startsAt: '2016-03-13T12:52:32.123Z', + endsAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/scheduled-renewal-configurations-response.md b/doc/models/scheduled-renewal-configurations-response.md index 7a99d060..4f79e7db 100644 --- a/doc/models/scheduled-renewal-configurations-response.md +++ b/doc/models/scheduled-renewal-configurations-response.md @@ -11,33 +11,23 @@ | --- | --- | --- | --- | | `scheduledRenewalConfigurations` | [`ScheduledRenewalConfiguration[] \| undefined`](../../doc/models/scheduled-renewal-configuration.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "scheduled_renewal_configurations": [ - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, - { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" - }, +```ts +import { + ScheduledRenewalConfigurationsResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalConfigurationsResponse: ScheduledRenewalConfigurationsResponse = { + scheduledRenewalConfigurations: [ { - "id": 122, - "site_id": 48, - "subscription_id": 232, - "starts_at": "2016-03-13T12:52:32.123Z", - "ends_at": "2016-03-13T12:52:32.123Z" + id: 122, + siteId: 48, + subscriptionId: 232, + startsAt: '2016-03-13T12:52:32.123Z', + endsAt: '2016-03-13T12:52:32.123Z', } - ] -} + ], +}; ``` diff --git a/doc/models/scheduled-renewal-item-request-body-component.md b/doc/models/scheduled-renewal-item-request-body-component.md index f963c065..2a34ad88 100644 --- a/doc/models/scheduled-renewal-item-request-body-component.md +++ b/doc/models/scheduled-renewal-item-request-body-component.md @@ -12,33 +12,38 @@ | `itemType` | `string` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Component'` | | `itemId` | `number` | Required | Product or component identifier. | | `pricePointId` | `number \| undefined` | Optional | Price point identifier. | -| `quantity` | `number \| undefined` | Optional | Optional quantity for the item. | +| `quantity` | `number \| undefined` | Optional | (Optional) Quantity for the item. | | `customPrice` | [`ScheduledRenewalComponentCustomPrice \| undefined`](../../doc/models/scheduled-renewal-component-custom-price.md) | Optional | Custom pricing for a component within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + PricingScheme, + ScheduledRenewalItemRequestBodyComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalItemRequestBodyComponent: ScheduledRenewalItemRequestBodyComponent = { + itemType: 'Component', + itemId: 20, + pricePointId: 6, + quantity: 84, + customPrice: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } -} + ], + taxIncluded: false, + }, +}; ``` diff --git a/doc/models/scheduled-renewal-item-request-body-product.md b/doc/models/scheduled-renewal-item-request-body-product.md index 1b97ea3d..c4bb8934 100644 --- a/doc/models/scheduled-renewal-item-request-body-product.md +++ b/doc/models/scheduled-renewal-item-request-body-product.md @@ -12,27 +12,32 @@ | `itemType` | `string` | Required, Constant | Item type to add. Either Product or Component.

**Value**: `'Product'` | | `itemId` | `number` | Required | Product or component identifier. | | `pricePointId` | `number \| undefined` | Optional | Price point identifier. | -| `quantity` | `number \| undefined` | Optional | Optional quantity for the item. | +| `quantity` | `number \| undefined` | Optional | (Optional) Quantity for the item. | | `customPrice` | [`ScheduledRenewalProductPricePoint \| undefined`](../../doc/models/scheduled-renewal-product-price-point.md) | Optional | Custom pricing for a product within a scheduled renewal. | -## Example (as JSON) - -```json -{ - "item_type": "Product", - "item_id": 32, - "price_point_id": 18, - "quantity": 96, - "custom_price": { - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 30, - "expiration_interval": 52 - } -} +## Example + +```ts +import { + IntervalUnit, + ScheduledRenewalItemRequestBodyProduct, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalItemRequestBodyProduct: ScheduledRenewalItemRequestBodyProduct = { + itemType: 'Product', + itemId: 154, + pricePointId: 168, + quantity: 166, + customPrice: { + priceInCents: 'String3', + interval: 'String3', + intervalUnit: IntervalUnit.Day, + name: 'name4', + handle: 'handle0', + taxIncluded: false, + initialChargeInCents: BigInt(30), + expirationInterval: 52, + }, +}; ``` diff --git a/doc/models/scheduled-renewal-lock-in-request.md b/doc/models/scheduled-renewal-lock-in-request.md index 31e2a115..befa1d80 100644 --- a/doc/models/scheduled-renewal-lock-in-request.md +++ b/doc/models/scheduled-renewal-lock-in-request.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `lockInAt` | `string` | Required | Date to lock in the renewal. | -## Example (as JSON) +## Example -```json -{ - "lock_in_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { + ScheduledRenewalLockInRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalLockInRequest: ScheduledRenewalLockInRequest = { + lockInAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/scheduled-renewal-product-price-point.md b/doc/models/scheduled-renewal-product-price-point.md index ae6ceb9d..583262bb 100644 --- a/doc/models/scheduled-renewal-product-price-point.md +++ b/doc/models/scheduled-renewal-product-price-point.md @@ -18,21 +18,26 @@ Custom pricing for a product within a scheduled renewal. | `intervalUnit` | [`IntervalUnit \| null`](../../doc/models/interval-unit.md) | Required | Required if using `custom_price` attribute. | | `taxIncluded` | `boolean \| undefined` | Optional | (Optional) | | `initialChargeInCents` | `bigint \| undefined` | Optional | The product price point initial charge, in integer cents. | -| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | +| `expirationInterval` | `number \| undefined` | Optional | The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | A string representing the expiration interval unit for this product price point, either month, day or never | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String9", - "interval_unit": "day", - "tax_included": false, - "initial_charge_in_cents": 86, - "expiration_interval": 108 -} +## Example + +```ts +import { + IntervalUnit, + ScheduledRenewalProductPricePoint, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalProductPricePoint: ScheduledRenewalProductPricePoint = { + priceInCents: 'String1', + interval: 'String7', + intervalUnit: IntervalUnit.Day, + name: 'name6', + handle: 'handle2', + taxIncluded: false, + initialChargeInCents: BigInt(218), + expirationInterval: 240, +}; ``` diff --git a/doc/models/scheduled-renewal-update-request.md b/doc/models/scheduled-renewal-update-request.md index 077993d8..8abc9c01 100644 --- a/doc/models/scheduled-renewal-update-request.md +++ b/doc/models/scheduled-renewal-update-request.md @@ -11,32 +11,37 @@ | --- | --- | --- | --- | | `renewalConfigurationItem` | [`ScheduledRenewalUpdateRequestRenewalConfigurationItem`](../../doc/models/containers/scheduled-renewal-update-request-renewal-configuration-item.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "renewal_configuration_item": { - "item_type": "Component", - "item_id": 108, - "price_point_id": 122, - "quantity": 212, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + PricingScheme, + ScheduledRenewalUpdateRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const scheduledRenewalUpdateRequest: ScheduledRenewalUpdateRequest = { + renewalConfigurationItem: { + itemType: 'Component', + itemId: 108, + pricePointId: 122, + quantity: 212, + customPrice: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } - } -} + ], + taxIncluded: false, + }, + }, +}; ``` diff --git a/doc/models/segment-price.md b/doc/models/segment-price.md index 858a7555..e74f5cdb 100644 --- a/doc/models/segment-price.md +++ b/doc/models/segment-price.md @@ -18,15 +18,17 @@ | `formattedUnitPrice` | `string \| undefined` | Optional | - | | `segmentId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 220, - "component_id": 74, - "starting_quantity": 118, - "ending_quantity": 92, - "unit_price": "unit_price0" -} +## Example + +```ts +import { SegmentPrice } from '@maxio-com/advanced-billing-sdk'; + +const segmentPrice: SegmentPrice = { + id: 194, + componentId: 48, + startingQuantity: 144, + endingQuantity: 118, + unitPrice: 'unit_price0', +}; ``` diff --git a/doc/models/segment-response.md b/doc/models/segment-response.md index 68e6dbf6..b5fd1c60 100644 --- a/doc/models/segment-response.md +++ b/doc/models/segment-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `segment` | [`Segment \| undefined`](../../doc/models/segment.md) | Optional | - | -## Example (as JSON) - -```json -{ - "segment": { - "id": 118, - "component_id": 228, - "price_point_id": 4, - "event_based_billing_metric_id": 56, - "pricing_scheme": "stairstep" - } -} +## Example + +```ts +import { + PricingScheme, + SegmentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const segmentResponse: SegmentResponse = { + segment: { + id: 118, + componentId: 228, + pricePointId: 4, + eventBasedBillingMetricId: 56, + pricingScheme: PricingScheme.Stairstep, + }, +}; ``` diff --git a/doc/models/segment.md b/doc/models/segment.md index 447efc18..5a325612 100644 --- a/doc/models/segment.md +++ b/doc/models/segment.md @@ -22,15 +22,17 @@ | `updatedAt` | `string \| undefined` | Optional | - | | `prices` | [`SegmentPrice[] \| undefined`](../../doc/models/segment-price.md) | Optional | **Constraints**: *Minimum Items*: `1` | -## Example (as JSON) - -```json -{ - "id": 6, - "component_id": 116, - "price_point_id": 140, - "event_based_billing_metric_id": 200, - "pricing_scheme": "stairstep" -} +## Example + +```ts +import { PricingScheme, Segment } from '@maxio-com/advanced-billing-sdk'; + +const segment: Segment = { + id: 118, + componentId: 228, + pricePointId: 4, + eventBasedBillingMetricId: 56, + pricingScheme: PricingScheme.Stairstep, +}; ``` diff --git a/doc/models/send-email.md b/doc/models/send-email.md index cc4d2d26..efc1389f 100644 --- a/doc/models/send-email.md +++ b/doc/models/send-email.md @@ -12,12 +12,14 @@ | `canExecute` | `boolean` | Required | - | | `url` | `string` | Required | - | -## Example (as JSON) +## Example -```json -{ - "can_execute": false, - "url": "url2" -} +```ts +import { SendEmail } from '@maxio-com/advanced-billing-sdk'; + +const sendEmail: SendEmail = { + canExecute: false, + url: 'url2', +}; ``` diff --git a/doc/models/send-invoice-request.md b/doc/models/send-invoice-request.md index 65907df8..60ce8254 100644 --- a/doc/models/send-invoice-request.md +++ b/doc/models/send-invoice-request.md @@ -14,25 +14,26 @@ | `bccRecipientEmails` | `string[] \| undefined` | Optional | **Constraints**: *Maximum Items*: `5` | | `attachmentUrls` | `string[] \| undefined` | Optional | Array of URLs to files to attach to the invoice email. Max 10 files, 10MB each.

**Constraints**: *Maximum Items*: `10` | -## Example (as JSON) +## Example -```json -{ - "recipient_emails": [ - "recipient_emails3", - "recipient_emails4" +```ts +import { SendInvoiceRequest } from '@maxio-com/advanced-billing-sdk'; + +const sendInvoiceRequest: SendInvoiceRequest = { + recipientEmails: [ + 'recipient_emails7' + ], + ccRecipientEmails: [ + 'cc_recipient_emails2' ], - "cc_recipient_emails": [ - "cc_recipient_emails6", - "cc_recipient_emails5" + bccRecipientEmails: [ + 'bcc_recipient_emails0', + 'bcc_recipient_emails1', + 'bcc_recipient_emails2' ], - "bcc_recipient_emails": [ - "bcc_recipient_emails6" + attachmentUrls: [ + 'attachment_urls4' ], - "attachment_urls": [ - "attachment_urls0", - "attachment_urls1" - ] -} +}; ``` diff --git a/doc/models/service-credit-1.md b/doc/models/service-credit-1.md index 0505c318..43878883 100644 --- a/doc/models/service-credit-1.md +++ b/doc/models/service-credit-1.md @@ -14,19 +14,24 @@ | `endingBalanceInCents` | `bigint \| undefined` | Optional | The new balance for the credit account | | `entryType` | [`ServiceCreditType \| undefined`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `string \| undefined` | Optional | The memo attached to the entry | -| `invoiceUid` | `string \| null \| undefined` | Optional | The invoice uid associated with the entry. Only present for debit entries | +| `invoiceUid` | `string \| null \| undefined` | Optional | The invoice uid associated with the entry. Only present for debit entries. | | `remainingBalanceInCents` | `bigint \| undefined` | Optional | The remaining balance for the entry | | `createdAt` | `string \| undefined` | Optional | The date and time the entry was created | -## Example (as JSON) - -```json -{ - "id": 174, - "amount_in_cents": 4, - "ending_balance_in_cents": 44, - "entry_type": "Credit", - "memo": "memo8" -} +## Example + +```ts +import { + ServiceCredit1, + ServiceCreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const serviceCredit1: ServiceCredit1 = { + id: 12, + amountInCents: BigInt(158), + endingBalanceInCents: BigInt(138), + entryType: ServiceCreditType.Credit, + memo: 'memo4', +}; ``` diff --git a/doc/models/service-credit-response.md b/doc/models/service-credit-response.md index 64b6030e..73ac3df5 100644 --- a/doc/models/service-credit-response.md +++ b/doc/models/service-credit-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `serviceCredit` | [`ServiceCredit`](../../doc/models/service-credit.md) | Required | - | -## Example (as JSON) - -```json -{ - "service_credit": { - "id": 38, - "amount_in_cents": 124, - "ending_balance_in_cents": 164, - "entry_type": "Credit", - "memo": "memo0" - } -} +## Example + +```ts +import { + ServiceCreditResponse, + ServiceCreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const serviceCreditResponse: ServiceCreditResponse = { + serviceCredit: { + id: 38, + amountInCents: BigInt(124), + endingBalanceInCents: BigInt(164), + entryType: ServiceCreditType.Credit, + memo: 'memo0', + }, +}; ``` diff --git a/doc/models/service-credit-type.md b/doc/models/service-credit-type.md index 6d70a37f..9d606eb7 100644 --- a/doc/models/service-credit-type.md +++ b/doc/models/service-credit-type.md @@ -14,3 +14,11 @@ The type of entry | `Credit` | | `Debit` | +## Example + +```ts +import { ServiceCreditType } from '@maxio-com/advanced-billing-sdk'; + +const serviceCreditType = ServiceCreditType.Credit; +``` + diff --git a/doc/models/service-credit.md b/doc/models/service-credit.md index 2277bddc..3bb5f0c6 100644 --- a/doc/models/service-credit.md +++ b/doc/models/service-credit.md @@ -15,15 +15,20 @@ | `entryType` | [`ServiceCreditType \| undefined`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `string \| undefined` | Optional | The memo attached to the entry | -## Example (as JSON) - -```json -{ - "id": 216, - "amount_in_cents": 210, - "ending_balance_in_cents": 86, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ts +import { + ServiceCredit, + ServiceCreditType, +} from '@maxio-com/advanced-billing-sdk'; + +const serviceCredit: ServiceCredit = { + id: 132, + amountInCents: BigInt(218), + endingBalanceInCents: BigInt(2), + entryType: ServiceCreditType.Credit, + memo: 'memo8', +}; ``` diff --git a/doc/models/signup-proforma-preview-response.md b/doc/models/signup-proforma-preview-response.md index 5fb3b138..2cf3c82b 100644 --- a/doc/models/signup-proforma-preview-response.md +++ b/doc/models/signup-proforma-preview-response.md @@ -11,26 +11,30 @@ | --- | --- | --- | --- | | `proformaInvoicePreview` | [`SignupProformaPreview`](../../doc/models/signup-proforma-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "proforma_invoice_preview": { - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 +## Example + +```ts +import { + SignupProformaPreviewResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const signupProformaPreviewResponse: SignupProformaPreviewResponse = { + proformaInvoicePreview: { + currentProformaInvoice: { + uid: 'uid6', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 132, }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } - } -} + nextProformaInvoice: { + uid: 'uid8', + siteId: 212, + customerId: 68, + subscriptionId: 140, + number: 16, + }, + }, +}; ``` diff --git a/doc/models/signup-proforma-preview.md b/doc/models/signup-proforma-preview.md index 4d084f86..62d7571b 100644 --- a/doc/models/signup-proforma-preview.md +++ b/doc/models/signup-proforma-preview.md @@ -12,24 +12,26 @@ | `currentProformaInvoice` | [`ProformaInvoice \| undefined`](../../doc/models/proforma-invoice.md) | Optional | - | | `nextProformaInvoice` | [`ProformaInvoice \| undefined`](../../doc/models/proforma-invoice.md) | Optional | - | -## Example (as JSON) - -```json -{ - "current_proforma_invoice": { - "uid": "uid6", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": 132 +## Example + +```ts +import { SignupProformaPreview } from '@maxio-com/advanced-billing-sdk'; + +const signupProformaPreview: SignupProformaPreview = { + currentProformaInvoice: { + uid: 'uid6', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 132, }, - "next_proforma_invoice": { - "uid": "uid8", - "site_id": 212, - "customer_id": 68, - "subscription_id": 140, - "number": 16 - } -} + nextProformaInvoice: { + uid: 'uid8', + siteId: 212, + customerId: 68, + subscriptionId: 140, + number: 16, + }, +}; ``` diff --git a/doc/models/single-error-response-error.md b/doc/models/single-error-response-error.md index 9360bada..d6cc209d 100644 --- a/doc/models/single-error-response-error.md +++ b/doc/models/single-error-response-error.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `error` | `string` | Required | - | -## Example (as JSON) - -```json -{ - "error": "error2" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SingleErrorResponseError) { + console.log(error.result); + } } ``` diff --git a/doc/models/single-string-error-response-error.md b/doc/models/single-string-error-response-error.md index b03e7487..f506d024 100644 --- a/doc/models/single-string-error-response-error.md +++ b/doc/models/single-string-error-response-error.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `errors` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "errors": "errors4" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SingleStringErrorResponseError) { + console.log(error.result); + } } ``` diff --git a/doc/models/site-response.md b/doc/models/site-response.md index 26c6eb66..71e17826 100644 --- a/doc/models/site-response.md +++ b/doc/models/site-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `site` | [`Site`](../../doc/models/site.md) | Required | - | -## Example (as JSON) - -```json -{ - "site": { - "id": 64, - "name": "name4", - "subdomain": "subdomain0", - "currency": "currency4", - "seller_id": 228 - } -} +## Example + +```ts +import { SiteResponse } from '@maxio-com/advanced-billing-sdk'; + +const siteResponse: SiteResponse = { + site: { + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + sellerId: 228, + }, +}; ``` diff --git a/doc/models/site-statistics.md b/doc/models/site-statistics.md index cb70547b..e68a1064 100644 --- a/doc/models/site-statistics.md +++ b/doc/models/site-statistics.md @@ -21,15 +21,17 @@ | `totalUnpaidSubscriptions` | `number \| undefined` | Optional | - | | `totalDunningSubscriptions` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "total_subscriptions": 204, - "subscriptions_today": 134, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" -} +## Example + +```ts +import { SiteStatistics } from '@maxio-com/advanced-billing-sdk'; + +const siteStatistics: SiteStatistics = { + totalSubscriptions: 168, + subscriptionsToday: 170, + totalRevenue: 'total_revenue2', + revenueToday: 'revenue_today0', + revenueThisMonth: 'revenue_this_month0', +}; ``` diff --git a/doc/models/site-summary.md b/doc/models/site-summary.md index cb8489e0..065640be 100644 --- a/doc/models/site-summary.md +++ b/doc/models/site-summary.md @@ -15,21 +15,23 @@ | `siteCurrency` | `string \| undefined` | Optional | - | | `stats` | [`SiteStatistics \| undefined`](../../doc/models/site-statistics.md) | Optional | - | -## Example (as JSON) - -```json -{ - "seller_name": "seller_name0", - "site_name": "site_name4", - "site_id": 218, - "site_currency": "site_currency6", - "stats": { - "total_subscriptions": 110, - "subscriptions_today": 228, - "total_revenue": "total_revenue6", - "revenue_today": "revenue_today4", - "revenue_this_month": "revenue_this_month4" - } -} +## Example + +```ts +import { SiteSummary } from '@maxio-com/advanced-billing-sdk'; + +const siteSummary: SiteSummary = { + sellerName: 'seller_name4', + siteName: 'site_name8', + siteId: 252, + siteCurrency: 'site_currency0', + stats: { + totalSubscriptions: 110, + subscriptionsToday: 228, + totalRevenue: 'total_revenue6', + revenueToday: 'revenue_today4', + revenueThisMonth: 'revenue_this_month4', + }, +}; ``` diff --git a/doc/models/site.md b/doc/models/site.md index e061473a..0c7624b3 100644 --- a/doc/models/site.md +++ b/doc/models/site.md @@ -30,15 +30,17 @@ | `portalEnabled` | `boolean \| undefined` | Optional | Whether the Billing Portal is enabled for this site. | | `test` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 34, - "name": "name0", - "subdomain": "subdomain4", - "currency": "currency0", - "seller_id": 198 -} +## Example + +```ts +import { Site } from '@maxio-com/advanced-billing-sdk'; + +const site: Site = { + id: 64, + name: 'name4', + subdomain: 'subdomain0', + currency: 'currency4', + sellerId: 228, +}; ``` diff --git a/doc/models/sorting-direction.md b/doc/models/sorting-direction.md index 047e9eda..f5418733 100644 --- a/doc/models/sorting-direction.md +++ b/doc/models/sorting-direction.md @@ -14,3 +14,11 @@ Used for sorting results. | `Asc` | | `Desc` | +## Example + +```ts +import { SortingDirection } from '@maxio-com/advanced-billing-sdk'; + +const sortingDirection = SortingDirection.Asc; +``` + diff --git a/doc/models/status.md b/doc/models/status.md index a7a8dca1..6ddc89b4 100644 --- a/doc/models/status.md +++ b/doc/models/status.md @@ -16,3 +16,11 @@ | `Active` | | `Fulfilled` | +## Example + +```ts +import { Status } from '@maxio-com/advanced-billing-sdk'; + +const status = Status.Pending; +``` + diff --git a/doc/models/subscription-add-coupon-error.md b/doc/models/subscription-add-coupon-error.md index d2548ce6..4d841c77 100644 --- a/doc/models/subscription-add-coupon-error.md +++ b/doc/models/subscription-add-coupon-error.md @@ -14,25 +14,15 @@ | `couponCodes` | `string[] \| undefined` | Optional | - | | `subscription` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "codes": [ - "codes6", - "codes7", - "codes8" - ], - "coupon_code": [ - "coupon_code8", - "coupon_code7" - ], - "coupon_codes": [ - "coupon_codes2" - ], - "subscription": [ - "subscription8" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionAddCouponError) { + console.log(error.result); + } } ``` diff --git a/doc/models/subscription-component-allocation-error-item.md b/doc/models/subscription-component-allocation-error-item.md index 1115f743..3c45139a 100644 --- a/doc/models/subscription-component-allocation-error-item.md +++ b/doc/models/subscription-component-allocation-error-item.md @@ -12,12 +12,16 @@ | `kind` | `string \| undefined` | Optional | - | | `message` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "kind": "kind0", - "message": "message8" -} +```ts +import { + SubscriptionComponentAllocationErrorItem, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionComponentAllocationErrorItem: SubscriptionComponentAllocationErrorItem = { + kind: 'kind6', + message: 'message8', +}; ``` diff --git a/doc/models/subscription-component-allocation-error.md b/doc/models/subscription-component-allocation-error.md index dd01ab16..e42e5b78 100644 --- a/doc/models/subscription-component-allocation-error.md +++ b/doc/models/subscription-component-allocation-error.md @@ -11,16 +11,15 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionComponentAllocationErrorItem[] \| undefined`](../../doc/models/subscription-component-allocation-error-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": [ - { - "kind": "kind8", - "message": "message0" - } - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionComponentAllocationError) { + console.log(error.result); + } } ``` diff --git a/doc/models/subscription-component-response.md b/doc/models/subscription-component-response.md index da8e487d..1a81ccb9 100644 --- a/doc/models/subscription-component-response.md +++ b/doc/models/subscription-component-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `component` | [`SubscriptionComponent \| undefined`](../../doc/models/subscription-component.md) | Optional | - | -## Example (as JSON) - -```json -{ - "component": { - "id": 80, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false - } -} +## Example + +```ts +import { + ComponentKind, + SubscriptionComponentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionComponentResponse: SubscriptionComponentResponse = { + component: { + id: 80, + name: 'name8', + kind: ComponentKind.QuantityBasedComponent, + unitName: 'unit_name0', + enabled: false, + }, +}; ``` diff --git a/doc/models/subscription-component-subscription.md b/doc/models/subscription-component-subscription.md index 2d8d0fbc..738bad5b 100644 --- a/doc/models/subscription-component-subscription.md +++ b/doc/models/subscription-component-subscription.md @@ -1,7 +1,7 @@ # Subscription Component Subscription -An optional object, will be returned if provided `include=subscription` query param. +(Optional) Object that will be returned if the `include=subscription` query param is provided. ## Structure @@ -14,12 +14,17 @@ An optional object, will be returned if provided `include=subscription` query pa | `state` | [`SubscriptionState \| undefined`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `updatedAt` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "state": "paused", - "updated_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { + SubscriptionComponentSubscription, + SubscriptionState, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionComponentSubscription: SubscriptionComponentSubscription = { + state: SubscriptionState.Assessing, + updatedAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/subscription-component.md b/doc/models/subscription-component.md index 803b3b9a..6c75773b 100644 --- a/doc/models/subscription-component.md +++ b/doc/models/subscription-component.md @@ -13,8 +13,8 @@ | `name` | `string \| undefined` | Optional | - | | `kind` | [`ComponentKind \| undefined`](../../doc/models/component-kind.md) | Optional | A handle for the component type | | `unitName` | `string \| undefined` | Optional | - | -| `enabled` | `boolean \| undefined` | Optional | (for on/off components) indicates if the component is enabled for the subscription | -| `unitBalance` | `number \| undefined` | Optional | - | +| `enabled` | `boolean \| undefined` | Optional | (for on/off components) indicates if the component is enabled for the subscription. | +| `unitBalance` | [`SubscriptionComponentUnitBalance \| undefined`](../../doc/models/containers/subscription-component-unit-balance.md) | Optional | This is a container for one-of cases. | | `currency` | `string \| undefined` | Optional | - | | `allocatedQuantity` | [`SubscriptionComponentAllocatedQuantity \| undefined`](../../doc/models/containers/subscription-component-allocated-quantity.md) | Optional | This is a container for one-of cases. | | `pricingScheme` | [`PricingScheme \| null \| undefined`](../../doc/models/pricing-scheme.md) | Optional | - | @@ -36,21 +36,26 @@ | `useSiteExchangeRate` | `boolean \| null \| undefined` | Optional | - | | `description` | `string \| null \| undefined` | Optional | - | | `allowFractionalQuantities` | `boolean \| undefined` | Optional | - | -| `subscription` | [`SubscriptionComponentSubscription \| undefined`](../../doc/models/subscription-component-subscription.md) | Optional | An optional object, will be returned if provided `include=subscription` query param. | +| `subscription` | [`SubscriptionComponentSubscription \| undefined`](../../doc/models/subscription-component-subscription.md) | Optional | (Optional) Object that will be returned if the `include=subscription` query param is provided. | | `historicUsages` | [`HistoricUsage[] \| undefined`](../../doc/models/historic-usage.md) | Optional | - | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | -## Example (as JSON) - -```json -{ - "id": 20, - "name": "name8", - "kind": "quantity_based_component", - "unit_name": "unit_name0", - "enabled": false -} +## Example + +```ts +import { + ComponentKind, + SubscriptionComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionComponent: SubscriptionComponent = { + id: 254, + name: 'name8', + kind: ComponentKind.QuantityBasedComponent, + unitName: 'unit_name0', + enabled: false, +}; ``` diff --git a/doc/models/subscription-custom-price.md b/doc/models/subscription-custom-price.md index c64918cb..877b91c7 100644 --- a/doc/models/subscription-custom-price.md +++ b/doc/models/subscription-custom-price.md @@ -19,25 +19,30 @@ | `trialPriceInCents` | [`SubscriptionCustomPriceTrialPriceInCents \| undefined`](../../doc/models/containers/subscription-custom-price-trial-price-in-cents.md) | Optional | This is a container for one-of cases. | | `trialInterval` | [`SubscriptionCustomPriceTrialInterval \| undefined`](../../doc/models/containers/subscription-custom-price-trial-interval.md) | Optional | This is a container for one-of cases. | | `trialIntervalUnit` | [`IntervalUnit \| undefined`](../../doc/models/interval-unit.md) | Optional | (Optional) | -| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | +| `trialType` | [`TrialType \| null \| undefined`](../../doc/models/trial-type.md) | Optional | Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. | | `initialChargeInCents` | [`SubscriptionCustomPriceInitialChargeInCents \| undefined`](../../doc/models/containers/subscription-custom-price-initial-charge-in-cents.md) | Optional | This is a container for one-of cases. | | `initialChargeAfterTrial` | `boolean \| undefined` | Optional | (Optional) | | `expirationInterval` | [`SubscriptionCustomPriceExpirationInterval \| undefined`](../../doc/models/containers/subscription-custom-price-expiration-interval.md) | Optional | This is a container for one-of cases. | | `expirationIntervalUnit` | [`ExpirationIntervalUnit \| null \| undefined`](../../doc/models/expiration-interval-unit.md) | Optional | (Optional) | | `taxIncluded` | `boolean \| undefined` | Optional | (Optional) | -## Example (as JSON) - -```json -{ - "name": "name4", - "handle": "handle0", - "price_in_cents": "String3", - "interval": "String3", - "interval_unit": "day", - "trial_price_in_cents": "String3", - "trial_interval": "String5", - "trial_interval_unit": "day" -} +## Example + +```ts +import { + IntervalUnit, + SubscriptionCustomPrice, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionCustomPrice: SubscriptionCustomPrice = { + priceInCents: 'String5', + interval: 'String1', + intervalUnit: IntervalUnit.Day, + name: 'name2', + handle: 'handle8', + trialPriceInCents: 'String5', + trialInterval: 'String9', + trialIntervalUnit: IntervalUnit.Day, +}; ``` diff --git a/doc/models/subscription-date-field.md b/doc/models/subscription-date-field.md index 96ed6f37..9be83dd1 100644 --- a/doc/models/subscription-date-field.md +++ b/doc/models/subscription-date-field.md @@ -19,3 +19,11 @@ | `TrialEndedAt` | | `UpdatedAt` | +## Example + +```ts +import { SubscriptionDateField } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionDateField = SubscriptionDateField.UpdatedAt; +``` + diff --git a/doc/models/subscription-filter.md b/doc/models/subscription-filter.md index e6fe21e1..27f7d131 100644 --- a/doc/models/subscription-filter.md +++ b/doc/models/subscription-filter.md @@ -18,19 +18,25 @@ Nested filter used for List Subscription Components For Site Filter | `startDatetime` | `string \| undefined` | Optional | The start date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or after exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of start_date. To use this filter you also have to include the following param in the request `include=subscription`. | | `endDatetime` | `string \| undefined` | Optional | The end date and time (format YYYY-MM-DD HH:MM:SS) with which to filter the date_field. Returns components that belong to the subscription with a timestamp at or before exact time provided in query. You can specify timezone in query - otherwise your site''s time zone will be used. If provided, this parameter will be used instead of end_date. To use this filter you also have to include the following param in the request `include=subscription`. | -## Example (as JSON) - -```json -{ - "states": [ - "active", - "canceled" +## Example + +```ts +import { + SubscriptionFilter, + SubscriptionListDateField, + SubscriptionStateFilter, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionFilter: SubscriptionFilter = { + states: [ + SubscriptionStateFilter.Active, + SubscriptionStateFilter.Canceled ], - "start_date": "2024-01-17", - "end_date": "2024-01-31", - "start_datetime": "01/17/2024 09:15:30", - "end_datetime": "01/17/2024 17:20:06", - "date_field": "updated_at" -} + dateField: SubscriptionListDateField.UpdatedAt, + startDate: '2024-01-17', + endDate: '2024-01-31', + startDatetime: '2024-01-17T09:15:30+00:00', + endDatetime: '2024-01-17T17:20:06Z', +}; ``` diff --git a/doc/models/subscription-group-balances.md b/doc/models/subscription-group-balances.md index ed05c3d0..8b69cd02 100644 --- a/doc/models/subscription-group-balances.md +++ b/doc/models/subscription-group-balances.md @@ -14,30 +14,32 @@ | `openInvoices` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | - | | `pendingDiscounts` | [`AccountBalance \| undefined`](../../doc/models/account-balance.md) | Optional | - | -## Example (as JSON) - -```json -{ - "prepayments": { - "balance_in_cents": 192, - "automatic_balance_in_cents": 178, - "remittance_balance_in_cents": 146 +## Example + +```ts +import { SubscriptionGroupBalances } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupBalances: SubscriptionGroupBalances = { + prepayments: { + balanceInCents: BigInt(192), + automaticBalanceInCents: BigInt(178), + remittanceBalanceInCents: BigInt(146), + }, + serviceCredits: { + balanceInCents: BigInt(84), + automaticBalanceInCents: BigInt(70), + remittanceBalanceInCents: BigInt(38), }, - "service_credits": { - "balance_in_cents": 84, - "automatic_balance_in_cents": 70, - "remittance_balance_in_cents": 38 + openInvoices: { + balanceInCents: BigInt(40), + automaticBalanceInCents: BigInt(202), + remittanceBalanceInCents: BigInt(170), }, - "open_invoices": { - "balance_in_cents": 40, - "automatic_balance_in_cents": 202, - "remittance_balance_in_cents": 170 + pendingDiscounts: { + balanceInCents: BigInt(88), + automaticBalanceInCents: BigInt(154), + remittanceBalanceInCents: BigInt(134), }, - "pending_discounts": { - "balance_in_cents": 88, - "automatic_balance_in_cents": 154, - "remittance_balance_in_cents": 134 - } -} +}; ``` diff --git a/doc/models/subscription-group-bank-account.md b/doc/models/subscription-group-bank-account.md index 180b130a..7ab8729b 100644 --- a/doc/models/subscription-group-bank-account.md +++ b/doc/models/subscription-group-bank-account.md @@ -11,9 +11,9 @@ | --- | --- | --- | --- | | `bankName` | `string \| undefined` | Optional | (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides | | `bankAccountNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number | -| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API | -| `bankIban` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided | -| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided | +| `bankRoutingNumber` | `string \| undefined` | Optional | (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless.) The routing number of the bank. It becomes bank_code while passing via GoCardless API. | +| `bankIban` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. | +| `bankBranchCode` | `string \| undefined` | Optional | (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. | | `bankAccountType` | [`BankAccountType \| undefined`](../../doc/models/bank-account-type.md) | Optional | Defaults to checking | | `bankAccountHolderType` | [`BankAccountHolderType \| undefined`](../../doc/models/bank-account-holder-type.md) | Optional | Defaults to personal | | `paymentType` | [`PaymentType \| undefined`](../../doc/models/payment-type.md) | Optional | - | @@ -26,15 +26,19 @@ | `currentVault` | [`BankAccountVault \| undefined`](../../doc/models/bank-account-vault.md) | Optional | The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. | | `gatewayHandle` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "bank_name": "bank_name2", - "bank_account_number": "bank_account_number4", - "bank_routing_number": "bank_routing_number8", - "bank_iban": "bank_iban6", - "bank_branch_code": "bank_branch_code6" -} +```ts +import { + SubscriptionGroupBankAccount, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupBankAccount: SubscriptionGroupBankAccount = { + bankName: 'bank_name2', + bankAccountNumber: 'bank_account_number4', + bankRoutingNumber: 'bank_routing_number8', + bankIban: 'bank_iban6', + bankBranchCode: 'bank_branch_code6', +}; ``` diff --git a/doc/models/subscription-group-component-custom-price.md b/doc/models/subscription-group-component-custom-price.md index badf0e64..3f235c44 100644 --- a/doc/models/subscription-group-component-custom-price.md +++ b/doc/models/subscription-group-component-custom-price.md @@ -15,34 +15,73 @@ Used in place of `price_point_id` to define a custom price point unique to the s | `prices` | [`Price[] \| undefined`](../../doc/models/price.md) | Optional | - | | `overagePricing` | [`ComponentCustomPrice[] \| undefined`](../../doc/models/component-custom-price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "pricing_scheme": "per_unit", - "prices": [ +```ts +import { + IntervalUnit, + PricingScheme, + SubscriptionGroupComponentCustomPrice, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupComponentCustomPrice: SubscriptionGroupComponentCustomPrice = { + pricingScheme: PricingScheme.Stairstep, + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "overage_pricing": [ + overagePricing: [ + { + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + } + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, + }, { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, + }, + { + prices: [ + { + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, + } + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, } - ] -} + ], +}; ``` diff --git a/doc/models/subscription-group-create-error-response-error.md b/doc/models/subscription-group-create-error-response-error.md index f22bec81..f2127b97 100644 --- a/doc/models/subscription-group-create-error-response-error.md +++ b/doc/models/subscription-group-create-error-response-error.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupCreateErrorResponseErrors`](../../doc/models/containers/subscription-group-create-error-response-errors.md) | Required | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members6" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionGroupCreateErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/subscription-group-credit-card.md b/doc/models/subscription-group-credit-card.md index 97f64592..a1995818 100644 --- a/doc/models/subscription-group-credit-card.md +++ b/doc/models/subscription-group-credit-card.md @@ -30,16 +30,21 @@ | `cvv` | `string \| undefined` | Optional | - | | `paymentType` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "chargify_token": "tok_592nf92ng0sjd4300p", - "full_number": 4111111111111111, - "vault_token": "vault_token6", - "current_vault": "braintree_blue", - "gateway_handle": "gateway_handle6", - "first_name": "first_name4" -} +## Example + +```ts +import { + CreditCardVault, + SubscriptionGroupCreditCard, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupCreditCard: SubscriptionGroupCreditCard = { + chargifyToken: 'tok_592nf92ng0sjd4300p', + vaultToken: 'vault_token0', + currentVault: CreditCardVault.BlueSnap, + gatewayHandle: 'gateway_handle0', + firstName: 'first_name8', + fullNumber: 4111111111111111, +}; ``` diff --git a/doc/models/subscription-group-customer.md b/doc/models/subscription-group-customer.md index 0ddab126..2c939451 100644 --- a/doc/models/subscription-group-customer.md +++ b/doc/models/subscription-group-customer.md @@ -15,15 +15,17 @@ | `email` | `string \| undefined` | Optional | - | | `reference` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "first_name": "first_name4", - "last_name": "last_name2", - "organization": "organization2", - "email": "email2", - "reference": "reference0" -} +## Example + +```ts +import { SubscriptionGroupCustomer } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupCustomer: SubscriptionGroupCustomer = { + firstName: 'first_name6', + lastName: 'last_name4', + organization: 'organization0', + email: 'email0', + reference: 'reference8', +}; ``` diff --git a/doc/models/subscription-group-include.md b/doc/models/subscription-group-include.md index a9b79d1a..5a64bc73 100644 --- a/doc/models/subscription-group-include.md +++ b/doc/models/subscription-group-include.md @@ -11,3 +11,11 @@ | --- | | `CurrentBillingAmountInCents` | +## Example + +```ts +import { SubscriptionGroupInclude } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupInclude = SubscriptionGroupInclude.CurrentBillingAmountInCents; +``` + diff --git a/doc/models/subscription-group-item.md b/doc/models/subscription-group-item.md index 5ad4a40b..206263bc 100644 --- a/doc/models/subscription-group-item.md +++ b/doc/models/subscription-group-item.md @@ -20,15 +20,17 @@ | `totalRevenueInCents` | `bigint \| undefined` | Optional | - | | `balanceInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 16, - "reference": "reference8", - "product_id": 214, - "product_handle": "product_handle4", - "product_price_point_id": 138 -} +## Example + +```ts +import { SubscriptionGroupItem } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupItem: SubscriptionGroupItem = { + id: 26, + reference: 'reference4', + productId: 32, + productHandle: 'product_handle8', + productPricePointId: 148, +}; ``` diff --git a/doc/models/subscription-group-members-array-error.md b/doc/models/subscription-group-members-array-error.md index 36a86aea..df3656fa 100644 --- a/doc/models/subscription-group-members-array-error.md +++ b/doc/models/subscription-group-members-array-error.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | | `members` | `string[]` | Required | - | -## Example (as JSON) - -```json -{ - "members": [ - "members6" - ] -} +## Example + +```ts +import { + SubscriptionGroupMembersArrayError, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupMembersArrayError: SubscriptionGroupMembersArrayError = { + members: [ + 'members6' + ], +}; ``` diff --git a/doc/models/subscription-group-payment-profile.md b/doc/models/subscription-group-payment-profile.md index 2c14926c..34887869 100644 --- a/doc/models/subscription-group-payment-profile.md +++ b/doc/models/subscription-group-payment-profile.md @@ -14,14 +14,18 @@ | `lastName` | `string \| undefined` | Optional | - | | `maskedCardNumber` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 22, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" -} +## Example + +```ts +import { + SubscriptionGroupPaymentProfile, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupPaymentProfile: SubscriptionGroupPaymentProfile = { + id: 246, + firstName: 'first_name6', + lastName: 'last_name4', + maskedCardNumber: 'masked_card_number4', +}; ``` diff --git a/doc/models/subscription-group-prepayment-method.md b/doc/models/subscription-group-prepayment-method.md index fb11c3df..0d5e5c03 100644 --- a/doc/models/subscription-group-prepayment-method.md +++ b/doc/models/subscription-group-prepayment-method.md @@ -16,3 +16,13 @@ | `PaypalAccount` | | `Other` | +## Example + +```ts +import { + SubscriptionGroupPrepaymentMethod, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupPrepaymentMethod = SubscriptionGroupPrepaymentMethod.Check; +``` + diff --git a/doc/models/subscription-group-prepayment-request.md b/doc/models/subscription-group-prepayment-request.md index 1325febe..710e6f9d 100644 --- a/doc/models/subscription-group-prepayment-request.md +++ b/doc/models/subscription-group-prepayment-request.md @@ -11,16 +11,21 @@ | --- | --- | --- | --- | | `prepayment` | [`SubscriptionGroupPrepayment`](../../doc/models/subscription-group-prepayment.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepayment": { - "amount": 136, - "details": "details8", - "memo": "memo2", - "method": "paypal_account" - } -} +## Example + +```ts +import { + SubscriptionGroupPrepaymentMethod, + SubscriptionGroupPrepaymentRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupPrepaymentRequest: SubscriptionGroupPrepaymentRequest = { + prepayment: { + amount: 136, + details: 'details8', + memo: 'memo2', + method: SubscriptionGroupPrepaymentMethod.PaypalAccount, + }, +}; ``` diff --git a/doc/models/subscription-group-prepayment-response.md b/doc/models/subscription-group-prepayment-response.md index 7e62cfde..fb9a0b89 100644 --- a/doc/models/subscription-group-prepayment-response.md +++ b/doc/models/subscription-group-prepayment-response.md @@ -15,15 +15,20 @@ | `entryType` | [`ServiceCreditType \| undefined`](../../doc/models/service-credit-type.md) | Optional | The type of entry | | `memo` | `string \| null \| undefined` | Optional | A memo attached to the entry. | -## Example (as JSON) - -```json -{ - "id": 110, - "amount_in_cents": 196, - "ending_balance_in_cents": 236, - "entry_type": "Credit", - "memo": "memo2" -} +## Example + +```ts +import { + ServiceCreditType, + SubscriptionGroupPrepaymentResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupPrepaymentResponse: SubscriptionGroupPrepaymentResponse = { + id: 32, + amountInCents: BigInt(138), + endingBalanceInCents: BigInt(158), + entryType: ServiceCreditType.Credit, + memo: 'memo2', +}; ``` diff --git a/doc/models/subscription-group-prepayment.md b/doc/models/subscription-group-prepayment.md index 044822e2..4247e04d 100644 --- a/doc/models/subscription-group-prepayment.md +++ b/doc/models/subscription-group-prepayment.md @@ -14,14 +14,19 @@ | `memo` | `string` | Required | - | | `method` | [`SubscriptionGroupPrepaymentMethod`](../../doc/models/subscription-group-prepayment-method.md) | Required | - | -## Example (as JSON) - -```json -{ - "amount": 96, - "details": "details2", - "memo": "memo6", - "method": "money_order" -} +## Example + +```ts +import { + SubscriptionGroupPrepayment, + SubscriptionGroupPrepaymentMethod, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupPrepayment: SubscriptionGroupPrepayment = { + amount: 12, + details: 'details4', + memo: 'memo8', + method: SubscriptionGroupPrepaymentMethod.MoneyOrder, +}; ``` diff --git a/doc/models/subscription-group-response.md b/doc/models/subscription-group-response.md index 84872a36..a8df9d53 100644 --- a/doc/models/subscription-group-response.md +++ b/doc/models/subscription-group-response.md @@ -11,25 +11,30 @@ | --- | --- | --- | --- | | `subscriptionGroup` | [`SubscriptionGroup`](../../doc/models/subscription-group.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "uid": "uid8", - "customer_id": 220, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" +## Example + +```ts +import { + CollectionMethod, + SubscriptionGroupResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupResponse: SubscriptionGroupResponse = { + subscriptionGroup: { + uid: 'uid8', + customerId: 220, + paymentProfile: { + id: 44, + firstName: 'first_name4', + lastName: 'last_name2', + maskedCardNumber: 'masked_card_number2', }, - "payment_collection_method": "prepaid", - "subscription_ids": [ + paymentCollectionMethod: CollectionMethod.Prepaid, + subscriptionIds: [ 74, 75 - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/subscription-group-signup-component.md b/doc/models/subscription-group-signup-component.md index 0bd62a95..40aa987f 100644 --- a/doc/models/subscription-group-signup-component.md +++ b/doc/models/subscription-group-signup-component.md @@ -15,73 +15,79 @@ | `pricePointId` | [`SubscriptionGroupSignupComponentPricePointId \| undefined`](../../doc/models/containers/subscription-group-signup-component-price-point-id.md) | Optional | This is a container for one-of cases. | | `customPrice` | [`SubscriptionGroupComponentCustomPrice \| undefined`](../../doc/models/subscription-group-component-custom-price.md) | Optional | Used in place of `price_point_id` to define a custom price point unique to the subscription. You still need to provide `component_id`. | -## Example (as JSON) +## Example -```json -{ - "component_id": "String1", - "allocated_quantity": "String5", - "unit_balance": "String9", - "price_point_id": "String5", - "custom_price": { - "pricing_scheme": "stairstep", - "prices": [ +```ts +import { + IntervalUnit, + PricingScheme, + SubscriptionGroupSignupComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupComponent: SubscriptionGroupSignupComponent = { + componentId: 'String7', + allocatedQuantity: 'String1', + unitBalance: 'String5', + pricePointId: 'String1', + customPrice: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } ], - "overage_pricing": [ + overagePricing: [ { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, }, { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, }, { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 230, - "interval_unit": "day", - "list_price_point_id": 10, - "prices": [ + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 230, + intervalUnit: IntervalUnit.Day, + listPricePointId: 10, } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/subscription-group-signup-error-response-error.md b/doc/models/subscription-group-signup-error-response-error.md index 2f315dfb..1ef16a5e 100644 --- a/doc/models/subscription-group-signup-error-response-error.md +++ b/doc/models/subscription-group-signup-error-response-error.md @@ -11,59 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupSignupError`](../../doc/models/subscription-group-signup-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "subscriptions": { - "0": { - "payment_profile.chargify_token": [ - "Chargify token not found" - ], - "product": [ - "Product must be among the Products for this Site" - ], - "product_price_point_id": [ - "Product price point must belong to product." - ], - "base": [ - "No payment method was on file for the $30.00 balance'" - ], - "payment_profile.expiration_month": [ - "Credit card expiration month: cannot be blank." - ], - "payment_profile.expiration_year": [ - "Credit card expiration year: cannot be blank." - ], - "payment_profile.full_number": [ - "Credit card number: cannot be blank." - ], - "payment_profile": [ - "payment_profile2" - ] - } - }, - "payer_reference": "payer_reference4", - "payer": { - "last_name": [ - "last_name5", - "last_name6" - ], - "first_name": [ - "first_name8" - ], - "email": [ - "email0", - "email9" - ] - }, - "subscription_group": [ - "subscription_group7", - "subscription_group8", - "subscription_group9" - ], - "payment_profile_id": "payment_profile_id8" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionGroupSignupErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/subscription-group-signup-error.md b/doc/models/subscription-group-signup-error.md index 015eebb9..18b6c981 100644 --- a/doc/models/subscription-group-signup-error.md +++ b/doc/models/subscription-group-signup-error.md @@ -16,67 +16,90 @@ | `paymentProfileId` | `string \| undefined` | Optional | - | | `payerId` | `string \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions": { - "key0": { - "product": [ - "product9" +```ts +import { + SubscriptionGroupSignupError, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupError: SubscriptionGroupSignupError = { + subscriptions: { + 'key0': { + product: [ + 'product9' + ], + productPricePointId: [ + 'product_price_point_id7' + ], + paymentProfile: [ + 'payment_profile2' + ], + paymentProfileChargifyToken: [ + 'payment_profile.chargify_token6' + ], + base: [ + 'base5', + 'base6' ], - "product_price_point_id": [ - "product_price_point_id7" + }, + 'key1': { + product: [ + 'product9' + ], + productPricePointId: [ + 'product_price_point_id7' + ], + paymentProfile: [ + 'payment_profile2' ], - "payment_profile": [ - "payment_profile2" + paymentProfileChargifyToken: [ + 'payment_profile.chargify_token6' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + base: [ + 'base5', + 'base6' ], - "base": [ - "base5", - "base6" - ] }, - "key1": { - "product": [ - "product9" + 'key2': { + product: [ + 'product9' ], - "product_price_point_id": [ - "product_price_point_id7" + productPricePointId: [ + 'product_price_point_id7' ], - "payment_profile": [ - "payment_profile2" + paymentProfile: [ + 'payment_profile2' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token6" + paymentProfileChargifyToken: [ + 'payment_profile.chargify_token6' + ], + base: [ + 'base5', + 'base6' ], - "base": [ - "base5", - "base6" - ] } }, - "payer_reference": "payer_reference0", - "payer": { - "last_name": [ - "last_name5", - "last_name6" + payerReference: 'payer_reference8', + payer: { + lastName: [ + 'last_name5', + 'last_name6' + ], + firstName: [ + 'first_name8' ], - "first_name": [ - "first_name8" + email: [ + 'email0', + 'email9' ], - "email": [ - "email0", - "email9" - ] }, - "subscription_group": [ - "subscription_group1", - "subscription_group2" + subscriptionGroup: [ + 'subscription_group3', + 'subscription_group4', + 'subscription_group5' ], - "payment_profile_id": "payment_profile_id2" -} + paymentProfileId: 'payment_profile_id4', +}; ``` diff --git a/doc/models/subscription-group-signup-event-data.md b/doc/models/subscription-group-signup-event-data.md index d4174348..473e788d 100644 --- a/doc/models/subscription-group-signup-event-data.md +++ b/doc/models/subscription-group-signup-event-data.md @@ -12,30 +12,34 @@ | `subscriptionGroup` | [`SubscriptionGroupSignupFailureData`](../../doc/models/subscription-group-signup-failure-data.md) | Required | - | | `customer` | [`Customer \| null`](../../doc/models/customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription_group": { - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_profile_id": 128, - "payment_collection_method": "payment_collection_method8", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } +## Example + +```ts +import { + SubscriptionGroupSignupEventData, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupEventData: SubscriptionGroupSignupEventData = { + subscriptionGroup: { + payerId: 150, + payerReference: 'payer_reference6', + paymentProfileId: 128, + paymentCollectionMethod: 'payment_collection_method8', + payerAttributes: { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails2', + organization: 'organization6', + }, }, - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} + customer: { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', + }, +}; ``` diff --git a/doc/models/subscription-group-signup-failure-data.md b/doc/models/subscription-group-signup-failure-data.md index 2df23cdd..8fee90c6 100644 --- a/doc/models/subscription-group-signup-failure-data.md +++ b/doc/models/subscription-group-signup-failure-data.md @@ -18,21 +18,25 @@ | `bankAccountAttributes` | [`SubscriptionGroupBankAccount \| undefined`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`SubscriptionGroupSignupItem[] \| undefined`](../../doc/models/subscription-group-signup-item.md) | Optional | - | -## Example (as JSON) - -```json -{ - "payer_id": 16, - "payer_reference": "payer_reference8", - "payment_profile_id": 6, - "payment_collection_method": "payment_collection_method0", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} +## Example + +```ts +import { + SubscriptionGroupSignupFailureData, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupFailureData: SubscriptionGroupSignupFailureData = { + payerId: 236, + payerReference: 'payer_reference2', + paymentProfileId: 42, + paymentCollectionMethod: 'payment_collection_method4', + payerAttributes: { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails2', + organization: 'organization6', + }, +}; ``` diff --git a/doc/models/subscription-group-signup-item.md b/doc/models/subscription-group-signup-item.md index 51a692c7..13060b6d 100644 --- a/doc/models/subscription-group-signup-item.md +++ b/doc/models/subscription-group-signup-item.md @@ -13,29 +13,31 @@ | `productId` | `number \| undefined` | Optional | The Product ID of the product for which you are creating a subscription. You can pass either `product_id` or `product_handle`. | | `productPricePointId` | `number \| undefined` | Optional | The ID of the particular price point on the product. | | `productPricePointHandle` | `string \| undefined` | Optional | The user-friendly API handle of a product's particular price point. | -| `offerId` | `number \| undefined` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:` | -| `reference` | `string \| undefined` | Optional | The reference value (provided by your app) for the subscription itelf. | +| `offerId` | `number \| undefined` | Optional | Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`. | +| `reference` | `string \| undefined` | Optional | The reference value (provided by your app) for the subscription itself. | | `primary` | `boolean \| undefined` | Optional | One of the subscriptions must be marked as primary in the group. | | `currency` | `string \| undefined` | Optional | (Optional) If Multi-Currency is enabled and the currency is configured in Chargify, pass it at signup to create a subscription on a non-default currency. Note that you cannot update the currency of an existing subscription. | | `couponCodes` | `string[] \| undefined` | Optional | An array for all the coupons attached to the subscription. | | `components` | [`SubscriptionGroupSignupComponent[] \| undefined`](../../doc/models/subscription-group-signup-component.md) | 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. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. | -| `calendarBilling` | [`CalendarBilling \| undefined`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at | +| `calendarBilling` | [`CalendarBilling \| undefined`](../../doc/models/calendar-billing.md) | Optional | (Optional). Cannot be used when also specifying next_billing_at. | | `metafields` | `Record \| undefined` | Optional | (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. | -## Example (as JSON) +## Example -```json -{ - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" +```ts +import { SubscriptionGroupSignupItem } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupItem: SubscriptionGroupSignupItem = { + productHandle: 'product_handle8', + productId: 12, + productPricePointId: 192, + productPricePointHandle: 'product_price_point_handle8', + offerId: 172, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "product_handle": "product_handle2", - "product_id": 34, - "product_price_point_id": 214, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 150 -} +}; ``` diff --git a/doc/models/subscription-group-signup-request.md b/doc/models/subscription-group-signup-request.md index e96a43d5..15bbdb6c 100644 --- a/doc/models/subscription-group-signup-request.md +++ b/doc/models/subscription-group-signup-request.md @@ -11,36 +11,41 @@ | --- | --- | --- | --- | | `subscriptionGroup` | [`SubscriptionGroupSignup`](../../doc/models/subscription-group-signup.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "subscriptions": [ +```ts +import { + CollectionMethod, + SubscriptionGroupSignupRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupRequest: SubscriptionGroupSignupRequest = { + subscriptionGroup: { + subscriptions: [ { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" + productHandle: 'product_handle8', + productId: 144, + productPricePointId: 68, + productPricePointHandle: 'product_price_point_handle4', + offerId: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 } ], - "payment_profile_id": 128, - "payer_id": 150, - "payer_reference": "payer_reference6", - "payment_collection_method": "prepaid", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } - } -} + paymentProfileId: 128, + payerId: 150, + payerReference: 'payer_reference6', + paymentCollectionMethod: CollectionMethod.Prepaid, + payerAttributes: { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails2', + organization: 'organization6', + }, + }, +}; ``` diff --git a/doc/models/subscription-group-signup-response.md b/doc/models/subscription-group-signup-response.md index 1aede4ed..7f5e9679 100644 --- a/doc/models/subscription-group-signup-response.md +++ b/doc/models/subscription-group-signup-response.md @@ -21,19 +21,21 @@ | `subscriptions` | [`SubscriptionGroupItem[] \| undefined`](../../doc/models/subscription-group-item.md) | Optional | - | | `paymentCollectionMethod` | [`CollectionMethod \| undefined`](../../doc/models/collection-method.md) | Optional | The type of payment collection to be used in the subscription. For legacy Statements Architecture valid options are - `invoice`, `automatic`. For current Relationship Invoicing Architecture valid options are - `remittance`, `automatic`, `prepaid`. | -## Example (as JSON) - -```json -{ - "uid": "uid8", - "scheme": 28, - "customer_id": 48, - "payment_profile_id": 44, - "subscription_ids": [ - 158, - 159, - 160 - ] -} +## Example + +```ts +import { + SubscriptionGroupSignupResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignupResponse: SubscriptionGroupSignupResponse = { + uid: 'uid4', + scheme: 60, + customerId: 80, + paymentProfileId: 244, + subscriptionIds: [ + 190 + ], +}; ``` diff --git a/doc/models/subscription-group-signup.md b/doc/models/subscription-group-signup.md index dd72b33c..c55e1329 100644 --- a/doc/models/subscription-group-signup.md +++ b/doc/models/subscription-group-signup.md @@ -18,34 +18,39 @@ | `bankAccountAttributes` | [`SubscriptionGroupBankAccount \| undefined`](../../doc/models/subscription-group-bank-account.md) | Optional | - | | `subscriptions` | [`SubscriptionGroupSignupItem[]`](../../doc/models/subscription-group-signup-item.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscriptions": [ +```ts +import { + CollectionMethod, + SubscriptionGroupSignup, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSignup: SubscriptionGroupSignup = { + subscriptions: [ { - "metafields": { - "custom_field_name_1": "custom_field_value_1", - "custom_field_name_2": "custom_field_value_2" + productHandle: 'product_handle8', + productId: 144, + productPricePointId: 68, + productPricePointHandle: 'product_price_point_handle4', + offerId: 40, + metafields: { + 'custom_field_name_1': 'custom_field_value_1', + 'custom_field_name_2': 'custom_field_value_2' }, - "product_handle": "product_handle8", - "product_id": 144, - "product_price_point_id": 68, - "product_price_point_handle": "product_price_point_handle4", - "offer_id": 40 } ], - "payment_profile_id": 42, - "payer_id": 64, - "payer_reference": "payer_reference8", - "payment_collection_method": "automatic", - "payer_attributes": { - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails2", - "organization": "organization6" - } -} + paymentProfileId: 124, + payerId: 146, + payerReference: 'payer_reference0', + paymentCollectionMethod: CollectionMethod.Prepaid, + payerAttributes: { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails2', + organization: 'organization6', + }, +}; ``` diff --git a/doc/models/subscription-group-single-error.md b/doc/models/subscription-group-single-error.md index 905ad863..26afcfc6 100644 --- a/doc/models/subscription-group-single-error.md +++ b/doc/models/subscription-group-single-error.md @@ -11,11 +11,15 @@ | --- | --- | --- | --- | | `subscriptionGroup` | `string` | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": "subscription_group2" -} +```ts +import { + SubscriptionGroupSingleError, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSingleError: SubscriptionGroupSingleError = { + subscriptionGroup: 'subscription_group0', +}; ``` diff --git a/doc/models/subscription-group-subscription-error.md b/doc/models/subscription-group-subscription-error.md index db2eb688..73c47e17 100644 --- a/doc/models/subscription-group-subscription-error.md +++ b/doc/models/subscription-group-subscription-error.md @@ -20,31 +20,35 @@ Object which contains subscription errors. | `paymentProfileExpirationYear` | `string[] \| undefined` | Optional | - | | `paymentProfileFullNumber` | `string[] \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "product": [ - "product7", - "product6" +```ts +import { + SubscriptionGroupSubscriptionError, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupSubscriptionError: SubscriptionGroupSubscriptionError = { + product: [ + 'product7', + 'product8' + ], + productPricePointId: [ + 'product_price_point_id3', + 'product_price_point_id4' ], - "product_price_point_id": [ - "product_price_point_id9", - "product_price_point_id0" + paymentProfile: [ + 'payment_profile8', + 'payment_profile9' ], - "payment_profile": [ - "payment_profile4", - "payment_profile5" + paymentProfileChargifyToken: [ + 'payment_profile.chargify_token2', + 'payment_profile.chargify_token3' ], - "payment_profile.chargify_token": [ - "payment_profile.chargify_token8", - "payment_profile.chargify_token9" + base: [ + 'base1', + 'base2', + 'base3' ], - "base": [ - "base7", - "base8", - "base9" - ] -} +}; ``` diff --git a/doc/models/subscription-group-update-error-response-error.md b/doc/models/subscription-group-update-error-response-error.md index 7783fe30..daf35208 100644 --- a/doc/models/subscription-group-update-error-response-error.md +++ b/doc/models/subscription-group-update-error-response-error.md @@ -11,15 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`SubscriptionGroupUpdateError \| undefined`](../../doc/models/subscription-group-update-error.md) | Optional | - | -## Example (as JSON) - -```json -{ - "errors": { - "members": [ - "members2", - "members1" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionGroupUpdateErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/subscription-group-update-error.md b/doc/models/subscription-group-update-error.md index a714ed9c..da3d65cc 100644 --- a/doc/models/subscription-group-update-error.md +++ b/doc/models/subscription-group-update-error.md @@ -11,15 +11,18 @@ | --- | --- | --- | --- | | `members` | `string[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "members": [ - "members4", - "members5", - "members6" - ] -} +## Example + +```ts +import { + SubscriptionGroupUpdateError, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupUpdateError: SubscriptionGroupUpdateError = { + members: [ + 'members6', + 'members7' + ], +}; ``` diff --git a/doc/models/subscription-group.md b/doc/models/subscription-group.md index 2692cec9..6f39bd1f 100644 --- a/doc/models/subscription-group.md +++ b/doc/models/subscription-group.md @@ -16,24 +16,29 @@ | `subscriptionIds` | `number[] \| undefined` | Optional | - | | `createdAt` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "uid": "uid4", - "customer_id": 36, - "payment_profile": { - "id": 44, - "first_name": "first_name4", - "last_name": "last_name2", - "masked_card_number": "masked_card_number2" +## Example + +```ts +import { + CollectionMethod, + SubscriptionGroup, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroup: SubscriptionGroup = { + uid: 'uid8', + customerId: 78, + paymentProfile: { + id: 44, + firstName: 'first_name4', + lastName: 'last_name2', + maskedCardNumber: 'masked_card_number2', }, - "payment_collection_method": "prepaid", - "subscription_ids": [ - 146, - 147, - 148 - ] -} + paymentCollectionMethod: CollectionMethod.Automatic, + subscriptionIds: [ + 188, + 189, + 190 + ], +}; ``` diff --git a/doc/models/subscription-groups-list-include.md b/doc/models/subscription-groups-list-include.md index fc6245e9..2e4b2586 100644 --- a/doc/models/subscription-groups-list-include.md +++ b/doc/models/subscription-groups-list-include.md @@ -11,3 +11,13 @@ | --- | | `AccountBalances` | +## Example + +```ts +import { + SubscriptionGroupsListInclude, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionGroupsListInclude = SubscriptionGroupsListInclude.AccountBalances; +``` + diff --git a/doc/models/subscription-include.md b/doc/models/subscription-include.md index a5f953d1..a68177f0 100644 --- a/doc/models/subscription-include.md +++ b/doc/models/subscription-include.md @@ -12,3 +12,11 @@ | `Coupons` | | `SelfServicePageToken` | +## Example + +```ts +import { SubscriptionInclude } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionInclude = SubscriptionInclude.Coupons; +``` + diff --git a/doc/models/subscription-included-coupon.md b/doc/models/subscription-included-coupon.md index d33544d1..25f54219 100644 --- a/doc/models/subscription-included-coupon.md +++ b/doc/models/subscription-included-coupon.md @@ -17,17 +17,19 @@ | `amountInCents` | `bigint \| null \| undefined` | Optional | **Constraints**: `>= 0` | | `percentage` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "code": "\"ABCD_10\"", - "use_count": 2, - "uses_allowed": 10, - "expires_at": "\"2023-07-13T05:18:58-04:00\"", - "amount_in_cents": 1000, - "percentage": "\"15.0\"", - "recurring": false -} +## Example + +```ts +import { SubscriptionIncludedCoupon } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionIncludedCoupon: SubscriptionIncludedCoupon = { + code: '"ABCD_10"', + useCount: 2, + usesAllowed: 10, + expiresAt: '"2023-07-13T05:18:58-04:00"', + recurring: false, + amountInCents: BigInt(1000), + percentage: '"15.0"', +}; ``` diff --git a/doc/models/subscription-list-date-field.md b/doc/models/subscription-list-date-field.md index da66051e..c7c153f1 100644 --- a/doc/models/subscription-list-date-field.md +++ b/doc/models/subscription-list-date-field.md @@ -13,7 +13,9 @@ ## Example -``` -updated_at +```ts +import { SubscriptionListDateField } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionListDateField = SubscriptionListDateField.UpdatedAt; ``` diff --git a/doc/models/subscription-list-include.md b/doc/models/subscription-list-include.md index 27359075..5b518abb 100644 --- a/doc/models/subscription-list-include.md +++ b/doc/models/subscription-list-include.md @@ -10,4 +10,15 @@ | Name | | --- | | `SelfServicePageToken` | +| `CurrentAccountBalanceInCents` | +| `CurrentBillingAmount` | +| `Coupons` | + +## Example + +```ts +import { SubscriptionListInclude } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionListInclude = SubscriptionListInclude.SelfServicePageToken; +``` diff --git a/doc/models/subscription-migration-preview-options.md b/doc/models/subscription-migration-preview-options.md index 46188050..ee126a6b 100644 --- a/doc/models/subscription-migration-preview-options.md +++ b/doc/models/subscription-migration-preview-options.md @@ -20,16 +20,20 @@ | `proration` | [`Proration \| undefined`](../../doc/models/proration.md) | Optional | - | | `prorationDate` | `string \| undefined` | Optional | The date that the proration is calculated from for the preview | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 242, - "product_price_point_id": 166 -} +## Example + +```ts +import { + SubscriptionMigrationPreviewOptions, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMigrationPreviewOptions: SubscriptionMigrationPreviewOptions = { + productId: 70, + productPricePointId: 250, + includeTrial: false, + includeInitialCharge: false, + includeCoupons: true, + preservePeriod: false, +}; ``` diff --git a/doc/models/subscription-migration-preview-request.md b/doc/models/subscription-migration-preview-request.md index bc501732..daadbbc9 100644 --- a/doc/models/subscription-migration-preview-request.md +++ b/doc/models/subscription-migration-preview-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreviewOptions`](../../doc/models/subscription-migration-preview-options.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ts +import { + SubscriptionMigrationPreviewRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMigrationPreviewRequest: SubscriptionMigrationPreviewRequest = { + migration: { + productId: 158, + productPricePointId: 82, + includeTrial: false, + includeInitialCharge: false, + includeCoupons: true, + preservePeriod: false, + }, +}; ``` diff --git a/doc/models/subscription-migration-preview-response.md b/doc/models/subscription-migration-preview-response.md index a46b86d2..0512400a 100644 --- a/doc/models/subscription-migration-preview-response.md +++ b/doc/models/subscription-migration-preview-response.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionMigrationPreview`](../../doc/models/subscription-migration-preview.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "prorated_adjustment_in_cents": 196, - "charge_in_cents": 78, - "payment_due_in_cents": 250, - "credit_applied_in_cents": 210 - } -} +## Example + +```ts +import { + SubscriptionMigrationPreviewResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMigrationPreviewResponse: SubscriptionMigrationPreviewResponse = { + migration: { + proratedAdjustmentInCents: BigInt(196), + chargeInCents: BigInt(78), + paymentDueInCents: BigInt(250), + creditAppliedInCents: BigInt(210), + }, +}; ``` diff --git a/doc/models/subscription-migration-preview.md b/doc/models/subscription-migration-preview.md index ea69ce65..b3bfff2c 100644 --- a/doc/models/subscription-migration-preview.md +++ b/doc/models/subscription-migration-preview.md @@ -14,14 +14,18 @@ | `paymentDueInCents` | `bigint \| undefined` | Optional | The amount of the payment due in the case of an upgrade. | | `creditAppliedInCents` | `bigint \| undefined` | Optional | Represents a credit in cents that is applied to your subscription as part of a migration process for a specific product, which reduces the amount owed for the subscription. | -## Example (as JSON) - -```json -{ - "prorated_adjustment_in_cents": 134, - "charge_in_cents": 16, - "payment_due_in_cents": 188, - "credit_applied_in_cents": 148 -} +## Example + +```ts +import { + SubscriptionMigrationPreview, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMigrationPreview: SubscriptionMigrationPreview = { + proratedAdjustmentInCents: BigInt(6), + chargeInCents: BigInt(144), + paymentDueInCents: BigInt(60), + creditAppliedInCents: BigInt(20), +}; ``` diff --git a/doc/models/subscription-mrr-breakout.md b/doc/models/subscription-mrr-breakout.md index dd62d818..1782b8b2 100644 --- a/doc/models/subscription-mrr-breakout.md +++ b/doc/models/subscription-mrr-breakout.md @@ -12,12 +12,14 @@ | `planAmountInCents` | `bigint` | Required | - | | `usageAmountInCents` | `bigint` | Required | - | -## Example (as JSON) +## Example -```json -{ - "plan_amount_in_cents": 208, - "usage_amount_in_cents": 60 -} +```ts +import { SubscriptionMRRBreakout } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMRRBreakout: SubscriptionMRRBreakout = { + planAmountInCents: BigInt(248), + usageAmountInCents: BigInt(100), +}; ``` diff --git a/doc/models/subscription-mrr-response.md b/doc/models/subscription-mrr-response.md index d7ee25e2..c41db151 100644 --- a/doc/models/subscription-mrr-response.md +++ b/doc/models/subscription-mrr-response.md @@ -11,20 +11,22 @@ | --- | --- | --- | --- | | `subscriptionsMrr` | [`SubscriptionMRR[]`](../../doc/models/subscription-mrr.md) | Required | **Constraints**: *Minimum Items*: `1`, *Unique Items Required* | -## Example (as JSON) +## Example -```json -{ - "subscriptions_mrr": [ +```ts +import { SubscriptionMRRResponse } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMRRResponse: SubscriptionMRRResponse = { + subscriptionsMrr: [ { - "subscription_id": 0, - "mrr_amount_in_cents": 0, - "breakouts": { - "plan_amount_in_cents": 0, - "usage_amount_in_cents": 0 - } + subscriptionId: 0, + mrrAmountInCents: BigInt(0), + breakouts: { + planAmountInCents: BigInt(0), + usageAmountInCents: BigInt(0), + }, } - ] -} + ], +}; ``` diff --git a/doc/models/subscription-mrr.md b/doc/models/subscription-mrr.md index 66ab0c27..d0ec1506 100644 --- a/doc/models/subscription-mrr.md +++ b/doc/models/subscription-mrr.md @@ -13,16 +13,18 @@ | `mrrAmountInCents` | `bigint` | Required | - | | `breakouts` | [`SubscriptionMRRBreakout \| undefined`](../../doc/models/subscription-mrr-breakout.md) | Optional | - | -## Example (as JSON) - -```json -{ - "subscription_id": 4, - "mrr_amount_in_cents": 22, - "breakouts": { - "plan_amount_in_cents": 254, - "usage_amount_in_cents": 106 - } -} +## Example + +```ts +import { SubscriptionMRR } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionMRR: SubscriptionMRR = { + subscriptionId: 192, + mrrAmountInCents: BigInt(210), + breakouts: { + planAmountInCents: BigInt(254), + usageAmountInCents: BigInt(106), + }, +}; ``` diff --git a/doc/models/subscription-note-response.md b/doc/models/subscription-note-response.md index aaf77947..d3b389fd 100644 --- a/doc/models/subscription-note-response.md +++ b/doc/models/subscription-note-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `note` | [`SubscriptionNote`](../../doc/models/subscription-note.md) | Required | - | -## Example (as JSON) - -```json -{ - "note": { - "id": 28, - "body": "body0", - "subscription_id": 138, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { SubscriptionNoteResponse } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionNoteResponse: SubscriptionNoteResponse = { + note: { + id: 28, + body: 'body0', + subscriptionId: 138, + createdAt: '2016-03-13T12:52:32.123Z', + updatedAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/subscription-note.md b/doc/models/subscription-note.md index c2731e93..f9b8e074 100644 --- a/doc/models/subscription-note.md +++ b/doc/models/subscription-note.md @@ -16,15 +16,17 @@ | `updatedAt` | `string \| undefined` | Optional | - | | `sticky` | `boolean \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 36, - "body": "body4", - "subscription_id": 146, - "created_at": "2016-03-13T12:52:32.123Z", - "updated_at": "2016-03-13T12:52:32.123Z" -} +## Example + +```ts +import { SubscriptionNote } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionNote: SubscriptionNote = { + id: 18, + body: 'body6', + subscriptionId: 128, + createdAt: '2016-03-13T12:52:32.123Z', + updatedAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/subscription-preview-response.md b/doc/models/subscription-preview-response.md index 4bd8bef6..55b2da9f 100644 --- a/doc/models/subscription-preview-response.md +++ b/doc/models/subscription-preview-response.md @@ -11,56 +11,62 @@ | --- | --- | --- | --- | | `subscriptionPreview` | [`SubscriptionPreview`](../../doc/models/subscription-preview.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_preview": { - "current_billing_manifest": { - "line_items": [ +```ts +import { + BillingManifestLineItemKind, + LineItemTransactionType, + SubscriptionPreviewResponse, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionPreviewResponse: SubscriptionPreviewResponse = { + subscriptionPreview: { + currentBillingManifest: { + lineItems: [ { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), } ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 + totalInCents: BigInt(38), + totalDiscountInCents: BigInt(24), + totalTaxInCents: BigInt(18), + subtotalInCents: BigInt(150), }, - "next_billing_manifest": { - "line_items": [ + nextBillingManifest: { + lineItems: [ { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), }, { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), }, { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), } ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } - } -} + totalInCents: BigInt(62), + totalDiscountInCents: BigInt(208), + totalTaxInCents: BigInt(42), + subtotalInCents: BigInt(174), + }, + }, +}; ``` diff --git a/doc/models/subscription-preview.md b/doc/models/subscription-preview.md index 98a10705..87042bfd 100644 --- a/doc/models/subscription-preview.md +++ b/doc/models/subscription-preview.md @@ -12,54 +12,60 @@ | `currentBillingManifest` | [`BillingManifest \| undefined`](../../doc/models/billing-manifest.md) | Optional | - | | `nextBillingManifest` | [`BillingManifest \| undefined`](../../doc/models/billing-manifest.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "current_billing_manifest": { - "line_items": [ +```ts +import { + BillingManifestLineItemKind, + LineItemTransactionType, + SubscriptionPreview, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionPreview: SubscriptionPreview = { + currentBillingManifest: { + lineItems: [ { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), } ], - "total_in_cents": 38, - "total_discount_in_cents": 24, - "total_tax_in_cents": 18, - "subtotal_in_cents": 150 + totalInCents: BigInt(38), + totalDiscountInCents: BigInt(24), + totalTaxInCents: BigInt(18), + subtotalInCents: BigInt(150), }, - "next_billing_manifest": { - "line_items": [ + nextBillingManifest: { + lineItems: [ { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), }, { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), }, { - "transaction_type": "credit", - "kind": "component", - "amount_in_cents": 24, - "memo": "memo2", - "discount_amount_in_cents": 172 + transactionType: LineItemTransactionType.Credit, + kind: BillingManifestLineItemKind.Component, + amountInCents: BigInt(24), + memo: 'memo2', + discountAmountInCents: BigInt(172), } ], - "total_in_cents": 62, - "total_discount_in_cents": 208, - "total_tax_in_cents": 42, - "subtotal_in_cents": 174 - } -} + totalInCents: BigInt(62), + totalDiscountInCents: BigInt(208), + totalTaxInCents: BigInt(42), + subtotalInCents: BigInt(174), + }, +}; ``` diff --git a/doc/models/subscription-product-change.md b/doc/models/subscription-product-change.md index cbd16f17..35e45786 100644 --- a/doc/models/subscription-product-change.md +++ b/doc/models/subscription-product-change.md @@ -1,6 +1,8 @@ # Subscription Product Change +Event data for both `subscription_product_change` and `subscription_product_change_scheduled`. The price point and `effective_at` fields are only populated for scheduled changes. + ## Structure `SubscriptionProductChange` @@ -11,13 +13,21 @@ | --- | --- | --- | --- | | `previousProductId` | `number` | Required | - | | `newProductId` | `number` | Required | - | - -## Example (as JSON) - -```json -{ - "previous_product_id": 126, - "new_product_id": 12 -} +| `previousProductPricePointId` | `number \| null \| undefined` | Optional | - | +| `newProductPricePointId` | `number \| null \| undefined` | Optional | - | +| `effectiveAt` | `string \| null \| undefined` | Optional | When the scheduled product change takes effect (the subscription's next renewal). Only sent for `subscription_product_change_scheduled`. | + +## Example + +```ts +import { SubscriptionProductChange } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionProductChange: SubscriptionProductChange = { + previousProductId: 104, + newProductId: 10, + previousProductPricePointId: 228, + newProductPricePointId: 222, + effectiveAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/subscription-product-migration-request.md b/doc/models/subscription-product-migration-request.md index 5b269939..491efc1c 100644 --- a/doc/models/subscription-product-migration-request.md +++ b/doc/models/subscription-product-migration-request.md @@ -11,18 +11,22 @@ | --- | --- | --- | --- | | `migration` | [`SubscriptionProductMigration`](../../doc/models/subscription-product-migration.md) | Required | - | -## Example (as JSON) - -```json -{ - "migration": { - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 158, - "product_price_point_id": 82 - } -} +## Example + +```ts +import { + SubscriptionProductMigrationRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionProductMigrationRequest: SubscriptionProductMigrationRequest = { + migration: { + productId: 158, + productPricePointId: 82, + includeTrial: false, + includeInitialCharge: false, + includeCoupons: true, + preservePeriod: false, + }, +}; ``` diff --git a/doc/models/subscription-product-migration.md b/doc/models/subscription-product-migration.md index dfdd8d1b..365f625e 100644 --- a/doc/models/subscription-product-migration.md +++ b/doc/models/subscription-product-migration.md @@ -19,16 +19,20 @@ | `productPricePointHandle` | `string \| undefined` | Optional | The ID or handle of the specified product's price point. This can be passed to migrate to a non-default price point. | | `proration` | [`Proration \| undefined`](../../doc/models/proration.md) | Optional | - | -## Example (as JSON) - -```json -{ - "include_trial": false, - "include_initial_charge": false, - "include_coupons": true, - "preserve_period": false, - "product_id": 8, - "product_price_point_id": 172 -} +## Example + +```ts +import { + SubscriptionProductMigration, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionProductMigration: SubscriptionProductMigration = { + productId: 44, + productPricePointId: 224, + includeTrial: false, + includeInitialCharge: false, + includeCoupons: true, + preservePeriod: false, +}; ``` diff --git a/doc/models/subscription-purge-type.md b/doc/models/subscription-purge-type.md index e8d5857e..1034f039 100644 --- a/doc/models/subscription-purge-type.md +++ b/doc/models/subscription-purge-type.md @@ -12,3 +12,11 @@ | `Customer` | | `PaymentProfile` | +## Example + +```ts +import { SubscriptionPurgeType } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionPurgeType = SubscriptionPurgeType.Customer; +``` + diff --git a/doc/models/subscription-remove-coupon-errors-error.md b/doc/models/subscription-remove-coupon-errors-error.md index 145da25b..db137b28 100644 --- a/doc/models/subscription-remove-coupon-errors-error.md +++ b/doc/models/subscription-remove-coupon-errors-error.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `subscription` | `string[]` | Required | - | -## Example (as JSON) - -```json -{ - "subscription": [ - "subscription0" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionRemoveCouponErrorsError) { + console.log(error.result); + } } ``` diff --git a/doc/models/subscription-response-error.md b/doc/models/subscription-response-error.md index 124dbc7c..0270a923 100644 --- a/doc/models/subscription-response-error.md +++ b/doc/models/subscription-response-error.md @@ -11,16 +11,14 @@ | --- | --- | --- | --- | | `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 +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/subscription-response.md b/doc/models/subscription-response.md index ceb44331..b35350f7 100644 --- a/doc/models/subscription-response.md +++ b/doc/models/subscription-response.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `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 - } -} +## Example + +```ts +import { + SubscriptionResponse, + SubscriptionState, +} from '@maxio-com/advanced-billing-sdk'; + +const subscriptionResponse: SubscriptionResponse = { + subscription: { + id: 8, + state: SubscriptionState.Paused, + balanceInCents: BigInt(124), + totalRevenueInCents: BigInt(48), + productPriceInCents: BigInt(238), + }, +}; ``` diff --git a/doc/models/subscription-sort.md b/doc/models/subscription-sort.md index 7ee76b10..9b4dd675 100644 --- a/doc/models/subscription-sort.md +++ b/doc/models/subscription-sort.md @@ -20,3 +20,11 @@ | `OpenBalance` | | `ExpiresAt` | +## Example + +```ts +import { SubscriptionSort } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionSort = SubscriptionSort.TotalPayments; +``` + diff --git a/doc/models/subscription-state-change.md b/doc/models/subscription-state-change.md index de0e9dcd..89e39336 100644 --- a/doc/models/subscription-state-change.md +++ b/doc/models/subscription-state-change.md @@ -12,12 +12,14 @@ | `previousSubscriptionState` | `string` | Required | **Constraints**: *Minimum Length*: `1` | | `newSubscriptionState` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "previous_subscription_state": "previous_subscription_state2", - "new_subscription_state": "new_subscription_state6" -} +```ts +import { SubscriptionStateChange } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionStateChange: SubscriptionStateChange = { + previousSubscriptionState: 'previous_subscription_state8', + newSubscriptionState: 'new_subscription_state2', +}; ``` diff --git a/doc/models/subscription-state-filter.md b/doc/models/subscription-state-filter.md index aaf21877..2d7959b6 100644 --- a/doc/models/subscription-state-filter.md +++ b/doc/models/subscription-state-filter.md @@ -15,12 +15,25 @@ Allowed values for filtering by the current state of the subscription. | `Canceled` | | `Expired` | | `ExpiredCards` | +| `EnumExpiredCardsLiveSubscriptions` | +| `EnumExpiredCardsAllSubscriptions` | | `OnHold` | +| `AwaitingSignup` | +| `AwaitingSignupDate` | | `PastDue` | | `PendingCancellation` | | `PendingRenewal` | +| `PrepaidDunning` | | `Suspended` | | `TrialEnded` | | `Trialing` | | `Unpaid` | +## Example + +```ts +import { SubscriptionStateFilter } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionStateFilter = SubscriptionStateFilter.AwaitingSignup; +``` + diff --git a/doc/models/subscription-state.md b/doc/models/subscription-state.md index 3b99ac5e..6b79ef8b 100644 --- a/doc/models/subscription-state.md +++ b/doc/models/subscription-state.md @@ -48,3 +48,11 @@ See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/2425211902 | `OnHold` | | `AwaitingSignup` | +## Example + +```ts +import { SubscriptionState } from '@maxio-com/advanced-billing-sdk'; + +const subscriptionState = SubscriptionState.AwaitingSignup; +``` + diff --git a/doc/models/subscription.md b/doc/models/subscription.md index 01fefddd..9b22d86d 100644 --- a/doc/models/subscription.md +++ b/doc/models/subscription.md @@ -13,13 +13,13 @@ | `state` | [`SubscriptionState \| undefined`](../../doc/models/subscription-state.md) | Optional | The state of a subscription.

* **Live States**
* `active` - A normal, active subscription. It is not in a trial and is paid and up to date.
* `assessing` - An internal (transient) state that indicates a subscription is in the middle of periodic assessment. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `pending` - An internal (transient) state that indicates a subscription is in the creation process. Do not base any access decisions in your app on this state, as it may not always be exposed.
* `trialing` - A subscription in trialing state has a valid trial subscription. This type of subscription may transition to active once payment is received when the trial has ended. Otherwise, it may go to a Problem or End of Life state.
* `paused` - An internal state that indicates that your account with Advanced Billing is in arrears.
* **Problem States**
* `past_due` - Indicates that the most recent payment has failed, and payment is past due for this subscription. If you have enabled our automated dunning, this subscription will be in the dunning process (additional status and callbacks from the dunning process will be available in the future). If you are handling dunning and payment updates yourself, you will want to use this state to initiate a payment update from your customers.
* `soft_failure` - Indicates that normal assessment/processing of the subscription has failed for a reason that cannot be fixed by the Customer. For example, a Soft Fail may result from a timeout at the gateway or incorrect credentials on your part. The subscriptions should be retried automatically. An interface is being built for you to review problems resulting from these events to take manual action when needed.
* `unpaid` - Indicates an unpaid subscription. A subscription is marked unpaid if the retry period expires and you have configured your [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) settings to have a Final Action of `mark the subscription unpaid`.
* **End of Life States**
* `canceled` - Indicates a canceled subscription. This may happen at your request (via the API or the web interface) or due to the expiration of the [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning-Overview) process without payment. See the [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Reactivating-and-Resuming) documentation for info on how to restart a canceled subscription.
While a subscription is canceled, its period will not advance, it will not accrue any new charges, and Advanced Billing will not attempt to collect the overdue balance.
* `expired` - Indicates a subscription that has expired due to running its normal life cycle. Some products may be configured to have an expiration period. An expired subscription then is one that stayed active until it fulfilled its full period.
* `failed_to_create` - Indicates that signup has failed. (You may see this state in a signup_failure webhook.)
* `on_hold` - Indicates that a subscription’s billing has been temporarily stopped. While it is expected that the subscription will resume and return to active status, this is still treated as an “End of Life” state because the customer is not paying for services during this time.
* `suspended` - Indicates that a prepaid subscription has used up all their prepayment balance. If a prepayment is applied, it will return to an active state.
* `trial_ended` - A subscription in a trial_ended state is a subscription that completed a no-obligation trial and did not have a card on file at the expiration of the trial period. See [Product Pricing – No Obligation Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-Editing) for more details.

See [Subscription States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscription-States) for more info about subscription states and state transitions. | | `balanceInCents` | `bigint \| undefined` | Optional | Gives the current outstanding subscription balance in the number of cents. | | `totalRevenueInCents` | `bigint \| undefined` | Optional | Gives the total revenue from the subscription in the number of cents. | -| `productPriceInCents` | `bigint \| undefined` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version. | +| `productPriceInCents` | `bigint \| undefined` | Optional | (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. NOTE: this may differ from the current price of the product, if you’ve changed the price of the product but haven’t moved this subscription to a newer version. | | `productVersionNumber` | `number \| undefined` | Optional | The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. | -| `currentPeriodEndsAt` | `string \| null \| undefined` | Optional | Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) | -| `nextAssessmentAt` | `string \| null \| undefined` | Optional | Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) | +| `currentPeriodEndsAt` | `string \| null \| undefined` | Optional | Timestamp relating to the end of the current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) | +| `nextAssessmentAt` | `string \| null \| undefined` | Optional | Timestamp that indicates when capture of payment will be tried or retried. This value will usually track the current_period_ends_at, but will diverge if a renewal payment fails and must be retried. In that case, the current_period_ends_at will advance to the end of the next period (time doesn’t stop because a payment was missed) but the next_assessment_at will be scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). | | `trialStartedAt` | `string \| null \| undefined` | Optional | Timestamp for when the trial period (if any) began | | `trialEndedAt` | `string \| null \| undefined` | Optional | Timestamp for when the trial period (if any) ended | -| `activatedAt` | `string \| null \| undefined` | Optional | Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) | +| `activatedAt` | `string \| null \| undefined` | Optional | Timestamp for when the subscription began (i.e., when it came out of trial, or when it began in the case of no trial) | | `expiresAt` | `string \| null \| undefined` | Optional | Timestamp giving the expiration date of this subscription (if any) | | `createdAt` | `string \| undefined` | Optional | The creation date for this subscription | | `updatedAt` | `string \| undefined` | Optional | The date of last update for this subscription | @@ -28,9 +28,9 @@ | `cancelAtEndOfPeriod` | `boolean \| null \| undefined` | Optional | Whether or not the subscription will (or has) canceled at the end of the period. | | `canceledAt` | `string \| null \| undefined` | Optional | The timestamp of the most recent cancellation | | `currentPeriodStartedAt` | `string \| null \| undefined` | Optional | Timestamp relating to the start of the current (recurring) period | -| `previousState` | [`SubscriptionState \| undefined`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state) | +| `previousState` | [`SubscriptionState \| undefined`](../../doc/models/subscription-state.md) | Optional | Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state). | | `signupPaymentId` | `number \| undefined` | Optional | The ID of the transaction that generated the revenue | -| `signupRevenue` | `string \| undefined` | Optional | The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) | +| `signupRevenue` | `string \| undefined` | Optional | The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00) | | `delayedCancelAt` | `string \| null \| undefined` | Optional | Timestamp for when the subscription is currently set to cancel. | | `couponCode` | `string \| null \| undefined` | Optional | (deprecated) The coupon code of the single coupon currently applied to the subscription. See coupon_codes instead as subscriptions can now have more than one coupon. | | `snapDay` | `string \| null \| undefined` | Optional | A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. | @@ -46,7 +46,7 @@ | `nextProductHandle` | `string \| null \| undefined` | Optional | If a delayed product change is scheduled, the handle of the product that the subscription will be changed to at the next renewal. | | `couponUseCount` | `number \| null \| undefined` | Optional | (deprecated) How many times the subscription's single coupon has been used. This field has no replacement for multiple coupons. | | `couponUsesAllowed` | `number \| null \| undefined` | Optional | (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. | -| `reasonCode` | `string \| null \| undefined` | Optional | The churn reason code associated to a cancelled subscription. | +| `reasonCode` | `string \| null \| undefined` | Optional | The churn reason code associated to a canceled subscription. | | `automaticallyResumeAt` | `string \| null \| undefined` | Optional | The date the subscription is scheduled to automatically resume from the on_hold state. | | `couponCodes` | `string[] \| undefined` | Optional | An array for all the coupons attached to the subscription. | | `offerId` | `number \| null \| undefined` | Optional | The ID of the offer associated with the subscription. | @@ -57,10 +57,10 @@ | `nextProductPricePointId` | `number \| null \| undefined` | Optional | If a delayed product change is scheduled, the ID of the product price point that the subscription will be changed to at the next renewal. | | `netTerms` | `number \| null \| undefined` | Optional | On Relationship Invoicing, the number of days before a renewal invoice is due. | | `storedCredentialTransactionId` | `number \| null \| undefined` | Optional | For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. | -| `reference` | `string \| null \| undefined` | Optional | The reference value (provided by your app) for the subscription istelf. | +| `reference` | `string \| null \| undefined` | Optional | The reference value (provided by your app) for the subscription itself. | | `onHoldAt` | `string \| null \| undefined` | Optional | The timestamp of the most recent on hold action. | -| `prepaidDunning` | `boolean \| undefined` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled | -| `coupons` | [`SubscriptionIncludedCoupon[] \| undefined`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`.
Only in Read Subscription Endpoint. | +| `prepaidDunning` | `boolean \| undefined` | Optional | Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. | +| `coupons` | [`SubscriptionIncludedCoupon[] \| undefined`](../../doc/models/subscription-included-coupon.md) | Optional | Additional coupon data. To use this data you also have to include the following param in the request: `include[]=coupons`.
Only in Read Subscription Endpoint. | | `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. | | `receivesInvoiceEmails` | `boolean \| null \| undefined` | Optional | - | @@ -72,38 +72,46 @@ | `prepaidConfiguration` | [`PrepaidConfiguration \| null \| undefined`](../../doc/models/prepaid-configuration.md) | Optional | - | | `selfServicePageToken` | `string \| undefined` | Optional | Returned only for list/read Subscription operation when `include[]=self_service_page_token` parameter is provided. | -## Example (as JSON) +## Example -```json -{ - "credit_card": { - "id": 10088716, - "first_name": "Test", - "last_name": "Subscription", - "masked_card_number": "XXXX-XXXX-XXXX-1", - "card_type": "bogus", - "expiration_month": 1, - "expiration_year": 2022, - "customer_id": 14543792, - "current_vault": "bogus", - "vault_token": "1", - "billing_address": "123 Montana Way", - "billing_city": "Billings", - "billing_state": "MT", - "billing_zip": "59101", - "billing_country": "US", - "customer_vault_token": null, - "billing_address_2": "", - "payment_type": "credit_card", - "site_gateway_setting_id": 1, - "gateway_handle": null +```ts +import { + CardType, + CreditCardVault, + PaymentType, + Subscription, + SubscriptionState, +} from '@maxio-com/advanced-billing-sdk'; + +const subscription: Subscription = { + id: 8, + state: SubscriptionState.Paused, + balanceInCents: BigInt(124), + totalRevenueInCents: BigInt(48), + productPriceInCents: BigInt(238), + creditCard: { + paymentType: PaymentType.CreditCard, + id: 10088716, + firstName: 'Test', + lastName: 'Subscription', + maskedCardNumber: 'XXXX-XXXX-XXXX-1', + cardType: CardType.Bogus, + expirationMonth: 1, + expirationYear: 2022, + customerId: 14543792, + currentVault: CreditCardVault.Bogus, + vaultToken: '1', + billingAddress: '123 Montana Way', + billingCity: 'Billings', + billingState: 'MT', + billingZip: '59101', + billingCountry: 'US', + customerVaultToken: 'customer_vault_token2', + billingAddress2: '', + siteGatewaySettingId: 1, + gatewayHandle: 'gateway_handle8', }, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "id": 96, - "state": "soft_failure", - "balance_in_cents": 212, - "total_revenue_in_cents": 136, - "product_price_in_cents": 70 -} + dunningCommunicationDelayTimeZone: '"Eastern Time (US & Canada)"', +}; ``` diff --git a/doc/models/subscriptions-mrr-error-response-error.md b/doc/models/subscriptions-mrr-error-response-error.md index 47b4def1..9628ae39 100644 --- a/doc/models/subscriptions-mrr-error-response-error.md +++ b/doc/models/subscriptions-mrr-error-response-error.md @@ -11,14 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`AttributeError`](../../doc/models/attribute-error.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "attribute": [ - "supplied value is invalid, expected ISO 8601 format" - ] +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof SubscriptionsMrrErrorResponseError) { + console.log(error.result); } } ``` diff --git a/doc/models/tax-configuration-kind.md b/doc/models/tax-configuration-kind.md index 291cea72..5e6d881e 100644 --- a/doc/models/tax-configuration-kind.md +++ b/doc/models/tax-configuration-kind.md @@ -14,3 +14,11 @@ | `EnumLinkedAvalara` | | `EnumDigitalRiver` | +## Example + +```ts +import { TaxConfigurationKind } from '@maxio-com/advanced-billing-sdk'; + +const taxConfigurationKind = TaxConfigurationKind.Custom; +``` + diff --git a/doc/models/tax-configuration.md b/doc/models/tax-configuration.md index 3f884634..a687151d 100644 --- a/doc/models/tax-configuration.md +++ b/doc/models/tax-configuration.md @@ -13,13 +13,19 @@ | `destinationAddress` | [`TaxDestinationAddress \| undefined`](../../doc/models/tax-destination-address.md) | Optional | - | | `fullyConfigured` | `boolean \| undefined` | Optional | Returns `true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview

**Default**: `false` | -## Example (as JSON) - -```json -{ - "kind": "custom", - "fully_configured": false, - "destination_address": "shipping_only" -} +## Example + +```ts +import { + TaxConfiguration, + TaxConfigurationKind, + TaxDestinationAddress, +} from '@maxio-com/advanced-billing-sdk'; + +const taxConfiguration: TaxConfiguration = { + kind: TaxConfigurationKind.Custom, + destinationAddress: TaxDestinationAddress.ShippingOnly, + fullyConfigured: false, +}; ``` diff --git a/doc/models/tax-destination-address.md b/doc/models/tax-destination-address.md index 891b350f..2326e3d0 100644 --- a/doc/models/tax-destination-address.md +++ b/doc/models/tax-destination-address.md @@ -14,3 +14,11 @@ | `ShippingOnly` | | `BillingOnly` | +## Example + +```ts +import { TaxDestinationAddress } from '@maxio-com/advanced-billing-sdk'; + +const taxDestinationAddress = TaxDestinationAddress.ShippingOnly; +``` + diff --git a/doc/models/tokenized-payment-profile.md b/doc/models/tokenized-payment-profile.md index 4495a715..ef0421f0 100644 --- a/doc/models/tokenized-payment-profile.md +++ b/doc/models/tokenized-payment-profile.md @@ -14,14 +14,16 @@ | `gatewayHandle` | `string \| null \| undefined` | Optional | - | | `customerVaultToken` | `string \| null \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 72, - "vault_token": "vault_token2", - "gateway_handle": "gateway_handle8", - "customer_vault_token": "customer_vault_token8" -} +## Example + +```ts +import { TokenizedPaymentProfile } from '@maxio-com/advanced-billing-sdk'; + +const tokenizedPaymentProfile: TokenizedPaymentProfile = { + id: 116, + vaultToken: 'vault_token0', + gatewayHandle: 'gateway_handle0', + customerVaultToken: 'customer_vault_token6', +}; ``` diff --git a/doc/models/too-many-management-link-requests-error.md b/doc/models/too-many-management-link-requests-error.md index e49c9902..f3a5e5cd 100644 --- a/doc/models/too-many-management-link-requests-error.md +++ b/doc/models/too-many-management-link-requests-error.md @@ -11,13 +11,14 @@ | --- | --- | --- | --- | | `errors` | [`TooManyManagementLinkRequests`](../../doc/models/too-many-management-link-requests.md) | Required | - | -## Example (as JSON) - -```json -{ - "errors": { - "error": "error4", - "new_link_available_at": "2016-03-13T12:52:32.123Z" +## Example + +```ts +try { + // make the API call +} catch (error) { + if (error instanceof TooManyManagementLinkRequestsError) { + console.log(error.result); } } ``` diff --git a/doc/models/too-many-management-link-requests.md b/doc/models/too-many-management-link-requests.md index deb44880..3e36b267 100644 --- a/doc/models/too-many-management-link-requests.md +++ b/doc/models/too-many-management-link-requests.md @@ -12,12 +12,16 @@ | `error` | `string` | Required | - | | `newLinkAvailableAt` | `string` | Required | - | -## Example (as JSON) +## Example -```json -{ - "error": "error2", - "new_link_available_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { + TooManyManagementLinkRequests, +} from '@maxio-com/advanced-billing-sdk'; + +const tooManyManagementLinkRequests: TooManyManagementLinkRequests = { + error: 'error8', + newLinkAvailableAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/trial-type.md b/doc/models/trial-type.md index 4807ad00..62fd5455 100644 --- a/doc/models/trial-type.md +++ b/doc/models/trial-type.md @@ -1,7 +1,7 @@ # Trial Type -Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. +Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. ## Enumeration @@ -14,3 +14,11 @@ Indicates how a trial is handled when the trail period ends and there is no cred | `NoObligation` | | `PaymentExpected` | +## Example + +```ts +import { TrialType } from '@maxio-com/advanced-billing-sdk'; + +const trialType = TrialType.NoObligation; +``` + diff --git a/doc/models/update-allocation-expiration-date.md b/doc/models/update-allocation-expiration-date.md index 2fcf7d4c..68873ef6 100644 --- a/doc/models/update-allocation-expiration-date.md +++ b/doc/models/update-allocation-expiration-date.md @@ -11,13 +11,17 @@ | --- | --- | --- | --- | | `allocation` | [`AllocationExpirationDate \| undefined`](../../doc/models/allocation-expiration-date.md) | Optional | - | -## Example (as JSON) - -```json -{ - "allocation": { - "expires_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { + UpdateAllocationExpirationDate, +} from '@maxio-com/advanced-billing-sdk'; + +const updateAllocationExpirationDate: UpdateAllocationExpirationDate = { + allocation: { + expiresAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/update-component-price-point-request.md b/doc/models/update-component-price-point-request.md index 52b49d2f..15021a55 100644 --- a/doc/models/update-component-price-point-request.md +++ b/doc/models/update-component-price-point-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `pricePoint` | [`UpdateComponentPricePoint \| undefined`](../../doc/models/update-component-price-point.md) | Optional | - | -## Example (as JSON) - -```json -{ - "price_point": { - "name": "name0", - "handle": "handle6", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false - } -} +## Example + +```ts +import { + PricingScheme, + UpdateComponentPricePointRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateComponentPricePointRequest: UpdateComponentPricePointRequest = { + pricePoint: { + name: 'name0', + handle: 'handle6', + pricingScheme: PricingScheme.PerUnit, + useSiteExchangeRate: false, + taxIncluded: false, + }, +}; ``` diff --git a/doc/models/update-component-price-point.md b/doc/models/update-component-price-point.md index df25a69a..1d6b119b 100644 --- a/doc/models/update-component-price-point.md +++ b/doc/models/update-component-price-point.md @@ -14,19 +14,24 @@ | `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. | | `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. | | `taxIncluded` | `boolean \| undefined` | Optional | Whether or not the price point includes tax | -| `interval` | `number \| 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. | +| `interval` | `number \| undefined` | Optional | The numerical interval. e.g., 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. | | `prices` | [`UpdatePrice[] \| undefined`](../../doc/models/update-price.md) | Optional | - | -## Example (as JSON) - -```json -{ - "name": "name2", - "handle": "handle8", - "pricing_scheme": "per_unit", - "use_site_exchange_rate": false, - "tax_included": false -} +## Example + +```ts +import { + PricingScheme, + UpdateComponentPricePoint, +} from '@maxio-com/advanced-billing-sdk'; + +const updateComponentPricePoint: UpdateComponentPricePoint = { + name: 'name4', + handle: 'handle0', + pricingScheme: PricingScheme.Stairstep, + useSiteExchangeRate: false, + taxIncluded: false, +}; ``` diff --git a/doc/models/update-component-request.md b/doc/models/update-component-request.md index 843437a0..e64a9962 100644 --- a/doc/models/update-component-request.md +++ b/doc/models/update-component-request.md @@ -11,18 +11,23 @@ | --- | --- | --- | --- | | `component` | [`UpdateComponent`](../../doc/models/update-component.md) | Required | - | -## Example (as JSON) - -```json -{ - "component": { - "item_category": "Business Software", - "handle": "handle4", - "name": "name8", - "description": "description2", - "accounting_code": "accounting_code4", - "taxable": false - } -} +## Example + +```ts +import { + ItemCategory, + UpdateComponentRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateComponentRequest: UpdateComponentRequest = { + component: { + handle: 'handle4', + name: 'name8', + description: 'description2', + accountingCode: 'accounting_code4', + taxable: false, + itemCategory: ItemCategory.EnumBusinessSoftware, + }, +}; ``` diff --git a/doc/models/update-component.md b/doc/models/update-component.md index 64aa6214..9e5eaacb 100644 --- a/doc/models/update-component.md +++ b/doc/models/update-component.md @@ -10,7 +10,7 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `handle` | `string \| undefined` | Optional | - | -| `name` | `string \| undefined` | Optional | The name of the Component, suitable for display on statements. i.e. Text Messages. | +| `name` | `string \| undefined` | Optional | The name of the Component, suitable for display on statements. e.g., Text Messages. | | `description` | `string \| null \| undefined` | Optional | The description of the component. | | `accountingCode` | `string \| null \| undefined` | Optional | - | | `taxable` | `boolean \| undefined` | Optional | Boolean flag describing whether a component is taxable or not. | @@ -18,17 +18,23 @@ | `itemCategory` | [`ItemCategory \| null \| undefined`](../../doc/models/item-category.md) | Optional | One of the following: Business Software, Consumer Software, Digital Services, Physical Goods, Other | | `displayOnHostedPage` | `boolean \| undefined` | Optional | - | | `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. | - -## Example (as JSON) - -```json -{ - "item_category": "Business Software", - "handle": "handle6", - "name": "name0", - "description": "description0", - "accounting_code": "accounting_code6", - "taxable": false -} +| `unspscCode` | `string \| null \| undefined` | Optional | (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. | + +## Example + +```ts +import { + ItemCategory, + UpdateComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const updateComponent: UpdateComponent = { + handle: 'handle4', + name: 'name8', + description: 'description8', + accountingCode: 'accounting_code4', + taxable: false, + itemCategory: ItemCategory.EnumBusinessSoftware, +}; ``` diff --git a/doc/models/update-coupon-currency.md b/doc/models/update-coupon-currency.md index 957e225a..196f11e5 100644 --- a/doc/models/update-coupon-currency.md +++ b/doc/models/update-coupon-currency.md @@ -12,12 +12,14 @@ | `currency` | `string` | Required | ISO code for the site defined currency. | | `price` | `number` | Required | Price for the given currency. | -## Example (as JSON) +## Example -```json -{ - "currency": "currency4", - "price": 146 -} +```ts +import { UpdateCouponCurrency } from '@maxio-com/advanced-billing-sdk'; + +const updateCouponCurrency: UpdateCouponCurrency = { + currency: 'currency4', + price: 100, +}; ``` diff --git a/doc/models/update-currency-price.md b/doc/models/update-currency-price.md index 13e2ca3b..eaf67b74 100644 --- a/doc/models/update-currency-price.md +++ b/doc/models/update-currency-price.md @@ -12,12 +12,14 @@ | `id` | `number` | Required | ID of the currency price record being updated | | `price` | `number` | Required | New price for the given currency | -## Example (as JSON) +## Example -```json -{ - "id": 146, - "price": 71.86 -} +```ts +import { UpdateCurrencyPrice } from '@maxio-com/advanced-billing-sdk'; + +const updateCurrencyPrice: UpdateCurrencyPrice = { + id: 104, + price: 163.6, +}; ``` diff --git a/doc/models/update-currency-prices-request.md b/doc/models/update-currency-prices-request.md index 24b4b7a7..3bdc4afa 100644 --- a/doc/models/update-currency-prices-request.md +++ b/doc/models/update-currency-prices-request.md @@ -11,16 +11,18 @@ | --- | --- | --- | --- | | `currencyPrices` | [`UpdateCurrencyPrice[]`](../../doc/models/update-currency-price.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "currency_prices": [ +```ts +import { UpdateCurrencyPricesRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateCurrencyPricesRequest: UpdateCurrencyPricesRequest = { + currencyPrices: [ { - "id": 50, - "price": 233.74 + id: 50, + price: 233.74, } - ] -} + ], +}; ``` diff --git a/doc/models/update-customer-request.md b/doc/models/update-customer-request.md index 1fa229e0..24ee6048 100644 --- a/doc/models/update-customer-request.md +++ b/doc/models/update-customer-request.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `customer` | [`UpdateCustomer`](../../doc/models/update-customer.md) | Required | - | -## Example (as JSON) - -```json -{ - "customer": { - "first_name": "first_name0", - "last_name": "last_name8", - "email": "email6", - "cc_emails": "cc_emails0", - "organization": "organization6" - } -} +## Example + +```ts +import { UpdateCustomerRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateCustomerRequest: UpdateCustomerRequest = { + customer: { + firstName: 'first_name0', + lastName: 'last_name8', + email: 'email6', + ccEmails: 'cc_emails0', + organization: 'organization6', + }, +}; ``` diff --git a/doc/models/update-customer.md b/doc/models/update-customer.md index 804cfbbc..adbf005a 100644 --- a/doc/models/update-customer.md +++ b/doc/models/update-customer.md @@ -25,20 +25,24 @@ | `locale` | `string \| undefined` | Optional | Set a specific language on a customer record. | | `vatNumber` | `string \| undefined` | Optional | - | | `taxExempt` | `boolean \| undefined` | Optional | - | +| `surcharging` | `boolean \| undefined` | Optional | Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. | | `taxExemptReason` | `string \| undefined` | Optional | - | | `parentId` | `number \| null \| undefined` | Optional | - | -| `verified` | `boolean \| null \| undefined` | Optional | Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway | +| `verified` | `boolean \| null \| undefined` | Optional | Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. | | `salesforceId` | `string \| null \| undefined` | Optional | The Salesforce ID of the customer | +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. | -## Example (as JSON) +## Example -```json -{ - "first_name": "first_name2", - "last_name": "last_name0", - "email": "email4", - "cc_emails": "cc_emails8", - "organization": "organization6" -} +```ts +import { UpdateCustomer } from '@maxio-com/advanced-billing-sdk'; + +const updateCustomer: UpdateCustomer = { + firstName: 'first_name2', + lastName: 'last_name0', + email: 'email4', + ccEmails: 'cc_emails8', + organization: 'organization6', +}; ``` diff --git a/doc/models/update-invoice-item.md b/doc/models/update-invoice-item.md new file mode 100644 index 00000000..305b239a --- /dev/null +++ b/doc/models/update-invoice-item.md @@ -0,0 +1,42 @@ + +# Update Invoice Item + +A line item change for a draft ad hoc invoice. Supports the same attributes as line items on invoice creation, plus `uid` and `_destroy` for updating or removing existing line items. + +## Structure + +`UpdateInvoiceItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string \| undefined` | Optional | - | +| `quantity` | [`UpdateInvoiceItemQuantity \| undefined`](../../doc/models/containers/update-invoice-item-quantity.md) | Optional | This is a container for one-of cases. | +| `unitPrice` | [`UpdateInvoiceItemUnitPrice \| undefined`](../../doc/models/containers/update-invoice-item-unit-price.md) | Optional | This is a container for one-of cases. | +| `taxable` | `boolean \| undefined` | Optional | Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. | +| `taxCode` | `string \| undefined` | Optional | A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. | +| `periodRangeStart` | `string \| undefined` | Optional | YYYY-MM-DD | +| `periodRangeEnd` | `string \| undefined` | Optional | YYYY-MM-DD | +| `productId` | [`UpdateInvoiceItemProductId \| undefined`](../../doc/models/containers/update-invoice-item-product-id.md) | Optional | This is a container for one-of cases. | +| `componentId` | [`UpdateInvoiceItemComponentId \| undefined`](../../doc/models/containers/update-invoice-item-component-id.md) | Optional | This is a container for one-of cases. | +| `pricePointId` | [`UpdateInvoiceItemPricePointId \| undefined`](../../doc/models/containers/update-invoice-item-price-point-id.md) | Optional | This is a container for one-of cases. | +| `productPricePointId` | [`UpdateInvoiceItemProductPricePointId \| undefined`](../../doc/models/containers/update-invoice-item-product-price-point-id.md) | Optional | This is a container for one-of cases. | +| `description` | `string \| undefined` | Optional | **Constraints**: *Maximum Length*: `255` | +| `uid` | `string \| undefined` | Optional | Unique identifier of an existing line item on the invoice. When provided, the matching line item is updated with the submitted attributes. When omitted, a new line item is added to the invoice. | +| `destroy` | `boolean \| undefined` | Optional | Set to `true` together with `uid` to remove the matching line item from the invoice. Line items not referenced in the request remain unchanged. | + +## Example + +```ts +import { UpdateInvoiceItem } from '@maxio-com/advanced-billing-sdk'; + +const updateInvoiceItem: UpdateInvoiceItem = { + title: 'title8', + quantity: 94.82, + unitPrice: 78.04, + taxable: false, + taxCode: 'tax_code0', +}; +``` + diff --git a/doc/models/update-invoice-request.md b/doc/models/update-invoice-request.md new file mode 100644 index 00000000..8ce66e66 --- /dev/null +++ b/doc/models/update-invoice-request.md @@ -0,0 +1,53 @@ + +# Update Invoice Request + +Request payload for updating a draft ad hoc invoice. + +## Structure + +`UpdateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`UpdateInvoice`](../../doc/models/update-invoice.md) | Required | Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. | + +## Example + +```ts +import { UpdateInvoiceRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateInvoiceRequest: UpdateInvoiceRequest = { + invoice: { + lineItems: [ + { + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', + }, + { + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', + }, + { + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', + } + ], + issueDate: '2024-01-01', + netTerms: 144, + paymentInstructions: 'payment_instructions6', + memo: 'memo0', + }, +}; +``` + diff --git a/doc/models/update-invoice.md b/doc/models/update-invoice.md new file mode 100644 index 00000000..30a7a9ef --- /dev/null +++ b/doc/models/update-invoice.md @@ -0,0 +1,45 @@ + +# Update Invoice + +Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. + +## Structure + +`UpdateInvoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `lineItems` | [`UpdateInvoiceItem[] \| undefined`](../../doc/models/update-invoice-item.md) | Optional | Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line items not referenced in the array remain unchanged. | +| `issueDate` | `string \| undefined` | Optional | New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. The due date is recalculated from the issue date and net terms. | +| `netTerms` | `number \| undefined` | Optional | Number of days after the issue date on which the invoice is due. The due date is recalculated when net terms or the issue date change. | +| `paymentInstructions` | `string \| undefined` | Optional | Custom payment instructions displayed on the invoice. | +| `memo` | `string \| undefined` | Optional | A custom memo displayed on the invoice. | +| `sellerAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Replaces the seller address on the invoice | +| `billingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Replaces the billing address on the invoice | +| `shippingAddress` | [`CreateInvoiceAddress \| undefined`](../../doc/models/create-invoice-address.md) | Optional | Replaces the shipping address on the invoice | +| `coupons` | [`CreateInvoiceCoupon[] \| undefined`](../../doc/models/create-invoice-coupon.md) | Optional | When present, replaces all discounts currently applied to the invoice. Send an empty array to remove all discounts. | + +## Example + +```ts +import { UpdateInvoice } from '@maxio-com/advanced-billing-sdk'; + +const updateInvoice: UpdateInvoice = { + lineItems: [ + { + title: 'title4', + quantity: 56.68, + unitPrice: 39.9, + taxable: false, + taxCode: 'tax_code6', + } + ], + issueDate: '2024-01-01', + netTerms: 46, + paymentInstructions: 'payment_instructions6', + memo: 'memo2', +}; +``` + diff --git a/doc/models/update-metadata-request.md b/doc/models/update-metadata-request.md index beecd2fb..9da9016c 100644 --- a/doc/models/update-metadata-request.md +++ b/doc/models/update-metadata-request.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `metadata` | [`UpdateMetadata \| undefined`](../../doc/models/update-metadata.md) | Optional | - | -## Example (as JSON) - -```json -{ - "metadata": { - "current_name": "current_name0", - "name": "name6", - "value": "value8" - } -} +## Example + +```ts +import { UpdateMetadataRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateMetadataRequest: UpdateMetadataRequest = { + metadata: { + currentName: 'current_name0', + name: 'name6', + value: 'value8', + }, +}; ``` diff --git a/doc/models/update-metadata.md b/doc/models/update-metadata.md index 9919d7d3..0665b987 100644 --- a/doc/models/update-metadata.md +++ b/doc/models/update-metadata.md @@ -13,13 +13,15 @@ | `name` | `string \| undefined` | Optional | - | | `value` | `string \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "current_name": "current_name4", - "name": "name0", - "value": "value2" -} +## Example + +```ts +import { UpdateMetadata } from '@maxio-com/advanced-billing-sdk'; + +const updateMetadata: UpdateMetadata = { + currentName: 'current_name8', + name: 'name4', + value: 'value6', +}; ``` diff --git a/doc/models/update-metafield.md b/doc/models/update-metafield.md index 351dca8f..b0aa4568 100644 --- a/doc/models/update-metafield.md +++ b/doc/models/update-metafield.md @@ -12,26 +12,34 @@ | `currentName` | `string \| undefined` | Optional | - | | `name` | `string \| undefined` | Optional | - | | `scope` | [`MetafieldScope \| undefined`](../../doc/models/metafield-scope.md) | Optional | Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. | -| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | +| `inputType` | [`MetafieldInput \| undefined`](../../doc/models/metafield-input.md) | Optional | Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. | | `mEnum` | `string[] \| undefined` | Optional | Only applicable when input_type is radio or dropdown. | -## Example (as JSON) - -```json -{ - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" +## Example + +```ts +import { + IncludeOption, + MetafieldInput, + UpdateMetafield, +} from '@maxio-com/advanced-billing-sdk'; + +const updateMetafield: UpdateMetafield = { + currentName: 'current_name6', + name: 'name2', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, }, - "input_type": "balance_tracker", - "enum": [ - "enum2" - ] -} + inputType: MetafieldInput.Radio, + mEnum: [ + 'enum8', + 'enum9', + 'enum0' + ], +}; ``` diff --git a/doc/models/update-metafields-request.md b/doc/models/update-metafields-request.md index ada05dfc..b125e2b5 100644 --- a/doc/models/update-metafields-request.md +++ b/doc/models/update-metafields-request.md @@ -11,25 +11,31 @@ | --- | --- | --- | --- | | `metafields` | [`UpdateMetafieldsRequestMetafields \| undefined`](../../doc/models/containers/update-metafields-request-metafields.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "metafields": { - "current_name": "current_name0", - "name": "name6", - "scope": { - "csv": "0", - "invoices": "0", - "statements": "0", - "portal": "0", - "public_show": "0" +## Example + +```ts +import { + IncludeOption, + MetafieldInput, + UpdateMetafieldsRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateMetafieldsRequest: UpdateMetafieldsRequest = { + metafields: { + currentName: 'current_name0', + name: 'name6', + scope: { + csv: IncludeOption.Exclude, + invoices: IncludeOption.Exclude, + statements: IncludeOption.Exclude, + portal: IncludeOption.Exclude, + publicShow: IncludeOption.Exclude, }, - "input_type": "balance_tracker", - "enum": [ - "enum2" - ] - } -} + inputType: MetafieldInput.BalanceTracker, + mEnum: [ + 'enum2' + ], + }, +}; ``` diff --git a/doc/models/update-payment-profile-request.md b/doc/models/update-payment-profile-request.md index 73b0036c..3a50733b 100644 --- a/doc/models/update-payment-profile-request.md +++ b/doc/models/update-payment-profile-request.md @@ -11,17 +11,22 @@ | --- | --- | --- | --- | | `paymentProfile` | [`UpdatePaymentProfile`](../../doc/models/update-payment-profile.md) | Required | - | -## Example (as JSON) - -```json -{ - "payment_profile": { - "full_number": "5424000000000015", - "first_name": "first_name4", - "last_name": "last_name2", - "card_type": "bogus", - "expiration_month": "expiration_month0" - } -} +## Example + +```ts +import { + CardType, + UpdatePaymentProfileRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updatePaymentProfileRequest: UpdatePaymentProfileRequest = { + paymentProfile: { + firstName: 'first_name4', + lastName: 'last_name2', + fullNumber: '5424000000000015', + cardType: CardType.Bogus, + expirationMonth: 'expiration_month0', + }, +}; ``` diff --git a/doc/models/update-payment-profile.md b/doc/models/update-payment-profile.md index bd4c080e..3862404e 100644 --- a/doc/models/update-payment-profile.md +++ b/doc/models/update-payment-profile.md @@ -13,25 +13,30 @@ | `lastName` | `string \| undefined` | Optional | The last name of the card holder. | | `fullNumber` | `string \| undefined` | Optional | The full credit card number | | `cardType` | [`CardType \| undefined`](../../doc/models/card-type.md) | Optional | The type of card used. | -| `expirationMonth` | `string \| undefined` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 | -| `expirationYear` | `string \| undefined` | Optional | (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 | +| `expirationMonth` | `string \| undefined` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 | +| `expirationYear` | `string \| undefined` | Optional | (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 | | `currentVault` | [`AllVaults \| undefined`](../../doc/models/all-vaults.md) | Optional | The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. | -| `billingAddress` | `string \| undefined` | Optional | The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. | -| `billingCity` | `string \| undefined` | Optional | The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. | -| `billingState` | `string \| undefined` | Optional | The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | -| `billingZip` | `string \| undefined` | Optional | The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. | -| `billingCountry` | `string \| undefined` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | -| `billingAddress2` | `string \| null \| undefined` | Optional | Second line of the customer’s billing address i.e. Apt. 100 | - -## Example (as JSON) - -```json -{ - "full_number": "5424000000000015", - "first_name": "first_name2", - "last_name": "last_name0", - "card_type": "carnet", - "expiration_month": "expiration_month2" -} +| `billingAddress` | `string \| undefined` | Optional | The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. | +| `billingCity` | `string \| undefined` | Optional | The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. | +| `billingState` | `string \| undefined` | Optional | The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. | +| `billingZip` | `string \| undefined` | Optional | The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. | +| `billingCountry` | `string \| undefined` | Optional | The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. | +| `billingAddress2` | `string \| null \| undefined` | Optional | Second line of the customer’s billing address, e.g., Apt. 100 | + +## Example + +```ts +import { + CardType, + UpdatePaymentProfile, +} from '@maxio-com/advanced-billing-sdk'; + +const updatePaymentProfile: UpdatePaymentProfile = { + firstName: 'first_name6', + lastName: 'last_name4', + fullNumber: '5424000000000015', + cardType: CardType.AmericanExpress, + expirationMonth: 'expiration_month8', +}; ``` diff --git a/doc/models/update-price.md b/doc/models/update-price.md index 44277850..2f5a929e 100644 --- a/doc/models/update-price.md +++ b/doc/models/update-price.md @@ -15,15 +15,17 @@ | `destroy` | `boolean \| undefined` | Optional | - | | `startingQuantity` | [`UpdatePriceStartingQuantity \| undefined`](../../doc/models/containers/update-price-starting-quantity.md) | Optional | This is a container for one-of cases. | -## Example (as JSON) - -```json -{ - "id": 18, - "ending_quantity": 216, - "unit_price": 166.62, - "_destroy": false, - "starting_quantity": 242 -} +## Example + +```ts +import { UpdatePrice } from '@maxio-com/advanced-billing-sdk'; + +const updatePrice: UpdatePrice = { + id: 206, + endingQuantity: 28, + unitPrice: 181.3, + destroy: false, + startingQuantity: 54, +}; ``` diff --git a/doc/models/update-product-price-point-request.md b/doc/models/update-product-price-point-request.md index abe9169c..56c900a7 100644 --- a/doc/models/update-product-price-point-request.md +++ b/doc/models/update-product-price-point-request.md @@ -11,14 +11,18 @@ | --- | --- | --- | --- | | `pricePoint` | [`UpdateProductPricePoint`](../../doc/models/update-product-price-point.md) | Required | - | -## Example (as JSON) - -```json -{ - "price_point": { - "handle": "handle6", - "price_in_cents": 196 - } -} +## Example + +```ts +import { + UpdateProductPricePointRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateProductPricePointRequest: UpdateProductPricePointRequest = { + pricePoint: { + handle: 'handle6', + priceInCents: BigInt(196), + }, +}; ``` diff --git a/doc/models/update-product-price-point.md b/doc/models/update-product-price-point.md index a2baf362..f0b030fc 100644 --- a/doc/models/update-product-price-point.md +++ b/doc/models/update-product-price-point.md @@ -12,12 +12,14 @@ | `handle` | `string \| undefined` | Optional | - | | `priceInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) +## Example -```json -{ - "handle": "handle6", - "price_in_cents": 220 -} +```ts +import { UpdateProductPricePoint } from '@maxio-com/advanced-billing-sdk'; + +const updateProductPricePoint: UpdateProductPricePoint = { + handle: 'handle2', + priceInCents: BigInt(154), +}; ``` diff --git a/doc/models/update-reason-code-request.md b/doc/models/update-reason-code-request.md index b008e451..13eaa553 100644 --- a/doc/models/update-reason-code-request.md +++ b/doc/models/update-reason-code-request.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `reasonCode` | [`UpdateReasonCode`](../../doc/models/update-reason-code.md) | Required | - | -## Example (as JSON) - -```json -{ - "reason_code": { - "code": "code4", - "description": "description6", - "position": 14 - } -} +## Example + +```ts +import { UpdateReasonCodeRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateReasonCodeRequest: UpdateReasonCodeRequest = { + reasonCode: { + code: 'code4', + description: 'description6', + position: 14, + }, +}; ``` diff --git a/doc/models/update-reason-code.md b/doc/models/update-reason-code.md index 6475061c..baecabc8 100644 --- a/doc/models/update-reason-code.md +++ b/doc/models/update-reason-code.md @@ -13,13 +13,15 @@ | `description` | `string \| undefined` | Optional | The friendly summary of what the code signifies | | `position` | `number \| undefined` | Optional | The order that code appears in lists | -## Example (as JSON) - -```json -{ - "code": "code0", - "description": "description8", - "position": 118 -} +## Example + +```ts +import { UpdateReasonCode } from '@maxio-com/advanced-billing-sdk'; + +const updateReasonCode: UpdateReasonCode = { + code: 'code4', + description: 'description6', + position: 4, +}; ``` diff --git a/doc/models/update-segment-request.md b/doc/models/update-segment-request.md index c84e55d1..9664184a 100644 --- a/doc/models/update-segment-request.md +++ b/doc/models/update-segment-request.md @@ -11,30 +11,35 @@ | --- | --- | --- | --- | | `segment` | [`UpdateSegment`](../../doc/models/update-segment.md) | Required | - | -## Example (as JSON) - -```json -{ - "segment": { - "pricing_scheme": "stairstep", - "prices": [ +## Example + +```ts +import { + PricingScheme, + UpdateSegmentRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateSegmentRequest: UpdateSegmentRequest = { + segment: { + pricingScheme: PricingScheme.Stairstep, + prices: [ { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/update-segment.md b/doc/models/update-segment.md index dd7359d0..9098ad8f 100644 --- a/doc/models/update-segment.md +++ b/doc/models/update-segment.md @@ -12,18 +12,33 @@ | `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` | [`CreateOrUpdateSegmentPrice[] \| undefined`](../../doc/models/create-or-update-segment-price.md) | Optional | - | -## Example (as JSON) +## Example -```json -{ - "pricing_scheme": "stairstep", - "prices": [ +```ts +import { + PricingScheme, + UpdateSegment, +} from '@maxio-com/advanced-billing-sdk'; + +const updateSegment: UpdateSegment = { + pricingScheme: PricingScheme.Stairstep, + prices: [ + { + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, + }, + { + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, + }, { - "starting_quantity": 64, - "ending_quantity": 38, - "unit_price": "String3" + unitPrice: 'String3', + startingQuantity: 64, + endingQuantity: 38, } - ] -} + ], +}; ``` diff --git a/doc/models/update-subscription-component.md b/doc/models/update-subscription-component.md index 8f18502d..f5905d1b 100644 --- a/doc/models/update-subscription-component.md +++ b/doc/models/update-subscription-component.md @@ -12,30 +12,36 @@ | `componentId` | `number \| undefined` | Optional | - | | `customPrice` | [`ComponentCustomPrice \| undefined`](../../doc/models/component-custom-price.md) | Optional | Create or update custom pricing unique to the subscription. Used in place of `price_point_id`. | -## Example (as JSON) - -```json -{ - "component_id": 244, - "custom_price": { - "tax_included": false, - "pricing_scheme": "stairstep", - "interval": 66, - "interval_unit": "day", - "list_price_point_id": 174, - "prices": [ +## Example + +```ts +import { + IntervalUnit, + PricingScheme, + UpdateSubscriptionComponent, +} from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionComponent: UpdateSubscriptionComponent = { + componentId: 118, + customPrice: { + prices: [ { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, }, { - "starting_quantity": 242, - "ending_quantity": 40, - "unit_price": 23.26 + startingQuantity: 242, + unitPrice: 23.26, + endingQuantity: 40, } - ] - } -} + ], + taxIncluded: false, + pricingScheme: PricingScheme.Stairstep, + interval: 66, + intervalUnit: IntervalUnit.Day, + listPricePointId: 174, + }, +}; ``` diff --git a/doc/models/update-subscription-group-request.md b/doc/models/update-subscription-group-request.md index 426b9369..6dd96f44 100644 --- a/doc/models/update-subscription-group-request.md +++ b/doc/models/update-subscription-group-request.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `subscriptionGroup` | [`UpdateSubscriptionGroup`](../../doc/models/update-subscription-group.md) | Required | - | -## Example (as JSON) +## Example -```json -{ - "subscription_group": { - "member_ids": [ +```ts +import { + UpdateSubscriptionGroupRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionGroupRequest: UpdateSubscriptionGroupRequest = { + subscriptionGroup: { + memberIds: [ 164, 165 - ] - } -} + ], + }, +}; ``` diff --git a/doc/models/update-subscription-group.md b/doc/models/update-subscription-group.md index fef09d7e..6126dc01 100644 --- a/doc/models/update-subscription-group.md +++ b/doc/models/update-subscription-group.md @@ -11,15 +11,17 @@ | --- | --- | --- | --- | | `memberIds` | `number[] \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "member_ids": [ - 52, - 53, - 54 - ] -} +## Example + +```ts +import { UpdateSubscriptionGroup } from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionGroup: UpdateSubscriptionGroup = { + memberIds: [ + 248, + 249, + 250 + ], +}; ``` diff --git a/doc/models/update-subscription-note-request.md b/doc/models/update-subscription-note-request.md index 05d27d6e..f2b97499 100644 --- a/doc/models/update-subscription-note-request.md +++ b/doc/models/update-subscription-note-request.md @@ -13,14 +13,18 @@ Updatable fields for Subscription Note | --- | --- | --- | --- | | `note` | [`UpdateSubscriptionNote`](../../doc/models/update-subscription-note.md) | Required | Updatable fields for Subscription Note | -## Example (as JSON) - -```json -{ - "note": { - "body": "body0", - "sticky": false - } -} +## Example + +```ts +import { + UpdateSubscriptionNoteRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionNoteRequest: UpdateSubscriptionNoteRequest = { + note: { + body: 'body0', + sticky: false, + }, +}; ``` diff --git a/doc/models/update-subscription-note.md b/doc/models/update-subscription-note.md index a0e11866..39275cb9 100644 --- a/doc/models/update-subscription-note.md +++ b/doc/models/update-subscription-note.md @@ -14,12 +14,14 @@ Updatable fields for Subscription Note | `body` | `string` | Required | - | | `sticky` | `boolean` | Required | - | -## Example (as JSON) +## Example -```json -{ - "body": "body8", - "sticky": false -} +```ts +import { UpdateSubscriptionNote } from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionNote: UpdateSubscriptionNote = { + body: 'body2', + sticky: false, +}; ``` diff --git a/doc/models/update-subscription-request.md b/doc/models/update-subscription-request.md index ede8dd80..2dfc4889 100644 --- a/doc/models/update-subscription-request.md +++ b/doc/models/update-subscription-request.md @@ -11,23 +11,25 @@ | --- | --- | --- | --- | | `subscription` | [`UpdateSubscription`](../../doc/models/update-subscription.md) | Required | - | -## Example (as JSON) - -```json -{ - "subscription": { - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" +## Example + +```ts +import { UpdateSubscriptionRequest } from '@maxio-com/advanced-billing-sdk'; + +const updateSubscriptionRequest: UpdateSubscriptionRequest = { + subscription: { + creditCardAttributes: { + fullNumber: 'full_number2', + expirationMonth: 'expiration_month6', + expirationYear: 'expiration_year2', }, - "product_handle": "product_handle6", - "product_id": 206, - "product_change_delayed": false, - "next_product_id": "next_product_id6" - } -} + productHandle: 'product_handle6', + productId: 206, + productChangeDelayed: false, + nextProductId: 'next_product_id6', + deferSignup: false, + dunningCommunicationDelayTimeZone: '"Eastern Time (US & Canada)"', + }, +}; ``` diff --git a/doc/models/update-subscription.md b/doc/models/update-subscription.md index 7d75b31d..80bf8ddd 100644 --- a/doc/models/update-subscription.md +++ b/doc/models/update-subscription.md @@ -10,15 +10,16 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `creditCardAttributes` | [`CreditCardAttributes \| undefined`](../../doc/models/credit-card-attributes.md) | Optional | - | -| `productHandle` | `string \| undefined` | Optional | Set to the handle of a different product to change the subscription's product | -| `productId` | `number \| undefined` | Optional | Set to the id of a different product to change the subscription's product | +| `productHandle` | `string \| undefined` | Optional | Set to the handle of a different product to change the subscription's product. | +| `productId` | `number \| undefined` | Optional | Set to the id of a different product to change the subscription's product. | | `productChangeDelayed` | `boolean \| undefined` | Optional | - | | `nextProductId` | `string \| undefined` | Optional | Set to an empty string to cancel a delayed product change. | | `nextProductPricePointId` | `string \| undefined` | Optional | - | | `snapDay` | [`UpdateSubscriptionSnapDay \| undefined`](../../doc/models/containers/update-subscription-snap-day.md) | Optional | This is a container for one-of cases. | -| `initialBillingAt` | `string \| undefined` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | +| `initialBillingAt` | `string \| undefined` | Optional | (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed, etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. | | `deferSignup` | `boolean \| undefined` | Optional | (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information.

**Default**: `false` | | `nextBillingAt` | `string \| undefined` | Optional | - | +| `brandingThemeId` | `number \| null \| undefined` | Optional | The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. | | `expiresAt` | `string \| undefined` | Optional | Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. | | `paymentCollectionMethod` | `string \| undefined` | Optional | - | | `receivesInvoiceEmails` | `boolean \| undefined` | Optional | - | @@ -32,21 +33,23 @@ | `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. | -## Example (as JSON) +## Example -```json -{ - "defer_signup": false, - "dunning_communication_delay_time_zone": "\"Eastern Time (US & Canada)\"", - "credit_card_attributes": { - "full_number": "full_number2", - "expiration_month": "expiration_month6", - "expiration_year": "expiration_year2" +```ts +import { UpdateSubscription } from '@maxio-com/advanced-billing-sdk'; + +const updateSubscription: UpdateSubscription = { + creditCardAttributes: { + fullNumber: 'full_number2', + expirationMonth: 'expiration_month6', + expirationYear: 'expiration_year2', }, - "product_handle": "product_handle2", - "product_id": 114, - "product_change_delayed": false, - "next_product_id": "next_product_id8" -} + productHandle: 'product_handle0', + productId: 16, + productChangeDelayed: false, + nextProductId: 'next_product_id0', + deferSignup: false, + dunningCommunicationDelayTimeZone: '"Eastern Time (US & Canada)"', +}; ``` diff --git a/doc/models/upgrade-charge-credit-type.md b/doc/models/upgrade-charge-credit-type.md index 477e0590..65c684cb 100644 --- a/doc/models/upgrade-charge-credit-type.md +++ b/doc/models/upgrade-charge-credit-type.md @@ -21,3 +21,11 @@ The type of credit to be created when upgrading/downgrading. Defaults to the com | `Prorated` | | `None` | +## Example + +```ts +import { UpgradeChargeCreditType } from '@maxio-com/advanced-billing-sdk'; + +const upgradeChargeCreditType = UpgradeChargeCreditType.Full; +``` + diff --git a/doc/models/upsert-prepaid-configuration-request.md b/doc/models/upsert-prepaid-configuration-request.md index 5dc31cde..f24b14c6 100644 --- a/doc/models/upsert-prepaid-configuration-request.md +++ b/doc/models/upsert-prepaid-configuration-request.md @@ -11,16 +11,20 @@ | --- | --- | --- | --- | | `prepaidConfiguration` | [`UpsertPrepaidConfiguration`](../../doc/models/upsert-prepaid-configuration.md) | Required | - | -## Example (as JSON) - -```json -{ - "prepaid_configuration": { - "initial_funding_amount_in_cents": 74, - "replenish_to_amount_in_cents": 76, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 20 - } -} +## Example + +```ts +import { + UpsertPrepaidConfigurationRequest, +} from '@maxio-com/advanced-billing-sdk'; + +const upsertPrepaidConfigurationRequest: UpsertPrepaidConfigurationRequest = { + prepaidConfiguration: { + initialFundingAmountInCents: BigInt(74), + replenishToAmountInCents: BigInt(76), + autoReplenish: false, + replenishThresholdAmountInCents: BigInt(20), + }, +}; ``` diff --git a/doc/models/upsert-prepaid-configuration.md b/doc/models/upsert-prepaid-configuration.md index 9c7a374e..38ed998e 100644 --- a/doc/models/upsert-prepaid-configuration.md +++ b/doc/models/upsert-prepaid-configuration.md @@ -14,14 +14,16 @@ | `autoReplenish` | `boolean \| undefined` | Optional | - | | `replenishThresholdAmountInCents` | `bigint \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "initial_funding_amount_in_cents": 40, - "replenish_to_amount_in_cents": 42, - "auto_replenish": false, - "replenish_threshold_amount_in_cents": 242 -} +## Example + +```ts +import { UpsertPrepaidConfiguration } from '@maxio-com/advanced-billing-sdk'; + +const upsertPrepaidConfiguration: UpsertPrepaidConfiguration = { + initialFundingAmountInCents: BigInt(244), + replenishToAmountInCents: BigInt(246), + autoReplenish: false, + replenishThresholdAmountInCents: BigInt(190), +}; ``` diff --git a/doc/models/usage-response.md b/doc/models/usage-response.md index 6afbae64..01041e08 100644 --- a/doc/models/usage-response.md +++ b/doc/models/usage-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `usage` | [`Usage`](../../doc/models/usage.md) | Required | - | -## Example (as JSON) - -```json -{ - "usage": { - "id": 150, - "memo": "memo2", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 28, - "quantity": 28 - } -} +## Example + +```ts +import { UsageResponse } from '@maxio-com/advanced-billing-sdk'; + +const usageResponse: UsageResponse = { + usage: { + id: BigInt(150), + memo: 'memo2', + createdAt: '2016-03-13T12:52:32.123Z', + pricePointId: 28, + quantity: 28, + }, +}; ``` diff --git a/doc/models/usage.md b/doc/models/usage.md index 2f500808..43b3fb01 100644 --- a/doc/models/usage.md +++ b/doc/models/usage.md @@ -19,15 +19,17 @@ | `componentHandle` | `string \| undefined` | Optional | - | | `subscriptionId` | `number \| undefined` | Optional | - | -## Example (as JSON) - -```json -{ - "id": 252, - "memo": "memo8", - "created_at": "2016-03-13T12:52:32.123Z", - "price_point_id": 126, - "quantity": 130 -} +## Example + +```ts +import { Usage } from '@maxio-com/advanced-billing-sdk'; + +const usage: Usage = { + id: BigInt(150), + memo: 'memo2', + createdAt: '2016-03-13T12:52:32.123Z', + pricePointId: 28, + quantity: 28, +}; ``` diff --git a/doc/models/void-invoice-event-data.md b/doc/models/void-invoice-event-data.md index 4fca8ea2..af5ef2d0 100644 --- a/doc/models/void-invoice-event-data.md +++ b/doc/models/void-invoice-event-data.md @@ -18,22 +18,24 @@ Example schema for an `void_invoice` event | `isAdvanceInvoice` | `boolean` | Required | If true, the invoice is an advance invoice. | | `reason` | `string` | Required | The reason for the void. | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" +## Example + +```ts +import { VoidInvoiceEventData } from '@maxio-com/advanced-billing-sdk'; + +const voidInvoiceEventData: VoidInvoiceEventData = { + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo6", - "applied_amount": "applied_amount6", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason8" -} + memo: 'memo6', + appliedAmount: 'applied_amount6', + transactionTime: '2016-03-13T12:52:32.123Z', + isAdvanceInvoice: false, + reason: 'reason8', +}; ``` diff --git a/doc/models/void-invoice-event.md b/doc/models/void-invoice-event.md index 0761dc41..c6c94e46 100644 --- a/doc/models/void-invoice-event.md +++ b/doc/models/void-invoice-event.md @@ -15,38 +15,43 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.VoidInvoice` | | `eventData` | [`VoidInvoiceEventData`](../../doc/models/void-invoice-event-data.md) | Required | Example schema for an `void_invoice` event | -## Example (as JSON) - -```json -{ - "id": 16, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + InvoiceEventType, + VoidInvoiceEvent, +} from '@maxio-com/advanced-billing-sdk'; + +const voidInvoiceEvent: VoidInvoiceEvent = { + id: BigInt(236), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "void_invoice", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" + eventType: InvoiceEventType.VoidInvoice, + eventData: { + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z", - "is_advance_invoice": false, - "reason": "reason2" - } -} + memo: 'memo0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + isAdvanceInvoice: false, + reason: 'reason2', + }, +}; ``` diff --git a/doc/models/void-invoice-request.md b/doc/models/void-invoice-request.md index 63f35714..2fcbe3fb 100644 --- a/doc/models/void-invoice-request.md +++ b/doc/models/void-invoice-request.md @@ -11,13 +11,15 @@ | --- | --- | --- | --- | | `mVoid` | [`VoidInvoice`](../../doc/models/void-invoice.md) | Required | - | -## Example (as JSON) - -```json -{ - "void": { - "reason": "reason6" - } -} +## Example + +```ts +import { VoidInvoiceRequest } from '@maxio-com/advanced-billing-sdk'; + +const voidInvoiceRequest: VoidInvoiceRequest = { + mVoid: { + reason: 'reason6', + }, +}; ``` diff --git a/doc/models/void-invoice.md b/doc/models/void-invoice.md index a4a70be3..aa02c7ad 100644 --- a/doc/models/void-invoice.md +++ b/doc/models/void-invoice.md @@ -11,11 +11,13 @@ | --- | --- | --- | --- | | `reason` | `string` | Required | **Constraints**: *Minimum Length*: `1` | -## Example (as JSON) +## Example -```json -{ - "reason": "reason2" -} +```ts +import { VoidInvoice } from '@maxio-com/advanced-billing-sdk'; + +const voidInvoice: VoidInvoice = { + reason: 'reason8', +}; ``` diff --git a/doc/models/void-remainder-event-data.md b/doc/models/void-remainder-event-data.md index 209ea2bf..9b1619be 100644 --- a/doc/models/void-remainder-event-data.md +++ b/doc/models/void-remainder-event-data.md @@ -16,20 +16,22 @@ Example schema for an `void_remainder` event | `appliedAmount` | `string` | Required | The amount of the void. | | `transactionTime` | `string` | Required | The time the refund was applied, in ISO 8601 format, i.e. "2019-06-07T17:20:06Z" | -## Example (as JSON) - -```json -{ - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" +## Example + +```ts +import { VoidRemainderEventData } from '@maxio-com/advanced-billing-sdk'; + +const voidRemainderEventData: VoidRemainderEventData = { + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo6", - "applied_amount": "applied_amount4", - "transaction_time": "2016-03-13T12:52:32.123Z" -} + memo: 'memo6', + appliedAmount: 'applied_amount6', + transactionTime: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/doc/models/void-remainder-event.md b/doc/models/void-remainder-event.md index 8389501c..7b378e57 100644 --- a/doc/models/void-remainder-event.md +++ b/doc/models/void-remainder-event.md @@ -15,36 +15,41 @@ | `eventType` | [`InvoiceEventType`](../../doc/models/invoice-event-type.md) | Required | **Default**: `InvoiceEventType.VoidRemainder` | | `eventData` | [`VoidRemainderEventData`](../../doc/models/void-remainder-event-data.md) | Required | Example schema for an `void_remainder` event | -## Example (as JSON) - -```json -{ - "id": 128, - "timestamp": "2016-03-13T12:52:32.123Z", - "invoice": { - "issue_date": "2024-01-01", - "due_date": "2024-01-01", - "paid_date": "2024-01-01", - "public_url_expires_on": "2024-01-21", - "id": 166, - "uid": "uid6", - "site_id": 92, - "customer_id": 204, - "subscription_id": 20 +## Example + +```ts +import { + InvoiceEventType, + VoidRemainderEvent, +} from '@maxio-com/advanced-billing-sdk'; + +const voidRemainderEvent: VoidRemainderEvent = { + id: BigInt(198), + timestamp: '2016-03-13T12:52:32.123Z', + invoice: { + id: BigInt(166), + uid: 'uid6', + siteId: 92, + customerId: 204, + subscriptionId: 20, + issueDate: '2024-01-01', + dueDate: '2024-01-01', + paidDate: '2024-01-01', + publicUrlExpiresOn: '2024-01-21', }, - "event_type": "void_remainder", - "event_data": { - "credit_note_attributes": { - "uid": "uid2", - "site_id": 72, - "customer_id": 184, - "subscription_id": 0, - "number": "number0" + eventType: InvoiceEventType.VoidRemainder, + eventData: { + creditNoteAttributes: { + uid: 'uid2', + siteId: 72, + customerId: 184, + subscriptionId: 0, + number: 'number0', }, - "memo": "memo0", - "applied_amount": "applied_amount2", - "transaction_time": "2016-03-13T12:52:32.123Z" - } -} + memo: 'memo0', + appliedAmount: 'applied_amount2', + transactionTime: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/webhook-order.md b/doc/models/webhook-order.md index 18ecc708..5e37eb6c 100644 --- a/doc/models/webhook-order.md +++ b/doc/models/webhook-order.md @@ -12,3 +12,11 @@ | `NewestFirst` | | `OldestFirst` | +## Example + +```ts +import { WebhookOrder } from '@maxio-com/advanced-billing-sdk'; + +const webhookOrder = WebhookOrder.NewestFirst; +``` + diff --git a/doc/models/webhook-response.md b/doc/models/webhook-response.md index 92e0e913..f25f1fd4 100644 --- a/doc/models/webhook-response.md +++ b/doc/models/webhook-response.md @@ -11,17 +11,19 @@ | --- | --- | --- | --- | | `webhook` | [`Webhook \| undefined`](../../doc/models/webhook.md) | Optional | - | -## Example (as JSON) - -```json -{ - "webhook": { - "event": "event2", - "id": 18, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error4", - "last_error_at": "2016-03-13T12:52:32.123Z" - } -} +## Example + +```ts +import { WebhookResponse } from '@maxio-com/advanced-billing-sdk'; + +const webhookResponse: WebhookResponse = { + webhook: { + event: 'event2', + id: BigInt(18), + createdAt: '2016-03-13T12:52:32.123Z', + lastError: 'last_error4', + lastErrorAt: '2016-03-13T12:52:32.123Z', + }, +}; ``` diff --git a/doc/models/webhook-status.md b/doc/models/webhook-status.md index 70a637ba..26e6dde3 100644 --- a/doc/models/webhook-status.md +++ b/doc/models/webhook-status.md @@ -14,3 +14,11 @@ | `Pending` | | `Paused` | +## Example + +```ts +import { WebhookStatus } from '@maxio-com/advanced-billing-sdk'; + +const webhookStatus = WebhookStatus.Successful; +``` + diff --git a/doc/models/webhook-subscription.md b/doc/models/webhook-subscription.md index 6a308306..d050a000 100644 --- a/doc/models/webhook-subscription.md +++ b/doc/models/webhook-subscription.md @@ -39,6 +39,7 @@ | `SubscriptionCardUpdate` | | `SubscriptionGroupCardUpdate` | | `SubscriptionProductChange` | +| `SubscriptionProductChangeScheduled` | | `SubscriptionStateChange` | | `TrialEndNotice` | | `UpcomingRenewalNotice` | @@ -48,3 +49,11 @@ | `SubscriptionPrepaymentAccountBalanceChanged` | | `SubscriptionServiceCreditAccountBalanceChanged` | +## Example + +```ts +import { WebhookSubscription } from '@maxio-com/advanced-billing-sdk'; + +const webhookSubscription = WebhookSubscription.DirectDebitPaymentPending; +``` + diff --git a/doc/models/webhook.md b/doc/models/webhook.md index b167d37a..b5b82422 100644 --- a/doc/models/webhook.md +++ b/doc/models/webhook.md @@ -10,27 +10,29 @@ | Name | Type | Tags | Description | | --- | --- | --- | --- | | `event` | `string \| undefined` | Optional | A string describing which event type produced the given webhook | -| `id` | `bigint \| undefined` | Optional | The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | +| `id` | `bigint \| undefined` | Optional | The unique identifier for the webhook (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. | | `createdAt` | `string \| undefined` | Optional | Timestamp indicating when the webhook was created | | `lastError` | `string \| undefined` | Optional | Text describing the status code and/or error from the last failed attempt to send the Webhook. When a webhook is retried and accepted, this field will be cleared. | | `lastErrorAt` | `string \| undefined` | Optional | Timestamp indicating when the last non-acceptance occurred. If a webhook is later resent and accepted, this field will be cleared. | | `acceptedAt` | `string \| null \| undefined` | Optional | Timestamp indicating when the webhook was accepted by the merchant endpoint. When a webhook is explicitly replayed by the merchant, this value will be cleared until it is accepted again. | | `lastSentAt` | `string \| undefined` | Optional | Timestamp indicating when the most recent attempt was made to send the webhook | | `lastSentUrl` | `string \| undefined` | Optional | The url that the endpoint was last sent to. | -| `successful` | `boolean \| undefined` | Optional | A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) | +| `successful` | `boolean \| undefined` | Optional | “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 seconds.)” | | `body` | `string \| undefined` | Optional | The data sent within the webhook post | | `signature` | `string \| undefined` | Optional | The calculated webhook signature | | `signatureHmacSha256` | `string \| undefined` | Optional | The calculated HMAC-SHA-256 webhook signature | -## Example (as JSON) +## Example -```json -{ - "event": "event6", - "id": 154, - "created_at": "2016-03-13T12:52:32.123Z", - "last_error": "last_error8", - "last_error_at": "2016-03-13T12:52:32.123Z" -} +```ts +import { Webhook } from '@maxio-com/advanced-billing-sdk'; + +const webhook: Webhook = { + event: 'event2', + id: BigInt(18), + createdAt: '2016-03-13T12:52:32.123Z', + lastError: 'last_error4', + lastErrorAt: '2016-03-13T12:52:32.123Z', +}; ``` diff --git a/package.json b/package.json index e2b9b647..9a7e566a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "9.1.0", + "version": "10.0.0", "license": "MIT", "sideEffects": false, "main": "dist/cjs/index.js", @@ -40,14 +40,14 @@ "jest": "^29.4.3", "rimraf": "^3.0.2", "ts-jest": "29.2.6", - "tslib": "^2.5.0", "typescript": "^5.2.0" }, "dependencies": { "@apimatic/authentication-adapters": "^0.5.14", "@apimatic/axios-client-adapter": "^0.3.20", - "@apimatic/core": "^0.10.28", - "@apimatic/schema": "^0.7.21" + "@apimatic/core": "^0.10.30", + "@apimatic/schema": "^0.7.21", + "tslib": "^2.5.0" }, "repository": { "type": "git", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 402b34aa..4db784b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,11 +15,14 @@ importers: specifier: ^0.3.20 version: 0.3.20 '@apimatic/core': - specifier: ^0.10.28 - version: 0.10.28 + specifier: ^0.10.30 + version: 0.10.30 '@apimatic/schema': specifier: ^0.7.21 version: 0.7.21 + tslib: + specifier: ^2.5.0 + version: 2.8.1 devDependencies: '@types/jest': specifier: ^29.4.0 @@ -42,9 +45,6 @@ importers: ts-jest: specifier: 29.2.6 version: 29.2.6(@babel/core@7.28.4)(jest@29.7.0)(typescript@5.9.2) - tslib: - specifier: ^2.5.0 - version: 2.8.1 typescript: specifier: ^5.2.0 version: 5.9.2 @@ -137,6 +137,13 @@ packages: tslib: 2.8.1 dev: false + /@apimatic/convert-to-stream@0.1.9: + resolution: {integrity: sha512-C9NEKnDZoTRBRVeUGXVyAEmy6P5o+8oLwEckTKj0iBlExJLEXNt14nf4wxfzRO1KR8j5Bw8S6yStKCrQzcVERA==} + engines: {node: '>=14.15.0 || >=16.0.0'} + dependencies: + tslib: 2.8.1 + dev: false + /@apimatic/core-interfaces@0.2.14: resolution: {integrity: sha512-PQmSU32ndxtDddMCjbkNY/sVvDwQAsHUGKrdG5aGVE7iw/qvB2Tm2zyCarOB5TlDr4OB+/tuLCVhji0icx6MHg==} engines: {node: '>=14.15.0 || >=16.0.0'} @@ -146,11 +153,11 @@ packages: tslib: 2.8.1 dev: false - /@apimatic/core@0.10.28: - resolution: {integrity: sha512-/1TsXtfuS6BOu1qRrKxnHuuBSSg3Q6ckf7ZPRyejzaA32PN0ke/eq+tK0tYGhnHrJtq869EXJ1r84mDw6Yb0zw==} + /@apimatic/core@0.10.30: + resolution: {integrity: sha512-MqODm1YwuW5yK7gkVtqiRQBgoAfjsTSNYTYJP4cg/JDaF8RokpiupSEDuUW6Xdo3fl/4tGCzphtAlKSeLUWKVA==} engines: {node: '>=14.15.0 || >=16.0.0'} dependencies: - '@apimatic/convert-to-stream': 0.1.8 + '@apimatic/convert-to-stream': 0.1.9 '@apimatic/core-interfaces': 0.2.14 '@apimatic/file-wrapper': 0.3.9 '@apimatic/http-headers': 0.3.8 diff --git a/src/client.ts b/src/client.ts index fa3c17d5..9c0ff1a0 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:9.1.0 on OS {os-info}' + 'AB SDK TypeScript:10.0.0 on OS {os-info}' ); this._requestBuilderFactory = createRequestHandlerFactory( (server) => getBaseUri(server, this._config), diff --git a/src/controllers/aPIExportsController.ts b/src/controllers/aPIExportsController.ts index d3059ba3..48a5e733 100644 --- a/src/controllers/aPIExportsController.ts +++ b/src/controllers/aPIExportsController.ts @@ -153,9 +153,8 @@ export class APIExportsController extends BaseController { } /** - * Creates a proforma invoices export and returns a batch job object. - * - * It is only available for Relationship Invoicing architecture. + * Creates a proforma invoices export and returns a batch job object. Proforma invoices are only + * available on Relationship Invoicing sites. * * @return Response from the API call */ @@ -217,7 +216,8 @@ export class APIExportsController extends BaseController { } /** - * Returns a batch job object for a proforma invoices export. + * Returns a batch job object for a proforma invoices export. Proforma invoices are only available on + * Relationship Invoicing sites. * * @param batchId Id of a Batch Job. * @return Response from the API call diff --git a/src/controllers/advanceInvoiceController.ts b/src/controllers/advanceInvoiceController.ts index bfc12d0a..7a0c9834 100644 --- a/src/controllers/advanceInvoiceController.ts +++ b/src/controllers/advanceInvoiceController.ts @@ -21,18 +21,20 @@ import { ErrorListResponseError } from '../errors/errorListResponseError.js'; export class AdvanceInvoiceController extends BaseController { /** - * Generate an invoice in advance for a subscription's next renewal date. [See our docs](https://maxio. - * zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on - * advance invoices, including eligibility for generating one; for the most part, they function like - * any other invoice, except they are issued early and have special behavior upon being voided. - * A subscription may only have one advance invoice per billing period. Attempting to issue an advance - * invoice when one already exists will return an error. - * That said, regeneration of the invoice may be forced with the params `force: true`, which will void - * an advance invoice if one exists and generate a new one. If no advance invoice exists, a new one - * will be generated. - * We recommend using either the create or preview endpoints for proforma invoices to preview this - * advance invoice before using this endpoint to generate it. + * Issues an invoice in advance for a subscription's next renewal date. For the most part, advance + * invoices function like any other invoice, except they are issued early and have special behavior + * upon being voided. For more information on advance invoices, including eligibility for generating + * one, see [Issue Invoice In Advance](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue- + * Invoice-In-Advance). * + * A subscription can only have one advance invoice per billing period. Attempting to issue an advance + * invoice when one already exists returns an error. + * + * Regeneration of the invoice can be forced with the params `force: true`, which voids an advance + * invoice if one exists and generates a new one. If no advance invoice exists, a new one is generated. + * + * Consider using either the create or preview endpoints for proforma invoices to preview this advance + * invoice before using this endpoint to generate it. * * @param subscriptionId The Chargify id of the subscription. * @param body @@ -84,10 +86,12 @@ export class AdvanceInvoiceController extends BaseController { } /** - * Void a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. - * 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, [see our help docs]($m/Invoice). + * Voids a subscription's existing advance invoice. Once voided, it can later be regenerated if desired. + * + * A `reason` is required to void, and the invoice must have an open status. Voiding causes 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, see [Invoice]($m/Invoice). * * @param subscriptionId The Chargify id of the subscription. * @param body diff --git a/src/controllers/billingPortalController.ts b/src/controllers/billingPortalController.ts index ad3c636f..cd7485bb 100644 --- a/src/controllers/billingPortalController.ts +++ b/src/controllers/billingPortalController.ts @@ -33,31 +33,22 @@ export class BillingPortalController extends BaseController { * Enables Billing Portal access for a customer, with an option to send an invitation email at the same * time. * - * ## Billing Portal Documentation - * - * Full documentation on how the Billing Portal operates within the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). - * - * This documentation is focused on how to configure the Billing Portal Settings, as well as Subscriber - * Interaction and Merchant Management of the Billing Portal. - * - * You can use this endpoint to enable Billing Portal access for a Customer, with the option of sending - * the Customer an Invitation email at the same time. - * * ## Billing Portal Security * - * If your customer has been invited to the Billing Portal, then they will receive a link to manage - * their subscription (the “Management URL”) automatically at the bottom of their statements, invoices, - * and receipts. **This link changes periodically for security and is only valid for 65 days.** + * If your customer has been invited to the Billing Portal, they receive a link to manage their + * subscription (the “Management URL”) automatically at the bottom of their statements, invoices, and + * receipts. **This link changes periodically for security and is only valid for 65 days.** * * If you need to provide your customer their Management URL through other means, you can retrieve it - * via the API. Because the URL is cryptographically signed with a timestamp, it is not possible for - * merchants to generate the URL without requesting it from Advanced Billing. + * [via the API]($e/Billing%20Portal/readBillingPortalLink). Because the URL is cryptographically + * signed with a timestamp, merchants cannot generate the URL without requesting it through the API. + * + * To prevent abuse and overuse, 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), **do not** make an API request every time. * - * 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), **do not** - * make an API request to Advanced Billing every time. + * For more information configuring the Billing Portal, see [Billing Portal Overview](https://maxio. + * zendesk.com/hc/en-us/articles/24252412965133-Billing-Portal-Overview). * * @param customerId The Chargify id of the customer * @param autoInvite When set to 1, an Invitation email will be sent to the Customer. When set to 0, @@ -89,16 +80,16 @@ export class BillingPortalController extends BaseController { /** * Returns the exact URL required for a subscriber to access the Billing Portal. * - * ## Rules for Management Link API + * ## Management Link Request Rules * - * + When retrieving a management URL, multiple requests for the same customer in a short period will - * return the **same** URL - * + We will not generate a new URL for 15 days + * + When retrieving a management URL, multiple requests for the same customer in a short period return + * the **same** URL + * + A new URL is not generated for 15 days * + You must cache and remember this URL if you are going to need it again within 15 days * + Only request a new URL after the `new_link_available_at` date * + 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`) + * `new_link_available_at`, you are blocked from further Management URL requests (with a response code + * `429`). * * @param customerId The Chargify id of the customer * @return Response from the API call diff --git a/src/controllers/componentPricePointsController.ts b/src/controllers/componentPricePointsController.ts index e6ecf9cf..fc3213fc 100644 --- a/src/controllers/componentPricePointsController.ts +++ b/src/controllers/componentPricePointsController.ts @@ -172,16 +172,12 @@ export class ComponentPricePointsController extends BaseController { * * You may specify the component by using either the numeric id or the `handle:gold` syntax. * - * When fetching a component'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 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. * * @param componentId The Advanced Billing id of the component - * @param currencyPrices Include an array of currency price data + * @param currencyPrices Include an array of currency price data. * @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 @@ -368,7 +364,7 @@ export class ComponentPricePointsController extends BaseController { * 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 + * @param currencyPrices Include an array of currency price data. * @return Response from the API call */ async readComponentPricePoint( diff --git a/src/controllers/componentsController.ts b/src/controllers/componentsController.ts index fb3d6b1b..04700501 100644 --- a/src/controllers/componentsController.ts +++ b/src/controllers/componentsController.ts @@ -60,9 +60,20 @@ export class ComponentsController extends BaseController { * the start of every billing period. If you want to bill for a quantity of something that does not * change unless you change it, then you want quantity components, instead. * + * #### Hybrid Pricing + * A `volume`, `tiered`, or `stairstep` metered component can combine its primary pricing with a + * secondary pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item + * instead of two. This does not apply to metered components configured for event-based billing (metric, + * meter, or formula). See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for + * requirements and configuration details. + * * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- * us/articles/24261141522189-Components-Overview). * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending + * `"tax_code": ""` returns `422`. + * * @param productFamilyId Either the product family's id or its handle prefixed * with `handle:` * @param body @@ -96,7 +107,7 @@ export class ComponentsController extends BaseController { * Creates a Quantity Based component definition under the specified product family. A Quantity Based * component can then be added and “allocated” for a subscription. * - * When defining a Quantity Based component, you can choose one of 2 types: + * When defining a Quantity Based component, you can choose one of two types: * #### Recurring * Recurring quantity-based components are used to bill for the number of some unit (think monthly * software user licenses or the number of pairs of socks in a box-a-month club). This is most commonly @@ -110,9 +121,21 @@ export class ComponentsController extends BaseController { * The allocated quantity for one-time quantity-based components immediately gets reset back to zero * after the allocation is made. * + * For more information, see [Components Overview](https://maxio.zendesk.com/hc/en- + * us/articles/24261141522189-Components-Overview). + * #### Hybrid Pricing + * A `volume`, `tiered`, or `stairstep` component can combine its primary pricing with a secondary + * pricing model (the `overage_pricing` parameter) so both bill as a single invoice line item instead + * of two. See [Hybrid Pricing](page:introduction/basic-concepts/hybrid-pricing) for requirements and + * configuration details. + * * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- * us/articles/24261141522189-Components-Overview). * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending + * `"tax_code": ""` returns `422`. + * * @param productFamilyId Either the product family's id or its handle * prefixed with `handle:` * @param body @@ -152,6 +175,10 @@ export class ComponentsController extends BaseController { * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- * us/articles/24261141522189-Components-Overview). * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending + * `"tax_code": ""` returns `422`. + * * @param productFamilyId Either the product family's id or its handle prefixed * with `handle:` * @param body @@ -188,11 +215,15 @@ export class ComponentsController extends BaseController { * Prepaid components allow customers to pre-purchase units that can be used up over time on their * subscription. In a sense, they are the mirror image of metered components; while metered components * charge at the end of the period for the amount of units used, prepaid components are charged for at - * the time of purchase, and we subsequently keep track of the usage against the amount purchased. + * the time of purchase, and usage is subsequently tracked against the amount purchased. * - * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * For more information, see [Components Overview](https://maxio.zendesk.com/hc/en- * us/articles/24261141522189-Components-Overview). * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending + * a blank value results in a validation error. + * * @param productFamilyId Either the product family's id or its handle prefixed * with `handle:` * @param body @@ -235,9 +266,13 @@ export class ComponentsController extends BaseController { * So, instead of reporting usage directly for each component (as you would with metered components), * the usage is derived from analysis of your events. * - * For more information on components, see our documentation [here](https://maxio.zendesk.com/hc/en- + * For more information, see [Components Overview](https://maxio.zendesk.com/hc/en- * us/articles/24261141522189-Components-Overview). * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`; sending + * a blank value results in a validation error. + * * @param productFamilyId Either the product family's id or its handle prefixed with * `handle:` * @param body @@ -317,6 +352,10 @@ export class ComponentsController extends BaseController { * You may read the component by either the component's id or handle. When using the handle, it must be * prefixed with `handle:`. * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending + * `"tax_code": ""` returns `422`. + * * @param productFamilyId The Advanced Billing id of the product family to which * the component belongs * @param componentId Either the Advanced Billing id of the component or the @@ -401,8 +440,8 @@ export class ComponentsController extends BaseController { * timestamp at or before exact time provided in query. You * can specify timezone in query - otherwise your site's time * zone will be used. If provided, this parameter will be used - * instead of end_date. optional - * @param includeArchived Include archived items + * instead of end_date. + * @param includeArchived Include archived items. * @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 @@ -473,6 +512,10 @@ export class ComponentsController extends BaseController { * You may read the component by either the component's id or handle. When using the handle, it must be * prefixed with `handle:`. * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, taxable components must include a non-blank `tax_code`. Sending + * `"tax_code": ""` returns `422`. + * * @param componentId The id or handle of the component * @param body * @return Response from the API call @@ -529,7 +572,7 @@ export class ComponentsController extends BaseController { * timestamp at or before exact time provided in query. You * can specify timezone in query - otherwise your site's time * zone will be used. If provided, this parameter will be - * used instead of end_date. optional. + * used instead of end_date. * @param startDate 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 diff --git a/src/controllers/couponsController.ts b/src/controllers/couponsController.ts index 288bfc77..6ce539a8 100644 --- a/src/controllers/couponsController.ts +++ b/src/controllers/couponsController.ts @@ -42,15 +42,8 @@ export class CouponsController extends BaseController { /** * Creates a coupon under the specified product family. * - * You can create either a flat amount coupon by specifying amount_in_cents, or a percentage coupon by - * specifying percentage - * 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 }` - * - * Coupons can be administered in the Advanced Billing application or created via API. See [creating - * coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creating-Editing-Deleting- - * Coupons) for more information. + * You can create either a flat amount coupon, by specifying `amount_in_cents`, or percentage coupon by + * specifying `percentage`. * * See [Apply Coupons to Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- * Coupons-and-Subscriptions) for information on applying a coupon to a subscription in the Advanced @@ -102,10 +95,9 @@ export class CouponsController extends BaseController { * 200; any per_page value over 200 will be changed to 200. Use * in query `per_page=200`. * @param filter Filter to use for List Coupons operations - * @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. Use in query + * @param currencyPrices (Optional) If you have defined multiple currencies at the + * site level, you can pass `?currency_prices=true` to include + * an array of currency price data in the response. Use in query * `currency_prices=true`. * @return Response from the API call */ @@ -143,18 +135,17 @@ export class CouponsController extends BaseController { } /** - * Searches for a coupon by code, returning a 404 if no coupon is found. By passing a code parameter, - * the find will attempt to locate a coupon that matches that code. + * Searches for a coupon by 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. + * the default product family in your site, you need to specify (either in the URL or as a query string + * param) the `product_family_id`. * * @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. + * @param currencyPrices (Optional) If you have defined multiple currencies at the site level, you can + * pass `?currency_prices=true` to include an array of currency price data in the + * response. * @return Response from the API call */ async findCoupon( @@ -177,23 +168,20 @@ export class CouponsController extends BaseController { } /** - * Returns a coupon by its Advanced Billing-assigned ID. You must identify the Coupon in this call by - * the ID parameter that Advanced Billing assigns. - * If instead you would like to find a Coupon using a Coupon code, see the Coupon Find method. + * Returns a coupon by its system-assigned ID. You must identify the Coupon in this call by the ID + * parameter assigned to it. * - * When fetching a coupon, 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 instead you would like to find a Coupon using a Coupon code, use the [Find + * Coupon]($e/Coupons/findCoupon) endpoint. * - * 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. + * If the coupon is set to `use_site_exchange_rate: true`, it returns pricing based on the current + * exchange rate. If the flag is set to false, it returns all of the defined prices for each currency. * * @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. + * @param currencyPrices (Optional) If you have defined multiple currencies at the site level, you can + * pass `?currency_prices=true` to include an array of currency price data in the + * response. * @return Response from the API call */ async readCoupon( @@ -294,10 +282,9 @@ export class CouponsController extends BaseController { * any per_page value over 200 will be changed to 200. Use in * query `per_page=200`. * @param filter Filter to use for List Coupons operations - * @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. Use in query + * @param currencyPrices (Optional) If you have defined multiple currencies at the site + * level, you can pass `?currency_prices=true` to include an array + * of currency price data in the response. Use in query * `currency_prices=true`. * @return Response from the API call */ @@ -354,30 +341,21 @@ export class CouponsController extends BaseController { /** * Verifies whether a specific coupon code is valid. This method is useful for validating coupon codes - * that are entered by a customer. If the coupon is found and is valid, the coupon will be returned - * with a 200 status code. - * - * If the coupon is invalid, the status code will be 404 and the response will say why it is invalid. - * If the coupon is valid, the status code will be 200 and the coupon will be returned. The following - * reasons for invalidity are supported: - * - * + Coupon not found - * + Coupon is invalid - * + Coupon expired + * that are entered by a customer. * * If you have more than one product family and if the coupon you are validating does not belong to the - * first product family in your site, then you will need to specify the product family, either in the - * url or as a query string param. This can be done by supplying the id or the handle in the `handle:my- - * family` format. + * first product family in your site, you need to specify the product family, either in the URL or as a + * query string param. This can be done by supplying the id or the handle in the `handle:my-family` + * format. * - * Eg. + * Supplying the `product_family_handle` in the URL: * * ``` * https://.chargify.com/product_families/handle:/coupons/validate. * ?code= * ``` * - * Or: + * Supplying the `product_family_id` as a query parameter: * * ``` * https://.chargify.com/coupons/validate.? @@ -448,8 +426,6 @@ export class CouponsController extends BaseController { /** * Creates subcodes for an existing coupon. * - * ## Coupon Subcodes Intro - * * Coupon Subcodes allow you to create a set of unique codes that allow you to expand the use of one * coupon. * @@ -465,27 +441,12 @@ export class CouponsController extends BaseController { * + DP80302 * + SPRINGBALTIMORE * - * Coupon subcodes can be administered in the Admin Interface or via the API. - * * When creating a coupon subcode, you must specify a coupon to attach it to using the coupon_id. Valid * coupon subcodes are all capital letters, contain only letters and numbers, and do not have any - * spaces. Lowercase letters will be capitalized before the subcode is created. - * - * ## Coupon Subcodes Documentation + * spaces. Lowercase letters are capitalized before the subcode is created. * - * Full documentation on how to create coupon subcodes in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes). - * - * Additionally, for documentation on how to apply a coupon to a Subscription within the Advanced - * Billing UI, see our documentation [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101- - * Coupons-and-Subscriptions). - * - * ## Create Coupon Subcode - * - * This request allows you to create specific subcodes underneath an existing coupon code. - * - * *Note*: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), - * you must encode them for use in the URL. + * Note: If you are using any of the allowed special characters ("%", "@", "+", "-", "_", and "."), you + * must encode them for use in the URL. * * % to %25 * @ to %40 @@ -495,7 +456,11 @@ export class CouponsController extends BaseController { * . to %2E * * 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.` + * //.chargify.com/coupons/567/codes/20%25OFF.`. + * + * For more information on coupon codes and applying coupons to subscriptions, see [Coupon Codes](https: + * //maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-Codes) and [Coupons and + * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and-Subscriptions). * * @param couponId The Advanced Billing id of the coupon * @param body @@ -620,7 +585,7 @@ export class CouponsController extends BaseController { * ## Percent Encoding Example * * 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. + * //.chargify.com/coupons/567/codes/20%25OFF.. * * @param couponId The Advanced Billing id of the coupon to which the subcode belongs * @param subcode The subcode of the coupon diff --git a/src/controllers/customersController.ts b/src/controllers/customersController.ts index 1f1b7857..6f504ec2 100644 --- a/src/controllers/customersController.ts +++ b/src/controllers/customersController.ts @@ -37,41 +37,38 @@ import { CustomerErrorResponseError } from '../errors/customerErrorResponseError export class CustomersController extends BaseController { /** * Creates a new customer; can also be created alongside a new subscription. The only validation - * restriction is that you may only create one customer for a given reference value. + * restriction is that you can only create one customer for a given reference value. * * If provided, the `reference` value must be unique. It represents a unique identifier for the * customer from your own app, i.e. the customer’s ID. This allows you to retrieve a given customer via - * a piece of shared information. Alternatively, you may choose to leave `reference` blank, and store - * Advanced Billing’s unique ID for the customer, which is in the `id` attribute. + * a piece of shared information. Alternatively, you can choose to leave `reference` blank, and store + * the system-assigned unique ID for the customer, which is in the `id` attribute. * - * Full documentation on how to locate, create and edit Customers in the Advanced Billing UI can be - * located [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer-Details). + * For more information, see [Customer Details](https://maxio.zendesk.com/hc/en- + * us/articles/24252190590093-Customer-Details). * * ## Required Country Format * - * Advanced Billing requires that you use the ISO Standard Country codes when formatting country - * attribute of the customer. + * Format the country attribute of the customer using the ISO Standard Country codes. * - * Countries should be formatted as 2 characters. For more information, see the following wikipedia - * article on [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) + * Countries should be formatted as two characters. For more information, see [ISO 3166-1](http://en. + * wikipedia.org/wiki/ISO_3166-1#Current_codes). * * ## Required State Format * - * Advanced Billing requires that you use the ISO Standard State codes when formatting state attribute - * of the customer. + * Format the state attribute of the customer using the ISO Standard State codes. * - * + US States (2 characters): [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) + * + US States (two characters): see [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US). * - * + States Outside the US (2-3 characters): To find the correct state codes outside of the US, go to - * [ISO_3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in the - * “ISO 3166-2 codes” column next to country you wish to populate. + * + States Outside the US (two to three characters): To find the correct state codes outside the US, + * go to [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) and click on the link in + * the “ISO 3166-2 codes” column next to the country you wish to populate. * * ## Locale * - * Advanced Billing allows you to attribute a language/region to your customer to deliver invoices in - * any required language. - * For more: [Customer Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Customer- - * Locale) + * You can attribute a language/region to the customer to deliver invoices in any required language. + * For more information, see [Customer Locale](https://maxio.zendesk.com/hc/en- + * us/articles/24286672013709-Customer-Locale). * * @param body * @return Response from the API call @@ -282,6 +279,11 @@ export class CustomersController extends BaseController { /** * Lists all subscriptions that belong to a customer. * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, subscriptions no longer require an associated product. For + * subscriptions without an associated product, 'product', 'product_price_point_id', and + * 'product_price_point_type' are returned as 'null'. + * * @param customerId The Chargify id of the customer * @return Response from the API call */ diff --git a/src/controllers/eventsBasedBillingSegmentsController.ts b/src/controllers/eventsBasedBillingSegmentsController.ts index 53a62cb0..8c128a6a 100644 --- a/src/controllers/eventsBasedBillingSegmentsController.ts +++ b/src/controllers/eventsBasedBillingSegmentsController.ts @@ -146,10 +146,10 @@ export class EventsBasedBillingSegmentsController extends BaseController { } /** - * Updates a single segment for a component with a segmented metric. It allows you to update the - * pricing for the segment. + * Updates a single segment for a component with a segmented metric. You can also update the pricing + * for the segment. * - * You may specify component and/or price point by using either the numeric ID or the `handle:gold` + * You can specify component and/or price point by using either the numeric ID or the `handle:gold` * syntax. * * @param componentId ID or Handle of the Component diff --git a/src/controllers/eventsController.ts b/src/controllers/eventsController.ts index 63795e89..117c6a22 100644 --- a/src/controllers/eventsController.ts +++ b/src/controllers/eventsController.ts @@ -20,20 +20,14 @@ export class EventsController extends BaseController { /** * Lists events for a site. * - * ## Events Intro + * Events include various activity that happens around a Site. This information is **especially** + * useful to track down issues that arise when subscriptions are not created due to errors. * - * Advanced Billing Events include various activity that happens around a Site. This information is - * **especially** useful to track down issues that arise when subscriptions are not created due to - * errors. + * Within the UI, Events are referred to as Site Activity. For more information, see [Site + * Activity](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). * - * Within the Advanced Billing UI, "Events" are referred to as "Site Activity". Full documentation on - * how to view Events / Site Activity in the Advanced Billing UI can be located [here](https://maxio. - * zendesk.com/hc/en-us/articles/24250671733517-Site-Activity). - * - * ## List Events for a Site - * - * This method will retrieve a list of events for a site. Use query string filters to narrow down - * results. You may use the `key` filter as part of your query string to narrow down results. + * Use query string filters to narrow down results. You can use the `filter` parameter to filter by + * event key. * * ### Legacy Filters * @@ -47,8 +41,8 @@ export class EventsController extends BaseController { * + `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]($m/Event%20Key). + * The event type is identified by the key property. See [Event Key]($m/Event%20Key) for a complete + * list of supported keys. * * ## Event Specific Data * @@ -64,7 +58,7 @@ export class EventsController extends BaseController { * "event": { * "id": 351, * "key": "subscription_product_change", - * "message": "Product changed on Marky Mark's subscription from 'Basic' to 'Pro'", + * "message": "Product changed on Mark Alan's subscription from 'Basic' to 'Pro'", * "subscription_id": 205, * "event_specific_data": { * "new_product_id": 3, @@ -82,7 +76,7 @@ export class EventsController extends BaseController { * "event": { * "id": 353, * "key": "subscription_state_change", - * "message": "State changed on Marky Mark's subscription to Pro from trialing to active", + * "message": "State changed on Mark Alan's subscription to Pro from trialing to active", * "subscription_id": 205, * "event_specific_data": { * "new_subscription_state": "active", @@ -93,6 +87,23 @@ export class EventsController extends BaseController { * } * ``` * + * ## Enhanced Catalog Experience + * + * If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new- + * catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + * + * Event name changes: + * + * - subscription_product_change → subscription_plan_change + * - component_allocation_change → allocation_change + * - component_billing_date_change → product_billing_date_change + * + * Message updates: + * + * - “Plan changed on Subscription from previous plan to new plan” + * - “Successful payment for allocation changes to Product on Subscription” + * - “Failed payment for allocation changes to Product on 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 @@ -103,9 +114,8 @@ export class EventsController extends BaseController { * @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`. - * @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 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`. @@ -189,8 +199,8 @@ export class EventsController extends BaseController { * Lists events for a subscription. * * ## Event Key - * The event type is identified by the key property. You can check supported keys - * [here]($m/Event%20Key). + * The event type is identified by the key property. See [Event Key]($m/Event%20Key) for a complete + * list of supported keys. * * ## Event Specific Data * @@ -198,6 +208,23 @@ export class EventsController extends BaseController { * 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). * + * ## Enhanced Catalog Experience + * + * If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new- + * catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + * + * Event name changes: + * + * - subscription_product_change → subscription_plan_change + * - component_allocation_change → allocation_change + * - component_billing_date_change → product_billing_date_change + * + * Message updates: + * + * - “Successful payment for allocation changes to Product on Subscription” + * - “Failed payment for allocation changes to Product on Subscription” + * - “Plan changed on Subscription from previous plan to new plan” + * * @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. @@ -208,8 +235,8 @@ export class EventsController extends BaseController { * @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`. - * @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 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`. @@ -259,6 +286,21 @@ export class EventsController extends BaseController { /** * Returns the total count of events for a given site. * + * If you’re using the [enhanced Catalog experience](page:help/announcements/2026-announcements#new- + * catalog-experience-and-terminology), you’ll see updated naming in webhook events and messages. + * + * Event name changes: + * + * - subscription_product_change → subscription_plan_change + * - component_allocation_change → allocation_change + * - component_billing_date_change → product_billing_date_change + * + * Message updates: + * + * - “Successful payment for allocation changes to Product on Subscription” + * - “Failed payment for allocation changes to Product on Subscription” + * - “Plan changed on Subscription from previous plan to new plan” + * * @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 @@ -268,8 +310,8 @@ export class EventsController extends BaseController { * @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`. - * @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 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`. diff --git a/src/controllers/insightsController.ts b/src/controllers/insightsController.ts index c041f3c9..9fb26ee1 100644 --- a/src/controllers/insightsController.ts +++ b/src/controllers/insightsController.ts @@ -53,8 +53,8 @@ export class InsightsController extends BaseController { /** * Returns your site's current MRR, including plan and usage breakouts. * - * @param atTime submit a timestamp in ISO8601 format to request MRR for a historic time - * @param subscriptionId submit the id of a subscription in order to limit results + * @param atTime submit a timestamp in ISO8601 format to request MRR for a historic time. + * @param subscriptionId submit the id of a subscription in order to limit results. * @return Response from the API call * @deprecated */ @@ -104,7 +104,7 @@ export class InsightsController extends BaseController { * * Metered Components * * Prepaid Usage Components * - * @param subscriptionId optionally filter results by subscription + * @param subscriptionId (Optional) Filter results by 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 @@ -151,8 +151,7 @@ export class InsightsController extends BaseController { } /** - * This endpoint returns your site's current MRR, including plan and usage breakouts split per - * subscription. + * Lists your site's current MRR, including plan and usage breakouts split per subscription. * * @param filter Filter to use for List MRR per subscription operation * @param atTime Submit a timestamp in ISO8601 format to request MRR for a historic time. diff --git a/src/controllers/invoicesController.ts b/src/controllers/invoicesController.ts index e3f857e6..5f413435 100644 --- a/src/controllers/invoicesController.ts +++ b/src/controllers/invoicesController.ts @@ -81,6 +81,10 @@ import { SendInvoiceRequest, sendInvoiceRequestSchema, } from '../models/sendInvoiceRequest.js'; +import { + UpdateInvoiceRequest, + updateInvoiceRequestSchema, +} from '../models/updateInvoiceRequest.js'; import { VoidInvoiceRequest, voidInvoiceRequestSchema, @@ -93,7 +97,7 @@ import { ErrorListResponseError } from '../errors/errorListResponseError.js'; export class InvoicesController extends BaseController { /** - * Refund an invoice, segment, or consolidated invoice. + * Refunds an invoice, segment, or consolidated invoice. * * ## Partial Refund for Consolidated Invoice * @@ -131,9 +135,10 @@ export class InvoicesController extends BaseController { } /** - * 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`. + * Lists invoices for a site. 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`. * * @param startDate The start date (format YYYY-MM-DD) with which to filter the * date_field. Returns invoices with a timestamp at or after @@ -164,13 +169,13 @@ export class InvoicesController extends BaseController { * any per_page value over 200 will be changed to 200. Use in query * `per_page=200`. * @param direction The sort direction of the returned invoices. - * @param lineItems Include line items data - * @param discounts Include discounts data - * @param taxes Include taxes data - * @param credits Include credits data - * @param payments Include payments data - * @param customFields Include custom fields data - * @param refunds Include refunds data + * @param lineItems Include line items data. + * @param discounts Include discounts data. + * @param taxes Include taxes data. + * @param credits Include credits data. + * @param payments Include payments data. + * @param customFields Include custom fields data. + * @param refunds Include refunds data. * @param dateField The type of filter you would like to apply to your search. Use * in query `date_field=issue_date`. * @param startDatetime The start date and time (format YYYY-MM-DD HH:MM:SS) with which @@ -307,7 +312,7 @@ export class InvoicesController extends BaseController { } /** - * Use this endpoint to retrieve the details for an invoice. + * Returns the details for an invoice. * * ## PDF Invoice retrieval * @@ -338,8 +343,8 @@ export class InvoicesController extends BaseController { } /** - * This endpoint returns a list of invoice events. Each event contains event "data" (such as an applied - * payment) as well as a snapshot of the `invoice` at the time of event completion. + * Lists invoice events for a site. Each event contains event "data" (such as an applied payment) as + * well as a snapshot of the `invoice` at the time of event completion. * * Exposed event types are: * @@ -442,7 +447,8 @@ export class InvoicesController extends BaseController { /** * Applies a payment of a given type against a specific invoice. If you would like to apply a payment - * across multiple invoices, you can use the Bulk Payment endpoint. + * across multiple invoices, you can use the [Record Payment for Multiple + * Invoices]($e/Invoices/recordPaymentForMultipleInvoices) endpoint. * * @param uid The unique identifier for the invoice, this does not * refer to the public facing invoice number. @@ -473,32 +479,11 @@ export class InvoicesController extends BaseController { } /** - * This API call should be used when you want to record an external payment against multiple invoices. + * Records an external payment against multiple invoices. * * To apply a payment to multiple invoices, at minimum, specify the `amount` and `applications` (i.e., * `invoice_uid` and `amount`) details. * - * ``` - * { - * "payment": { - * "memo": "to pay the bills", - * "details": "check number 8675309", - * "method": "check", - * "amount": "250.00", - * "applications": [ - * { - * "invoice_uid": "inv_8gk5bwkct3gqt", - * "amount": "100.00" - * }, - * { - * "invoice_uid": "inv_7bc6bwkct3lyt", - * "amount": "150.00" - * } - * ] - * } - * } - * ``` - * * Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal * to invoices payment amount sum. * @@ -526,7 +511,8 @@ export class InvoicesController extends BaseController { } /** - * Credit Notes are like inverse invoices. They reduce the amount a customer owes. + * Lists credit notes for a site. 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 @@ -542,11 +528,11 @@ export class InvoicesController extends BaseController { * @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`. - * @param lineItems Include line items data - * @param discounts Include discounts data - * @param taxes Include taxes data - * @param refunds Include refunds data - * @param applications Include applications data + * @param lineItems Include line items data. + * @param discounts Include discounts data. + * @param taxes Include taxes data. + * @param refunds Include refunds data. + * @param applications Include applications data. * @return Response from the API call */ async listCreditNotes( @@ -595,7 +581,7 @@ export class InvoicesController extends BaseController { } /** - * Use this endpoint to retrieve the details for a credit note. + * Returns the details for a credit note. * * @param uid The unique identifier of the credit note * @return Response from the API call @@ -612,7 +598,7 @@ export class InvoicesController extends BaseController { } /** - * Record an external payment made against a subscription that will pay partially or in full one or + * Records an external payment made against a subscription that will pay partially or in full one or * more invoices. * * Payment will be applied starting with the oldest open invoice and then next oldest, and so on until @@ -650,9 +636,8 @@ export class InvoicesController extends BaseController { } /** - * This endpoint allows you to reopen any invoice with the "canceled" status. Invoices enter "canceled" - * status if they were open at the time the subscription was canceled (whether through dunning or an - * intentional cancellation). + * Reopens any invoice with the "canceled" status. Invoices enter "canceled" status if they were open + * at the time the subscription was canceled (whether through dunning or an intentional cancellation). * * Invoices with "canceled" status are no longer considered to be due. Once reopened, they are * considered due for payment. Payment may then be captured in one of the following ways: @@ -693,8 +678,8 @@ export class InvoicesController extends BaseController { } /** - * 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. + * Voids 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. * * @param uid The unique identifier for the invoice, this does not refer to * the public facing invoice number. @@ -726,8 +711,9 @@ export class InvoicesController extends BaseController { } /** - * Invoice segments returned on the index will only include totals, not detailed breakdowns for - * `line_items`, `discounts`, `taxes`, `credits`, `payments`, or `custom_fields`. + * Lists segments for a consolidated invoice. Invoice segments returned on the index will only include + * totals, not detailed breakdowns for `line_items`, `discounts`, `taxes`, `credits`, `payments`, or + * `custom_fields`. * * @param invoiceUid The unique identifier of the consolidated invoice * @param page Result records are organized in pages. By default, the first page of results is @@ -772,7 +758,7 @@ export class InvoicesController extends BaseController { } /** - * This endpoint will allow you to create an ad hoc invoice. + * Creates an ad hoc invoice. * * ### Basic Behavior * @@ -1018,10 +1004,148 @@ export class InvoicesController extends BaseController { } /** - * This endpoint allows for invoices to be programmatically delivered via email. This endpoint supports - * the delivery of both ad-hoc and automatically generated invoices. Additionally, this endpoint - * supports email delivery to direct recipients, carbon-copy (cc) recipients, and blind carbon-copy - * (bcc) recipients. + * Updates an ad hoc invoice while it is in the `draft` state. + * + * **Important: only invoices with the `adhoc` role and `draft` status can be updated.** Any other + * invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be updated through + * this endpoint and the request returns a `422` error. If the invoice does not belong to the provided + * subscription, a `404` error is returned. + * + * Only the attributes submitted in the request are changed — omitted attributes keep their current + * values. + * + * ### Line Items + * + * The `line_items` array describes changes to the invoice's line items. Line items not referenced in + * the array remain unchanged. + * + * #### Adding a line item + * + * A line item without a `uid` is added to the invoice. The same line item types and options as on + * invoice creation are supported (custom items, `product_id`, `component_id`, price points, period + * date ranges, taxes). + * + * #### Updating a line item + * + * A line item with the `uid` of an existing line item updates that line item with the submitted + * attributes. Amounts and taxes are recalculated. + * + * #### Removing a line item + * + * A line item with a `uid` and `"_destroy": true` is removed from the invoice. Other line items remain + * unchanged. + * + * Referencing a `uid` which does not exist on the invoice returns a `422` error. + * + * ### Coupons + * + * When the `coupons` key is present, the submitted coupons replace all discounts currently applied to + * the invoice. Send an empty array to remove all discounts. Coupon options are the same as on invoice + * creation. + * + * ### Invoice Options + * + * #### Issue Date and Net Terms + * + * The `issue_date` parameter can be sent to change the invoice's issue date. Only today or dates in + * the past are accepted. The date is interpreted and validated in your site's time zone, using the + * `YYYY-MM-DD` format. The `net_terms` parameter indicates the number of days after the issue date on + * which the invoice is due. The due date is recalculated whenever the issue date or net terms change. + * + * #### Addresses + * + * The seller, shipping and billing addresses can be sent to replace the addresses on the invoice. Each + * address requires to send a `first_name` at a minimum in order to work. Taxes are recalculated after + * an address change. + * + * #### Memo and Payment Instructions + * + * A custom memo can be sent with the `memo` parameter. Likewise, custom payment instructions can be + * sent with the `payment_instructions` parameter. + * + * @param subscriptionId The Chargify id of the subscription. + * @param uid The unique identifier for the invoice, this does not refer + * to the public facing invoice number. + * @param body + * @return Response from the API call + */ + async updateInvoice( + subscriptionId: number, + uid: string, + body?: UpdateInvoiceRequest, + requestOptions?: RequestOptions + ): Promise> { + const req = this.createRequest('PUT'); + const mapped = req.prepareArgs({ + subscriptionId: [subscriptionId, number()], + uid: [uid, string()], + body: [body, optional(updateInvoiceRequestSchema)], + }); + req.header('Content-Type', 'application/json'); + req.json(mapped.body); + req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/invoices/${mapped.uid}.json`; + req.throwOn( + 404, + ErrorListResponseError, + true, + "Not Found:'{$response.body}'" + ); + req.throwOn( + 422, + ErrorArrayMapResponseError, + true, + "HTTP Response Not OK. Status code: {$statusCode}. Response: '{$response.body}'." + ); + req.authenticate([{ basicAuth: true }]); + return req.callAsJson(invoiceResponseSchema, requestOptions); + } + + /** + * Deletes an ad hoc invoice while it is in the `draft` state. + * + * **Important: only invoices with the `adhoc` role and `draft` status can be deleted.** Any other + * invoice — issued, or with a different role (e.g. `renewal`, `signup`) — cannot be deleted through + * this endpoint and the request returns a `422` error. Issued invoices should be voided instead. If + * the invoice does not belong to the provided subscription, a `404` error is returned. + * + * A successful deletion returns a `204 No Content` response and the invoice is permanently removed. + * + * @param subscriptionId The Chargify id of the subscription. + * @param uid The unique identifier for the invoice, this does not refer to the public facing + * invoice number. + * @return Response from the API call + */ + async deleteInvoice( + subscriptionId: number, + uid: string, + requestOptions?: RequestOptions + ): Promise> { + const req = this.createRequest('DELETE'); + const mapped = req.prepareArgs({ + subscriptionId: [subscriptionId, number()], + uid: [uid, string()], + }); + req.appendTemplatePath`/subscriptions/${mapped.subscriptionId}/invoices/${mapped.uid}.json`; + req.throwOn( + 404, + ErrorListResponseError, + 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.call(requestOptions); + } + + /** + * Sends an invoice to the customer via email. This endpoint supports the delivery of both ad-hoc and + * automatically generated invoices. Additionally, this endpoint supports email delivery to direct + * recipients, carbon-copy (cc) recipients, and blind carbon-copy (bcc) recipients. * * **File Attachments**: You can attach files to invoice emails using `attachment_urls[]` parameter by * providing URLs to the files you want to attach. When using attachments, the request must use @@ -1065,9 +1189,10 @@ export class InvoicesController extends BaseController { } /** - * Customer information may change after an invoice is issued, which may lead to a mismatch between - * customer information that is present on an open invoice and actual customer information. This - * endpoint allows you to preview these differences, if any. + * Previews the effect of customer information changes on an open invoice. Customer information may + * change after an invoice is issued, which may lead to a mismatch between customer information that is + * present on an open invoice and actual customer information. This endpoint allows you to preview + * these differences, if any. * * The endpoint doesn't accept a request body. Customer information differences are calculated on the * application side. @@ -1100,9 +1225,9 @@ export class InvoicesController extends BaseController { } /** - * This endpoint updates customer information on an open invoice and returns the updated invoice. If - * you would like to preview changes that will be applied, use the - * `/invoices/{uid}/customer_information/preview.json` endpoint first. + * Updates customer information on an open invoice and returns the updated invoice. If you would like + * to preview changes that will be applied, use the `/invoices/{uid}/customer_information/preview.json` + * endpoint first. * * The endpoint doesn't accept a request body. Customer information differences are calculated on the * application side. @@ -1135,9 +1260,8 @@ export class InvoicesController extends BaseController { } /** - * This endpoint allows you to issue an invoice that is in "pending" or "draft" status. For example, - * you can issue an invoice that was created when allocating new quantity on a component and using - * "accrue charges" option. + * Issues an invoice that is in "pending" or "draft" status. For example, you can issue an invoice that + * was created when allocating new quantity on a component and using "accrue charges" option. * * You cannot issue a pending child invoice that was created for a member subscription in a group. * diff --git a/src/controllers/offersController.ts b/src/controllers/offersController.ts index 080b5a11..8e48b7fe 100644 --- a/src/controllers/offersController.ts +++ b/src/controllers/offersController.ts @@ -21,17 +21,15 @@ import { ErrorListResponseError } from '../errors/errorListResponseError.js'; export class OffersController extends BaseController { /** - * Creates an offer within your Advanced Billing site. - * - * ## Documentation + * Creates an offer within your site. * * Offers allow you to package complicated combinations of products, components and coupons into a * convenient package which can then be subscribed to just like products. * * Once an offer is defined it can be used as an alternative to the product when creating subscriptions. * - * Full documentation on how to use offers in the Advanced Billing UI can be located [here](https: - * //maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-Overview). + * For more information, see [Offers](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers- + * Overview) in the product documentation. * * ## Using a Product Price Point * diff --git a/src/controllers/paymentProfilesController.ts b/src/controllers/paymentProfilesController.ts index 528d628f..bf5bf95a 100644 --- a/src/controllers/paymentProfilesController.ts +++ b/src/controllers/paymentProfilesController.ts @@ -130,8 +130,8 @@ export class PaymentProfilesController extends BaseController { } /** - * Returns all 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. + * Lists all active payment profiles for a site, or for one customer within a site. If no payment + * profiles are found, this endpoint returns an empty array. * * @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 @@ -307,8 +307,8 @@ export class PaymentProfilesController extends BaseController { /** * 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. + * If the payment profile is in use by one or more subscriptions or groups, an error message is + * returned. * * @param paymentProfileId The Chargify id of the payment profile * @return Response from the API call @@ -336,12 +336,12 @@ export class PaymentProfilesController extends BaseController { /** * Deletes a payment profile belonging to the customer on the subscription. * - * + If the customer has multiple subscriptions, the payment profile will be removed from all of them. + * If the customer has multiple subscriptions, the payment profile is removed from all of them. * - * + 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 + * If you delete the default payment profile for a subscription, you 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). * * @param subscriptionId The Chargify id of the subscription. @@ -454,8 +454,8 @@ export class PaymentProfilesController extends BaseController { } /** - * This will change the default payment profile on the subscription group to the existing payment - * profile with the id specified. + * Changes the default payment profile on the subscription group to the existing payment profile with + * the specified ID. * * 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. @@ -489,8 +489,9 @@ export class PaymentProfilesController extends BaseController { } /** - * One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or Stripe - * only) data for a customer. + * Returns the one-time token data, including credit card or ACH details, associated with the provided + * token ID. One Time Tokens aka Advanced Billing Tokens house the credit card or ACH (Authorize.Net or + * Stripe only) data for a customer. * * You can use One Time Tokens while creating a subscription or payment profile instead of passing all * bank account or credit card data directly to a given API endpoint. @@ -521,7 +522,7 @@ export class PaymentProfilesController extends BaseController { } /** - * You can send a "request payment update" email to the customer associated with the subscription. + * Sends a "request payment update" email to the customer associated with the subscription. * * If you attempt to send a "request payment update" email more than five times within a 30-minute * period, you will receive a `422` response with an error message in the body. This error message will diff --git a/src/controllers/productFamiliesController.ts b/src/controllers/productFamiliesController.ts index aaadb961..caf91e3d 100644 --- a/src/controllers/productFamiliesController.ts +++ b/src/controllers/productFamiliesController.ts @@ -75,7 +75,7 @@ export class ProductFamiliesController extends BaseController { * specify timezone in query - otherwise your site's time zone * will be used. If provided, this parameter will be used * instead of end_date. - * @param includeArchived Include archived products + * @param includeArchived Include archived products. * @param include Allows including additional data in the response. Use in * query `include=prepaid_product_price_point`. * @return Response from the API call @@ -139,8 +139,8 @@ export class ProductFamiliesController extends BaseController { } /** - * Creates a Product Family within your Advanced Billing site. Create a Product Family to act as a - * container for your products, components, and coupons. + * Creates a Product Family within your site. Create a Product Family to act as a container for your + * products, components, and coupons. * * 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). @@ -169,7 +169,7 @@ export class ProductFamiliesController extends BaseController { } /** - * Returns a list of Product Families for a site. + * Lists Product Families for a site. * * @param dateField The type of filter you would like to apply to your search. Use in query: * `date_field=created_at`. diff --git a/src/controllers/productPricePointsController.ts b/src/controllers/productPricePointsController.ts index a84aaf85..bbe99cc0 100644 --- a/src/controllers/productPricePointsController.ts +++ b/src/controllers/productPricePointsController.ts @@ -151,15 +151,14 @@ export class ProductPricePointsController extends BaseController { * in each request. Default value is 10. The maximum * allowed values is 200; any per_page value over 200 * will be changed to 200. - * @param currencyPrices 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. + * @param currencyPrices (Optional) If you have defined multiple currencies + * at the site level, you can pass ? + * currency_prices=true 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. * @param filterType Use in query: `filter[type]=catalog,default`. * @param archived Set to include archived price points in the * response. @@ -250,10 +249,9 @@ export class ProductPricePointsController extends BaseController { * handle, it must be prefixed with `handle:`. Example: * `123` for an integer ID, or `handle:example-product- * price-point-handle` for a string handle. - * @param currencyPrices 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 + * @param currencyPrices (Optional) If you have defined multiple currencies at + * the site level, you can pass ?currency_prices=true 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 diff --git a/src/controllers/productsController.ts b/src/controllers/productsController.ts index 02ee458e..01ec5ab9 100644 --- a/src/controllers/productsController.ts +++ b/src/controllers/productsController.ts @@ -31,12 +31,15 @@ import { ErrorListResponseError } from '../errors/errorListResponseError.js'; export class ProductsController extends BaseController { /** - * Creates a product in your Advanced Billing site. + * Creates a product in your site. * - * See the following product documentation for more information: + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, the `auto_create_signup_page` parameter is not supported. If + * `auto_create_signup_page` is included (with any value) an error is returned. * - * + [Products Documentation](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products- - * Overview) + * For more information, see: + * + * + [Products Overview](https://maxio.zendesk.com/hc/en-us/articles/24261090117645-Products-Overview) * + [Changing a Subscription's Product](https://maxio.zendesk.com/hc/en-us/articles/24252069837581- * Product-Changes-and-Migrations) * diff --git a/src/controllers/proformaInvoicesController.ts b/src/controllers/proformaInvoicesController.ts index c5d15ce9..17471aae 100644 --- a/src/controllers/proformaInvoicesController.ts +++ b/src/controllers/proformaInvoicesController.ts @@ -47,10 +47,9 @@ import { ProformaBadRequestErrorResponseError } from '../errors/proformaBadReque export class ProformaInvoicesController extends BaseController { /** - * Creates a consolidated proforma invoice asynchronously. It will return a 201 with no message, or a - * 422 with any errors. To find and view the new consolidated proforma invoice, you may poll the - * subscription group listing for proforma invoices; only one consolidated proforma invoice may be - * created per group at a time. + * Creates a consolidated proforma invoice asynchronously. To find and view the new consolidated + * proforma invoice, you can poll the subscription group listing for proforma invoices; only one + * consolidated proforma invoice can be created per group at a time. * * If the information becomes outdated, simply void the old consolidated proforma invoice and generate * a new one. @@ -89,12 +88,12 @@ export class ProformaInvoicesController extends BaseController { * * * @param uid The uid of the subscription group - * @param lineItems Include line items data - * @param discounts Include discounts data - * @param taxes Include taxes data - * @param credits Include credits data - * @param payments Include payments data - * @param customFields Include custom fields data + * @param lineItems Include line items data. + * @param discounts Include discounts data. + * @param taxes Include taxes data. + * @param credits Include credits data. + * @param payments Include payments data. + * @param customFields Include custom fields data. * @return Response from the API call */ async listSubscriptionGroupProformaInvoices( @@ -221,12 +220,12 @@ export class ProformaInvoicesController extends BaseController { * any per_page value over 200 will be changed to 200. Use in query * `per_page=200`. * @param direction The sort direction of the returned invoices. - * @param lineItems Include line items data - * @param discounts Include discounts data - * @param taxes Include taxes data - * @param credits Include credits data - * @param payments Include payments data - * @param customFields Include custom fields data + * @param lineItems Include line items data. + * @param discounts Include discounts data. + * @param taxes Include taxes data. + * @param credits Include credits data. + * @param payments Include payments data. + * @param customFields Include custom fields data. * @return Response from the API call */ async listProformaInvoices( @@ -375,10 +374,10 @@ export class ProformaInvoicesController extends BaseController { } /** - * Returns a preview of the data that will be included on a given subscription's proforma invoice if - * one were to be generated. It will have similar line items and totals as a renewal preview, but the - * response will be presented in the format of a proforma invoice. Consequently it will include - * additional information such as the name and addresses that will appear on the proforma invoice. + * Previews the data that will be included on a given subscription's proforma invoice if one were to be + * generated. It will have similar line items and totals as a renewal preview, but the response will be + * presented in the format of a proforma invoice. Consequently it will include additional information + * such as the name and addresses that will appear on the proforma invoice. * * The preview endpoint is subject to all the same conditions as the proforma invoice endpoint. For * example, previews are only available on the Relationship Invoicing architecture, and previews cannot diff --git a/src/controllers/reasonCodesController.ts b/src/controllers/reasonCodesController.ts index a7753f86..10ab3798 100644 --- a/src/controllers/reasonCodesController.ts +++ b/src/controllers/reasonCodesController.ts @@ -27,24 +27,14 @@ export class ReasonCodesController extends BaseController { /** * Creates a reason code for a given site. * - * # Reason Codes Intro - * * Reason Codes are a way to gain a high-level view of why your customers are cancelling the * subscription to your product or service. * * Add a set of churn reason codes to be displayed in-app and/or the Maxio Billing Portal. As your * subscribers decide to cancel their subscription, learn why they decided to cancel. * - * ## Reason Code Documentation - * - * Full documentation on how Reason Codes operate within Advanced Billing can be located under the - * following links. - * - * [Churn Reason Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Reason-Codes) - * - * ## Create Reason Code - * - * This method gives a merchant the option to create reason codes for a given site. + * For more information, see [Churn Reason Codes](https://maxio.zendesk.com/hc/en- + * us/articles/24286647554701-Churn-Reason-Codes). * * @param body * @return Response from the API call diff --git a/src/controllers/referralCodesController.ts b/src/controllers/referralCodesController.ts index b35f081a..02877cc4 100644 --- a/src/controllers/referralCodesController.ts +++ b/src/controllers/referralCodesController.ts @@ -18,15 +18,8 @@ export class ReferralCodesController extends BaseController { * Validates whether a referral code is valid and applicable within your site. This method is useful * for validating referral codes that are entered by a customer. * - * ## Referrals Documentation - * - * Full documentation on how to use the referrals feature in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referrals). - * - * ## Server Response - * - * 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. + * For more information, see [Understanding Referrals](https://docs.maxio.com/hc/en- + * us/articles/24286981223693-Understanding-Referrals) in the product documentation. * * @param code The referral code you are trying to validate * @return Response from the API call diff --git a/src/controllers/salesCommissionsController.ts b/src/controllers/salesCommissionsController.ts index c7f8f4fc..dfe3a0f8 100644 --- a/src/controllers/salesCommissionsController.ts +++ b/src/controllers/salesCommissionsController.ts @@ -34,7 +34,7 @@ export class SalesCommissionsController extends BaseController { * seller has the Advanced Analytics component enabled. For further information on getting access to * Advanced Analytics contact Maxio support. * - * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` + * > Note: The request is at seller level, it means `<>` variable will be replaced by `app`. * * @param sellerId The Chargify id of your seller account * @param authorization For authorization use user API key. See details [here](https://developers. @@ -86,7 +86,7 @@ export class SalesCommissionsController extends BaseController { } /** - * Returns a sales rep list with details. + * Lists sales reps with details. * * ## Modified Authentication Process * @@ -101,7 +101,7 @@ export class SalesCommissionsController extends BaseController { * seller has the Advanced Analytics component enabled. For further information on getting access to * Advanced Analytics contact Maxio support. * - * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` + * > Note: The request is at seller level, it means `<>` variable will be replaced by `app`. * * @param sellerId The Chargify id of your seller account * @param authorization For authorization use user API key. See details [here](https://developers. @@ -168,7 +168,7 @@ export class SalesCommissionsController extends BaseController { * seller has the Advanced Analytics component enabled. For further information on getting access to * Advanced Analytics contact Maxio support. * - * > Note: The request is at seller level, it means `<>` variable will be replaced by `app` + * > Note: The request is at seller level, it means `<>` variable will be replaced by `app`. * * @param sellerId The Chargify id of your seller account * @param salesRepId The Advanced Billing id of sales rep. diff --git a/src/controllers/sitesController.ts b/src/controllers/sitesController.ts index 45dfba75..c5ce7e26 100644 --- a/src/controllers/sitesController.ts +++ b/src/controllers/sitesController.ts @@ -18,21 +18,21 @@ export class SitesController extends BaseController { /** * Retrieves site data. * - * Full documentation on Sites in the Advanced Billing UI can be located [here](https://maxio.zendesk. - * com/hc/en-us/sections/24250550707085-Sites). - * - * Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365- - * Clearing-Site-Data) section is relevant to this endpoint documentation. + * For more information, see [Sites](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites) + * in the product documentation. Specifically, the [Clearing Site Data](https://maxio.zendesk.com/hc/en- + * us/articles/24250617028365-Clearing-Site-Data) section is relevant to this endpoint. * * #### Relationship invoicing enabled - * If the site has RI enabled then you will see more settings like: + * If the site has Relationship invoicing enabled, additional properties are returned in the response: * + * ``` * "customer_hierarchy_enabled": true, * "whopays_enabled": true, * "whopays_default_payer": "self" - * You can read more about these settings here: - * [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Customer- - * Hierarchies-WhoPays) + * ``` + * + * For more information, see [Who Pays & Customer Hierarchy](https://maxio.zendesk.com/hc/en- + * us/articles/24252185211533-Customer-Hierarchies-WhoPays). * * @return Response from the API call */ @@ -74,7 +74,7 @@ export class SitesController extends BaseController { } /** - * Returns public keys used for Maxio.js (formerly Chargify.js). + * Lists public keys used for Maxio.js (formerly Chargify.js). * * @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 diff --git a/src/controllers/subscriptionComponentsController.ts b/src/controllers/subscriptionComponentsController.ts index 5382ff74..2d0ce046 100644 --- a/src/controllers/subscriptionComponentsController.ts +++ b/src/controllers/subscriptionComponentsController.ts @@ -394,7 +394,7 @@ export class SubscriptionComponentsController extends BaseController { } /** - * Returns the 50 most recent Allocations, ordered by most recent first. + * Lists the 50 most recent Allocations, ordered by most recent first. * * ## On/Off Components * @@ -752,8 +752,8 @@ export class SubscriptionComponentsController extends BaseController { } /** - * Returns a list of usages associated with a subscription for a particular metered component. This - * will display the previously recorded components for a subscription. + * Lists usages associated with a subscription for a particular metered component. This will display + * the previously recorded components for a subscription. * * This endpoint is not compatible with quantity-based components. * @@ -792,11 +792,9 @@ export class SubscriptionComponentsController extends BaseController { * component's handle prefixed by * `handle:` * @param sinceId Returns usages with an id greater - * than or equal to the one - * specified + * than or equal to the one specified. * @param maxId Returns usages with an id less - * than or equal to the one - * specified + * than or equal to the one specified. * @param sinceDate Returns usages with a created_at * date greater than or equal to * midnight (12:00 AM) on the date @@ -877,18 +875,18 @@ export class SubscriptionComponentsController extends BaseController { /** * Activates an event-based component for a single subscription. * - * In order to bill your subscribers on your Events data under the Events-Based Billing feature, the - * components must be activated for the subscriber. + * To bill your subscribers on your Events data under the Events-Based Billing feature, the components + * must be activated for the subscriber. * - * Learn more about the role of activation in the [Events-Based Billing docs](https://maxio.zendesk. - * com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). + * For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en- + * us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). * * Use this endpoint to activate an event-based component for a single subscription. Activating an - * event-based component causes Advanced Billing to bill for events when the subscription is renewed. + * event-based component causes billing for events when the subscription is renewed. * - * *Note: it is possible to stream events for a subscription at any time, regardless of component + * 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.* + * event-based component usage at renewal. * * @param subscriptionId The Advanced Billing id of the subscription * @param componentId The Advanced Billing id of the component @@ -940,8 +938,6 @@ export class SubscriptionComponentsController extends BaseController { /** * Records a single event for Events-Based Billing. * - * ## Documentation - * * Events-Based Billing is an evolved form of metered billing that is based on data-rich events * streamed in real-time from your system to Advanced Billing. * @@ -950,15 +946,11 @@ export class SubscriptionComponentsController extends BaseController { * * This API allows you to stream events into the Advanced Billing data ingestion engine. * - * Learn more about the feature in general in the [Events-Based Billing help docs](https://maxio. - * zendesk.com/hc/en-us/articles/24260323329805-Events-Based-Billing-Overview). - * - * ## Record Event - * - * Use this endpoint to record a single event. + * For more information, see [Design Your Catalog](https://docs.maxio.com/hc/en- + * us/articles/24181036583053-Design-Your-Catalog?method=componenttypes). * - * *Note: this endpoint differs from the standard Chargify API endpoints in that the URL subdomain will - * be `events` and your site subdomain will be included in the URL path. For example:* + * Note: this endpoint differs from the standard URL for this API in that `events` and your site + * subdomain are included in the path. For example: * * ``` * https://events.chargify.com/my-site-subdomain/events/my-stream-api-handle @@ -966,7 +958,8 @@ export class SubscriptionComponentsController extends BaseController { * * @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. + * store, use this parameter to indicate the data-store. This applies to + * Legacy Metering sites only — it has no effect on Maxio Metering sites. * @param body * @return Response from the API call */ @@ -994,15 +987,16 @@ export class SubscriptionComponentsController extends BaseController { /** * Records a collection of events. * - * *Note: this endpoint differs from the standard Chargify API endpoints in that the subdomain will be - * `events` and your site subdomain will be included in the URL path.* + * Note: this endpoint differs from the standard URL for this API in that `events` and your site + * subdomain are included in the path. * * A maximum of 1000 events can be published in a single request. A 422 will be returned if this limit * is exceeded. * * @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. + * store, use this parameter to indicate the data-store. This applies to Legacy + * Metering sites only — it has no effect on Maxio Metering sites. * @param body * @return Response from the API call */ diff --git a/src/controllers/subscriptionGroupsController.ts b/src/controllers/subscriptionGroupsController.ts index cd32da95..9107b529 100644 --- a/src/controllers/subscriptionGroupsController.ts +++ b/src/controllers/subscriptionGroupsController.ts @@ -136,8 +136,8 @@ export class SubscriptionGroupsController extends BaseController { } /** - * Returns an array of subscription groups for the site. The response is paginated and will return a - * `meta` key with pagination information. + * Lists subscription groups for the site. The response is paginated and will return a `meta` key with + * pagination information. * * #### Account Balance Information * @@ -274,7 +274,7 @@ export class SubscriptionGroupsController extends BaseController { /** * Finds the subscription group associated with a subscription. * - * If the subscription is not in a group, the endpoint will return a 404 code. + * If the subscription is not in a group, this endpoint returns an error. * * @param subscriptionId The Advanced Billing id of the subscription associated with the subscription * group @@ -295,10 +295,11 @@ export class SubscriptionGroupsController extends BaseController { } /** - * 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 add existing subscriptions to subscription groups. + * Adds an existing subscription to a subscription group. 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 add existing + * subscriptions to subscription groups. * * Passing `group` parameters with a `target` containing a `type` and optional `id` is all that's * needed. When the `target` parameter specifies a `"customer"` or `"subscription"` that is already @@ -345,10 +346,11 @@ export class SubscriptionGroupsController extends BaseController { } /** - * 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 an existing subscription from a subscription group. + * Removes an existing subscription from a subscription group. 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 an existing subscription from a subscription group. * * @param subscriptionId The Chargify id of the subscription. * @return Response from the API call diff --git a/src/controllers/subscriptionNotesController.ts b/src/controllers/subscriptionNotesController.ts index c8a832e6..b17bdfd1 100644 --- a/src/controllers/subscriptionNotesController.ts +++ b/src/controllers/subscriptionNotesController.ts @@ -21,14 +21,14 @@ export class SubscriptionNotesController extends BaseController { /** * Creates a note for a subscription. * - * ## How to Use Subscription Notes - * * Notes allow you to record information about a particular Subscription in a free text format. * - * If you have structured data such as birth date, color, etc., consider using Metadata instead. + * If you have structured data such as birth date, color, etc., consider using + * [Metadata]($e/Custom%20Fields/createMetadata) instead. * - * 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). + * For more information, see [Adding Notes](https://docs.maxio.com/hc/en-us/articles/24251654953997- + * Understanding-the-Subscription-Summary-Page#billing-portal-status:~:text=documentation%20for%20more.- + * ,Adding%20Notes,-Notes%20are%20optional) in the product documentation. * * @param subscriptionId The Chargify id of the subscription. * @param body diff --git a/src/controllers/subscriptionProductsController.ts b/src/controllers/subscriptionProductsController.ts index 1147a145..7a14e80c 100644 --- a/src/controllers/subscriptionProductsController.ts +++ b/src/controllers/subscriptionProductsController.ts @@ -29,26 +29,23 @@ export class SubscriptionProductsController extends BaseController { /** * Migrates a subscription to a different product. * - * In order to create a migration, you must pass the `product_id` or `product_handle` in the object - * when you send a POST request. You may also pass either a `product_price_point_id` or + * To create a migration, you must pass the `product_id` or `product_handle` in the object when you + * send a POST request. You can also pass either a `product_price_point_id` or * `product_price_point_handle` to choose which price point the subscription is moved to. If no price - * point identifier is passed the subscription will be moved to the products default price point. The - * response will be the updated subscription. + * point identifier is passed, the subscription is moved to the product's default price point. The + * response is the updated subscription. * * ## Valid Subscriptions * - * Subscriptions should be in the `active` or `trialing` state in order to be migrated. + * Subscriptions should be in the `active` or `trialing` state to be migrated. * * (For backwards compatibility reasons, it is possible to migrate a subscription that is in the * `trial_ended` state via the API, however this is not recommended. Since `trial_ended` is an end-of- * life state, the subscription should be canceled, the product changed, and then the subscription can * be reactivated.) * - * ## Migrations Documentation - * - * Full documentation on how to record Migrations in the Advanced Billing UI can be located - * [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Migration-to-Advanced- - * Billing). + * For more information, see [Product Changes and Migrations](https://docs.maxio.com/hc/en- + * us/articles/24252069837581-Product-Changes-and-Migrations). * * ## Failed Migrations * diff --git a/src/controllers/subscriptionRenewalsController.ts b/src/controllers/subscriptionRenewalsController.ts index 544afba1..4d57fb1c 100644 --- a/src/controllers/subscriptionRenewalsController.ts +++ b/src/controllers/subscriptionRenewalsController.ts @@ -209,7 +209,7 @@ export class SubscriptionRenewalsController extends BaseController { } /** - * Returns a scheduled renewal configuration to an editable state. + * Restores a scheduled renewal configuration to an editable state. * * @param subscriptionId The Chargify id of the subscription. * @param id The renewal id. @@ -263,6 +263,11 @@ export class SubscriptionRenewalsController extends BaseController { /** * Adds product and component line items to the scheduled renewal. * + * If your site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price. + * list_price_point_id, validates and persists it; omitted value follows existing/default behavior; + * with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This + * functionality is supported in the API, but is not currently supported in SDKs. + * * @param subscriptionId The Chargify id of * the subscription. * @param scheduledRenewalsConfigurationId The scheduled @@ -300,6 +305,11 @@ export class SubscriptionRenewalsController extends BaseController { /** * Updates an existing configuration item’s pricing and quantity. * + * If you site has list vs sales pricing enabled, accepts renewal_configuration_item.custom_price. + * list_price_point_id, validates and persists it; omitted value follows existing/default behavior; + * with list vs sales pricing disabled, parameter is ignored (no validation/behavioral impact). This + * functionality is supported in the API, but is not currently supported in SDKs. + * * @param subscriptionId The Chargify id of the * subscription. * @param scheduledRenewalsConfigurationId The scheduled renewal diff --git a/src/controllers/subscriptionStatusController.ts b/src/controllers/subscriptionStatusController.ts index 1dd1f914..75688579 100644 --- a/src/controllers/subscriptionStatusController.ts +++ b/src/controllers/subscriptionStatusController.ts @@ -521,15 +521,15 @@ export class SubscriptionStatusController extends BaseController { * be charged on their next renewal. * * The "Next Billing" amount and "Next Billing" date are already represented in the UI on each - * Subscriber's Summary. For more information, see our documentation [here](https://maxio.zendesk. - * com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). + * Subscriber's Summary. For more information, see [Subscriber Interface Overview](https://maxio. + * zendesk.com/hc/en-us/articles/24252493695757-Subscriber-Interface-Overview). * * ## Optional Component Fields * - * This endpoint is particularly useful due to the fact that it will return the computed billing amount - * for the base product and the components which are in use by a subscriber. + * This endpoint is particularly useful because it returns the computed billing amount for the base + * product and the components which are in use by a subscriber. * - * By default, the preview will include billing details for all components _at their **current** + * By default, the preview includes billing details for all components _at their **current** * quantities_. This means: * * * Current `allocated_quantity` for quantity-based components @@ -538,17 +538,17 @@ export class SubscriptionStatusController extends BaseController { * * Current metric quantity value for events recorded thus far for events-based components * * In the above statements, "current" means the quantity or value as of the call to the renewal preview - * endpoint. We do not predict end-of-period values for components, so metered or events-based usage + * endpoint. End-of-period values for components are not predicted, so metered or events-based usage * may be less than it will eventually be at the end of the period. * - * Optionally, **you may provide your own custom quantities** for any component to see a billing + * Optionally, **you can provide your own custom quantities** for any component to see a billing * preview for non-current quantities. This is accomplished by sending a request body with data under * the `components` key. See the request body documentation below. * - * ## Subscription Side Effects + * ## Preview Behavior * - * You can request a `POST` to obtain this data from the endpoint without any side effects. This method - * allows you to preview data, but does not log any changes against a subscription. + * Sending a `POST` request to this endpoint returns preview data without modifying the subscription. + * This method previews data, but does not log any changes against a subscription. * * @param subscriptionId The Chargify id of the subscription. * @param body diff --git a/src/controllers/subscriptionsController.ts b/src/controllers/subscriptionsController.ts index 6538dd75..724568f3 100644 --- a/src/controllers/subscriptionsController.ts +++ b/src/controllers/subscriptionsController.ts @@ -18,10 +18,19 @@ import { AddCouponsRequest, addCouponsRequestSchema, } from '../models/addCouponsRequest.js'; +import { + CollectionMethod1, + collectionMethod1Schema, +} from '../models/collectionMethod1.js'; +import { + ListSubscriptionsInputProduct, + listSubscriptionsInputProductSchema, +} from '../models/containers/listSubscriptionsInputProduct.js'; import { CreateSubscriptionRequest, createSubscriptionRequestSchema, } from '../models/createSubscriptionRequest.js'; +import { GroupStatus, groupStatusSchema } from '../models/groupStatus.js'; import { OverrideSubscriptionRequest, overrideSubscriptionRequestSchema, @@ -30,6 +39,7 @@ import { PrepaidConfigurationResponse, prepaidConfigurationResponseSchema, } from '../models/prepaidConfigurationResponse.js'; +import { QScope, qScopeSchema } from '../models/qScope.js'; import { SortingDirection, sortingDirectionSchema, @@ -74,7 +84,7 @@ import { UpsertPrepaidConfigurationRequest, upsertPrepaidConfigurationRequestSchema, } from '../models/upsertPrepaidConfigurationRequest.js'; -import { array, dict, number, optional, string } from '../schema.js'; +import { array, boolean, dict, number, optional, string } from '../schema.js'; import { BaseController } from './baseController.js'; import { ApiError } from '@apimatic/core'; import { ErrorArrayMapResponseError } from '../errors/errorArrayMapResponseError.js'; @@ -99,6 +109,61 @@ export class SubscriptionsController extends BaseController { * Select an option from the **Request Examples** drop-down on the right side of the portal to see * examples of common scenarios for creating subscriptions. * + * ## List vs Sales Pricing + * + * When a subscription uses custom pricing as the sales price, you can optionally provide a list price + * for any item. If omitted, the list price defaults to the sales price. The difference between the + * list price and sales price is used to calculate implicit discounts, which appear on Invoices and in + * reporting. List price can also support revenue allocations in [Advanced Revenue](https://docs.maxio. + * com/hc/en-us/articles/24177001342861-Create-and-Configure-RevenueBooks). + * + * If your site has list pricing enabled, the API accepts `custom_price.list_price_point_id` for custom + * pricing, validates and persists it, and returns list price metadata in subscription responses. If + * list pricing is disabled, this input is ignored and related response fields are omitted. + * + * When list pricing is enabled: + * + * - Subscription → Product `product_price_point_list_price_point_id` (integer) + * - `product_price_point_list_price_point_handle` (string) + * - Subscription Components (when components are included in the response, such as with subscriptions + * built from components or component serialization paths) `component_id` (integer) + * - `price_point_id` (integer) + * - `list_price_point_id` (integer) + * + * When list pricing is disabled: + * + * - Subscription → Product `product_price_point_list_price_point_id`: omitted + * - `product_price_point_list_price_point_handle`: omitted + * - Subscription Components `list_price_point_id`: omitted + * + * This functionality is supported in the API, but is not currently supported in SDKs. + * + * ## Subscriptions can now work independently from the catalog + * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, you can create subscriptions without a `product_id` or + * `product_handle` using POST /subscriptions, building them entirely from components. + * + * A valid subscription must include at least one active component with: + * - a positive `allocated_quantity`, + * - a positive `unit_balance`, or + * - 'enabled: true' (for on/off components) + * - a configured metered component + * + * `component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and + * `trial_interval_unit` are included, they are applied at creation. + * + * In the response, product and product price point fields are null, and component details are returned + * instead. + * + * This functionality is supported in the API, but is not currently supported in SDKs. + * + * ## Payment information + * + * Payment information may be required to create a subscription, depending on the options for the + * Product being subscribed. See [product options](https://docs.maxio.com/hc/en- + * us/articles/24261076617869-Edit-Products) for more information. See the [Payments + * Profile]($e/Payment%20Profiles/createPaymentProfile) endpoint for details on payment parameters. * See the [Subscription Signups](page:introduction/basic-concepts/subscription-signup) article for * more information on working with subscriptions in Advanced Billing. * @@ -153,8 +218,13 @@ export class SubscriptionsController extends BaseController { } /** - * Returns an array of subscriptions from a Site. Pay close attention to query string filters and - * pagination in order to control responses from the server. + * Lists subscriptions for a site. Use the query string filters and pagination to control responses + * from the server. + * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, some subscriptions may not have an associated product. For + * subscriptions without an associated product, 'product', 'product_price_point_id', and + * 'product_price_point_type' are returned as 'null'. * * ## Search for a subscription * @@ -166,104 +236,138 @@ export class SubscriptionsController extends BaseController { * 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. * - * @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`. + * @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`. + * @param sort The attribute by which to sort + * @param direction Controls the order in which results are returned. + * Use in query `direction=asc`. * @param state The current state of the subscription - * @param product The product id of the subscription. (Note that the - * product handle cannot be used.) + * @param product Filter subscriptions by product. Accepts product + * ID or exact product name. Product handle is not + * supported. + * @param q Search string. + * @param qScope Scope of fields used by the q search. + * @param customerId The Advanced Billing id of the customer. * @param productPricePointId The ID of the product price point. If supplied, - * product is required - * @param coupon The numeric id of the coupon currently applied to the - * subscription. (This can be found in the URL when - * editing a coupon. Note that the coupon code cannot be - * used.) - * @param couponCode The coupon code currently applied to the subscription - * @param dateField The type of filter you'd like to apply to your search. - * Allowed Values: , current_period_ends_at, - * current_period_starts_at, created_at, activated_at, - * canceled_at, expires_at, trial_started_at, - * trial_ended_at, updated_at + * product is required. + * @param coupon The numeric id of the coupon currently applied to + * the subscription. (This can be found in the URL + * when editing a coupon. Note that the coupon code + * cannot be used.) + * @param couponCode The coupon code currently applied to the + * subscription + * @param collectionMethod The collection method for the subscription. + * @param brandingThemeId Filter subscriptions by the ID of an assigned + * Branding Theme. Branding Themes is a beta feature. + * See [Understand Branding Themes](https://docs.maxio. + * com/hc/en-us/articles/43796895662093-Understand- + * Branding-Themes#understand-branding-themes-0-0) for + * more information. + * @param dateField The type of filter you'd like to apply to your + * search. Allowed Values: , current_period_ends_at, + * current_period_starts_at, created_at, activated_at, + * canceled_at, expires_at, trial_started_at, + * trial_ended_at, updated_at * @param startDate The start date (format YYYY-MM-DD) with which to - * filter the date_field. Returns subscriptions with a - * timestamp at or after midnight (12:00:00 AM) in your - * site’s time zone on the date specified. Use in query - * `start_date=2022-07-01`. - * @param endDate The end date (format YYYY-MM-DD) with which to filter - * the date_field. Returns subscriptions with a timestamp - * up to and including 11:59:59PM in your site’s time zone - * on the date specified. Use in query `end_date=2022-08- - * 01`. - * @param startDatetime The start date and time (format YYYY-MM-DD HH:MM:SS) - * with which to filter the date_field. Returns - * subscriptions with a timestamp at or after exact time - * provided in query. You can specify timezone in query - - * otherwise your site's time zone will be used. If - * provided, this parameter will be used instead of - * start_date. Use in query `start_datetime=2022-07-01 09: - * 00:05`. + * filter the date_field. Returns subscriptions with a + * timestamp at or after midnight (12:00:00 AM) in + * your site’s time zone on the date specified. Use in + * query `start_date=2022-07-01`. + * @param endDate The end date (format YYYY-MM-DD) with which to + * filter the date_field. Returns subscriptions with a + * timestamp up to and including 11:59:59PM in your + * site’s time zone on the date specified. Use in + * query `end_date=2022-08-01`. + * @param startDatetime The start date and time (format YYYY-MM-DD HH:MM: + * SS) with which to filter the date_field. Returns + * subscriptions with a timestamp at or after exact + * time provided in query. You can specify timezone in + * query - otherwise your site's time zone will be + * used. If provided, this parameter will be used + * instead of start_date. Use in query + * `start_datetime=2022-07-01 09:00:05`. * @param endDatetime The end date and time (format YYYY-MM-DD HH:MM:SS) - * with which to filter the date_field. Returns - * subscriptions with a timestamp at or before exact time - * provided in query. You can specify timezone in query - - * otherwise your site's time zone will be used. If - * provided, this parameter will be used instead of - * end_date. Use in query `end_datetime=2022-08-01 10:00: - * 05`. + * with which to filter the date_field. Returns + * subscriptions with a timestamp at or before exact + * time provided in query. You can specify timezone in + * query - otherwise your site's time zone will be + * used. If provided, this parameter will be used + * instead of end_date. Use in query + * `end_datetime=2022-08-01 10:00:05`. * @param metadata The value of the metadata field specified in the - * parameter. Use in query `metadata[my- - * field]=value&metadata[other-field]=another_value`. - * @param direction Controls the order in which results are returned. Use - * in query `direction=asc`. - * @param sort The attribute by which to sort - * @param include Allows including additional data in the response. Use - * in query: `include[]=self_service_page_token`. + * parameter. Use in query `metadata[my- + * field]=value&metadata[other-field]=another_value`. + * @param groupStatus Filter by whether a subscription is in a group. + * @param dunningExemption Filter by dunning exemption status. + * @param paymentGateways Comma-separated payment gateway identifiers. + * @param currencies Comma-separated currency codes. + * @param include Allows including additional data in the response. + * Use in query: `include[]=self_service_page_token`. * @return Response from the API call */ async listSubscriptions( { page, perPage, + sort, + direction, state, product, + q, + qScope, + customerId, productPricePointId, coupon, couponCode, + collectionMethod, + brandingThemeId, dateField, startDate, endDate, startDatetime, endDatetime, metadata, - direction, - sort, + groupStatus, + dunningExemption, + paymentGateways, + currencies, include, }: { page?: number; perPage?: number; + sort?: SubscriptionSort; + direction?: SortingDirection; state?: SubscriptionStateFilter; - product?: number; + product?: ListSubscriptionsInputProduct; + q?: string; + qScope?: QScope; + customerId?: number; productPricePointId?: number; coupon?: number; couponCode?: string; + collectionMethod?: CollectionMethod1; + brandingThemeId?: number; dateField?: SubscriptionDateField; startDate?: string; endDate?: string; startDatetime?: string; endDatetime?: string; metadata?: Record; - direction?: SortingDirection; - sort?: SubscriptionSort; + groupStatus?: GroupStatus; + dunningExemption?: boolean; + paymentGateways?: string; + currencies?: string; include?: SubscriptionListInclude[]; }, requestOptions?: RequestOptions @@ -272,25 +376,39 @@ export class SubscriptionsController extends BaseController { const mapped = req.prepareArgs({ page: [page, optional(number())], perPage: [perPage, optional(number())], + sort: [sort, optional(subscriptionSortSchema)], + direction: [direction, optional(sortingDirectionSchema)], state: [state, optional(subscriptionStateFilterSchema)], - product: [product, optional(number())], + product: [product, optional(listSubscriptionsInputProductSchema)], + q: [q, optional(string())], + qScope: [qScope, optional(qScopeSchema)], + customerId: [customerId, optional(number())], productPricePointId: [productPricePointId, optional(number())], coupon: [coupon, optional(number())], couponCode: [couponCode, optional(string())], + collectionMethod: [collectionMethod, optional(collectionMethod1Schema)], + brandingThemeId: [brandingThemeId, optional(number())], dateField: [dateField, optional(subscriptionDateFieldSchema)], startDate: [startDate, optional(string())], endDate: [endDate, optional(string())], startDatetime: [startDatetime, optional(string())], endDatetime: [endDatetime, optional(string())], metadata: [metadata, optional(dict(string()))], - direction: [direction, optional(sortingDirectionSchema)], - sort: [sort, optional(subscriptionSortSchema)], + groupStatus: [groupStatus, optional(groupStatusSchema)], + dunningExemption: [dunningExemption, optional(boolean())], + paymentGateways: [paymentGateways, optional(string())], + currencies: [currencies, optional(string())], include: [include, optional(array(subscriptionListIncludeSchema))], }); req.query('page', mapped.page, unindexedPrefix); req.query('per_page', mapped.perPage, unindexedPrefix); + req.query('sort', mapped.sort, unindexedPrefix); + req.query('direction', mapped.direction, unindexedPrefix); req.query('state', mapped.state, unindexedPrefix); req.query('product', mapped.product, unindexedPrefix); + req.query('q', mapped.q, unindexedPrefix); + req.query('q_scope', mapped.qScope, unindexedPrefix); + req.query('customer_id', mapped.customerId, unindexedPrefix); req.query( 'product_price_point_id', mapped.productPricePointId, @@ -298,14 +416,18 @@ export class SubscriptionsController extends BaseController { ); req.query('coupon', mapped.coupon, unindexedPrefix); req.query('coupon_code', mapped.couponCode, unindexedPrefix); + req.query('collection_method', mapped.collectionMethod, unindexedPrefix); + req.query('branding_theme_id', mapped.brandingThemeId, unindexedPrefix); req.query('date_field', mapped.dateField, unindexedPrefix); req.query('start_date', mapped.startDate, unindexedPrefix); req.query('end_date', mapped.endDate, unindexedPrefix); req.query('start_datetime', mapped.startDatetime, unindexedPrefix); req.query('end_datetime', mapped.endDatetime, unindexedPrefix); req.query('metadata', mapped.metadata, unindexedPrefix); - req.query('direction', mapped.direction, unindexedPrefix); - req.query('sort', mapped.sort, unindexedPrefix); + req.query('group_status', mapped.groupStatus, unindexedPrefix); + req.query('dunning_exemption', mapped.dunningExemption, unindexedPrefix); + req.query('payment_gateways', mapped.paymentGateways, unindexedPrefix); + req.query('currencies', mapped.currencies, unindexedPrefix); req.query('include', mapped.include, unindexedPrefix); req.authenticate([{ basicAuth: true }]); return req.callAsJson(array(subscriptionResponseSchema), requestOptions); @@ -390,10 +512,15 @@ export class SubscriptionsController extends BaseController { * eligible for calendar billing**. * * > Note: If you change the product associated with a subscription that contains a `snap_day` and - * immediately `READ/GET` the subscription data, it will still contain original `snap_day`. The - * `snap_day` will reset to null on the next billing cycle. This is because a product change is + * immediately READ/GET the subscription data, it will still contain the original `snap_day`. The + * `snap_day` will be reset to `null` on the next billing cycle. This is because a product change is * instantaneous and only affects the product associated with a subscription. * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, some subscriptions may not have an associated product. For + * subscriptions without an associated product, `product`, `product_price_point_id`, and + * `product_price_point_type` are returned as `null`. + * * @param subscriptionId The Chargify id of the subscription. * @param body * @return Response from the API call @@ -424,6 +551,11 @@ export class SubscriptionsController extends BaseController { /** * Retrieves subscription details. * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, some subscriptions may not have an associated product. For + * subscriptions without an associated product, 'product', 'product_price_point_id', and + * 'product_price_point_type' are returned as 'null'. + * * ## Self-Service Page token * * Self-Service Page token for the subscription is not returned by default. If this information is @@ -534,7 +666,7 @@ export class SubscriptionsController extends BaseController { /** * Purges an individual subscription for sites in test mode. * - * Provide the subscription ID in the url. To confirm, supply the customer ID in the query string + * Provide the subscription ID in the URL. To confirm, supply the customer ID in the query string * `ack` parameter. You may also delete the customer record and/or payment profiles by passing * `cascade` parameters. For example, to delete just the customer record, the query params would be: `? * ack={customer_id}&cascade[]=customer` @@ -611,37 +743,54 @@ export class SubscriptionsController extends BaseController { * * The "Next Billing" amount and "Next Billing" date are represented in each Subscriber's Summary. * - * A subscription will not be created by utilizing this endpoint; it is meant to serve as a prediction. + * This endpoint does not create a subscription; it is meant to serve as a prediction. * - * For more information, see our documentation [here](https://maxio.zendesk.com/hc/en- + * For more information, see [Subscriber Interface Overview](https://maxio.zendesk.com/hc/en- * us/articles/24252493695757-Subscriber-Interface-Overview). * + * ## Subscriptions can now work independently from the catalog + * + * If you have the new [Catalog experience](page:help/announcements/2026-announcements#new-catalog- + * experience-and-terminology) enabled, you can create subscriptions without a `product_id` or + * `product_handle` using POST /subscriptions, building them entirely from components. + * + * A valid subscription must include at least one active component with: + * - a positive `allocated_quantity`, + * - a positive `unit_balance`, or + * - 'enabled: true' (for on/off components) + * + * `component_id` can be provided as a numeric ID or in handle: format. If `trial_interval` and + * `trial_interval_unit` are included, they are applied at creation. + * + * In the response, product and product price point fields are null, and component details are returned + * instead. + * + * This functionality is supported in the API, but is not currently supported in SDKs. + * * ## Taxable Subscriptions * - * This endpoint will preview taxes applicable to a purchase. In order for taxes to be previewed, the - * following conditions must be met: + * This endpoint previews taxes applicable to a purchase. For taxes to be previewed, the following + * conditions must be met: * * + Taxes must be configured on the subscription * + The preview must be for the purchase of a taxable product or component, or combination of the two. - * + The subscription payload must contain a full billing or shipping address in order to calculate - * tax + * + The subscription payload must contain a full billing or shipping address to calculate tax * - * For more information about creating taxable previews, see our documentation guide on how to create - * [taxable subscriptions.](https://maxio.zendesk.com/hc/en-us/sections/24287012349325-Taxes) + * For more information about creating taxable previews, see [Taxes](https://maxio.zendesk.com/hc/en- + * us/sections/24287012349325-Taxes). * * You do **not** need to include a card number to generate tax information when you are previewing a * subscription. However, when you actually want to create the subscription, you must include the - * credit card information if you want the billing address to be stored in Advanced Billing. The - * billing address and the credit card information are stored together within the payment profile - * object. Also, you may not send a billing address to Advanced Billing without payment profile - * information, as the address is stored on the card. + * credit card information if you want the billing address to be stored. The billing address and the + * credit card information are stored together within the payment profile object. Also, you cannot send + * a billing address without payment profile information, as the address is stored on the card. * * You can pass shipping and billing addresses and still decide not to calculate taxes. To do that, * pass `skip_billing_manifest_taxes: true` attribute. * * ## Non-taxable Subscriptions * - * If you'd like to calculate subscriptions that do not include tax you may leave off the billing + * If you'd like to calculate subscriptions that do not include tax, you can leave off the billing * information. * * @param body @@ -712,9 +861,9 @@ export class SubscriptionsController extends BaseController { /** * Removes a coupon from an existing subscription. * - * For more information on the expected behavior of removing a coupon from a subscription, see our - * documentation [here.](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- - * Subscriptions#removing-a-coupon) + * For more information on the expected behavior of removing a coupon from a subscription, see [Coupons + * and Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-and- + * Subscriptions#removing-a-coupon). * * @param subscriptionId The Chargify id of the subscription. * @param couponCode The coupon code @@ -744,21 +893,18 @@ export class SubscriptionsController extends BaseController { /** * Activates awaiting signup and trialing subscriptions. This feature is only available on the - * Relationship Invoicing architecture. Subscriptions in a group may not be activated immediately. - * - * For details on how the activation works, and how to activate subscriptions through the application, - * see [activation](#). + * Relationship Invoicing architecture. Subscriptions in a group cannot be activated immediately. * * The `revert_on_failure` parameter controls the behavior upon activation failure. - * - If set to `true` and something goes wrong i.e. payment fails, then Advanced Billing will not - * change the subscription's state. The subscription’s billing period will also remain the same. - * - If set to `false` and something goes wrong i.e. payment fails, then Advanced Billing will continue - * through with the activation and enter an end of life state. For trialing subscriptions, that will - * either be trial ended (if the trial is no obligation), past due (if the trial has an obligation), or - * canceled (if the site has no dunning strategy, or has a strategy that says to cancel immediately). - * For awaiting signup subscriptions, that will always be canceled. - * - * The default activation failure behavior can be configured per activation attempt, or you may set a + * - If set to `true` and something goes wrong i.e. payment fails, the subscription's state does not + * change. The subscription’s billing period also remains the same. + * - If set to `false` and something goes wrong i.e. payment fails, the activation continues and enters + * an end of life state. For trialing subscriptions, that is either trial ended (if the trial is no + * obligation), past due (if the trial has an obligation), or canceled (if the site has no dunning + * strategy, or has a strategy that says to cancel immediately). For awaiting signup subscriptions, + * that is always canceled. + * + * The default activation failure behavior can be configured per activation attempt, or you can set a * default value under Config > Settings > Subscription Activation Settings. * * ## Activation Scenarios @@ -791,11 +937,11 @@ export class SubscriptionsController extends BaseController { * * ### Activate Trialing subscription * - * You can read more about the behavior of trialing subscriptions [here](https://maxio.zendesk. - * com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). - * 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. + * For more information about the behavior of trialing subscriptions, see [Trialing + * Subscriptions](https://maxio.zendesk.com/hc/en-us/articles/24252155721869-Trialing-Subscriptions). + * When the `revert_on_failure` parameter is set to `true`, the subscription's state remains Trialing; + * the invoice from activation is voided, and any prepayments and credits applied to the invoice are + * returned to the subscription. * * * @param subscriptionId The Chargify id of the subscription. diff --git a/src/controllers/webhooksController.ts b/src/controllers/webhooksController.ts index a1a4d224..b423b34a 100644 --- a/src/controllers/webhooksController.ts +++ b/src/controllers/webhooksController.ts @@ -176,7 +176,7 @@ export class WebhooksController extends BaseController { } /** - * Returns created endpoints for a site. + * Lists endpoints configured for a site. * * @return Response from the API call */ diff --git a/src/index.ts b/src/index.ts index 107da676..ba659ffa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -153,6 +153,7 @@ export { CleanupScope } from './models/cleanupScope.js'; export type { CloneComponentPricePoint } from './models/cloneComponentPricePoint.js'; export type { CloneComponentPricePointRequest } from './models/cloneComponentPricePointRequest.js'; export { CollectionMethod } from './models/collectionMethod.js'; +export { CollectionMethod1 } from './models/collectionMethod1.js'; export type { Component } from './models/component.js'; export type { ComponentAllocationChange } from './models/componentAllocationChange.js'; export type { ComponentAllocationErrorItem } from './models/componentAllocationErrorItem.js'; @@ -308,10 +309,12 @@ export type { FailedPaymentEvent } from './models/failedPaymentEvent.js'; export type { FailedPaymentEventData } from './models/failedPaymentEventData.js'; export { FirstChargeType } from './models/firstChargeType.js'; export type { FullSubscriptionGroupResponse } from './models/fullSubscriptionGroupResponse.js'; +export type { GetOneTimeTokenBankAccountPaymentProfile } from './models/getOneTimeTokenBankAccountPaymentProfile.js'; export type { GetOneTimeTokenPaymentProfile } from './models/getOneTimeTokenPaymentProfile.js'; export type { GetOneTimeTokenRequest } from './models/getOneTimeTokenRequest.js'; export type { GroupBilling } from './models/groupBilling.js'; export type { GroupSettings } from './models/groupSettings.js'; +export { GroupStatus } from './models/groupStatus.js'; export type { GroupTarget } from './models/groupTarget.js'; export { GroupTargetType } from './models/groupTargetType.js'; export { GroupType } from './models/groupType.js'; @@ -399,13 +402,13 @@ export type { ListSaleRepItem } from './models/listSaleRepItem.js'; export type { ListSegmentsFilter } from './models/listSegmentsFilter.js'; export type { ListSegmentsResponse } from './models/listSegmentsResponse.js'; export type { ListServiceCreditsResponse } from './models/listServiceCreditsResponse.js'; -export type { ListSubcriptionGroupPrepaymentItem } from './models/listSubcriptionGroupPrepaymentItem.js'; export type { ListSubscriptionComponentsFilter } from './models/listSubscriptionComponentsFilter.js'; export type { ListSubscriptionComponentsForSiteFilter } from './models/listSubscriptionComponentsForSiteFilter.js'; export { ListSubscriptionComponentsInclude } from './models/listSubscriptionComponentsInclude.js'; export type { ListSubscriptionComponentsResponse } from './models/listSubscriptionComponentsResponse.js'; export { ListSubscriptionComponentsSort } from './models/listSubscriptionComponentsSort.js'; export type { ListSubscriptionGroupPrepayment } from './models/listSubscriptionGroupPrepayment.js'; +export type { ListSubscriptionGroupPrepaymentItem } from './models/listSubscriptionGroupPrepaymentItem.js'; export type { ListSubscriptionGroupPrepaymentResponse } from './models/listSubscriptionGroupPrepaymentResponse.js'; export type { ListSubscriptionGroupsItem } from './models/listSubscriptionGroupsItem.js'; export type { ListSubscriptionGroupsMeta } from './models/listSubscriptionGroupsMeta.js'; @@ -495,6 +498,7 @@ export { ProformaInvoiceTaxSourceType } from './models/proformaInvoiceTaxSourceT export type { Proration } from './models/proration.js'; export type { PublicKey } from './models/publicKey.js'; export type { PublicSignupPage } from './models/publicSignupPage.js'; +export { QScope } from './models/qScope.js'; export type { QuantityBasedComponent } from './models/quantityBasedComponent.js'; export type { ReactivateSubscriptionGroupRequest } from './models/reactivateSubscriptionGroupRequest.js'; export type { ReactivateSubscriptionGroupResponse } from './models/reactivateSubscriptionGroupResponse.js'; @@ -643,6 +647,9 @@ export type { UpdateCurrencyPrice } from './models/updateCurrencyPrice.js'; export type { UpdateCurrencyPricesRequest } from './models/updateCurrencyPricesRequest.js'; export type { UpdateCustomer } from './models/updateCustomer.js'; export type { UpdateCustomerRequest } from './models/updateCustomerRequest.js'; +export type { UpdateInvoice } from './models/updateInvoice.js'; +export type { UpdateInvoiceItem } from './models/updateInvoiceItem.js'; +export type { UpdateInvoiceRequest } from './models/updateInvoiceRequest.js'; export type { UpdateMetadata } from './models/updateMetadata.js'; export type { UpdateMetadataRequest } from './models/updateMetadataRequest.js'; export type { UpdateMetafield } from './models/updateMetafield.js'; @@ -719,6 +726,7 @@ export * from './models/containers/createSegmentSegmentProperty4Value.js'; export * from './models/containers/createSubscriptionComponentAllocatedQuantity.js'; export * from './models/containers/createSubscriptionComponentComponentId.js'; export * from './models/containers/createSubscriptionComponentPricePointId.js'; +export * from './models/containers/createSubscriptionComponentUnitBalance.js'; export * from './models/containers/createSubscriptionOfferId.js'; export * from './models/containers/createUsageComponentId.js'; export * from './models/containers/createUsageSubscriptionIdOrReference.js'; @@ -726,19 +734,24 @@ export * from './models/containers/customerErrorResponseErrors.js'; export * from './models/containers/deductServiceCreditAmount.js'; export * from './models/containers/eBBComponentUnitPrice.js'; export * from './models/containers/eventEventSpecificData.js'; +export * from './models/containers/getOneTimeTokenRequestPaymentProfile.js'; export * from './models/containers/invoiceEvent.js'; export * from './models/containers/invoiceEventPayment.js'; export * from './models/containers/issueServiceCreditAmount.js'; export * from './models/containers/listProductPricePointsInputProductId.js'; +export * from './models/containers/listSubscriptionsInputProduct.js'; export * from './models/containers/listUsagesInputComponentId.js'; export * from './models/containers/listUsagesInputSubscriptionIdOrReference.js'; export * from './models/containers/metafieldEnum.js'; export * from './models/containers/meteredComponentUnitPrice.js'; +export * from './models/containers/meteredUsageNewUnitBalance.js'; export * from './models/containers/onOffComponentUnitPrice.js'; export * from './models/containers/paymentProfile.js'; export * from './models/containers/paymentProfileAttributesExpirationMonth.js'; export * from './models/containers/paymentProfileAttributesExpirationYear.js'; export * from './models/containers/prepaidUsageComponentUnitPrice.js'; +export * from './models/containers/prepaidUsageNewOverageUnitBalance.js'; +export * from './models/containers/prepaidUsageNewUnitBalance.js'; export * from './models/containers/priceEndingQuantity.js'; export * from './models/containers/priceStartingQuantity.js'; export * from './models/containers/priceUnitPrice.js'; @@ -762,6 +775,7 @@ export * from './models/containers/segmentSegmentProperty2Value.js'; export * from './models/containers/segmentSegmentProperty3Value.js'; export * from './models/containers/segmentSegmentProperty4Value.js'; export * from './models/containers/subscriptionComponentAllocatedQuantity.js'; +export * from './models/containers/subscriptionComponentUnitBalance.js'; export * from './models/containers/subscriptionCustomPriceExpirationInterval.js'; export * from './models/containers/subscriptionCustomPriceInitialChargeInCents.js'; export * from './models/containers/subscriptionCustomPriceInterval.js'; @@ -778,6 +792,12 @@ export * from './models/containers/subscriptionGroupSignupComponentPricePointId. export * from './models/containers/subscriptionGroupSignupComponentUnitBalance.js'; export * from './models/containers/updateComponentPricePointComponentId.js'; export * from './models/containers/updateComponentPricePointPricePointId.js'; +export * from './models/containers/updateInvoiceItemComponentId.js'; +export * from './models/containers/updateInvoiceItemPricePointId.js'; +export * from './models/containers/updateInvoiceItemProductId.js'; +export * from './models/containers/updateInvoiceItemProductPricePointId.js'; +export * from './models/containers/updateInvoiceItemQuantity.js'; +export * from './models/containers/updateInvoiceItemUnitPrice.js'; export * from './models/containers/updateMetafieldsRequestMetafields.js'; export * from './models/containers/updatePriceEndingQuantity.js'; export * from './models/containers/updatePriceStartingQuantity.js'; diff --git a/src/models/accountBalances.ts b/src/models/accountBalances.ts index 5800177b..b789fb5e 100644 --- a/src/models/accountBalances.ts +++ b/src/models/accountBalances.ts @@ -8,9 +8,9 @@ import { expandoObject, lazy, optional, Schema } from '../schema.js'; import { AccountBalance, accountBalanceSchema } from './accountBalance.js'; export interface AccountBalances { - /** The balance, in cents, of the sum of the subscription's open, payable invoices. */ + /** The balance, in cents, of the sum of the subscription's open, payable invoices. */ openInvoices?: AccountBalance; - /** The balance, in cents, of the sum of the subscription's pending, payable invoices. */ + /** The balance, in cents, of the sum of the subscription's pending, payable invoices. */ pendingInvoices?: AccountBalance; /** The balance, in cents, of the subscription's Pending Discount account. */ pendingDiscounts?: AccountBalance; diff --git a/src/models/activateSubscriptionRequest.ts b/src/models/activateSubscriptionRequest.ts index ed2d070c..65957c24 100644 --- a/src/models/activateSubscriptionRequest.ts +++ b/src/models/activateSubscriptionRequest.ts @@ -13,7 +13,7 @@ import { } from '../schema.js'; export interface ActivateSubscriptionRequest { - /** You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end of life state. If this parameter is omitted or `null` is passed it will default to value set in the site settings (default: `true`) */ + /** You may choose how to handle the activation failure. `true` means do not change the subscription’s state and billing period. `false` means to continue through with the activation and enter an end-of-life state. If this parameter is omitted or `null` is passed it will default to the value set in the site settings (default: `true`). */ revertOnFailure?: boolean | null; [key: string]: unknown; } diff --git a/src/models/agreementAcceptance.ts b/src/models/agreementAcceptance.ts index 17e087c0..6361cca1 100644 --- a/src/models/agreementAcceptance.ts +++ b/src/models/agreementAcceptance.ts @@ -10,7 +10,7 @@ import { expandoObject, optional, Schema, string } from '../schema.js'; export interface AgreementAcceptance { /** Required when providing agreement acceptance params. */ ipAddress?: string; - /** Required when creating a subscription with Maxio Payments. Either terms_url or provacy_policy_url required when providing agreement_acceptance params. */ + /** Required when creating a subscription with Maxio Payments. Either terms_url or privacy_policy_url is required when providing agreement_acceptance params. */ termsUrl?: string; privacyPolicyUrl?: string; returnRefundPolicyUrl?: string; diff --git a/src/models/allocateComponents.ts b/src/models/allocateComponents.ts index 2d606723..7b797ba6 100644 --- a/src/models/allocateComponents.ts +++ b/src/models/allocateComponents.ts @@ -33,7 +33,7 @@ export interface AllocateComponents { 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. */ downgradeCredit?: CreditType | null; - /** (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription */ + /** (Optional) If not passed, the allocation(s) will use the payment collection method on the subscription. */ paymentCollectionMethod?: CollectionMethod; /** * If true, if the immediate component payment fails, initiate dunning for the subscription. diff --git a/src/models/allocation.ts b/src/models/allocation.ts index 261ce0ab..d652cf72 100644 --- a/src/models/allocation.ts +++ b/src/models/allocation.ts @@ -31,21 +31,21 @@ import { } from './paymentForAllocation.js'; export interface Allocation { - /** The allocation unique id */ + /** The allocation unique ID */ allocationId?: number; - /** The integer component ID for the allocation. This references a component that you have created in your Product setup */ + /** The integer component ID for the allocation. This references a component that you have created in your Product setup. */ componentId?: number; - /** The handle of the component. This references a component that you have created in your Product setup */ + /** The handle of the component. This references a component that you have created in your Product setup. */ componentHandle?: string | null; - /** The integer subscription ID for the allocation. This references a unique subscription in your Site */ + /** The integer subscription ID for the allocation. This references a unique subscription in your Site. */ subscriptionId?: number; - /** The allocated quantity set in to effect by the allocation. String for components supporting fractional quantities */ + /** The allocated quantity set into effect by the allocation. String for components supporting fractional quantities */ quantity?: AllocationQuantity; /** The allocated quantity that was in effect before this allocation was created. String for components supporting fractional quantities */ previousQuantity?: AllocationPreviousQuantity; /** The memo passed when the allocation was created */ memo?: string | null; - /** The time that the allocation was recorded, in format and UTC timezone, i.e. 2012-11-20T22:00:37Z */ + /** The time that the allocation was recorded, in ISO 8601 format and UTC timezone, e.g., 2012-11-20T22:00:37Z */ timestamp?: string; /** Timestamp indicating when this allocation was created */ createdAt?: string; @@ -56,7 +56,7 @@ export interface Allocation { pricePointId?: number; pricePointName?: string; pricePointHandle?: string; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/allocationPreviewItem.ts b/src/models/allocationPreviewItem.ts index 5e59f991..1b7cf0a9 100644 --- a/src/models/allocationPreviewItem.ts +++ b/src/models/allocationPreviewItem.ts @@ -40,7 +40,7 @@ export interface AllocationPreviewItem { /** The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. */ downgradeCredit?: CreditType | null; pricePointId?: number; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/allocationPreviewLineItem.ts b/src/models/allocationPreviewLineItem.ts index 1be8e95b..1a5f1b6a 100644 --- a/src/models/allocationPreviewLineItem.ts +++ b/src/models/allocationPreviewLineItem.ts @@ -36,7 +36,7 @@ export interface AllocationPreviewLineItem { taxableAmountInCents?: bigint; componentId?: number; componentHandle?: string; - /** Visible when using Fine-grained Component Control */ + /** Visible when using Fine-grained Component Control. */ direction?: AllocationPreviewDirection; [key: string]: unknown; } diff --git a/src/models/applePayPaymentProfile.ts b/src/models/applePayPaymentProfile.ts index 61a7e3e1..ad18641b 100644 --- a/src/models/applePayPaymentProfile.ts +++ b/src/models/applePayPaymentProfile.ts @@ -22,7 +22,7 @@ export interface ApplePayPaymentProfile { firstName?: string; /** The last name of the Apple Pay account holder */ lastName?: string; - /** The Chargify-assigned id for the customer record to which the Apple Pay account belongs */ + /** The Chargify-assigned ID for the customer record to which the Apple Pay account belongs */ customerId?: number; /** The vault that stores the payment profile with the provided vault_token. */ currentVault?: ApplePayVault; diff --git a/src/models/applyCreditNoteEventData.ts b/src/models/applyCreditNoteEventData.ts index 03696ab1..5834d817 100644 --- a/src/models/applyCreditNoteEventData.ts +++ b/src/models/applyCreditNoteEventData.ts @@ -37,7 +37,7 @@ export interface ApplyCreditNoteEventData { memo?: string | null; /** The role of the credit note (e.g. 'general') */ role?: string; - /** Shows whether it was applied to consolidated invoice or not */ + /** Shows whether it was applied to consolidated invoice or not. */ consolidatedInvoice?: boolean; /** List of credit notes applied to children invoices (if consolidated invoice) */ appliedCreditNotes?: AppliedCreditNoteData[]; diff --git a/src/models/bankAccountAttributes.ts b/src/models/bankAccountAttributes.ts index b57e2956..e0779f9e 100644 --- a/src/models/bankAccountAttributes.ts +++ b/src/models/bankAccountAttributes.ts @@ -20,15 +20,15 @@ export interface BankAccountAttributes { chargifyToken?: string; /** (Required when creating a subscription with ACH or GoCardless) The name of the bank where the customer’s account resides */ bankName?: string; - /** (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API */ + /** (Required when creating a subscription with ACH; optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. */ bankRoutingNumber?: string; /** (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number */ bankAccountNumber?: string; /** Defaults to checking */ bankAccountType?: BankAccountType; - /** (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided */ + /** (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. */ bankBranchCode?: string; - /** (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided */ + /** (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. */ bankIban?: string; /** Defaults to personal */ bankAccountHolderType?: BankAccountHolderType; diff --git a/src/models/bankAccountPaymentProfile.ts b/src/models/bankAccountPaymentProfile.ts index 99130163..cf833a4f 100644 --- a/src/models/bankAccountPaymentProfile.ts +++ b/src/models/bankAccountPaymentProfile.ts @@ -25,13 +25,13 @@ import { import { PaymentType, paymentTypeSchema } from './paymentType.js'; export interface BankAccountPaymentProfile { - /** The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer */ + /** The Chargify-assigned ID of the stored bank account. This value can be used as an input to payment_profile_id when creating a subscription, in order to re-use a stored payment profile for the same customer. */ id?: number; /** The first name of the bank account holder */ firstName?: string; /** The last name of the bank account holder */ lastName?: string; - /** The Chargify-assigned id for the customer record to which the bank account belongs */ + /** The Chargify-assigned ID for the customer record to which the bank account belongs */ customerId?: number; /** The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. */ currentVault?: BankAccountVault; @@ -53,16 +53,16 @@ export interface BankAccountPaymentProfile { billingAddress2?: string | null; /** The bank where the account resides */ bankName?: string; - /** A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account */ + /** A string representation of the stored bank routing number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). payment_type will be bank_account. */ maskedBankRoutingNumber?: string | null; - /** A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111') */ + /** A string representation of the stored bank account number with all but the last 4 digits marked with X's (i.e. 'XXXXXXX1111'). */ maskedBankAccountNumber?: string | null; /** Defaults to checking */ bankAccountType?: BankAccountType; /** Defaults to personal */ bankAccountHolderType?: BankAccountHolderType; paymentType: PaymentType; - /** denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account */ + /** Denotes whether a bank account has been verified by providing the amounts of two small deposits made into the account. */ verified?: boolean; siteGatewaySettingId?: number | null; gatewayHandle?: string | null; diff --git a/src/models/calendarBilling.ts b/src/models/calendarBilling.ts index 731d9058..4f7e8f07 100644 --- a/src/models/calendarBilling.ts +++ b/src/models/calendarBilling.ts @@ -11,7 +11,7 @@ import { } from './containers/calendarBillingSnapDay.js'; import { FirstChargeType, firstChargeTypeSchema } from './firstChargeType.js'; -/** (Optional). Cannot be used when also specifying next_billing_at */ +/** (Optional). Cannot be used when also specifying next_billing_at. */ export interface CalendarBilling { /** A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. */ snapDay?: CalendarBillingSnapDay; diff --git a/src/models/cancellationOptions.ts b/src/models/cancellationOptions.ts index c13944c0..31675fa2 100644 --- a/src/models/cancellationOptions.ts +++ b/src/models/cancellationOptions.ts @@ -20,7 +20,7 @@ export interface CancellationOptions { reasonCode?: string; /** When true, the subscription is cancelled at the current period end instead of immediately. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. */ cancelAtEndOfPeriod?: boolean; - /** Schedules the cancellation on the provided date. This is option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. */ + /** Schedules the cancellation on the provided date. This option is not applicable for prepaid subscriptions. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. */ scheduledCancellationAt?: string | null; /** Applies to prepaid subscriptions. When true, which is the default, the remaining prepaid balance is refunded as part of cancellation processing. When false, prepaid balance is not refunded as part of cancellation processing. To use this option, the Schedule Subscription Cancellation feature must be enabled on your site. */ refundPrepaymentAccountBalance?: boolean; diff --git a/src/models/collectionMethod1.ts b/src/models/collectionMethod1.ts new file mode 100644 index 00000000..f1526beb --- /dev/null +++ b/src/models/collectionMethod1.ts @@ -0,0 +1,23 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { Schema, stringEnum } from '../schema.js'; + +/** + * Enum for CollectionMethod1 + */ +export enum CollectionMethod1 { + Automatic = 'automatic', + Remittance = 'remittance', + Prepaid = 'prepaid', +} + +/** + * Schema for CollectionMethod1 + */ +export const collectionMethod1Schema: Schema = stringEnum( + CollectionMethod1 +); diff --git a/src/models/component.ts b/src/models/component.ts index a24e20d8..7208c9ca 100644 --- a/src/models/component.ts +++ b/src/models/component.ts @@ -26,12 +26,12 @@ import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface Component { /** The unique ID assigned to the component by Chargify. This ID can be used to fetch the component from the API. */ id?: number; - /** The name of the Component, suitable for display on statements. i.e. Text Messages. */ + /** The name of the Component, suitable for display on statements. e.g., Text Messages. */ name?: string; /** The component API handle */ handle?: string | null; pricingScheme?: PricingScheme | null; - /** The name of the unit that the component’s usage is measured in. i.e. message */ + /** The name of the unit that the component’s usage is measured in. e.g., message */ unitName?: string; /** The amount the customer will be charged per unit. This field is only populated for ‘per_unit’ pricing schemes, otherwise it may be null. */ unitPrice?: string | null; @@ -41,7 +41,7 @@ export interface Component { productFamilyName?: string; /** The handle of the Product Family to which the Component belongs */ productFamilyHandle?: string; - /** deprecated - use unit_price instead */ + /** deprecated - use unit_price instead. */ pricePerUnitInCents?: bigint | null; /** A handle for the component type */ kind?: ComponentKind; @@ -84,10 +84,12 @@ export interface Component { accountingCode?: string | null; /** (Only for Event Based Components) This is an ID of a metric attached to the component. This metric is used to bill upon collected events. */ 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -146,5 +148,6 @@ export const componentSchema: Schema = lazy(() => ], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/componentCustomPrice.ts b/src/models/componentCustomPrice.ts index b937c54c..c3631f89 100644 --- a/src/models/componentCustomPrice.ts +++ b/src/models/componentCustomPrice.ts @@ -26,14 +26,14 @@ import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface ComponentCustomPrice { /** Whether or not the price point includes tax */ taxIncluded?: boolean; - /** Omit for On/Off components */ + /** Omit for On/Off components. */ pricingScheme?: PricingScheme; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; /** - * Optional id of the price point to use for list price calculations when + * (Optional) Id of the price point to use for list price calculations when * overriding the customer price. */ listPricePointId?: number | null; diff --git a/src/models/componentPricePoint.ts b/src/models/componentPricePoint.ts index 6b86a276..7666e30a 100644 --- a/src/models/componentPricePoint.ts +++ b/src/models/componentPricePoint.ts @@ -37,7 +37,7 @@ export interface ComponentPricePoint { * 3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. */ type?: PricePointType; - /** Note: Refer to type attribute instead */ + /** Note: Refer to type attribute instead. */ mDefault?: boolean; name?: string; /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ @@ -53,7 +53,7 @@ export interface ComponentPricePoint { /** (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. */ subscriptionId?: number; taxIncluded?: boolean; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number | null; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/componentPricePointItem.ts b/src/models/componentPricePointItem.ts index faa09eff..9f9561cf 100644 --- a/src/models/componentPricePointItem.ts +++ b/src/models/componentPricePointItem.ts @@ -23,7 +23,7 @@ export interface ComponentPricePointItem { 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; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/containers/createSubscriptionComponentUnitBalance.ts b/src/models/containers/createSubscriptionComponentUnitBalance.ts new file mode 100644 index 00000000..7420e828 --- /dev/null +++ b/src/models/containers/createSubscriptionComponentUnitBalance.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type CreateSubscriptionComponentUnitBalance = number | string; + +export const createSubscriptionComponentUnitBalanceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace CreateSubscriptionComponentUnitBalance { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/getOneTimeTokenRequestPaymentProfile.ts b/src/models/containers/getOneTimeTokenRequestPaymentProfile.ts new file mode 100644 index 00000000..503e8fd0 --- /dev/null +++ b/src/models/containers/getOneTimeTokenRequestPaymentProfile.ts @@ -0,0 +1,63 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + anyOf, + isMappedValueValidForSchema, + lazy, + Schema, +} from '../../schema.js'; +import { + GetOneTimeTokenBankAccountPaymentProfile, + getOneTimeTokenBankAccountPaymentProfileSchema, +} from '../getOneTimeTokenBankAccountPaymentProfile.js'; +import { + GetOneTimeTokenPaymentProfile, + getOneTimeTokenPaymentProfileSchema, +} from '../getOneTimeTokenPaymentProfile.js'; + +/** This is a container type for any-of types. */ +export type GetOneTimeTokenRequestPaymentProfile = + | GetOneTimeTokenPaymentProfile + | GetOneTimeTokenBankAccountPaymentProfile; + +export const getOneTimeTokenRequestPaymentProfileSchema: Schema = lazy( + () => + anyOf([ + getOneTimeTokenPaymentProfileSchema, + getOneTimeTokenBankAccountPaymentProfileSchema, + ]) +); + +export namespace GetOneTimeTokenRequestPaymentProfile { + /** + * Validation method to narrow down union type to GetOneTimeTokenPaymentProfile type case. + * + * This is Get One Time Token Payment Profile case. + */ + export function isGetOneTimeTokenPaymentProfile( + value: unknown + ): value is GetOneTimeTokenPaymentProfile { + return isMappedValueValidForSchema( + value, + getOneTimeTokenPaymentProfileSchema + ); + } + + /** + * Validation method to narrow down union type to GetOneTimeTokenBankAccountPaymentProfile type case. + * + * This is Get One Time Token Bank Account Payment Profile case. + */ + export function isGetOneTimeTokenBankAccountPaymentProfile( + value: unknown + ): value is GetOneTimeTokenBankAccountPaymentProfile { + return isMappedValueValidForSchema( + value, + getOneTimeTokenBankAccountPaymentProfileSchema + ); + } +} diff --git a/src/models/containers/listSubscriptionsInputProduct.ts b/src/models/containers/listSubscriptionsInputProduct.ts new file mode 100644 index 00000000..d0974965 --- /dev/null +++ b/src/models/containers/listSubscriptionsInputProduct.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type ListSubscriptionsInputProduct = number | string; + +export const listSubscriptionsInputProductSchema: Schema = oneOf( + [number(), string()] +); + +export namespace ListSubscriptionsInputProduct { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/meteredUsageNewUnitBalance.ts b/src/models/containers/meteredUsageNewUnitBalance.ts new file mode 100644 index 00000000..9a46ebf8 --- /dev/null +++ b/src/models/containers/meteredUsageNewUnitBalance.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type MeteredUsageNewUnitBalance = number | string; + +export const meteredUsageNewUnitBalanceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace MeteredUsageNewUnitBalance { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/prepaidUsageNewOverageUnitBalance.ts b/src/models/containers/prepaidUsageNewOverageUnitBalance.ts new file mode 100644 index 00000000..49da8b11 --- /dev/null +++ b/src/models/containers/prepaidUsageNewOverageUnitBalance.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type PrepaidUsageNewOverageUnitBalance = number | string; + +export const prepaidUsageNewOverageUnitBalanceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace PrepaidUsageNewOverageUnitBalance { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/prepaidUsageNewUnitBalance.ts b/src/models/containers/prepaidUsageNewUnitBalance.ts new file mode 100644 index 00000000..e9b1caa3 --- /dev/null +++ b/src/models/containers/prepaidUsageNewUnitBalance.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type PrepaidUsageNewUnitBalance = number | string; + +export const prepaidUsageNewUnitBalanceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace PrepaidUsageNewUnitBalance { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/subscriptionComponentUnitBalance.ts b/src/models/containers/subscriptionComponentUnitBalance.ts new file mode 100644 index 00000000..532bf0b5 --- /dev/null +++ b/src/models/containers/subscriptionComponentUnitBalance.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type SubscriptionComponentUnitBalance = number | string; + +export const subscriptionComponentUnitBalanceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace SubscriptionComponentUnitBalance { + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/updateInvoiceItemComponentId.ts b/src/models/containers/updateInvoiceItemComponentId.ts new file mode 100644 index 00000000..7b042ff6 --- /dev/null +++ b/src/models/containers/updateInvoiceItemComponentId.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemComponentId = string | number; + +export const updateInvoiceItemComponentIdSchema: Schema = oneOf( + [string(), number()] +); + +export namespace UpdateInvoiceItemComponentId { + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } + + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } +} diff --git a/src/models/containers/updateInvoiceItemPricePointId.ts b/src/models/containers/updateInvoiceItemPricePointId.ts new file mode 100644 index 00000000..e1f3b2ee --- /dev/null +++ b/src/models/containers/updateInvoiceItemPricePointId.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemPricePointId = string | number; + +export const updateInvoiceItemPricePointIdSchema: Schema = oneOf( + [string(), number()] +); + +export namespace UpdateInvoiceItemPricePointId { + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } + + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } +} diff --git a/src/models/containers/updateInvoiceItemProductId.ts b/src/models/containers/updateInvoiceItemProductId.ts new file mode 100644 index 00000000..90bb4ecb --- /dev/null +++ b/src/models/containers/updateInvoiceItemProductId.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemProductId = string | number; + +export const updateInvoiceItemProductIdSchema: Schema = oneOf( + [string(), number()] +); + +export namespace UpdateInvoiceItemProductId { + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } + + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } +} diff --git a/src/models/containers/updateInvoiceItemProductPricePointId.ts b/src/models/containers/updateInvoiceItemProductPricePointId.ts new file mode 100644 index 00000000..8c04e159 --- /dev/null +++ b/src/models/containers/updateInvoiceItemProductPricePointId.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemProductPricePointId = string | number; + +export const updateInvoiceItemProductPricePointIdSchema: Schema = oneOf( + [string(), number()] +); + +export namespace UpdateInvoiceItemProductPricePointId { + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } + + /** + * Validation method to narrow down union type to number type case. + * + * This is Number case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } +} diff --git a/src/models/containers/updateInvoiceItemQuantity.ts b/src/models/containers/updateInvoiceItemQuantity.ts new file mode 100644 index 00000000..d37a43f4 --- /dev/null +++ b/src/models/containers/updateInvoiceItemQuantity.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemQuantity = number | string; + +export const updateInvoiceItemQuantitySchema: Schema = oneOf( + [number(), string()] +); + +export namespace UpdateInvoiceItemQuantity { + /** + * Validation method to narrow down union type to number type case. + * + * This is Precision case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/containers/updateInvoiceItemUnitPrice.ts b/src/models/containers/updateInvoiceItemUnitPrice.ts new file mode 100644 index 00000000..2fcda7dc --- /dev/null +++ b/src/models/containers/updateInvoiceItemUnitPrice.ts @@ -0,0 +1,34 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { number, oneOf, Schema, string } from '../../schema.js'; + +/** This is a container type for one-of types. */ +export type UpdateInvoiceItemUnitPrice = number | string; + +export const updateInvoiceItemUnitPriceSchema: Schema = oneOf( + [number(), string()] +); + +export namespace UpdateInvoiceItemUnitPrice { + /** + * Validation method to narrow down union type to number type case. + * + * This is Precision case. + */ + export function isNumber(value: unknown): value is number { + return typeof value === 'number'; + } + + /** + * Validation method to narrow down union type to string type case. + * + * This is String case. + */ + export function isString(value: unknown): value is string { + return typeof value === 'string'; + } +} diff --git a/src/models/couponPayload.ts b/src/models/couponPayload.ts index 27a7c14d..3e5a609f 100644 --- a/src/models/couponPayload.ts +++ b/src/models/couponPayload.ts @@ -25,13 +25,13 @@ import { 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 “.” */ + /** 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 */ + /** 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 */ + /** 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; diff --git a/src/models/couponRequest.ts b/src/models/couponRequest.ts index b9e52b6d..b4a79fee 100644 --- a/src/models/couponRequest.ts +++ b/src/models/couponRequest.ts @@ -16,9 +16,9 @@ import { CouponPayload, couponPayloadSchema } from './couponPayload.js'; export interface CouponRequest { coupon?: CouponPayload; - /** An object where the keys are product IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the product */ + /** An object where the keys are product IDs or handles (prefixed with 'handle:'), 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 or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component */ + /** An object where the keys are component IDs or handles (prefixed with 'handle:'), and the values are booleans indicating if the coupon should be applicable to the component. */ restrictedComponents?: Record; [key: string]: unknown; } diff --git a/src/models/couponUsage.ts b/src/models/couponUsage.ts index df0896b1..fdc53758 100644 --- a/src/models/couponUsage.ts +++ b/src/models/couponUsage.ts @@ -25,9 +25,9 @@ export interface CouponUsage { savings?: number | null; /** Dollar amount of customer savings as a result of the coupon. */ savingsInCents?: bigint | null; - /** Total revenue of the all subscriptions that have received a discount from this coupon. */ + /** Total revenue of all subscriptions that have received a discount from this coupon. */ revenue?: number | null; - /** Total revenue of the all subscriptions that have received a discount from this coupon. */ + /** Total revenue of all subscriptions that have received a discount from this coupon. */ revenueInCents?: bigint; [key: string]: unknown; } diff --git a/src/models/createAllocation.ts b/src/models/createAllocation.ts index 7279abda..a60576d7 100644 --- a/src/models/createAllocation.ts +++ b/src/models/createAllocation.ts @@ -33,7 +33,7 @@ import { } from './upgradeChargeCreditType.js'; export interface CreateAllocation { - /** The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1for on and 0 for off. */ + /** The allocated quantity to which to set the line-items allocated quantity. By default, this is an integer. If decimal allocations are enabled for the component, it will be a decimal number. For On/Off components, use 1 for on and 0 for off. */ quantity: number; /** * Decimal representation of the allocated quantity. Only valid when decimal diff --git a/src/models/createComponentPricePoint.ts b/src/models/createComponentPricePoint.ts index 6eb40e2d..b1eb0a38 100644 --- a/src/models/createComponentPricePoint.ts +++ b/src/models/createComponentPricePoint.ts @@ -29,7 +29,7 @@ export interface CreateComponentPricePoint { useSiteExchangeRate?: boolean; /** 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. */ + /** The numerical interval. e.g., 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; /** A string representing the interval unit for this price point, either month or day. This property is only available for sites with Multifrequency enabled. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/createCustomer.ts b/src/models/createCustomer.ts index fa919257..5e5fac40 100644 --- a/src/models/createCustomer.ts +++ b/src/models/createCustomer.ts @@ -32,11 +32,15 @@ export interface CreateCustomer { locale?: string; vatNumber?: string; taxExempt?: boolean; + /** Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. */ + surcharging?: boolean; taxExemptReason?: string; /** The parent ID in Chargify if applicable. Parent is another Customer object. */ parentId?: number | null; /** The Salesforce ID of the customer */ salesforceId?: string | null; + /** The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. */ + brandingThemeId?: number | null; [key: string]: unknown; } @@ -57,7 +61,9 @@ export const createCustomerSchema: Schema = expandoObject({ locale: ['locale', optional(string())], vatNumber: ['vat_number', optional(string())], taxExempt: ['tax_exempt', optional(boolean())], + surcharging: ['surcharging', optional(boolean())], taxExemptReason: ['tax_exempt_reason', optional(string())], parentId: ['parent_id', optional(nullable(number()))], salesforceId: ['salesforce_id', optional(nullable(string()))], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], }); diff --git a/src/models/createInvoice.ts b/src/models/createInvoice.ts index 509a1bb8..7a68c8d3 100644 --- a/src/models/createInvoice.ts +++ b/src/models/createInvoice.ts @@ -39,11 +39,11 @@ export interface CreateInvoice { paymentInstructions?: string; /** A custom memo can be sent to override the site's default. */ memo?: string; - /** Overrides the defaults for the site */ + /** Overrides the defaults for the site. */ sellerAddress?: CreateInvoiceAddress; - /** Overrides the default for the customer */ + /** Overrides the default for the customer. */ billingAddress?: CreateInvoiceAddress; - /** Overrides the default for the customer */ + /** Overrides the default for the customer. */ shippingAddress?: CreateInvoiceAddress; coupons?: CreateInvoiceCoupon[]; status?: CreateInvoiceStatus; diff --git a/src/models/createInvoiceItem.ts b/src/models/createInvoiceItem.ts index b25311e0..795fe63e 100644 --- a/src/models/createInvoiceItem.ts +++ b/src/models/createInvoiceItem.ts @@ -39,9 +39,9 @@ import { export interface CreateInvoiceItem { title?: string; - /** The quantity can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ + /** The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ quantity?: CreateInvoiceItemQuantity; - /** The unit_price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ + /** The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ unitPrice?: CreateInvoiceItemUnitPrice; /** Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. */ taxable?: boolean; diff --git a/src/models/createMetafield.ts b/src/models/createMetafield.ts index b3e5413a..3350d15b 100644 --- a/src/models/createMetafield.ts +++ b/src/models/createMetafield.ts @@ -19,7 +19,7 @@ export interface CreateMetafield { name?: string; /** Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. */ scope?: MetafieldScope; - /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ + /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ inputType?: MetafieldInput; /** Only applicable when input_type is radio or dropdown. Empty strings will not be submitted. */ mEnum?: string[]; diff --git a/src/models/createOrUpdateEndpoint.ts b/src/models/createOrUpdateEndpoint.ts index c71513ef..7cd20e6a 100644 --- a/src/models/createOrUpdateEndpoint.ts +++ b/src/models/createOrUpdateEndpoint.ts @@ -10,7 +10,7 @@ import { webhookSubscriptionSchema, } from './webhookSubscription.js'; -/** Used to Create or Update Endpoint */ +/** Used to Create or Update Endpoint. */ export interface CreateOrUpdateEndpoint { url: string; webhookSubscriptions: WebhookSubscription[]; diff --git a/src/models/createOrUpdateEndpointRequest.ts b/src/models/createOrUpdateEndpointRequest.ts index ac755d85..bd4634ce 100644 --- a/src/models/createOrUpdateEndpointRequest.ts +++ b/src/models/createOrUpdateEndpointRequest.ts @@ -10,9 +10,9 @@ import { createOrUpdateEndpointSchema, } from './createOrUpdateEndpoint.js'; -/** Used to Create or Update Endpoint */ +/** Used to Create or Update Endpoint. */ export interface CreateOrUpdateEndpointRequest { - /** Used to Create or Update Endpoint */ + /** Used to Create or Update Endpoint. */ endpoint: CreateOrUpdateEndpoint; [key: string]: unknown; } diff --git a/src/models/createOrUpdateProduct.ts b/src/models/createOrUpdateProduct.ts index 585a5d35..17b3c363 100644 --- a/src/models/createOrUpdateProduct.ts +++ b/src/models/createOrUpdateProduct.ts @@ -34,25 +34,27 @@ export interface CreateOrUpdateProduct { requireCreditCard?: boolean; /** The product price, in integer cents */ priceInCents: bigint; - /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days */ + /** The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. */ interval: number; /** A string representing the interval unit for this product, either month or day */ intervalUnit: IntervalUnit; /** The product trial price, in integer cents */ trialPriceInCents?: bigint; - /** The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. */ + /** The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product trial would last 30 days. */ trialInterval?: number; /** A string representing the trial interval unit for this product, either month or day */ trialIntervalUnit?: IntervalUnit | null; - /** Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ + /** Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ trialType?: TrialType | null; - /** The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. */ + /** The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product would expire after 30 days. */ expirationInterval?: number; /** A string representing the expiration interval unit for this product, either month, day or never */ expirationIntervalUnit?: ExpirationIntervalUnit | null; autoCreateSignupPage?: boolean; /** A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ taxCode?: string; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -80,5 +82,6 @@ export const createOrUpdateProductSchema: Schema = expand ], autoCreateSignupPage: ['auto_create_signup_page', optional(boolean())], taxCode: ['tax_code', optional(string())], + unspscCode: ['unspsc_code', optional(nullable(string()))], } ); diff --git a/src/models/createOrUpdateSegmentPrice.ts b/src/models/createOrUpdateSegmentPrice.ts index 1e7c4ac5..885d92e4 100644 --- a/src/models/createOrUpdateSegmentPrice.ts +++ b/src/models/createOrUpdateSegmentPrice.ts @@ -13,7 +13,7 @@ import { export interface CreateOrUpdateSegmentPrice { startingQuantity?: number; endingQuantity?: number; - /** The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ + /** The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 */ unitPrice: CreateOrUpdateSegmentPriceUnitPrice; [key: string]: unknown; } diff --git a/src/models/createPaymentProfile.ts b/src/models/createPaymentProfile.ts index 2cc6df96..0ac98d17 100644 --- a/src/models/createPaymentProfile.ts +++ b/src/models/createPaymentProfile.ts @@ -44,21 +44,21 @@ export interface CreatePaymentProfile { fullNumber?: string; /** The type of card used. */ cardType?: CardType; - /** (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 */ + /** (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 */ expirationMonth?: CreatePaymentProfileExpirationMonth; - /** (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 */ + /** (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 */ expirationYear?: CreatePaymentProfileExpirationYear; - /** The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. */ billingAddress?: string; - /** Second line of the customer’s billing address i.e. Apt. 100 */ + /** Second line of the customer’s billing address e.g., Apt. 100 */ billingAddress2?: string | null; - /** The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. */ billingCity?: string; - /** The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ + /** The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ billingState?: string; - /** The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ + /** “The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time.” */ billingCountry?: string; - /** The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. */ billingZip?: string; /** The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. */ currentVault?: AllVaults; @@ -78,13 +78,13 @@ export interface CreatePaymentProfile { cvv?: string; /** (Required when creating with ACH or GoCardless, optional with Stripe Direct Debit). The name of the bank where the customerʼs account resides */ bankName?: string; - /** (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided */ + /** (Optional when creating with GoCardless, required with Stripe Direct Debit). International Bank Account Number. Alternatively, local bank details can be provided. */ bankIban?: string; - /** (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API */ + /** (Required when creating with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API. */ bankRoutingNumber?: string; /** (Required when creating with ACH, GoCardless, Stripe BECS or BACS Direct Debit, and bank_iban is blank) The customerʼs bank account number */ bankAccountNumber?: string; - /** (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided */ + /** (Optional when creating with GoCardless, required with Stripe BECS or BACS Direct Debit) Branch/Sort code. Alternatively, an IBAN can be provided. */ bankBranchCode?: string; /** Defaults to checking */ bankAccountType?: BankAccountType; diff --git a/src/models/createPrepaidUsageComponentPricePoint.ts b/src/models/createPrepaidUsageComponentPricePoint.ts index 3d580306..257c2c77 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; - /** (only for prepaid usage components) 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; - /** (only for prepaid usage components) 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 */ + /** (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; - /** (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 */ + /** (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/createPrepayment.ts b/src/models/createPrepayment.ts index c6f5de2e..105984e4 100644 --- a/src/models/createPrepayment.ts +++ b/src/models/createPrepayment.ts @@ -14,7 +14,7 @@ export interface CreatePrepayment { amount: number; details: string; memo: string; - /** :- When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. */ + /** When the `method` specified is `"credit_card_on_file"`, the prepayment amount will be collected using the default credit card payment profile and applied to the prepayment account balance. This is especially useful for manual replenishment of prepaid subscriptions. */ method: CreatePrepaymentMethod; paymentProfileId?: number; [key: string]: unknown; diff --git a/src/models/createProductFamily.ts b/src/models/createProductFamily.ts index 681a3309..90241b67 100644 --- a/src/models/createProductFamily.ts +++ b/src/models/createProductFamily.ts @@ -5,6 +5,7 @@ */ import { + boolean, expandoObject, nullable, optional, @@ -16,6 +17,8 @@ export interface CreateProductFamily { name: string; handle?: string | null; description?: string | null; + /** Whether surcharging applies to this product family. Defaults to `true` when omitted. Only applied on sites where surcharging is enabled. */ + surcharging?: boolean; [key: string]: unknown; } @@ -24,5 +27,6 @@ export const createProductFamilySchema: Schema = expandoObj name: ['name', string()], handle: ['handle', optional(nullable(string()))], description: ['description', optional(nullable(string()))], + surcharging: ['surcharging', optional(boolean())], } ); diff --git a/src/models/createProductPricePoint.ts b/src/models/createProductPricePoint.ts index 40ae0e62..54cfa762 100644 --- a/src/models/createProductPricePoint.ts +++ b/src/models/createProductPricePoint.ts @@ -28,22 +28,22 @@ export interface CreateProductPricePoint { handle?: string; /** The product price point price, in integer cents */ priceInCents: bigint; - /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days */ + /** The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. */ interval: number; /** A string representing the interval unit for this product price point, either month or day */ intervalUnit: IntervalUnit; /** The product price point trial price, in integer cents */ trialPriceInCents?: bigint; - /** The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. */ + /** The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. */ trialInterval?: number; /** A string representing the trial interval unit for this product price point, either month or day */ trialIntervalUnit?: IntervalUnit; - /** Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ + /** Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ trialType?: TrialType | null; /** The product price point initial charge, in integer cents */ initialChargeInCents?: bigint; initialChargeAfterTrial?: boolean; - /** The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. */ + /** The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. */ expirationInterval?: number; /** A string representing the expiration interval unit for this product price point, either month, day or never */ expirationIntervalUnit?: ExpirationIntervalUnit | null; diff --git a/src/models/createSubscription.ts b/src/models/createSubscription.ts index 822018d2..72e0d2d2 100644 --- a/src/models/createSubscription.ts +++ b/src/models/createSubscription.ts @@ -79,16 +79,18 @@ export interface CreateSubscription { netTerms?: string; /** The ID of an existing customer within Chargify. Required, unless a `customer_reference` or a set of `customer_attributes` is given. */ customerId?: number; + /** The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. */ + brandingThemeId?: number | null; /** (Optional) Set this attribute to a future date/time to sync imported subscriptions to your existing renewal schedule. See the notes on “Date/Time Format” in our [subscription import documentation](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format). If you provide a next_billing_at timestamp that is in the future, no trial or initial charges will be applied when you create the subscription. In fact, no payment will be captured at all. The first payment will be captured, according to the prices defined by the product, near the time specified by next_billing_at. If you do not provide a value for next_billing_at, any trial and/or initial charges will be assessed and charged at the time of subscription creation. If the card cannot be successfully charged, the subscription will not be created. See further notes in the section on Importing Subscriptions. */ nextBillingAt?: string; /** (Optional) Set this attribute to a future date/time to create a subscription in the Awaiting Signup state, rather than Active or Trialing. You can omit the initial_billing_at date to activate the subscription immediately. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the initial_billing_at date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time Formats. */ initialBillingAt?: string; - /** (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information. */ + /** (Optional) Set this attribute to true to create the subscription in the Awaiting Signup Date state. Use this when you want to create a subscription that has an unknown first billing date. When the first billing date is known, update a subscription and set the `initial_billing_at` date. The subscription moves to the Awaiting Signup state with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information. */ deferSignup?: boolean; /** For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. */ storedCredentialTransactionId?: number; salesRepId?: number; - /** The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id) */ + /** The Payment Profile ID of an existing card or bank account, which belongs to an existing customer to use for payment for this subscription. If the card, bank account, or customer does not exist already, or if you want to use a new (unstored) card or bank account for the subscription, use `payment_profile_attributes` instead to create a new payment profile along with the subscription. (This value is available on an existing subscription via the API as `credit_card` > id or `bank_account` > id.) */ paymentProfileId?: number; /** The reference value (provided by your app) for the subscription itself. */ reference?: string; @@ -100,7 +102,7 @@ export interface CreateSubscription { bankAccountAttributes?: BankAccountAttributes; /** (Optional) An array of component ids and quantities to be added to the subscription. See [Components](https://maxio.zendesk.com/hc/en-us/articles/24261141522189-Components-Overview) for more information. */ components?: CreateSubscriptionComponent[]; - /** (Optional). Cannot be used when also specifying next_billing_at */ + /** (Optional). Cannot be used when also specifying next_billing_at. */ calendarBilling?: CalendarBilling; /** (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. */ metafields?: Record; @@ -131,7 +133,7 @@ export interface CreateSubscription { reasonCode?: string; /** (Optional) used only for Delayed Product Change When set to true, indicates that a changed value for product_handle should schedule the product change to the next subscription renewal. */ productChangeDelayed?: boolean; - /** Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify id of the offer or its handle prefixed with `handle:`.er */ + /** Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify id of the offer or its handle prefixed with `handle:`. */ offerId?: CreateSubscriptionOfferId; prepaidConfiguration?: UpsertPrepaidConfiguration; /** Providing a previous_billing_at that is in the past will set the current_period_starts_at when the subscription is created. It will also set activated_at if not explicitly passed during the subscription import. Can only be used if next_billing_at is also passed. Using this option will allow you to set the period start for the subscription so mid period component allocations have the correct prorated amount. */ @@ -169,6 +171,7 @@ export const createSubscriptionSchema: Schema = lazy(() => receivesInvoiceEmails: ['receives_invoice_emails', optional(string())], netTerms: ['net_terms', optional(string())], customerId: ['customer_id', optional(number())], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], nextBillingAt: ['next_billing_at', optional(string())], initialBillingAt: ['initial_billing_at', optional(string())], deferSignup: ['defer_signup', optional(boolean())], diff --git a/src/models/createSubscriptionComponent.ts b/src/models/createSubscriptionComponent.ts index 424ac935..4b7e37b1 100644 --- a/src/models/createSubscriptionComponent.ts +++ b/src/models/createSubscriptionComponent.ts @@ -28,13 +28,17 @@ import { CreateSubscriptionComponentPricePointId, createSubscriptionComponentPricePointIdSchema, } from './containers/createSubscriptionComponentPricePointId.js'; +import { + CreateSubscriptionComponentUnitBalance, + createSubscriptionComponentUnitBalanceSchema, +} from './containers/createSubscriptionComponentUnitBalance.js'; export interface CreateSubscriptionComponent { componentId?: CreateSubscriptionComponentComponentId; /** Used for on/off components only. */ enabled?: boolean; /** Used for metered and events based components. */ - unitBalance?: number; + unitBalance?: CreateSubscriptionComponentUnitBalance; /** Used for quantity based components. */ allocatedQuantity?: CreateSubscriptionComponentAllocatedQuantity; /** Deprecated. Use `allocated_quantity` instead. */ @@ -53,7 +57,10 @@ export const createSubscriptionComponentSchema: Schema = firstName: ['first_name', optional(string())], lastName: ['last_name', optional(string())], maskedCardNumber: ['masked_card_number', optional(string())], - cardType: ['card_type', optional(cardTypeSchema)], + cardType: ['card_type', optional(nullable(cardTypeSchema))], expirationMonth: ['expiration_month', optional(number())], expirationYear: ['expiration_year', optional(number())], customerId: ['customer_id', optional(number())], diff --git a/src/models/creditNote.ts b/src/models/creditNote.ts index a86c716a..ff01a20a 100644 --- a/src/models/creditNote.ts +++ b/src/models/creditNote.ts @@ -68,7 +68,7 @@ export interface CreditNote { memo?: string; /** Information about the seller (merchant) listed on the masthead of the credit note. */ seller?: InvoiceSeller; - /** Information about the customer who is owner or recipient the credited subscription. */ + /** Information about the customer who is owner or recipient of the credited subscription. */ customer?: InvoiceCustomer; /** The billing address of the credit subscription. */ billingAddress?: InvoiceAddress; @@ -76,11 +76,11 @@ export interface CreditNote { shippingAddress?: InvoiceAddress; /** Subtotal of the credit note, which is the sum of all line items before discounts or taxes. Note that this is a positive amount representing the credit back to the customer. */ subtotalAmount?: string; - /** Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e. a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). */ + /** Total discount applied to the credit note. Note that this is a positive amount representing the discount amount being credited back to the customer (i.e., a credit on an earlier discount). For example, if the original purchase was $1.00 and the original discount was $0.10, a credit of $0.50 of the original purchase (half) would have a discount credit of $0.05 (also half). */ discountAmount?: string; - /** Total tax of the credit note. Note that this is a positive amount representing a previously taxex amount being credited back to the customer (i.e. a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). */ + /** Total tax of the credit note. Note that this is a positive amount representing a previously taxed amount being credited back to the customer (i.e., a credit of an earlier tax). For example, if the original purchase was $1.00 and the original tax was $0.10, a credit of $0.50 of the original purchase (half) would also have a tax credit of $0.05 (also half). */ taxAmount?: string; - /** The credit note total, which is `subtotal_amount - discount_amount + tax_amount`.' */ + /** The credit note total, which is `subtotal_amount - discount_amount + tax_amount`. */ totalAmount?: string; /** The amount of the credit note that has already been applied to invoices. */ appliedAmount?: string; @@ -92,7 +92,7 @@ export interface CreditNote { taxes?: InvoiceTax[]; applications?: CreditNoteApplication[]; refunds?: InvoiceRefund[]; - /** An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices) */ + /** An array of origin invoices for the credit note. Learn more about [Origin Invoice from our docs](https://maxio.zendesk.com/hc/en-us/articles/24252261284749-Credit-Notes-Proration#origin-invoices). */ originInvoices?: OriginInvoice[]; [key: string]: unknown; } diff --git a/src/models/creditNoteLineItem.ts b/src/models/creditNoteLineItem.ts index 02e2dc58..836720d8 100644 --- a/src/models/creditNoteLineItem.ts +++ b/src/models/creditNoteLineItem.ts @@ -31,7 +31,7 @@ export interface CreditNoteLineItem { quantity?: string; /** * The price per unit for the line item. - * When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. + * When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. */ unitPrice?: string; /** The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). */ diff --git a/src/models/currencyOveragePrices.ts b/src/models/currencyOveragePrices.ts index e4eb907f..cf378b20 100644 --- a/src/models/currencyOveragePrices.ts +++ b/src/models/currencyOveragePrices.ts @@ -38,7 +38,7 @@ export interface CurrencyOveragePrices { * 3. **catalog**: a price point that is **not** marked as a default price for a certain product and is **not** a custom one. */ type?: PricePointType; - /** Note: Refer to type attribute instead */ + /** Note: Refer to type attribute instead. */ mDefault?: boolean; name?: string; /** The identifier for the pricing scheme. See [Product Components](https://help.chargify.com/products/product-components.html) for an overview of pricing schemes. */ @@ -54,7 +54,7 @@ export interface CurrencyOveragePrices { /** (only used for Custom Pricing - ie. when the price point's type is `custom`) The id of the subscription that the custom price point is for. */ subscriptionId?: number; taxIncluded?: boolean; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number | null; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/customer.ts b/src/models/customer.ts index 4c9eee54..04338724 100644 --- a/src/models/customer.ts +++ b/src/models/customer.ts @@ -21,7 +21,7 @@ export interface Customer { lastName?: string; /** The email address of the customer */ email?: string; - /** A comma-separated list of emails that should be cc’d on all customer communications (i.e. “joe@example.com, sue@example.com”) */ + /** “A comma-separated list of emails that should be cc’d on all customer communications (e.g., “joe@example.com, sue@example.com”)” */ ccEmails?: string | null; /** The organization of the customer. If no value, `null` or empty string is provided, `organization` will be populated with the customer's first and last name, separated with a space. */ organization?: string | null; @@ -33,17 +33,17 @@ export interface Customer { createdAt?: string; /** The timestamp in which the customer object was last edited */ updatedAt?: string; - /** The customer’s shipping street address (i.e. “123 Main St.”) */ + /** The customer’s shipping street address (e.g., “123 Main St.”) */ address?: string | null; - /** Second line of the customer’s shipping address i.e. “Apt. 100” */ + /** Second line of the customer’s shipping address e.g., “Apt. 100” */ address2?: string | null; - /** The customer’s shipping address city (i.e. “Boston”) */ + /** The customer’s shipping address city (e.g., “Boston”) */ city?: string | null; - /** The customer’s shipping address state (i.e. “MA”) */ + /** The customer’s shipping address state (e.g., “MA”) */ state?: string | null; /** The customer's full name of state */ stateName?: string | null; - /** The customer’s shipping address zip code (i.e. “12345”) */ + /** The customer’s shipping address zip code (e.g., “12345”) */ zip?: string | null; /** The customer shipping address country */ country?: string | null; @@ -61,6 +61,8 @@ export interface Customer { portalInviteLastAcceptedAt?: string | null; /** The tax exempt status for the customer. Acceptable values are true or 1 for true and false or 0 for false. */ taxExempt?: boolean; + /** Whether surcharging is enabled for the customer. Only included on sites where surcharging control is enabled. */ + surcharging?: boolean; /** The VAT business identification number for the customer. This number is used to determine VAT tax opt out rules. It is not validated when added or updated on a customer record. Instead, it is validated via VIES before calculating taxes. Only valid business identification numbers will allow for VAT opt out. */ vatNumber?: string | null; /** The parent ID in Chargify if applicable. Parent is another Customer object. */ @@ -76,6 +78,8 @@ export interface Customer { defaultAutoRenewalProfileId?: number | null; /** The Maxio-generated unique identifier for the customer. */ maxioid?: string | null; + /** The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. */ + brandingThemeId?: number | null; [key: string]: unknown; } @@ -112,6 +116,7 @@ export const customerSchema: Schema = expandoObject({ optional(nullable(string())), ], taxExempt: ['tax_exempt', optional(boolean())], + surcharging: ['surcharging', optional(boolean())], vatNumber: ['vat_number', optional(nullable(string()))], parentId: ['parent_id', optional(nullable(number()))], locale: ['locale', optional(nullable(string()))], @@ -126,4 +131,5 @@ export const customerSchema: Schema = expandoObject({ optional(nullable(number())), ], maxioid: ['maxioid', optional(nullable(string()))], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], }); diff --git a/src/models/customerAttributes.ts b/src/models/customerAttributes.ts index 34a71219..8b4d7fed 100644 --- a/src/models/customerAttributes.ts +++ b/src/models/customerAttributes.ts @@ -22,30 +22,32 @@ export interface CustomerAttributes { lastName?: string; /** The email address of the customer. Required when creating a customer via attributes. */ email?: string; - /** A list of emails that should be cc’d on all customer communications. Optional. */ + /** (Optional) A list of emails that should be cc’d on all customer communications. */ ccEmails?: string; - /** The organization/company of the customer. Optional. */ + /** (Optional) The organization/company of the customer. */ organization?: string; - /** A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. Optional. */ + /** (Optional) A customer “reference”, or unique identifier from your app, stored in Chargify. Can be used so that you may reference your customer’s within Chargify using the same unique value you use in your application. */ reference?: string; - /** (Optional) The customer’s shipping street address (i.e. “123 Main St.”). */ + /** (Optional) The customer’s shipping street address (e.g., “123 Main St.”). */ address?: string; - /** (Optional) Second line of the customer’s shipping address i.e. “Apt. 100” */ + /** (Optional) Second line of the customer’s shipping address e.g., “Apt. 100” */ address2?: string | null; - /** (Optional) The customer’s shipping address city (i.e. “Boston”). */ + /** (Optional) The customer’s shipping address city (e.g., “Boston”). */ city?: string; - /** (Optional) The customer’s shipping address state (i.e. “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ + /** “(Optional) The customer’s shipping address state (e.g., “MA”). This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes.” */ state?: string; - /** (Optional) The customer’s shipping address zip code (i.e. “12345”). */ + /** (Optional) The customer’s shipping address zip code (e.g., “12345”). */ zip?: string; - /** (Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). */ + /** “(Optional) The customer shipping address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”).” */ country?: string; /** (Optional) The phone number of the customer. */ phone?: string; verified?: boolean; /** (Optional) The tax_exempt status of the customer. Acceptable values are true or 1 for true and false or 0 for false. */ taxExempt?: boolean; - /** (Optional) Supplying the VAT number allows EU customer’s to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. */ + /** (Optional) Whether surcharging is enabled for the customer. Defaults to `true` when omitted. Only applied on sites where surcharging control is enabled. */ + surcharging?: boolean; + /** (Optional) Supplying the VAT number allows EU customers to opt-out of the Value Added Tax assuming the merchant address and customer billing address are not within the same EU country. It’s important to omit the country code from the VAT number upon entry. Otherwise, taxes will be assessed upon the purchase. */ vatNumber?: string; /** (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. */ metafields?: Record; @@ -75,6 +77,7 @@ export const customerAttributesSchema: Schema = expandoObjec phone: ['phone', optional(string())], verified: ['verified', optional(boolean())], taxExempt: ['tax_exempt', optional(boolean())], + surcharging: ['surcharging', optional(boolean())], vatNumber: ['vat_number', optional(string())], metafields: ['metafields', optional(dict(string()))], parentId: ['parent_id', optional(nullable(number()))], diff --git a/src/models/debitNote.ts b/src/models/debitNote.ts index 6a8acee5..30542ac5 100644 --- a/src/models/debitNote.ts +++ b/src/models/debitNote.ts @@ -35,7 +35,7 @@ export interface DebitNote { customerId?: number; /** ID of the subscription that generated the debit note. */ subscriptionId?: number; - /** A unique, identifier that appears on the debit note and in places it is referenced. */ + /** A unique identifier that appears on the debit note and in places it is referenced. */ number?: number; /** A monotonically increasing number assigned to debit notes as they are created. */ sequenceNumber?: number; @@ -44,7 +44,7 @@ export interface DebitNote { * While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. */ originCreditNoteUid?: string; - /** A unique, identifying string of the connected credit note. */ + /** A unique identifying string of the connected credit note. */ originCreditNoteNumber?: string; /** * Date the document was issued to the customer. This is the date that the document was made available for payment. @@ -68,7 +68,7 @@ export interface DebitNote { currency?: string; /** Information about the seller (merchant) listed on the masthead of the debit note. */ seller?: InvoiceSeller; - /** Information about the customer who is owner or recipient the debited subscription. */ + /** Information about the customer who is the owner or recipient of the debited subscription. */ customer?: InvoiceCustomer; /** The billing address of the debited subscription. */ billingAddress?: InvoiceAddress; diff --git a/src/models/eBBComponent.ts b/src/models/eBBComponent.ts index 91a6e848..4529de50 100644 --- a/src/models/eBBComponent.ts +++ b/src/models/eBBComponent.ts @@ -28,13 +28,13 @@ import { Price, priceSchema } from './price.js'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface EBBComponent { - /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ + /** A name for this component that is suitable for showing customers and displaying on billing statements, i.e., "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 */ + /** “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; /** 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 '_'. */ + /** A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; @@ -43,7 +43,7 @@ export interface EBBComponent { /** (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[]; 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 */ + /** 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; /** A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ taxCode?: string; @@ -51,10 +51,12 @@ export interface EBBComponent { hideDateRangeOnInvoice?: boolean; /** 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. */ + /** 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -77,5 +79,6 @@ export const eBBComponentSchema: Schema = lazy(() => eventBasedBillingMetricId: ['event_based_billing_metric_id', number()], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/event.ts b/src/models/event.ts index 21b0e060..ff99cb88 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -28,7 +28,7 @@ export interface Event { createdAt: string; /** * The schema varies based on the event key. The key-to-event data mapping is as follows: - * * `subscription_product_change` - SubscriptionProductChange + * * `subscription_product_change`, `subscription_product_change_scheduled` - 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 diff --git a/src/models/eventKey.ts b/src/models/eventKey.ts index d6bf0601..2f032144 100644 --- a/src/models/eventKey.ts +++ b/src/models/eventKey.ts @@ -22,6 +22,7 @@ export enum EventKey { RenewalFailure = 'renewal_failure', SubscriptionStateChange = 'subscription_state_change', SubscriptionProductChange = 'subscription_product_change', + SubscriptionProductChangeScheduled = 'subscription_product_change_scheduled', PendingCancellationChange = 'pending_cancellation_change', ExpiringCard = 'expiring_card', CustomerUpdate = 'customer_update', diff --git a/src/models/getOneTimeTokenBankAccountPaymentProfile.ts b/src/models/getOneTimeTokenBankAccountPaymentProfile.ts new file mode 100644 index 00000000..7bdb1558 --- /dev/null +++ b/src/models/getOneTimeTokenBankAccountPaymentProfile.ts @@ -0,0 +1,85 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + boolean, + expandoObject, + nullable, + number, + optional, + Schema, + string, +} from '../schema.js'; +import { + BankAccountHolderType, + bankAccountHolderTypeSchema, +} from './bankAccountHolderType.js'; +import { BankAccountType, bankAccountTypeSchema } from './bankAccountType.js'; +import { + BankAccountVault, + bankAccountVaultSchema, +} from './bankAccountVault.js'; + +export interface GetOneTimeTokenBankAccountPaymentProfile { + id?: string | null; + firstName: string; + lastName: string; + customerId?: string | null; + /** The vault that stores the payment profile with the provided vault_token. Use `bogus` for testing. */ + currentVault: BankAccountVault; + vaultToken: string; + billingAddress: string; + billingAddress2?: string; + billingCity: string; + billingCountry: string; + billingState: string; + billingZip: string; + bankName: string; + maskedBankRoutingNumber: string; + maskedBankAccountNumber: string; + /** Defaults to checking */ + bankAccountType: BankAccountType; + /** Defaults to personal */ + bankAccountHolderType: BankAccountHolderType; + paymentType: string; + disabled: boolean; + siteGatewaySettingId: number; + customerVaultToken?: string | null; + gatewayHandle?: string | null; + verified?: boolean | null; + [key: string]: unknown; +} + +export const getOneTimeTokenBankAccountPaymentProfileSchema: Schema = expandoObject( + { + id: ['id', optional(nullable(string()))], + firstName: ['first_name', string()], + lastName: ['last_name', string()], + customerId: ['customer_id', optional(nullable(string()))], + currentVault: ['current_vault', bankAccountVaultSchema], + vaultToken: ['vault_token', string()], + billingAddress: ['billing_address', string()], + billingAddress2: ['billing_address_2', optional(string())], + billingCity: ['billing_city', string()], + billingCountry: ['billing_country', string()], + billingState: ['billing_state', string()], + billingZip: ['billing_zip', string()], + bankName: ['bank_name', string()], + maskedBankRoutingNumber: ['masked_bank_routing_number', string()], + maskedBankAccountNumber: ['masked_bank_account_number', string()], + bankAccountType: ['bank_account_type', bankAccountTypeSchema], + bankAccountHolderType: [ + 'bank_account_holder_type', + bankAccountHolderTypeSchema, + ], + paymentType: ['payment_type', string()], + disabled: ['disabled', boolean()], + siteGatewaySettingId: ['site_gateway_setting_id', number()], + customerVaultToken: ['customer_vault_token', optional(nullable(string()))], + gatewayHandle: ['gateway_handle', optional(nullable(string()))], + verified: ['verified', optional(nullable(boolean()))], + } +); diff --git a/src/models/getOneTimeTokenRequest.ts b/src/models/getOneTimeTokenRequest.ts index bf4ffaaf..14a3f05e 100644 --- a/src/models/getOneTimeTokenRequest.ts +++ b/src/models/getOneTimeTokenRequest.ts @@ -6,18 +6,21 @@ import { expandoObject, lazy, Schema } from '../schema.js'; import { - GetOneTimeTokenPaymentProfile, - getOneTimeTokenPaymentProfileSchema, -} from './getOneTimeTokenPaymentProfile.js'; + GetOneTimeTokenRequestPaymentProfile, + getOneTimeTokenRequestPaymentProfileSchema, +} from './containers/getOneTimeTokenRequestPaymentProfile.js'; export interface GetOneTimeTokenRequest { - paymentProfile: GetOneTimeTokenPaymentProfile; + paymentProfile: GetOneTimeTokenRequestPaymentProfile; [key: string]: unknown; } export const getOneTimeTokenRequestSchema: Schema = lazy( () => expandoObject({ - paymentProfile: ['payment_profile', getOneTimeTokenPaymentProfileSchema], + paymentProfile: [ + 'payment_profile', + getOneTimeTokenRequestPaymentProfileSchema, + ], }) ); diff --git a/src/models/groupBilling.ts b/src/models/groupBilling.ts index c860b220..8867c32a 100644 --- a/src/models/groupBilling.ts +++ b/src/models/groupBilling.ts @@ -6,7 +6,7 @@ import { boolean, expandoObject, optional, Schema } from '../schema.js'; -/** Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. */ +/** (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. */ export interface GroupBilling { /** A flag indicating whether or not to accrue charges on the new subscription. */ accrue?: boolean; diff --git a/src/models/groupSettings.ts b/src/models/groupSettings.ts index 4976277e..116827e4 100644 --- a/src/models/groupSettings.ts +++ b/src/models/groupSettings.ts @@ -11,7 +11,7 @@ import { GroupTarget, groupTargetSchema } from './groupTarget.js'; export interface GroupSettings { /** Attributes of the target customer who will be the responsible payer of the created subscription. Required. */ target: GroupTarget; - /** Optional attributes related to billing date and accrual. Note: Only applicable for new subscriptions. */ + /** (Optional) Attributes related to billing date and accrual. Note: Only applicable for new subscriptions. */ billing?: GroupBilling; [key: string]: unknown; } diff --git a/src/models/groupStatus.ts b/src/models/groupStatus.ts new file mode 100644 index 00000000..86a76b5d --- /dev/null +++ b/src/models/groupStatus.ts @@ -0,0 +1,20 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { Schema, stringEnum } from '../schema.js'; + +/** + * Enum for GroupStatus + */ +export enum GroupStatus { + Ungrouped = 'ungrouped', + Grouped = 'grouped', +} + +/** + * Schema for GroupStatus + */ +export const groupStatusSchema: Schema = stringEnum(GroupStatus); diff --git a/src/models/groupTarget.ts b/src/models/groupTarget.ts index 96ca3227..edbb79e3 100644 --- a/src/models/groupTarget.ts +++ b/src/models/groupTarget.ts @@ -11,7 +11,7 @@ import { GroupTargetType, groupTargetTypeSchema } from './groupTargetType.js'; export interface GroupTarget { /** The type of object indicated by the id attribute. */ type: GroupTargetType; - /** The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self" , "parent", or "eldest" */ + /** The id of the target customer or subscription to group the existing subscription with. Ignored and should not be included if type is "self", "parent", or "eldest". */ id?: number; [key: string]: unknown; } diff --git a/src/models/historicUsage.ts b/src/models/historicUsage.ts index 6946d92a..2fabca18 100644 --- a/src/models/historicUsage.ts +++ b/src/models/historicUsage.ts @@ -6,7 +6,7 @@ import { expandoObject, number, optional, Schema, string } from '../schema.js'; -/** Optional for Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. */ +/** (Optional) For Event Based Components. If the `include=historic_usages` query param is provided, the last ten billing periods will be returned. */ export interface HistoricUsage { /** Total usage of a component for billing period */ totalUsageQuantity?: number; diff --git a/src/models/invoice.ts b/src/models/invoice.ts index 8a2ab498..71228f28 100644 --- a/src/models/invoice.ts +++ b/src/models/invoice.ts @@ -68,13 +68,13 @@ export interface Invoice { * While the UID is long and not appropriate to show to customers, the number is usually shorter and consumable by the customer and the merchant alike. */ number?: string; - /** A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. */ + /** A monotonically increasing number assigned to invoices as they are created. This number is unique within a site and can be used to sort and order invoices. */ sequenceNumber?: number; transactionTime?: string; createdAt?: string; updatedAt?: string; /** - * Date the invoice was issued to the customer. This is the date that the invoice was made available for payment. + * Date the invoice was issued to the customer. This is the date that the invoice was made available for payment. * The format is `"YYYY-MM-DD"`. */ issueDate?: string; @@ -100,7 +100,7 @@ export interface Invoice { /** The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. */ currency?: string; /** - * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: + * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * * "none": A normal invoice with no consolidation. * * "child": An invoice segment which has been combined into a consolidated invoice. * * "parent": A consolidated invoice, whose contents are composed of invoice segments. @@ -121,12 +121,12 @@ export interface Invoice { productFamilyName?: string; /** Information about the seller (merchant) listed on the masthead of the invoice. */ seller?: InvoiceSeller; - /** Information about the customer who is owner or recipient the invoiced subscription. */ + /** Information about the customer who is owner or recipient of the invoiced subscription. */ customer?: InvoiceCustomer; payer?: InvoicePayer; recipientEmails?: string[]; netTerms?: number; - /** The memo printed on invoices of any collection type. This message is in control of the merchant. */ + /** The memo printed on invoices of any collection type. This message is in control of the merchant. */ memo?: string; /** The invoice billing address. */ billingAddress?: InvoiceAddress; @@ -138,7 +138,7 @@ export interface Invoice { discountAmount?: string; /** Total tax on the invoice. */ taxAmount?: string; - /** The invoice total, which is `subtotal_amount - discount_amount + tax_amount`.' */ + /** The invoice total, which is `subtotal_amount - discount_amount + tax_amount`. */ totalAmount?: string; /** * The amount of credit (from credit notes) applied to this invoice. @@ -167,6 +167,8 @@ export interface Invoice { previousBalanceData?: InvoicePreviousBalance; /** The format is `"YYYY-MM-DD"`. */ publicUrlExpiresOn?: string; + /** The ID of the Branding Theme associated with this invoice. This value represents the Branding Theme used for invoice theming, such as themed invoice rendering. Available only when Branding Themes are enabled for the site. */ + brandingThemeId?: number | null; [key: string]: unknown; } @@ -246,5 +248,6 @@ export const invoiceSchema: Schema = lazy(() => optional(invoicePreviousBalanceSchema), ], publicUrlExpiresOn: ['public_url_expires_on', optional(string())], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], }) ); diff --git a/src/models/invoiceCustomer.ts b/src/models/invoiceCustomer.ts index 8fcf1ec3..877c2351 100644 --- a/src/models/invoiceCustomer.ts +++ b/src/models/invoiceCustomer.ts @@ -13,7 +13,7 @@ import { string, } from '../schema.js'; -/** Information about the customer who is owner or recipient the invoiced subscription. */ +/** Information about the customer who is owner or recipient of the invoiced subscription. */ export interface InvoiceCustomer { chargifyId?: number | null; firstName?: string; diff --git a/src/models/invoiceLineItem.ts b/src/models/invoiceLineItem.ts index 5f61ac25..7e56d4f0 100644 --- a/src/models/invoiceLineItem.ts +++ b/src/models/invoiceLineItem.ts @@ -20,12 +20,12 @@ import { } from './invoiceLineItemComponentCostData.js'; export interface InvoiceLineItem { - /** Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. */ + /** Unique identifier for the line item. Useful when cross-referencing the line against individual discounts in the `discounts` or `taxes` lists. */ uid?: string; /** A short descriptor for the charge or item represented by this line. */ title?: string; /** - * Detailed description for the charge or item represented by this line. May include proration details in plain text. + * Detailed description for the charge or item represented by this line. May include proration details in plain text. * Note: this string may contain line breaks that are hints for the best display format on the invoice. */ description?: string; @@ -36,7 +36,7 @@ export interface InvoiceLineItem { quantity?: string; /** * The price per unit for the line item. - * When tiered pricing was used (i.e. not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. + * When tiered pricing was used (i.e., not every unit was actually priced at the same price) this will be the blended average cost per unit and the `tiered_unit_price` field will be set to `true`. */ unitPrice?: string; /** The line subtotal, generally calculated as `quantity * unit_price`. This is the canonical amount of record for the line - when rounding differences are in play, `subtotal_amount` takes precedence over the value derived from `quantity * unit_price` (which may not have the proper precision to exactly equal this amount). */ @@ -59,7 +59,7 @@ export interface InvoiceLineItem { taxIncluded?: boolean; /** * The non-canonical total amount for the line. - * `subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. + * `subtotal_amount` is the canonical amount for a line. The invoice `total_amount` is derived from the sum of the line `subtotal_amount`s and discounts or taxes applied thereafter. Therefore, due to rounding or precision errors, the sum of line `total_amount`s may not equal the invoice `total_amount`. */ totalAmount?: string; /** When `true`, indicates that the actual pricing scheme for the line was tiered, so the `unit_price` shown is the blended average for all units. */ @@ -67,14 +67,14 @@ export interface InvoiceLineItem { /** * Start date for the period covered by this line. The format is `"YYYY-MM-DD"`. * * For periodic charges paid in advance, this date will match the billing date, and the end date will be in the future. - * * For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the previous billing, and the end date will be the current billing date. + * * For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the previous billing, and the end date will be the current billing date. * * For non-periodic charges, this date and the end date will match. */ periodRangeStart?: string; /** * End date for the period covered by this line. The format is `"YYYY-MM-DD"`. * * For periodic charges paid in advance, this date will match the next (future) billing date. - * * For periodic charges paid in arrears (e.g. metered charges), this date will be the date of the current billing date. + * * For periodic charges paid in arrears (e.g., metered charges), this date will be the date of the current billing date. * * For non-periodic charges, this date and the start date will match. */ periodRangeEnd?: string; diff --git a/src/models/issueInvoiceEventData.ts b/src/models/issueInvoiceEventData.ts index fd44eb90..4ac67c28 100644 --- a/src/models/issueInvoiceEventData.ts +++ b/src/models/issueInvoiceEventData.ts @@ -14,7 +14,7 @@ import { InvoiceStatus, invoiceStatusSchema } from './invoiceStatus.js'; /** Example schema for an `issue_invoice` event */ export interface IssueInvoiceEventData { /** - * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: + * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * * "none": A normal invoice with no consolidation. * * "child": An invoice segment which has been combined into a consolidated invoice. * * "parent": A consolidated invoice, whose contents are composed of invoice segments. diff --git a/src/models/issueInvoiceRequest.ts b/src/models/issueInvoiceRequest.ts index ba654387..deae24ec 100644 --- a/src/models/issueInvoiceRequest.ts +++ b/src/models/issueInvoiceRequest.ts @@ -15,7 +15,7 @@ export interface IssueInvoiceRequest { * Action taken when payment for an invoice fails: * - `leave_open_invoice` - prepayments and credits applied to 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. This is the default option. * - `rollback_to_pending` - prepayments and credits not applied; invoice remains in "pending" status; no email sent to the customer; payment failure recorded in the invoice history. - * - `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). + * - `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). */ onFailedPayment?: FailedPaymentAction; [key: string]: unknown; diff --git a/src/models/listSubscriptionGroupPrepayment.ts b/src/models/listSubscriptionGroupPrepayment.ts index 81e0314d..2ec56265 100644 --- a/src/models/listSubscriptionGroupPrepayment.ts +++ b/src/models/listSubscriptionGroupPrepayment.ts @@ -6,18 +6,18 @@ import { expandoObject, lazy, Schema } from '../schema.js'; import { - ListSubcriptionGroupPrepaymentItem, - listSubcriptionGroupPrepaymentItemSchema, -} from './listSubcriptionGroupPrepaymentItem.js'; + ListSubscriptionGroupPrepaymentItem, + listSubscriptionGroupPrepaymentItemSchema, +} from './listSubscriptionGroupPrepaymentItem.js'; export interface ListSubscriptionGroupPrepayment { - prepayment: ListSubcriptionGroupPrepaymentItem; + prepayment: ListSubscriptionGroupPrepaymentItem; [key: string]: unknown; } export const listSubscriptionGroupPrepaymentSchema: Schema = lazy( () => expandoObject({ - prepayment: ['prepayment', listSubcriptionGroupPrepaymentItemSchema], + prepayment: ['prepayment', listSubscriptionGroupPrepaymentItemSchema], }) ); diff --git a/src/models/listSubcriptionGroupPrepaymentItem.ts b/src/models/listSubscriptionGroupPrepaymentItem.ts similarity index 86% rename from src/models/listSubcriptionGroupPrepaymentItem.ts rename to src/models/listSubscriptionGroupPrepaymentItem.ts index b47ee9a7..b4bf534f 100644 --- a/src/models/listSubcriptionGroupPrepaymentItem.ts +++ b/src/models/listSubscriptionGroupPrepaymentItem.ts @@ -18,7 +18,7 @@ import { prepaymentMethodSchema, } from './prepaymentMethod.js'; -export interface ListSubcriptionGroupPrepaymentItem { +export interface ListSubscriptionGroupPrepaymentItem { id?: number; subscriptionGroupUid?: string; amountInCents?: bigint; @@ -31,7 +31,7 @@ export interface ListSubcriptionGroupPrepaymentItem { [key: string]: unknown; } -export const listSubcriptionGroupPrepaymentItemSchema: Schema = expandoObject( +export const listSubscriptionGroupPrepaymentItemSchema: Schema = expandoObject( { id: ['id', optional(number())], subscriptionGroupUid: ['subscription_group_uid', optional(string())], diff --git a/src/models/metafield.ts b/src/models/metafield.ts index 478b1df4..3f647fee 100644 --- a/src/models/metafield.ts +++ b/src/models/metafield.ts @@ -27,7 +27,7 @@ export interface Metafield { scope?: MetafieldScope; /** The amount of subscriptions this metafield has been applied to in Advanced Billing. */ dataCount?: number; - /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ + /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ inputType?: MetafieldInput; mEnum?: MetafieldEnum | null; [key: string]: unknown; diff --git a/src/models/meteredComponent.ts b/src/models/meteredComponent.ts index 32274978..951e5f99 100644 --- a/src/models/meteredComponent.ts +++ b/src/models/meteredComponent.ts @@ -28,13 +28,13 @@ import { Price, priceSchema } from './price.js'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface MeteredComponent { - /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ + /** A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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 */ + /** The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item */ 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 '_'. */ + /** A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; @@ -43,7 +43,7 @@ export interface MeteredComponent { /** (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[]; 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 */ + /** 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. e.g., 1.00 or 0.0012 or 0.00000065 */ unitPrice?: MeteredComponentUnitPrice; /** A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ taxCode?: string; @@ -52,10 +52,12 @@ export interface MeteredComponent { displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -83,5 +85,6 @@ export const meteredComponentSchema: Schema = lazy(() => publicSignupPageIds: ['public_signup_page_ids', optional(array(number()))], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/meteredUsage.ts b/src/models/meteredUsage.ts index eb0c70c2..61f776ae 100644 --- a/src/models/meteredUsage.ts +++ b/src/models/meteredUsage.ts @@ -4,11 +4,15 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { expandoObject, number, Schema, string } from '../schema.js'; +import { expandoObject, lazy, number, Schema, string } from '../schema.js'; +import { + MeteredUsageNewUnitBalance, + meteredUsageNewUnitBalanceSchema, +} from './containers/meteredUsageNewUnitBalance.js'; export interface MeteredUsage { previousUnitBalance: string; - newUnitBalance: number; + newUnitBalance: MeteredUsageNewUnitBalance; usageQuantity: number; componentId: number; componentHandle: string; @@ -16,11 +20,13 @@ export interface MeteredUsage { [key: string]: unknown; } -export const meteredUsageSchema: Schema = expandoObject({ - previousUnitBalance: ['previous_unit_balance', string()], - newUnitBalance: ['new_unit_balance', number()], - usageQuantity: ['usage_quantity', number()], - componentId: ['component_id', number()], - componentHandle: ['component_handle', string()], - memo: ['memo', string()], -}); +export const meteredUsageSchema: Schema = lazy(() => + expandoObject({ + previousUnitBalance: ['previous_unit_balance', string()], + newUnitBalance: ['new_unit_balance', meteredUsageNewUnitBalanceSchema], + usageQuantity: ['usage_quantity', number()], + componentId: ['component_id', number()], + componentHandle: ['component_handle', string()], + memo: ['memo', string()], + }) +); diff --git a/src/models/offerItem.ts b/src/models/offerItem.ts index a4012d69..0945815a 100644 --- a/src/models/offerItem.ts +++ b/src/models/offerItem.ts @@ -27,7 +27,7 @@ export interface OfferItem { componentName?: string; pricePointName?: string; currencyPrices?: CurrencyPrice[]; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/onOffComponent.ts b/src/models/onOffComponent.ts index 66ff213b..e55e7350 100644 --- a/src/models/onOffComponent.ts +++ b/src/models/onOffComponent.ts @@ -27,11 +27,11 @@ import { CreditType, creditTypeSchema } from './creditType.js'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit.js'; export interface OnOffComponent { - /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ + /** A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "Minutes". */ name: 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 '_'. */ + /** A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; @@ -40,7 +40,7 @@ export interface OnOffComponent { /** The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. */ downgradeCredit?: CreditType | null; pricePoints?: ComponentPricePointItem[]; - /** 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 */ + /** 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. e.g., 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 AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ taxCode?: string; @@ -49,10 +49,12 @@ export interface OnOffComponent { displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -79,5 +81,6 @@ export const onOffComponentSchema: Schema = lazy(() => publicSignupPageIds: ['public_signup_page_ids', optional(array(number()))], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/pauseRequest.ts b/src/models/pauseRequest.ts index 9bc6544a..fcf17ff2 100644 --- a/src/models/pauseRequest.ts +++ b/src/models/pauseRequest.ts @@ -7,7 +7,7 @@ import { expandoObject, lazy, optional, Schema } from '../schema.js'; import { AutoResume, autoResumeSchema } from './autoResume.js'; -/** Allows to pause a Subscription */ +/** Allows you to pause a Subscription. */ export interface PauseRequest { hold?: AutoResume; [key: string]: unknown; diff --git a/src/models/paymentProfileAttributes.ts b/src/models/paymentProfileAttributes.ts index f585ef09..13252ce1 100644 --- a/src/models/paymentProfileAttributes.ts +++ b/src/models/paymentProfileAttributes.ts @@ -27,7 +27,7 @@ import { PaymentType, paymentTypeSchema } from './paymentType.js'; /** alias to credit_card_attributes */ export interface PaymentProfileAttributes { - /** (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt) */ + /** (Optional) Token received after sending billing information using Maxio.js (formerly Chargify.js). This token must be passed as a sole attribute of `payment_profile_attributes` (e.g., tok_9g6hw85pnpt6knmskpwp4ttt). */ chargifyToken?: string; id?: number; paymentType?: PaymentType; @@ -36,25 +36,25 @@ export interface PaymentProfileAttributes { /** (Optional) Last name on card or bank account. If omitted, the last_name from customer attributes will be used. */ lastName?: string; maskedCardNumber?: string; - /** The full credit card number (string representation, i.e. 5424000000000015) */ + /** The full credit card number (string representation, e.g., 5424000000000015) */ fullNumber?: string; - /** (Optional, used only for Subscription Import) If you know the card type (i.e. Visa, MC, etc) you may supply it here so that we may display the card type in the UI. */ + /** (Optional, used only for Subscription Import) If you know the card type (e.g., Visa, MC, etc.) you may supply it here so that we may display the card type in the UI. */ cardType?: CardType; - /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 */ + /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 */ expirationMonth?: PaymentProfileAttributesExpirationMonth; - /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 */ + /** (Optional when performing a Subscription Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 */ expirationYear?: PaymentProfileAttributesExpirationYear; - /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. */ + /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. */ billingAddress?: string; - /** (Optional) Second line of the customer’s billing address i.e. Apt. 100 */ + /** (Optional) Second line of the customer’s billing address, e.g., Apt. 100 */ billingAddress2?: string | null; - /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. */ + /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. */ billingCity?: string; - /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ + /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ billingState?: string; - /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ + /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ billingCountry?: string; - /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. */ + /** (Optional, may be required by your product configuration or gateway settings) The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. */ billingZip?: string; /** (Optional, used only for Subscription Import) The vault that stores the payment profile with the provided vault_token. */ currentVault?: AllVaults; @@ -70,7 +70,7 @@ export interface PaymentProfileAttributes { gatewayHandle?: string; /** (Optional, may be required by your gateway settings) The 3- or 4-digit Card Verification Value. This value is merely passed through to the payment gateway. */ cvv?: string; - /** (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (i.e. XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. */ + /** (Optional, used only for Subscription Import) If you have the last 4 digits of the credit card number, you may supply them here so that we may create a masked card number (e.g., XXXX-XXXX-XXXX-1234) for display in the UI. Last 4 digits are required for refunds in Auth.Net. */ lastFour?: string; [key: string]: unknown; } diff --git a/src/models/prepaidUsage.ts b/src/models/prepaidUsage.ts index dc68351f..ae61ab99 100644 --- a/src/models/prepaidUsage.ts +++ b/src/models/prepaidUsage.ts @@ -12,6 +12,14 @@ import { Schema, string, } from '../schema.js'; +import { + PrepaidUsageNewOverageUnitBalance, + prepaidUsageNewOverageUnitBalanceSchema, +} from './containers/prepaidUsageNewOverageUnitBalance.js'; +import { + PrepaidUsageNewUnitBalance, + prepaidUsageNewUnitBalanceSchema, +} from './containers/prepaidUsageNewUnitBalance.js'; import { PrepaidUsageAllocationDetail, prepaidUsageAllocationDetailSchema, @@ -20,8 +28,8 @@ import { export interface PrepaidUsage { previousUnitBalance: string; previousOverageUnitBalance: string; - newUnitBalance: number; - newOverageUnitBalance: number; + newUnitBalance: PrepaidUsageNewUnitBalance; + newOverageUnitBalance: PrepaidUsageNewOverageUnitBalance; usageQuantity: number; overageUsageQuantity: number; componentId: number; @@ -35,8 +43,11 @@ export const prepaidUsageSchema: Schema = lazy(() => expandoObject({ previousUnitBalance: ['previous_unit_balance', string()], previousOverageUnitBalance: ['previous_overage_unit_balance', string()], - newUnitBalance: ['new_unit_balance', number()], - newOverageUnitBalance: ['new_overage_unit_balance', number()], + newUnitBalance: ['new_unit_balance', prepaidUsageNewUnitBalanceSchema], + newOverageUnitBalance: [ + 'new_overage_unit_balance', + prepaidUsageNewOverageUnitBalanceSchema, + ], usageQuantity: ['usage_quantity', number()], overageUsageQuantity: ['overage_usage_quantity', number()], componentId: ['component_id', number()], diff --git a/src/models/prepaidUsageComponent.ts b/src/models/prepaidUsageComponent.ts index a6ee619a..4856e056 100644 --- a/src/models/prepaidUsageComponent.ts +++ b/src/models/prepaidUsageComponent.ts @@ -33,13 +33,13 @@ import { Price, priceSchema } from './price.js'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface PrepaidUsageComponent { - /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ + /** A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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 */ + /** The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item */ 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 '_'. */ + /** A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; @@ -52,16 +52,16 @@ export interface PrepaidUsageComponent { /** The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. */ downgradeCredit?: CreditType | null; 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 */ + /** 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. e.g., 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 AvaTax to tax based on locale. This attribute has a max length of 25 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; overagePricing: OveragePricing; - /** Boolean which controls whether or not remaining units should be rolled over to the next period */ + /** 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 */ + /** 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; @@ -69,6 +69,8 @@ export interface PrepaidUsageComponent { displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: number[]; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -117,5 +119,6 @@ export const prepaidUsageComponentSchema: Schema = lazy( 'public_signup_page_ids', optional(array(number())), ], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/price.ts b/src/models/price.ts index 30113214..279f7743 100644 --- a/src/models/price.ts +++ b/src/models/price.ts @@ -21,7 +21,7 @@ import { export interface Price { startingQuantity: PriceStartingQuantity; endingQuantity?: PriceEndingQuantity | null; - /** The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ + /** The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 */ unitPrice: PriceUnitPrice; [key: string]: unknown; } diff --git a/src/models/product.ts b/src/models/product.ts index 084b3ce0..c3abf4d0 100644 --- a/src/models/product.ts +++ b/src/models/product.ts @@ -35,11 +35,11 @@ export interface Product { handle?: string | null; /** The product description */ description?: string | null; - /** E.g. Internal ID or SKU Number */ + /** E.g., Internal ID or SKU Number */ accountingCode?: string | null; /** Deprecated value that can be ignored unless you have legacy hosted pages. For Public Signup Page users, read this attribute from under the signup page. */ requestCreditCard?: boolean; - /** A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval */ + /** A numerical interval for the length a subscription to this product will run before it expires. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. */ expirationInterval?: number | null; /** A string representing the expiration interval unit for this product, either month, day or never */ expirationIntervalUnit?: ExpirationIntervalUnit | null; @@ -49,7 +49,7 @@ export interface Product { updatedAt?: string; /** The product price, in integer cents */ priceInCents?: bigint; - /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days */ + /** The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product would renew every 30 days. */ interval?: number; /** A string representing the interval unit for this product, either month or day */ intervalUnit?: IntervalUnit; @@ -57,7 +57,7 @@ export interface Product { initialChargeInCents?: bigint | null; /** The price of the trial period for a subscription to this product, in integer cents. */ trialPriceInCents?: bigint | null; - /** A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval */ + /** A numerical interval for the length of the trial period of a subscription to this product. See the description of interval for a description of how this value is coupled with an interval unit to calculate the full interval. */ trialInterval?: number | null; /** A string representing the trial interval unit for this product, either month or day */ trialIntervalUnit?: IntervalUnit | null; @@ -72,7 +72,7 @@ export interface Product { initialChargeAfterTrial?: boolean | null; /** The version of the product */ versionNumber?: number; - /** The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update) */ + /** The parameters will append to the url after a successful account update. See [help documentation](https://help.chargify.com/products/product-editing.html#return-parameters-after-account-update). */ updateReturnParams?: string | null; productFamily?: ProductFamily; publicSignupPages?: PublicSignupPage[]; @@ -91,6 +91,8 @@ export interface Product { itemCategory?: string | null; productPricePointId?: number; productPricePointHandle?: string | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this product instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -157,5 +159,6 @@ export const productSchema: Schema = lazy(() => 'product_price_point_handle', optional(nullable(string())), ], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/productFamily.ts b/src/models/productFamily.ts index b2043ab9..bb9868c7 100644 --- a/src/models/productFamily.ts +++ b/src/models/productFamily.ts @@ -5,6 +5,7 @@ */ import { + boolean, expandoObject, nullable, number, @@ -19,6 +20,8 @@ export interface ProductFamily { handle?: string; accountingCode?: string | null; description?: string | null; + /** Whether surcharging applies to this product family. Only included on sites where surcharging is enabled. */ + surcharging?: boolean; createdAt?: string; updatedAt?: string; /** Timestamp indicating when this product family was archived. `null` if the product family is not archived. */ @@ -32,6 +35,7 @@ export const productFamilySchema: Schema = expandoObject({ handle: ['handle', optional(string())], accountingCode: ['accounting_code', optional(nullable(string()))], description: ['description', optional(nullable(string()))], + surcharging: ['surcharging', optional(boolean())], createdAt: ['created_at', optional(string())], updatedAt: ['updated_at', optional(string())], archivedAt: ['archived_at', optional(nullable(string()))], diff --git a/src/models/productPricePoint.ts b/src/models/productPricePoint.ts index 7ffca186..6e86216a 100644 --- a/src/models/productPricePoint.ts +++ b/src/models/productPricePoint.ts @@ -33,24 +33,24 @@ export interface ProductPricePoint { handle?: string | null; /** The product price point price, in integer cents */ priceInCents?: bigint; - /** The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days */ + /** The numerical interval. e.g., an interval of ‘30’ coupled with an interval_unit of day would mean this product price point would renew every 30 days. */ interval?: number; /** A string representing the interval unit for this product price point, either month or day */ intervalUnit?: IntervalUnit; /** The product price point trial price, in integer cents */ trialPriceInCents?: bigint | null; - /** The numerical trial interval. i.e. an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days */ + /** The numerical trial interval. e.g., an interval of ‘30’ coupled with a trial_interval_unit of day would mean this product price point trial would last 30 days. */ trialInterval?: number | null; /** A string representing the trial interval unit for this product price point, either month or day */ trialIntervalUnit?: IntervalUnit | null; - /** Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ + /** Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ trialType?: TrialType | null; /** reserved for future use */ introductoryOffer?: boolean | null; /** The product price point initial charge, in integer cents */ initialChargeInCents?: bigint | null; initialChargeAfterTrial?: boolean | null; - /** The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days */ + /** The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. */ expirationInterval?: number | null; /** A string representing the expiration interval unit for this product price point, either month, day or never */ expirationIntervalUnit?: ExpirationIntervalUnit | null; diff --git a/src/models/proformaInvoice.ts b/src/models/proformaInvoice.ts index 5be37917..3303aa65 100644 --- a/src/models/proformaInvoice.ts +++ b/src/models/proformaInvoice.ts @@ -74,7 +74,7 @@ export interface ProformaInvoice { paymentInstructions?: string; currency?: string; /** - * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: + * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * * "none": A normal invoice with no consolidation. * * "child": An invoice segment which has been combined into a consolidated invoice. * * "parent": A consolidated invoice, whose contents are composed of invoice segments. @@ -84,11 +84,11 @@ export interface ProformaInvoice { consolidationLevel?: InvoiceConsolidationLevel; productName?: string; productFamilyName?: string; - /** 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic */ + /** 'proforma' value is deprecated in favor of proforma_adhoc and proforma_automatic. */ role?: ProformaInvoiceRole; /** Information about the seller (merchant) listed on the masthead of the invoice. */ seller?: InvoiceSeller; - /** Information about the customer who is owner or recipient the invoiced subscription. */ + /** Information about the customer who is owner or recipient of the invoiced subscription. */ customer?: InvoiceCustomer; memo?: string; billingAddress?: InvoiceAddress; diff --git a/src/models/publicSignupPage.ts b/src/models/publicSignupPage.ts index d3f5db29..dde62710 100644 --- a/src/models/publicSignupPage.ts +++ b/src/models/publicSignupPage.ts @@ -16,11 +16,11 @@ import { export interface PublicSignupPage { /** The id of the signup page (public_signup_pages only) */ id?: number; - /** The url to which a customer will be returned after a successful signup (public_signup_pages only) */ + /** The url to which a customer will be returned after a successful signup (public_signup_pages only). */ returnUrl?: string | null; /** The params to be appended to the return_url (public_signup_pages only) */ returnParams?: string | null; - /** The url where the signup page can be viewed (public_signup_pages only) */ + /** The url where the signup page can be viewed (public_signup_pages only). */ url?: string; [key: string]: unknown; } diff --git a/src/models/qScope.ts b/src/models/qScope.ts new file mode 100644 index 00000000..d309eb01 --- /dev/null +++ b/src/models/qScope.ts @@ -0,0 +1,24 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { Schema, stringEnum } from '../schema.js'; + +/** + * Enum for QScope + */ +export enum QScope { + FullName = 'full_name', + FirstName = 'first_name', + LastName = 'last_name', + Organization = 'organization', + CustomerReference = 'customer_reference', + SubscriptionReference = 'subscription_reference', +} + +/** + * Schema for QScope + */ +export const qScopeSchema: Schema = stringEnum(QScope); diff --git a/src/models/quantityBasedComponent.ts b/src/models/quantityBasedComponent.ts index 5d86dff4..10562c2f 100644 --- a/src/models/quantityBasedComponent.ts +++ b/src/models/quantityBasedComponent.ts @@ -29,13 +29,13 @@ import { Price, priceSchema } from './price.js'; import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface QuantityBasedComponent { - /** A name for this component that is suitable for showing customers and displaying on billing statements, ie. "Minutes". */ + /** A name for this component that is suitable for showing customers and displaying on billing statements, e.g., "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 */ + /** “The name of the unit of measurement for the component. It should be singular since it will be automatically pluralized when necessary. e.g., “message”, which may then be shown as “5 messages” on a subscription’s component line-item.” */ 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 '_'. */ + /** A unique identifier for your use that can be used to retrieve this component in subsequent requests. Must start with a letter or number and may only contain lowercase letters, numbers, or the characters '.', ':', '-', or '_'. */ handle?: string; /** Boolean flag describing whether a component is taxable or not. */ taxable?: boolean; @@ -48,7 +48,7 @@ export interface QuantityBasedComponent { /** The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. */ 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 */ + /** 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. e.g., 1.00 or 0.0012 or 0.00000065 */ unitPrice?: QuantityBasedComponentUnitPrice; /** A string representing the tax code related to the component type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ taxCode?: string; @@ -58,10 +58,12 @@ export interface QuantityBasedComponent { displayOnHostedPage?: boolean; allowFractionalQuantities?: boolean; publicSignupPageIds?: 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -105,5 +107,6 @@ export const quantityBasedComponentSchema: Schema = lazy ], interval: ['interval', optional(number())], intervalUnit: ['interval_unit', optional(nullable(intervalUnitSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }) ); diff --git a/src/models/reactivateSubscriptionRequest.ts b/src/models/reactivateSubscriptionRequest.ts index 3444efe0..9ec5b031 100644 --- a/src/models/reactivateSubscriptionRequest.ts +++ b/src/models/reactivateSubscriptionRequest.ts @@ -22,7 +22,7 @@ import { } from './reactivationBilling.js'; export interface ReactivateSubscriptionRequest { - /** These values are only applicable to subscriptions using calendar billing */ + /** These values are only applicable to subscriptions using calendar billing. */ calendarBilling?: ReactivationBilling; /** If `true` is sent, the reactivated Subscription will include a trial if one is available. If `false` is sent, the trial period will be ignored. */ includeTrial?: boolean; diff --git a/src/models/reactivationBilling.ts b/src/models/reactivationBilling.ts index 14d6402a..79c48055 100644 --- a/src/models/reactivationBilling.ts +++ b/src/models/reactivationBilling.ts @@ -10,9 +10,9 @@ import { reactivationChargeSchema, } from './reactivationCharge.js'; -/** These values are only applicable to subscriptions using calendar billing */ +/** These values are only applicable to subscriptions using calendar billing. */ export interface ReactivationBilling { - /** You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted for to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal */ + /** You may choose how to handle the reactivation charge for that subscription: 1) `prorated` A prorated charge for the product price will be attempted to complete the period 2) `immediate` A full-price charge for the product price will be attempted immediately 3) `delayed` A full-price charge for the product price will be attempted at the next renewal. */ reactivationCharge?: ReactivationCharge; [key: string]: unknown; } diff --git a/src/models/refundConsolidatedInvoice.ts b/src/models/refundConsolidatedInvoice.ts index 26556b81..82e2fba3 100644 --- a/src/models/refundConsolidatedInvoice.ts +++ b/src/models/refundConsolidatedInvoice.ts @@ -18,7 +18,7 @@ import { refundConsolidatedInvoiceSegmentUidsSchema, } from './containers/refundConsolidatedInvoiceSegmentUids.js'; -/** Refund consolidated invoice */ +/** Refund consolidated invoice. */ export interface RefundConsolidatedInvoice { /** A description for the refund */ memo: string; diff --git a/src/models/refundInvoice.ts b/src/models/refundInvoice.ts index 8c375cb8..dcbdcf9b 100644 --- a/src/models/refundInvoice.ts +++ b/src/models/refundInvoice.ts @@ -25,7 +25,7 @@ export interface RefundInvoice { external?: boolean; /** If set to true, creates credit and applies it to an invoice. Defaults to `false`. */ applyCredit?: boolean; - /** If `apply_credit` set to false and refunding full amount, if `void_invoice` set to true, invoice will be voided after refund. Defaults to `false`. */ + /** If `apply_credit` is set to false and refunding full amount, if `void_invoice` is set to true, invoice will be voided after refund. Defaults to `false`. */ voidInvoice?: boolean; [key: string]: unknown; } diff --git a/src/models/refundInvoiceEventData.ts b/src/models/refundInvoiceEventData.ts index 0d22ddd6..a5af4040 100644 --- a/src/models/refundInvoiceEventData.ts +++ b/src/models/refundInvoiceEventData.ts @@ -24,7 +24,7 @@ export interface RefundInvoiceEventData { /** If true, credit was created and applied it to the invoice. */ applyCredit: boolean; /** - * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: + * Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * * "none": A normal invoice with no consolidation. * * "child": An invoice segment which has been combined into a consolidated invoice. * * "parent": A consolidated invoice, whose contents are composed of invoice segments. diff --git a/src/models/register.ts b/src/models/register.ts index 08b727c6..c19af3c2 100644 --- a/src/models/register.ts +++ b/src/models/register.ts @@ -10,7 +10,7 @@ export interface Register { id?: number; maxioId?: string; name?: string; - /** The ISO 4217 currency code (3 character string) representing the currency of invoice transaction. */ + /** The ISO 4217 currency code (3 character string) representing the currency of an invoice transaction. */ currencyCode?: string; [key: string]: unknown; } diff --git a/src/models/renewalPreviewRequest.ts b/src/models/renewalPreviewRequest.ts index fae1c4cf..185ecca3 100644 --- a/src/models/renewalPreviewRequest.ts +++ b/src/models/renewalPreviewRequest.ts @@ -11,7 +11,7 @@ import { } from './renewalPreviewComponent.js'; export interface RenewalPreviewRequest { - /** An optional array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). */ + /** (Optional) Array of component definitions to preview. Providing any component definitions here will override the actual components on the subscription (and their quantities), and the billing preview will contain only these components (in addition to any product base fees). */ components?: RenewalPreviewComponent[]; [key: string]: unknown; } diff --git a/src/models/scheduledRenewalComponentCustomPrice.ts b/src/models/scheduledRenewalComponentCustomPrice.ts index 860dc25a..7824478a 100644 --- a/src/models/scheduledRenewalComponentCustomPrice.ts +++ b/src/models/scheduledRenewalComponentCustomPrice.ts @@ -19,7 +19,7 @@ import { PricingScheme, pricingSchemeSchema } from './pricingScheme.js'; export interface ScheduledRenewalComponentCustomPrice { /** Whether or not the price point includes tax */ taxIncluded?: boolean; - /** Omit for On/Off components */ + /** Omit for On/Off components. */ pricingScheme: PricingScheme; /** On/off components only need one price bracket starting at 1. */ prices: Price[]; diff --git a/src/models/scheduledRenewalItemRequestBodyComponent.ts b/src/models/scheduledRenewalItemRequestBodyComponent.ts index b4f976fc..f20dd2d8 100644 --- a/src/models/scheduledRenewalItemRequestBodyComponent.ts +++ b/src/models/scheduledRenewalItemRequestBodyComponent.ts @@ -24,7 +24,7 @@ export interface ScheduledRenewalItemRequestBodyComponent { itemId: number; /** Price point identifier. */ pricePointId?: number; - /** Optional quantity for the item. */ + /** (Optional) Quantity for the item. */ quantity?: number; /** Custom pricing for a component within a scheduled renewal. */ customPrice?: ScheduledRenewalComponentCustomPrice; diff --git a/src/models/scheduledRenewalItemRequestBodyProduct.ts b/src/models/scheduledRenewalItemRequestBodyProduct.ts index 09ec0370..60abd662 100644 --- a/src/models/scheduledRenewalItemRequestBodyProduct.ts +++ b/src/models/scheduledRenewalItemRequestBodyProduct.ts @@ -24,7 +24,7 @@ export interface ScheduledRenewalItemRequestBodyProduct { itemId: number; /** Price point identifier. */ pricePointId?: number; - /** Optional quantity for the item. */ + /** (Optional) Quantity for the item. */ quantity?: number; /** Custom pricing for a product within a scheduled renewal. */ customPrice?: ScheduledRenewalProductPricePoint; diff --git a/src/models/scheduledRenewalProductPricePoint.ts b/src/models/scheduledRenewalProductPricePoint.ts index 993ce068..61aa174a 100644 --- a/src/models/scheduledRenewalProductPricePoint.ts +++ b/src/models/scheduledRenewalProductPricePoint.ts @@ -45,7 +45,7 @@ export interface ScheduledRenewalProductPricePoint { taxIncluded?: boolean; /** The product price point initial charge, in integer cents. */ initialChargeInCents?: bigint; - /** The numerical expiration interval. i.e. an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. */ + /** The numerical expiration interval. e.g., an expiration_interval of ‘30’ coupled with an expiration_interval_unit of day would mean this product price point would expire after 30 days. */ expirationInterval?: number; /** A string representing the expiration interval unit for this product price point, either month, day or never */ expirationIntervalUnit?: ExpirationIntervalUnit | null; diff --git a/src/models/serviceCredit1.ts b/src/models/serviceCredit1.ts index 09d97029..fee6aa2e 100644 --- a/src/models/serviceCredit1.ts +++ b/src/models/serviceCredit1.ts @@ -28,7 +28,7 @@ export interface ServiceCredit1 { entryType?: ServiceCreditType; /** The memo attached to the entry */ memo?: string; - /** The invoice uid associated with the entry. Only present for debit entries */ + /** The invoice uid associated with the entry. Only present for debit entries. */ invoiceUid?: string | null; /** The remaining balance for the entry */ remainingBalanceInCents?: bigint; diff --git a/src/models/subscription.ts b/src/models/subscription.ts index cdfef020..88f69d31 100644 --- a/src/models/subscription.ts +++ b/src/models/subscription.ts @@ -82,19 +82,19 @@ export interface Subscription { balanceInCents?: bigint; /** Gives the total revenue from the subscription in the number of cents. */ totalRevenueInCents?: bigint; - /** (Added Nov 5 2013) The recurring amount of the product (and version),currently subscribed. NOTE: this may differ from the current price of,the product, if you’ve changed the price of the product but haven’t,moved this subscription to a newer version. */ + /** (Added Nov 5 2013) The recurring amount of the product (and version), currently subscribed. NOTE: this may differ from the current price of the product, if you’ve changed the price of the product but haven’t moved this subscription to a newer version. */ productPriceInCents?: bigint; /** The version of the product for the subscription. Note that this is a deprecated field kept for backwards-compatibility. */ productVersionNumber?: number; - /** Timestamp relating to the end of the current (recurring) period (i.e.,when the next regularly scheduled attempted charge will occur) */ + /** Timestamp relating to the end of the current (recurring) period (i.e., when the next regularly scheduled attempted charge will occur) */ currentPeriodEndsAt?: string | null; - /** Timestamp that indicates when capture of payment will be tried or,retried. This value will usually track the current_period_ends_at, but,will diverge if a renewal payment fails and must be retried. In that,case, the current_period_ends_at will advance to the end of the next,period (time doesn’t stop because a payment was missed) but the,next_assessment_at will be scheduled for the auto-retry time (i.e. 24,hours in the future, in some cases) */ + /** Timestamp that indicates when capture of payment will be tried or retried. This value will usually track the current_period_ends_at, but will diverge if a renewal payment fails and must be retried. In that case, the current_period_ends_at will advance to the end of the next period (time doesn’t stop because a payment was missed) but the next_assessment_at will be scheduled for the auto-retry time (e.g., 24 hours in the future, in some cases). */ nextAssessmentAt?: string | null; /** Timestamp for when the trial period (if any) began */ trialStartedAt?: string | null; /** Timestamp for when the trial period (if any) ended */ trialEndedAt?: string | null; - /** Timestamp for when the subscription began (i.e. when it came out of trial, or when it began in the case of no trial) */ + /** Timestamp for when the subscription began (i.e., when it came out of trial, or when it began in the case of no trial) */ activatedAt?: string | null; /** Timestamp giving the expiration date of this subscription (if any) */ expiresAt?: string | null; @@ -112,11 +112,11 @@ export interface Subscription { canceledAt?: string | null; /** Timestamp relating to the start of the current (recurring) period */ currentPeriodStartedAt?: string | null; - /** Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state) */ + /** Only valid for webhook payloads The previous state for webhooks that have indicated a change in state. For normal API calls, this will always be the same as the state (current state). */ previousState?: SubscriptionState; /** The ID of the transaction that generated the revenue */ signupPaymentId?: number; - /** The revenue, formatted as a string of decimal separated dollars and,cents, from the subscription signup ($50.00 would be formatted as,50.00) */ + /** The revenue, formatted as a string of decimal separated dollars and cents, from the subscription signup ($50.00 would be formatted as 50.00) */ signupRevenue?: string; /** Timestamp for when the subscription is currently set to cancel. */ delayedCancelAt?: string | null; @@ -143,7 +143,7 @@ export interface Subscription { couponUseCount?: number | null; /** (deprecated) How many times the subscription's single coupon may be used. This field has no replacement for multiple coupons. */ couponUsesAllowed?: number | null; - /** The churn reason code associated to a cancelled subscription. */ + /** The churn reason code associated to a canceled subscription. */ reasonCode?: string | null; /** The date the subscription is scheduled to automatically resume from the on_hold state. */ automaticallyResumeAt?: string | null; @@ -170,14 +170,14 @@ export interface Subscription { netTerms?: number | null; /** For European sites subject to PSD2 and using 3D Secure, this can be used to reference a previous transaction for the customer. This will ensure the card will be charged successfully at renewal. */ storedCredentialTransactionId?: number | null; - /** The reference value (provided by your app) for the subscription istelf. */ + /** The reference value (provided by your app) for the subscription itself. */ reference?: string | null; /** The timestamp of the most recent on hold action. */ onHoldAt?: string | null; - /** Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled */ + /** Boolean representing whether the subscription is prepaid and currently in dunning. Only returned for Relationship Invoicing sites with the feature enabled. */ prepaidDunning?: boolean; /** - * Additional coupon data. To use this data you also have to include the following param in the request`include[]=coupons`. + * Additional coupon data. To use this data you also have to include the following param in the request: `include[]=coupons`. * Only in Read Subscription Endpoint. */ coupons?: SubscriptionIncludedCoupon[]; diff --git a/src/models/subscriptionComponent.ts b/src/models/subscriptionComponent.ts index fdcd7b77..feaf63cb 100644 --- a/src/models/subscriptionComponent.ts +++ b/src/models/subscriptionComponent.ts @@ -20,6 +20,10 @@ import { SubscriptionComponentAllocatedQuantity, subscriptionComponentAllocatedQuantitySchema, } from './containers/subscriptionComponentAllocatedQuantity.js'; +import { + SubscriptionComponentUnitBalance, + subscriptionComponentUnitBalanceSchema, +} from './containers/subscriptionComponentUnitBalance.js'; import { CreditType, creditTypeSchema } from './creditType.js'; import { HistoricUsage, historicUsageSchema } from './historicUsage.js'; import { IntervalUnit, intervalUnitSchema } from './intervalUnit.js'; @@ -36,9 +40,9 @@ export interface SubscriptionComponent { /** A handle for the component type */ kind?: ComponentKind; unitName?: string; - /** (for on/off components) indicates if the component is enabled for the subscription */ + /** (for on/off components) indicates if the component is enabled for the subscription. */ enabled?: boolean; - unitBalance?: number; + unitBalance?: SubscriptionComponentUnitBalance; currency?: string; /** For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off. */ allocatedQuantity?: SubscriptionComponentAllocatedQuantity; @@ -63,11 +67,11 @@ export interface SubscriptionComponent { useSiteExchangeRate?: boolean | null; description?: string | null; allowFractionalQuantities?: boolean; - /** An optional object, will be returned if provided `include=subscription` query param. */ + /** (Optional) Object that will be returned if the `include=subscription` query param is provided. */ subscription?: SubscriptionComponentSubscription; historicUsages?: HistoricUsage[]; displayOnHostedPage?: boolean; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; @@ -82,7 +86,10 @@ export const subscriptionComponentSchema: Schema = lazy( kind: ['kind', optional(componentKindSchema)], unitName: ['unit_name', optional(string())], enabled: ['enabled', optional(boolean())], - unitBalance: ['unit_balance', optional(number())], + unitBalance: [ + 'unit_balance', + optional(subscriptionComponentUnitBalanceSchema), + ], currency: ['currency', optional(string())], allocatedQuantity: [ 'allocated_quantity', diff --git a/src/models/subscriptionComponentSubscription.ts b/src/models/subscriptionComponentSubscription.ts index ff619251..deafee16 100644 --- a/src/models/subscriptionComponentSubscription.ts +++ b/src/models/subscriptionComponentSubscription.ts @@ -10,7 +10,7 @@ import { subscriptionStateSchema, } from './subscriptionState.js'; -/** An optional object, will be returned if provided `include=subscription` query param. */ +/** (Optional) Object that will be returned if the `include=subscription` query param is provided. */ export interface SubscriptionComponentSubscription { /** * The state of a subscription. diff --git a/src/models/subscriptionCustomPrice.ts b/src/models/subscriptionCustomPrice.ts index 7f8d0686..6b59f333 100644 --- a/src/models/subscriptionCustomPrice.ts +++ b/src/models/subscriptionCustomPrice.ts @@ -62,7 +62,7 @@ export interface SubscriptionCustomPrice { trialInterval?: SubscriptionCustomPriceTrialInterval; /** (Optional) */ trialIntervalUnit?: IntervalUnit; - /** Indicates how a trial is handled when the trail period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ + /** Indicates how a trial is handled when the trial period ends and there is no credit card on file. For `no_obligation`, the subscription transitions to a Trial Ended state. Maxio will not send any emails or statements. For `payment_expected`, the subscription transitions to a Past Due state. Maxio will send normal dunning emails and statements according to your other settings. */ trialType?: TrialType | null; /** (Optional) */ initialChargeInCents?: SubscriptionCustomPriceInitialChargeInCents; diff --git a/src/models/subscriptionGroupBankAccount.ts b/src/models/subscriptionGroupBankAccount.ts index b53843ed..21d27849 100644 --- a/src/models/subscriptionGroupBankAccount.ts +++ b/src/models/subscriptionGroupBankAccount.ts @@ -21,11 +21,11 @@ export interface SubscriptionGroupBankAccount { bankName?: string; /** (Required when creating a subscription with ACH. Required when creating a subscription with GoCardless and bank_iban is blank) The customerʼs bank account number */ bankAccountNumber?: string; - /** (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless). The routing number of the bank. It becomes bank_code while passing via GoCardless API */ + /** (Required when creating a subscription with ACH. Optional when creating a subscription with GoCardless.) The routing number of the bank. It becomes bank_code while passing via GoCardless API. */ bankRoutingNumber?: string; - /** (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided */ + /** (Optional when creating a subscription with GoCardless). International Bank Account Number. Alternatively, local bank details can be provided. */ bankIban?: string; - /** (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided */ + /** (Optional when creating a subscription with GoCardless) Branch code. Alternatively, an IBAN can be provided. */ bankBranchCode?: string; /** Defaults to checking */ bankAccountType?: BankAccountType; diff --git a/src/models/subscriptionGroupSignupItem.ts b/src/models/subscriptionGroupSignupItem.ts index 286ecafc..5a88f3c5 100644 --- a/src/models/subscriptionGroupSignupItem.ts +++ b/src/models/subscriptionGroupSignupItem.ts @@ -34,9 +34,9 @@ export interface SubscriptionGroupSignupItem { productPricePointId?: number; /** The user-friendly API handle of a product's particular price point. */ productPricePointHandle?: string; - /** Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:` */ + /** Use in place of passing product and component information to set up the subscription with an existing offer. May be either the Chargify ID of the offer or its handle prefixed with `handle:`. */ offerId?: number; - /** The reference value (provided by your app) for the subscription itelf. */ + /** The reference value (provided by your app) for the subscription itself. */ reference?: string; /** One of the subscriptions must be marked as primary in the group. */ primary?: boolean; @@ -47,7 +47,7 @@ export interface SubscriptionGroupSignupItem { components?: SubscriptionGroupSignupComponent[]; /** (Optional) Used in place of `product_price_point_id` to define a custom price point unique to the subscription. A subscription can have up to 30 custom price points. Exceeding this limit will result in an API error. */ customPrice?: SubscriptionCustomPrice; - /** (Optional). Cannot be used when also specifying next_billing_at */ + /** (Optional). Cannot be used when also specifying next_billing_at. */ calendarBilling?: CalendarBilling; /** (Optional) A set of key/value pairs representing custom fields and their values. Metafields will be created “on-the-fly” in your site for a given key, if they have not been created yet. */ metafields?: Record; diff --git a/src/models/subscriptionListInclude.ts b/src/models/subscriptionListInclude.ts index 553f04b8..0edf6325 100644 --- a/src/models/subscriptionListInclude.ts +++ b/src/models/subscriptionListInclude.ts @@ -11,6 +11,9 @@ import { Schema, stringEnum } from '../schema.js'; */ export enum SubscriptionListInclude { SelfServicePageToken = 'self_service_page_token', + CurrentAccountBalanceInCents = 'current_account_balance_in_cents', + CurrentBillingAmount = 'current_billing_amount', + Coupons = 'coupons', } /** diff --git a/src/models/subscriptionProductChange.ts b/src/models/subscriptionProductChange.ts index 9db38a29..ee19a002 100644 --- a/src/models/subscriptionProductChange.ts +++ b/src/models/subscriptionProductChange.ts @@ -4,11 +4,23 @@ * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). */ -import { expandoObject, number, Schema } from '../schema.js'; +import { + expandoObject, + nullable, + number, + optional, + Schema, + string, +} from '../schema.js'; +/** Event data for both `subscription_product_change` and `subscription_product_change_scheduled`. The price point and `effective_at` fields are only populated for scheduled changes. */ export interface SubscriptionProductChange { previousProductId: number; newProductId: number; + previousProductPricePointId?: number | null; + newProductPricePointId?: number | null; + /** When the scheduled product change takes effect (the subscription's next renewal). Only sent for `subscription_product_change_scheduled`. */ + effectiveAt?: string | null; [key: string]: unknown; } @@ -16,5 +28,14 @@ export const subscriptionProductChangeSchema: Schema { previousProductId: ['previous_product_id', number()], newProductId: ['new_product_id', number()], + previousProductPricePointId: [ + 'previous_product_price_point_id', + optional(nullable(number())), + ], + newProductPricePointId: [ + 'new_product_price_point_id', + optional(nullable(number())), + ], + effectiveAt: ['effective_at', optional(nullable(string()))], } ); diff --git a/src/models/subscriptionStateFilter.ts b/src/models/subscriptionStateFilter.ts index 4536f29f..2c158934 100644 --- a/src/models/subscriptionStateFilter.ts +++ b/src/models/subscriptionStateFilter.ts @@ -14,10 +14,15 @@ export enum SubscriptionStateFilter { Canceled = 'canceled', Expired = 'expired', ExpiredCards = 'expired_cards', + EnumExpiredCardsLiveSubscriptions = 'expired_cards_(live_subscriptions)', + EnumExpiredCardsAllSubscriptions = 'expired_cards_(all_subscriptions)', OnHold = 'on_hold', + AwaitingSignup = 'awaiting_signup', + AwaitingSignupDate = 'awaiting_signup_date', PastDue = 'past_due', PendingCancellation = 'pending_cancellation', PendingRenewal = 'pending_renewal', + PrepaidDunning = 'prepaid_dunning', Suspended = 'suspended', TrialEnded = 'trial_ended', Trialing = 'trialing', diff --git a/src/models/updateComponent.ts b/src/models/updateComponent.ts index f98a7179..c3115515 100644 --- a/src/models/updateComponent.ts +++ b/src/models/updateComponent.ts @@ -17,7 +17,7 @@ import { ItemCategory, itemCategorySchema } from './itemCategory.js'; export interface UpdateComponent { handle?: string; - /** The name of the Component, suitable for display on statements. i.e. Text Messages. */ + /** The name of the Component, suitable for display on statements. e.g., Text Messages. */ name?: string; /** The description of the component. */ description?: string | null; @@ -31,6 +31,8 @@ export interface UpdateComponent { displayOnHostedPage?: boolean; /** The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. */ upgradeCharge?: CreditType | null; + /** (Optional) Custom UNSPSC commodity code for Level 3/CEDP payment data. When set, this value is sent as the commodity code on invoice line items for this component instead of the default derived from item_category. */ + unspscCode?: string | null; [key: string]: unknown; } @@ -44,4 +46,5 @@ export const updateComponentSchema: Schema = expandoObject({ itemCategory: ['item_category', optional(nullable(itemCategorySchema))], displayOnHostedPage: ['display_on_hosted_page', optional(boolean())], upgradeCharge: ['upgrade_charge', optional(nullable(creditTypeSchema))], + unspscCode: ['unspsc_code', optional(nullable(string()))], }); diff --git a/src/models/updateComponentPricePoint.ts b/src/models/updateComponentPricePoint.ts index 2e64fa4a..5e04b173 100644 --- a/src/models/updateComponentPricePoint.ts +++ b/src/models/updateComponentPricePoint.ts @@ -28,7 +28,7 @@ export interface UpdateComponentPricePoint { useSiteExchangeRate?: boolean; /** Whether or not the price point includes tax */ taxIncluded?: boolean; - /** 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. */ + /** The numerical interval. e.g., 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. */ interval?: number; /** 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. */ intervalUnit?: IntervalUnit | null; diff --git a/src/models/updateCustomer.ts b/src/models/updateCustomer.ts index eeea54ba..a9cde660 100644 --- a/src/models/updateCustomer.ts +++ b/src/models/updateCustomer.ts @@ -32,12 +32,16 @@ export interface UpdateCustomer { locale?: string; vatNumber?: string; taxExempt?: boolean; + /** Whether surcharging is enabled for the customer. Only applied on sites where surcharging control is enabled. */ + surcharging?: boolean; taxExemptReason?: string; parentId?: number | null; - /** Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway */ + /** Is the customer verified to use ACH as a payment method. Available only on the Authorize.Net gateway. */ verified?: boolean | null; /** The Salesforce ID of the customer */ salesforceId?: string | null; + /** The ID of the Branding Theme assigned to this customer as the customer's default Branding Theme. This customer-level Branding Theme is used when a subscription does not have its own subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. */ + brandingThemeId?: number | null; [key: string]: unknown; } @@ -58,8 +62,10 @@ export const updateCustomerSchema: Schema = expandoObject({ locale: ['locale', optional(string())], vatNumber: ['vat_number', optional(string())], taxExempt: ['tax_exempt', optional(boolean())], + surcharging: ['surcharging', optional(boolean())], taxExemptReason: ['tax_exempt_reason', optional(string())], parentId: ['parent_id', optional(nullable(number()))], verified: ['verified', optional(nullable(boolean()))], salesforceId: ['salesforce_id', optional(nullable(string()))], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], }); diff --git a/src/models/updateInvoice.ts b/src/models/updateInvoice.ts new file mode 100644 index 00000000..f1261ff0 --- /dev/null +++ b/src/models/updateInvoice.ts @@ -0,0 +1,64 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + array, + expandoObject, + lazy, + number, + optional, + Schema, + string, +} from '../schema.js'; +import { + CreateInvoiceAddress, + createInvoiceAddressSchema, +} from './createInvoiceAddress.js'; +import { + CreateInvoiceCoupon, + createInvoiceCouponSchema, +} from './createInvoiceCoupon.js'; +import { + UpdateInvoiceItem, + updateInvoiceItemSchema, +} from './updateInvoiceItem.js'; + +/** Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. */ +export interface UpdateInvoice { + /** Line item changes to apply. Line items without a `uid` are added, line items with a `uid` are updated, and line items with a `uid` and `_destroy` set to `true` are removed. Existing line items not referenced in the array remain unchanged. */ + lineItems?: UpdateInvoiceItem[]; + /** New issue date for the invoice (format YYYY-MM-DD). This date is interpreted and validated in your site's time zone. It must be today or a date in the past — future dates are not accepted. The due date is recalculated from the issue date and net terms. */ + issueDate?: string; + /** Number of days after the issue date on which the invoice is due. The due date is recalculated when net terms or the issue date change. */ + netTerms?: number; + /** Custom payment instructions displayed on the invoice. */ + paymentInstructions?: string; + /** A custom memo displayed on the invoice. */ + memo?: string; + /** Replaces the seller address on the invoice */ + sellerAddress?: CreateInvoiceAddress; + /** Replaces the billing address on the invoice */ + billingAddress?: CreateInvoiceAddress; + /** Replaces the shipping address on the invoice */ + shippingAddress?: CreateInvoiceAddress; + /** When present, replaces all discounts currently applied to the invoice. Send an empty array to remove all discounts. */ + coupons?: CreateInvoiceCoupon[]; + [key: string]: unknown; +} + +export const updateInvoiceSchema: Schema = lazy(() => + expandoObject({ + lineItems: ['line_items', optional(array(updateInvoiceItemSchema))], + issueDate: ['issue_date', optional(string())], + netTerms: ['net_terms', optional(number())], + paymentInstructions: ['payment_instructions', optional(string())], + memo: ['memo', optional(string())], + sellerAddress: ['seller_address', optional(createInvoiceAddressSchema)], + billingAddress: ['billing_address', optional(createInvoiceAddressSchema)], + shippingAddress: ['shipping_address', optional(createInvoiceAddressSchema)], + coupons: ['coupons', optional(array(createInvoiceCouponSchema))], + }) +); diff --git a/src/models/updateInvoiceItem.ts b/src/models/updateInvoiceItem.ts new file mode 100644 index 00000000..707f12e6 --- /dev/null +++ b/src/models/updateInvoiceItem.ts @@ -0,0 +1,93 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { + boolean, + expandoObject, + lazy, + optional, + Schema, + string, +} from '../schema.js'; +import { + UpdateInvoiceItemComponentId, + updateInvoiceItemComponentIdSchema, +} from './containers/updateInvoiceItemComponentId.js'; +import { + UpdateInvoiceItemPricePointId, + updateInvoiceItemPricePointIdSchema, +} from './containers/updateInvoiceItemPricePointId.js'; +import { + UpdateInvoiceItemProductId, + updateInvoiceItemProductIdSchema, +} from './containers/updateInvoiceItemProductId.js'; +import { + UpdateInvoiceItemProductPricePointId, + updateInvoiceItemProductPricePointIdSchema, +} from './containers/updateInvoiceItemProductPricePointId.js'; +import { + UpdateInvoiceItemQuantity, + updateInvoiceItemQuantitySchema, +} from './containers/updateInvoiceItemQuantity.js'; +import { + UpdateInvoiceItemUnitPrice, + updateInvoiceItemUnitPriceSchema, +} from './containers/updateInvoiceItemUnitPrice.js'; + +/** A line item change for a draft ad hoc invoice. Supports the same attributes as line items on invoice creation, plus `uid` and `_destroy` for updating or removing existing line items. */ +export interface UpdateInvoiceItem { + title?: string; + /** The quantity can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ + quantity?: UpdateInvoiceItemQuantity; + /** The unit_price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065. If you submit a value with more than 8 decimal places, we will round it down to the 8th decimal place. */ + unitPrice?: UpdateInvoiceItemUnitPrice; + /** Set to true to automatically calculate taxes. Site must be configured to use and calculate taxes. If using AvaTax, a tax_code parameter must also be sent. */ + taxable?: boolean; + /** A string representing the tax code related to the product type. This is especially important when using AvaTax to tax based on locale. This attribute has a max length of 25 characters. */ + taxCode?: string; + /** YYYY-MM-DD */ + periodRangeStart?: string; + /** YYYY-MM-DD */ + periodRangeEnd?: string; + /** Product handle or product id. */ + productId?: UpdateInvoiceItemProductId; + /** Component handle or component id. */ + componentId?: UpdateInvoiceItemComponentId; + /** Price point handle or id. For component. */ + pricePointId?: UpdateInvoiceItemPricePointId; + productPricePointId?: UpdateInvoiceItemProductPricePointId; + description?: string; + /** Unique identifier of an existing line item on the invoice. When provided, the matching line item is updated with the submitted attributes. When omitted, a new line item is added to the invoice. */ + uid?: string; + /** Set to `true` together with `uid` to remove the matching line item from the invoice. Line items not referenced in the request remain unchanged. */ + destroy?: boolean; + [key: string]: unknown; +} + +export const updateInvoiceItemSchema: Schema = lazy(() => + expandoObject({ + title: ['title', optional(string())], + quantity: ['quantity', optional(updateInvoiceItemQuantitySchema)], + unitPrice: ['unit_price', optional(updateInvoiceItemUnitPriceSchema)], + taxable: ['taxable', optional(boolean())], + taxCode: ['tax_code', optional(string())], + periodRangeStart: ['period_range_start', optional(string())], + periodRangeEnd: ['period_range_end', optional(string())], + productId: ['product_id', optional(updateInvoiceItemProductIdSchema)], + componentId: ['component_id', optional(updateInvoiceItemComponentIdSchema)], + pricePointId: [ + 'price_point_id', + optional(updateInvoiceItemPricePointIdSchema), + ], + productPricePointId: [ + 'product_price_point_id', + optional(updateInvoiceItemProductPricePointIdSchema), + ], + description: ['description', optional(string())], + uid: ['uid', optional(string())], + destroy: ['_destroy', optional(boolean())], + }) +); diff --git a/src/models/updateInvoiceRequest.ts b/src/models/updateInvoiceRequest.ts new file mode 100644 index 00000000..323114d7 --- /dev/null +++ b/src/models/updateInvoiceRequest.ts @@ -0,0 +1,19 @@ +/** + * AdvancedBilling + * + * This file was automatically generated for Maxio by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { expandoObject, lazy, Schema } from '../schema.js'; +import { UpdateInvoice, updateInvoiceSchema } from './updateInvoice.js'; + +/** Request payload for updating a draft ad hoc invoice. */ +export interface UpdateInvoiceRequest { + /** Attributes of a draft ad hoc invoice which can be updated. Only the submitted attributes are changed. */ + invoice: UpdateInvoice; + [key: string]: unknown; +} + +export const updateInvoiceRequestSchema: Schema = lazy( + () => expandoObject({ invoice: ['invoice', updateInvoiceSchema] }) +); diff --git a/src/models/updateMetafield.ts b/src/models/updateMetafield.ts index cdae5f24..77b63180 100644 --- a/src/models/updateMetafield.ts +++ b/src/models/updateMetafield.ts @@ -20,7 +20,7 @@ export interface UpdateMetafield { name?: string; /** Warning: When updating a metafield's scope attribute, all scope attributes must be passed. Partially complete scope attributes will override the existing settings. */ scope?: MetafieldScope; - /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ + /** Indicates the type of metafield. A text metafield allows any string value. Dropdown and radio metafields have a set of values that can be selected. Defaults to 'text'. */ inputType?: MetafieldInput; /** Only applicable when input_type is radio or dropdown. */ mEnum?: string[]; diff --git a/src/models/updatePaymentProfile.ts b/src/models/updatePaymentProfile.ts index aaaa7e6d..479046c7 100644 --- a/src/models/updatePaymentProfile.ts +++ b/src/models/updatePaymentProfile.ts @@ -23,23 +23,23 @@ export interface UpdatePaymentProfile { fullNumber?: string; /** The type of card used. */ cardType?: CardType; - /** (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, i.e. 5 */ + /** (Optional when performing an Import via vault_token, required otherwise) The 1- or 2-digit credit card expiration month, as an integer or string, e.g., 5 */ expirationMonth?: string; - /** (Optional when performing a Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, i.e. 2012 */ + /** (Optional when performing an Import via vault_token, required otherwise) The 4-digit credit card expiration year, as an integer or string, e.g., 2012 */ expirationYear?: string; /** The vault that stores the payment profile with the provided `vault_token`. Use `bogus` for testing. */ currentVault?: AllVaults; - /** The credit card or bank account billing street address (i.e. 123 Main St.). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing street address (e.g., 123 Main St.). This value is merely passed through to the payment gateway. */ billingAddress?: string; - /** The credit card or bank account billing address city (i.e. “Boston”). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing address city (e.g., “Boston”). This value is merely passed through to the payment gateway. */ billingCity?: string; - /** The credit card or bank account billing address state (i.e. MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ + /** The credit card or bank account billing address state (e.g., MA). This value is merely passed through to the payment gateway. This must conform to the [ISO_3166-1](https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes) in order to be valid for tax locale purposes. */ billingState?: string; - /** The credit card or bank account billing address zip code (i.e. 12345). This value is merely passed through to the payment gateway. */ + /** The credit card or bank account billing address zip code (e.g., 12345). This value is merely passed through to the payment gateway. */ billingZip?: string; - /** The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (i.e. “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ + /** The credit card or bank account billing address country, required in [ISO_3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format (e.g., “US”). This value is merely passed through to the payment gateway. Some gateways require country codes in a specific format. Check your gateway’s documentation. If creating an ACH subscription, only US is supported at this time. */ billingCountry?: string; - /** Second line of the customer’s billing address i.e. Apt. 100 */ + /** Second line of the customer’s billing address, e.g., Apt. 100 */ billingAddress2?: string | null; [key: string]: unknown; } diff --git a/src/models/updatePrice.ts b/src/models/updatePrice.ts index cec7b4af..5b91c5a6 100644 --- a/src/models/updatePrice.ts +++ b/src/models/updatePrice.ts @@ -28,7 +28,7 @@ import { export interface UpdatePrice { id?: number; endingQuantity?: UpdatePriceEndingQuantity; - /** The price can contain up to 8 decimal places. i.e. 1.00 or 0.0012 or 0.00000065 */ + /** The price can contain up to 8 decimal places. e.g., 1.00 or 0.0012 or 0.00000065 */ unitPrice?: UpdatePriceUnitPrice; destroy?: boolean; startingQuantity?: UpdatePriceStartingQuantity; diff --git a/src/models/updateSubscription.ts b/src/models/updateSubscription.ts index a5ec31f5..ff449292 100644 --- a/src/models/updateSubscription.ts +++ b/src/models/updateSubscription.ts @@ -38,9 +38,9 @@ import { export interface UpdateSubscription { creditCardAttributes?: CreditCardAttributes; - /** Set to the handle of a different product to change the subscription's product */ + /** Set to the handle of a different product to change the subscription's product. */ productHandle?: string; - /** Set to the id of a different product to change the subscription's product */ + /** Set to the id of a different product to change the subscription's product. */ productId?: number; productChangeDelayed?: boolean; /** Set to an empty string to cancel a delayed product change. */ @@ -48,11 +48,13 @@ export interface UpdateSubscription { nextProductPricePointId?: string; /** A day of month that subscription will be processed on. Can be 1 up to 28 or 'end'. */ snapDay?: UpdateSubscriptionSnapDay; - /** (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed. etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. */ + /** (Optional) Set this attribute to a future date/time to update a subscription in the Awaiting Signup Date state, to Awaiting Signup. In the Awaiting Signup state, a subscription behaves like any other. It can be canceled, allocated to, or have its billing date changed, etc. When the `initial_billing_at` date hits, the subscription will transition to the expected state. If the product has a trial, the subscription will enter a trial, otherwise it will go active. Setup fees will be respected either before or after the trial, as configured on the price point. If the payment is due at the initial_billing_at and it fails the subscription will be immediately canceled. You can omit the initial_billing_at date to activate the subscription immediately. See the [subscription import](https://maxio.zendesk.com/hc/en-us/articles/24251489107213-Advanced-Billing-Subscription-Imports#date-format) documentation for more information about Date/Time formats. */ initialBillingAt?: string; /** (Optional) Set this attribute to true to move the subscription from Awaiting Signup, to Awaiting Signup Date. Use this when you want to update a subscription that has an unknown initial billing date. When the first billing date is known, update a subscription to set the `initial_billing_at` date. The subscription moves to the awaiting signup with a scheduled initial billing date. You can omit the initial_billing_at date to activate the subscription immediately. See [Subscription States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773-Subscription-States) for more information. */ deferSignup?: boolean; nextBillingAt?: string; + /** The ID of the Branding Theme to assign to this subscription. When set, this subscription-level Branding Theme is used instead of the customer's default Branding Theme for subscription-related documents and communications that use subscription theming. Pass null or an empty value to clear the subscription-level Branding Theme. Available only when Branding Themes are enabled for the site. Not returned in the response. */ + brandingThemeId?: number | null; /** Timestamp giving the expiration date of this subscription (if any). You may manually change the expiration date at any point during a subscription period. */ expiresAt?: string; paymentCollectionMethod?: string; @@ -93,6 +95,7 @@ export const updateSubscriptionSchema: Schema = lazy(() => initialBillingAt: ['initial_billing_at', optional(string())], deferSignup: ['defer_signup', optional(boolean())], nextBillingAt: ['next_billing_at', optional(string())], + brandingThemeId: ['branding_theme_id', optional(nullable(number()))], expiresAt: ['expires_at', optional(string())], paymentCollectionMethod: ['payment_collection_method', optional(string())], receivesInvoiceEmails: ['receives_invoice_emails', optional(boolean())], diff --git a/src/models/webhook.ts b/src/models/webhook.ts index b33ecb2b..293424b2 100644 --- a/src/models/webhook.ts +++ b/src/models/webhook.ts @@ -17,7 +17,7 @@ import { export interface Webhook { /** A string describing which event type produced the given webhook */ event?: string; - /** The unique identifier for the webhooks (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. */ + /** The unique identifier for the webhook (unique across all of Chargify). This is not changed on a retry/replay of the same webhook, so it may be used to avoid duplicate action for the same event. */ id?: bigint; /** Timestamp indicating when the webhook was created */ createdAt?: string; @@ -31,7 +31,7 @@ export interface Webhook { lastSentAt?: string; /** The url that the endpoint was last sent to. */ lastSentUrl?: string; - /** A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, i.e. 15 seconds) */ + /** “A boolean flag describing whether the webhook was accepted by the webhook endpoint for the most recent attempt. (Acceptance is defined by receiving a “200 OK” HTTP response within a reasonable timeframe, e.g., 15 seconds.)” */ successful?: boolean; /** The data sent within the webhook post */ body?: string; diff --git a/src/models/webhookSubscription.ts b/src/models/webhookSubscription.ts index 41a7d89c..0bf151a9 100644 --- a/src/models/webhookSubscription.ts +++ b/src/models/webhookSubscription.ts @@ -40,6 +40,7 @@ export enum WebhookSubscription { SubscriptionCardUpdate = 'subscription_card_update', SubscriptionGroupCardUpdate = 'subscription_group_card_update', SubscriptionProductChange = 'subscription_product_change', + SubscriptionProductChangeScheduled = 'subscription_product_change_scheduled', SubscriptionStateChange = 'subscription_state_change', TrialEndNotice = 'trial_end_notice', UpcomingRenewalNotice = 'upcoming_renewal_notice', diff --git a/tsconfig.base.json b/tsconfig.base.json index c827c229..428f46a7 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,6 +1,7 @@ { "include": ["src", "types"], "compilerOptions": { + "skipLibCheck": true, "importHelpers": true, "declaration": true, "declarationMap": true, diff --git a/tsconfig.json b/tsconfig.json index 57d362c9..a4b825c6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "module": "esnext", "lib": ["esnext"], + "skipLibCheck": true, "importHelpers": true, "declaration": true, "sourceMap": true,