Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
88 changes: 44 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ curl -u <api_key>: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@7.0.1
npm install @maxio-com/advanced-billing-sdk@8.0.0
```

For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@7.0.1 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/7.0.1).
For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@8.0.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/8.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/7.0.1/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -45,9 +45,9 @@ The following parameters are configurable for the API Client:
| site | `string` | The subdomain for your Advanced Billing site.<br>*Default*: `'subdomain'` |
| environment | `Environment` | The API environment. <br> **Default: `Environment.US`** |
| timeout | `number` | Timeout for API calls.<br>*Default*: `120000` |
| httpClientOptions | [`Partial<HttpClientOptions>`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/http-client-options.md) | Stable configurable http client options. |
| httpClientOptions | [`Partial<HttpClientOptions>`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.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/7.0.1/doc/auth/basic-authentication.md) | The credential object for basicAuth |
| basicAuthCredentials | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/auth/basic-authentication.md) | The credential object for basicAuth |

The API client can be initialized as follows:

Expand Down Expand Up @@ -80,57 +80,57 @@ 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/7.0.1/doc/auth/basic-authentication.md)
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/auth/basic-authentication.md)

## List of APIs

* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/controllers/webhooks.md)
* [API Exports](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/api-exports.md)
* [Advance Invoice](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/advance-invoice.md)
* [Billing Portal](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/billing-portal.md)
* [Component Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/component-price-points.md)
* [Custom Fields](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/custom-fields.md)
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/events-based-billing-segments.md)
* [Payment Profiles](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/payment-profiles.md)
* [Product Families](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/product-families.md)
* [Product Price Points](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/product-price-points.md)
* [Proforma Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/proforma-invoices.md)
* [Reason Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/reason-codes.md)
* [Referral Codes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/referral-codes.md)
* [Sales Commissions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/sales-commissions.md)
* [Subscription Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-components.md)
* [Subscription Groups](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-groups.md)
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-group-invoice-account.md)
* [Subscription Group Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-group-status.md)
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-invoice-account.md)
* [Subscription Notes](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-notes.md)
* [Subscription Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-products.md)
* [Subscription Status](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscription-status.md)
* [Coupons](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/coupons.md)
* [Components](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/components.md)
* [Customers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/customers.md)
* [Events](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/events.md)
* [Insights](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/insights.md)
* [Invoices](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/invoices.md)
* [Offers](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/offers.md)
* [Products](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/products.md)
* [Sites](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/sites.md)
* [Subscriptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/subscriptions.md)
* [Webhooks](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/controllers/webhooks.md)

## SDK Infrastructure

### Configuration

* [HttpClientOptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/http-client-options.md)
* [RetryConfiguration](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/retry-configuration.md)
* [ProxySettings](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/proxy-settings.md)
* [HttpClientOptions](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/http-client-options.md)
* [RetryConfiguration](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/retry-configuration.md)
* [ProxySettings](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/proxy-settings.md)

### HTTP

* [HttpRequest](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/http-request.md)
* [HttpRequest](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/http-request.md)

### Utilities

* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/api-response.md)
* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/7.0.1/doc/api-error.md)
* [ApiResponse](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/api-response.md)
* [ApiError](https://www.github.com/maxio-com/ab-typescript-sdk/tree/8.0.0/doc/api-error.md)

70 changes: 53 additions & 17 deletions doc/controllers/advance-invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const advanceInvoiceController = new AdvanceInvoiceController(client);

# Issue Advance Invoice

Generate an invoice in advance for a subscription's next renewal date. [Please see our docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Invoice-In-Advance) for more information on advance invoices, including eligibility on generating one; for the most part, they function like any other invoice, except they are issued early and have special behavior upon being voided.
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 on 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.
Expand Down Expand Up @@ -52,16 +52,28 @@ const body: IssueAdvanceInvoiceRequest = {
};

try {
const { result, ...httpResponse } = await advanceInvoiceController.issueAdvanceInvoice(
const response = await advanceInvoiceController.issueAdvanceInvoice(
subscriptionId,
body
);
// Get more response info...
// const { statusCode, headers } = httpResponse;

// 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) {
const errors = error.result;
// const { statusCode, headers } = error;
// 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);
}
}
```
Expand Down Expand Up @@ -102,13 +114,25 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The
const subscriptionId = 222;

try {
const { result, ...httpResponse } = await advanceInvoiceController.readAdvanceInvoice(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
const response = await advanceInvoiceController.readAdvanceInvoice(subscriptionId);

// 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) {
const errors = error.result;
// const { statusCode, headers } = error;
// 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);
}
}
```
Expand All @@ -123,7 +147,7 @@ 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, please [see our help docs](../../doc/models/invoice.md).
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).

```ts
async voidAdvanceInvoice(
Expand Down Expand Up @@ -151,13 +175,25 @@ This method returns an [`ApiResponse`](../../doc/api-response.md) instance. The
const subscriptionId = 222;

try {
const { result, ...httpResponse } = await advanceInvoiceController.voidAdvanceInvoice(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
const response = await advanceInvoiceController.voidAdvanceInvoice(subscriptionId);

// 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) {
const errors = error.result;
// const { statusCode, headers } = error;
// 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);
}
}
```
Expand Down
Loading