Skip to content

Commit

Permalink
[DE-1013] Release 5.2.0 (#89)
Browse files Browse the repository at this point in the history
- Added `tax_exempt_reason` and `default_auto_renewal_profile_id` to `Customer`
- Added `received_on` to `InvoicePayment` and `CreateInvoicePayment`
- Added `product_price_point_id` and `product_price_point_handle` to `UpdateSubscription`
- Improved some properties descriptions
  • Loading branch information
maciej-nedza authored Oct 17, 2024
1 parent 10cc113 commit 538dbe3
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 48 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,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:

```ts
npm install @maxio-com/advanced-billing-sdk@5.1.0
npm install @maxio-com/advanced-billing-sdk@5.2.0
```

For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@5.1.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/5.1.0).
For additional package details, see the [Npm page for the @maxio-com/advanced-billing-sdk@5.2.0 npm](https://www.npmjs.com/package/@maxio-com/advanced-billing-sdk/v/5.2.0).

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.1.0/doc/client.md)
**_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/client.md)

The following parameters are configurable for the API Client:

Expand All @@ -49,7 +49,7 @@ The following parameters are configurable for the API Client:
| `timeout` | `number` | Timeout for API calls.<br>*Default*: `120000` |
| `httpClientOptions` | `Partial<HttpClientOptions>` | Stable configurable http client options. |
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.1.0/doc/auth/basic-authentication.md) | The credential object for basicAuth |
| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-typescript-sdk/tree/5.2.0/doc/auth/basic-authentication.md) | The credential object for basicAuth |

### HttpClientOptions

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

## List of APIs

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

## Classes Documentation

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

7 changes: 7 additions & 0 deletions doc/controllers/product-families.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ const collect = {
page: 2,
perPage: 50,
dateField: BasicDateField.UpdatedAt,
filter: {
ids: [
1,
2,
3
],
},
include: ListProductsInclude.PrepaidProductPricePoint
}

Expand Down
7 changes: 7 additions & 0 deletions doc/controllers/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,13 @@ requestOptions?: RequestOptions): Promise<ApiResponse<ProductResponse[]>>
```ts
const collect = {
dateField: BasicDateField.UpdatedAt,
filter: {
ids: [
1,
2,
3
],
},
page: 2,
perPage: 50,
includeArchived: true,
Expand Down
5 changes: 3 additions & 2 deletions doc/models/create-invoice-payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `amount` | [`CreateInvoicePaymentAmount \| undefined`](../../doc/models/containers/create-invoice-payment-amount.md) | Optional | This is a container for one-of cases. |
| `memo` | `string \| undefined` | Optional | A description to be attached to the payment. |
| `memo` | `string \| undefined` | Optional | A description to be attached to the payment. Applicable only to `external` payments. |
| `method` | [`InvoicePaymentMethodType \| undefined`](../../doc/models/invoice-payment-method-type.md) | Optional | The type of payment method used. Defaults to other. |
| `details` | `string \| undefined` | Optional | Additional information related to the payment method (eg. Check #) |
| `details` | `string \| undefined` | Optional | Additional information related to the payment method (eg. Check #). Applicable only to `external` payments. |
| `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<br>`external` payments. |

## Example (as JSON)

Expand Down
1 change: 1 addition & 0 deletions doc/models/customer-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
| `metafields` | `Record<string, string> \| 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)

Expand Down
4 changes: 3 additions & 1 deletion doc/models/customer.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
| `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 |
| `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. |
| `portalCustomerCreatedAt` | `string \| null \| undefined` | Optional | The timestamp of when the Billing Portal entry was created at for the customer |
| `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 |
Expand All @@ -37,6 +37,8 @@
| `locale` | `string \| null \| undefined` | Optional | The locale for the customer to identify language-region |
| `defaultSubscriptionGroupUid` | `string \| null \| undefined` | Optional | - |
| `salesforceId` | `string \| null \| undefined` | Optional | The Salesforce ID for the customer |
| `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 |

## Example (as JSON)

Expand Down
2 changes: 2 additions & 0 deletions doc/models/invoice-payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
| `gatewayHandle` | `string \| null \| undefined` | Optional | - |
| `gatewayUsed` | `string \| undefined` | Optional | - |
| `gatewayTransactionId` | `string \| null \| undefined` | Optional | The transaction ID for the payment as returned from the payment gateway |
| `receivedOn` | `string \| null \| undefined` | Optional | Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to<br>`external` payments. |
| `uid` | `string \| undefined` | Optional | - |

## Example (as JSON)

Expand Down
6 changes: 6 additions & 0 deletions doc/models/list-products-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@

| Name | Type | Tags | Description |
| --- | --- | --- | --- |
| `ids` | `number[] \| undefined` | Optional | Allows fetching products with matching id based on provided values. Use in query `filter[ids]=1,2,3`.<br>**Constraints**: *Minimum Items*: `1` |
| `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)

```json
{
"ids": [
1,
2,
3
],
"prepaid_product_price_point": {
"product_price_point_id": "product_price_point_id2"
},
Expand Down
2 changes: 2 additions & 0 deletions doc/models/update-subscription.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
| `components` | [`UpdateSubscriptionComponent[] \| undefined`](../../doc/models/update-subscription-component.md) | Optional | (Optional) An array of component ids and custom prices to be added to the subscription. |
| `dunningCommunicationDelayEnabled` | `boolean \| null \| undefined` | Optional | Enable Communication Delay feature, making sure no communication (email or SMS) is sent to the Customer between 9PM and 8AM in time zone set by the `dunning_communication_delay_time_zone` attribute. |
| `dunningCommunicationDelayTimeZone` | `string \| null \| undefined` | Optional | Time zone for the Dunning Communication Delay feature. |
| `productPricePointId` | `number \| undefined` | Optional | Set to change the current product's price point. |
| `productPricePointHandle` | `string \| undefined` | Optional | Set to change the current product's price point. |

## Example (as JSON)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "5.1.0",
"version": "5.2.0",
"license": "MIT",
"sideEffects": false,
"main": "dist/cjs/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Client implements ClientInterface {
? this._config.httpClientOptions.timeout
: this._config.timeout;
this._userAgent = updateUserAgent(
'AB SDK TypeScript:5.1.0 on OS {os-info}'
'AB SDK TypeScript:5.2.0 on OS {os-info}'
);
this._requestBuilderFactory = createRequestHandlerFactory(
(server) => getBaseUri(server, this._config),
Expand Down
10 changes: 8 additions & 2 deletions src/models/createInvoicePayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ import {
export interface CreateInvoicePayment {
/** A string of the dollar amount to be refunded (eg. "10.50" => $10.50) */
amount?: CreateInvoicePaymentAmount;
/** A description to be attached to the payment. */
/** A description to be attached to the payment. Applicable only to `external` payments. */
memo?: string;
/** The type of payment method used. Defaults to other. */
method?: InvoicePaymentMethodType;
/** Additional information related to the payment method (eg. Check #) */
/** Additional information related to the payment method (eg. Check #). Applicable only to `external` payments. */
details?: string;
/** The ID of the payment profile to be used for the payment. */
paymentProfileId?: number;
/**
* Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
* `external` payments.
*/
receivedOn?: string;
[key: string]: unknown;
}

Expand All @@ -35,5 +40,6 @@ export const createInvoicePaymentSchema: Schema<CreateInvoicePayment> = expandoO
method: ['method', optional(invoicePaymentMethodTypeSchema)],
details: ['details', optional(string())],
paymentProfileId: ['payment_profile_id', optional(number())],
receivedOn: ['received_on', optional(string())],
}
);
11 changes: 10 additions & 1 deletion src/models/customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface Customer {
countryName?: string | null;
/** The phone number of the customer */
phone?: string | 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. */
verified?: boolean | null;
/** The timestamp of when the Billing Portal entry was created at for the customer */
portalCustomerCreatedAt?: string | null;
Expand All @@ -70,6 +70,10 @@ export interface Customer {
defaultSubscriptionGroupUid?: string | null;
/** The Salesforce ID for the customer */
salesforceId?: string | null;
/** The Tax Exemption Reason Code for the customer */
taxExemptReason?: string | null;
/** The default auto-renewal profile ID for the customer */
defaultAutoRenewalProfileId?: number | null;
[key: string]: unknown;
}

Expand Down Expand Up @@ -114,4 +118,9 @@ export const customerSchema: Schema<Customer> = expandoObject({
optional(nullable(string())),
],
salesforceId: ['salesforce_id', optional(nullable(string()))],
taxExemptReason: ['tax_exempt_reason', optional(nullable(string()))],
defaultAutoRenewalProfileId: [
'default_auto_renewal_profile_id',
optional(nullable(number())),
],
});
Loading

0 comments on commit 538dbe3

Please sign in to comment.