Skip to content

Commit

Permalink
Merge branch 'main' into DE-672-e2e-metadataenpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Blacutt authored and Alberto Blacutt committed Feb 2, 2024
2 parents e4efc4b + 43181b3 commit dd11c4b
Show file tree
Hide file tree
Showing 62 changed files with 566 additions and 394 deletions.
32 changes: 16 additions & 16 deletions doc/controllers/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ const componentsController = new ComponentsController(client);
* [Create on Off Component](../../doc/controllers/components.md#create-on-off-component)
* [Create Prepaid Usage Component](../../doc/controllers/components.md#create-prepaid-usage-component)
* [Create Event Based Component](../../doc/controllers/components.md#create-event-based-component)
* [Read Component by Handle](../../doc/controllers/components.md#read-component-by-handle)
* [Read Component by Id](../../doc/controllers/components.md#read-component-by-id)
* [Find Component](../../doc/controllers/components.md#find-component)
* [Read Component](../../doc/controllers/components.md#read-component)
* [Update Product Family Component](../../doc/controllers/components.md#update-product-family-component)
* [Archive Component](../../doc/controllers/components.md#archive-component)
* [List Components](../../doc/controllers/components.md#list-components)
* [Update Component](../../doc/controllers/components.md#update-component)
* [Update Default Price Point for Component](../../doc/controllers/components.md#update-default-price-point-for-component)
* [Promote Component Price Point to Default](../../doc/controllers/components.md#promote-component-price-point-to-default)
* [List Components for Product Family](../../doc/controllers/components.md#list-components-for-product-family)
* [Create Component Price Point](../../doc/controllers/components.md#create-component-price-point)
* [List Component Price Points](../../doc/controllers/components.md#list-component-price-points)
* [Create Component Price Points](../../doc/controllers/components.md#create-component-price-points)
* [Bulk Create Component Price Points](../../doc/controllers/components.md#bulk-create-component-price-points)
* [Update Component Price Point](../../doc/controllers/components.md#update-component-price-point)
* [Archive Component Price Point](../../doc/controllers/components.md#archive-component-price-point)
* [Unarchive Component Price Point](../../doc/controllers/components.md#unarchive-component-price-point)
Expand Down Expand Up @@ -682,12 +682,12 @@ try {
| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) |


# Read Component by Handle
# Find Component

This request will return information regarding a component having the handle you provide. You can identify your components with a handle so you don't have to save or reference the IDs we generate.

```ts
async readComponentByHandle(
async findComponent(
handle: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<ComponentResponse>>
Expand All @@ -712,7 +712,7 @@ const handle = 'handle6';
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await componentsController.readComponentByHandle(handle);
const { result, ...httpResponse } = await componentsController.findComponent(handle);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
Expand Down Expand Up @@ -756,14 +756,14 @@ try {
```


# Read Component by Id
# Read Component

This request will return information regarding a component from a specific product family.

You may read the component by either the component's id or handle. When using the handle, it must be prefixed with `handle:`.

```ts
async readComponentById(
async readComponent(
productFamilyId: number,
componentId: string,
requestOptions?: RequestOptions
Expand Down Expand Up @@ -792,7 +792,7 @@ const componentId = 'component_id8';
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await componentsController.readComponentById(
const { result, ...httpResponse } = await componentsController.readComponent(
productFamilyId,
componentId
);
Expand Down Expand Up @@ -1274,7 +1274,7 @@ try {
| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) |


# Update Default Price Point for Component
# Promote Component Price Point to Default

Sets a new default price point for the component. This new default will apply to all new subscriptions going forward - existing subscriptions will remain on their current price point.

Expand All @@ -1283,7 +1283,7 @@ See [Price Points Documentation](https://chargify.zendesk.com/hc/en-us/articles/
Note: Custom price points are not able to be set as the default for a component.

```ts
async updateDefaultPricePointForComponent(
async promoteComponentPricePointToDefault(
componentId: number,
pricePointId: number,
requestOptions?: RequestOptions
Expand Down Expand Up @@ -1312,7 +1312,7 @@ const pricePointId = 10;
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await componentsController.updateDefaultPricePointForComponent(
const { result, ...httpResponse } = await componentsController.promoteComponentPricePointToDefault(
componentId,
pricePointId
);
Expand Down Expand Up @@ -1705,12 +1705,12 @@ try {
```


# Create Component Price Points
# Bulk Create Component Price Points

Use this endpoint to create multiple component price points in one request.

```ts
async createComponentPricePoints(
async bulkCreateComponentPricePoints(
componentId: string,
body?: CreateComponentPricePointsRequest,
requestOptions?: RequestOptions
Expand Down Expand Up @@ -1775,7 +1775,7 @@ const body: CreateComponentPricePointsRequest = {
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await componentsController.createComponentPricePoints(
const { result, ...httpResponse } = await componentsController.bulkCreateComponentPricePoints(
componentId,
body
);
Expand Down
16 changes: 8 additions & 8 deletions doc/controllers/coupons.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const couponsController = new CouponsController(client);

* [Create Coupon](../../doc/controllers/coupons.md#create-coupon)
* [List Coupons for Product Family](../../doc/controllers/coupons.md#list-coupons-for-product-family)
* [Read Coupon by Code](../../doc/controllers/coupons.md#read-coupon-by-code)
* [Find Coupon](../../doc/controllers/coupons.md#find-coupon)
* [Read Coupon](../../doc/controllers/coupons.md#read-coupon)
* [Update Coupon](../../doc/controllers/coupons.md#update-coupon)
* [Archive Coupon](../../doc/controllers/coupons.md#archive-coupon)
* [List Coupons](../../doc/controllers/coupons.md#list-coupons)
* [Read Coupon Usage](../../doc/controllers/coupons.md#read-coupon-usage)
* [Validate Coupon](../../doc/controllers/coupons.md#validate-coupon)
* [Update Coupon Currency Prices](../../doc/controllers/coupons.md#update-coupon-currency-prices)
* [Create or Update Coupon Currency Prices](../../doc/controllers/coupons.md#create-or-update-coupon-currency-prices)
* [Create Coupon Subcodes](../../doc/controllers/coupons.md#create-coupon-subcodes)
* [List Coupon Subcodes](../../doc/controllers/coupons.md#list-coupon-subcodes)
* [Update Coupon Subcodes](../../doc/controllers/coupons.md#update-coupon-subcodes)
Expand Down Expand Up @@ -283,14 +283,14 @@ try {
```


# Read Coupon by Code
# Find Coupon

You can search for a coupon via the API with the find method. By passing a code parameter, the find will attempt to locate a coupon that matches that code. If no coupon is found, a 404 is returned.

If you have more than one product family and if the coupon you are trying to find does not belong to the default product family in your site, then you will need to specify (either in the url or as a query string param) the product family id.

```ts
async readCouponByCode(
async findCoupon(
productFamilyId?: number,
code?: string,
requestOptions?: RequestOptions
Expand All @@ -315,7 +315,7 @@ async readCouponByCode(
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await couponsController.readCouponByCode();
const { result, ...httpResponse } = await couponsController.findCoupon();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
Expand Down Expand Up @@ -927,14 +927,14 @@ try {
| 404 | Not Found | [`SingleStringErrorResponseError`](../../doc/models/single-string-error-response-error.md) |


# Update Coupon Currency Prices
# Create or Update Coupon Currency Prices

This endpoint allows you to create and/or update currency prices for an existing coupon. Multiple prices can be created or updated in a single request but each of the currencies must be defined on the site level already and the coupon must be an amount-based coupon, not percentage.

Currency pricing for coupons must mirror the setup of the primary coupon pricing - if the primary coupon is percentage based, you will not be able to define pricing in non-primary currencies.

```ts
async updateCouponCurrencyPrices(
async createOrUpdateCouponCurrencyPrices(
couponId: number,
body?: CouponCurrencyRequest,
requestOptions?: RequestOptions
Expand Down Expand Up @@ -974,7 +974,7 @@ const body: CouponCurrencyRequest = {
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await couponsController.updateCouponCurrencyPrices(
const { result, ...httpResponse } = await couponsController.createOrUpdateCouponCurrencyPrices(
couponId,
body
);
Expand Down
16 changes: 8 additions & 8 deletions doc/controllers/events-based-billing-segments.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const eventsBasedBillingSegmentsController = new EventsBasedBillingSegmentsContr
* [List Segments for Price Point](../../doc/controllers/events-based-billing-segments.md#list-segments-for-price-point)
* [Update Segment](../../doc/controllers/events-based-billing-segments.md#update-segment)
* [Delete Segment](../../doc/controllers/events-based-billing-segments.md#delete-segment)
* [Create Segments](../../doc/controllers/events-based-billing-segments.md#create-segments)
* [Update Segments](../../doc/controllers/events-based-billing-segments.md#update-segments)
* [Bulk Create Segments](../../doc/controllers/events-based-billing-segments.md#bulk-create-segments)
* [Bulk Update Segments](../../doc/controllers/events-based-billing-segments.md#bulk-update-segments)


# Create Segment
Expand Down Expand Up @@ -305,7 +305,7 @@ try {
| 422 | Unprocessable Entity (WebDAV) | `ApiError` |


# Create Segments
# Bulk Create Segments

This endpoint allows you to create multiple segments in one request. The array of segments can contain up to `2000` records.

Expand All @@ -314,7 +314,7 @@ If any of the records contain an error the whole request would fail and none of
You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.

```ts
async createSegments(
async bulkCreateSegments(
componentId: string,
pricePointId: string,
body?: BulkCreateSegments,
Expand Down Expand Up @@ -345,7 +345,7 @@ const pricePointId = 'price_point_id8';
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await eventsBasedBillingSegmentsController.createSegments(
const { result, ...httpResponse } = await eventsBasedBillingSegmentsController.bulkCreateSegments(
componentId,
pricePointId
);
Expand All @@ -369,7 +369,7 @@ try {
| 422 | Unprocessable Entity (WebDAV) | [`EventBasedBillingSegmentError`](../../doc/models/event-based-billing-segment-error-1.md) |


# Update Segments
# Bulk Update Segments

This endpoint allows you to update multiple segments in one request. The array of segments can contain up to `1000` records.

Expand All @@ -378,7 +378,7 @@ If any of the records contain an error the whole request would fail and none of
You may specify component and/or price point by using either the numeric ID or the `handle:gold` syntax.

```ts
async updateSegments(
async bulkUpdateSegments(
componentId: string,
pricePointId: string,
body?: BulkUpdateSegments,
Expand Down Expand Up @@ -409,7 +409,7 @@ const pricePointId = 'price_point_id8';
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await eventsBasedBillingSegmentsController.updateSegments(
const { result, ...httpResponse } = await eventsBasedBillingSegmentsController.bulkUpdateSegments(
componentId,
pricePointId
);
Expand Down
8 changes: 4 additions & 4 deletions doc/controllers/insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const insightsController = new InsightsController(client);

* [Read Site Stats](../../doc/controllers/insights.md#read-site-stats)
* [Read Mrr](../../doc/controllers/insights.md#read-mrr)
* [Read Mrr Movements](../../doc/controllers/insights.md#read-mrr-movements)
* [List Mrr Movements](../../doc/controllers/insights.md#list-mrr-movements)
* [List Mrr Per Subscription](../../doc/controllers/insights.md#list-mrr-per-subscription)


Expand Down Expand Up @@ -149,7 +149,7 @@ try {
```


# Read Mrr Movements
# List Mrr Movements

**This endpoint is deprecated.**

Expand Down Expand Up @@ -179,7 +179,7 @@ Usage includes revenue from:
* Prepaid Usage Components

```ts
async readMrrMovements(
async listMrrMovements(
subscriptionId?: number,
page?: number,
perPage?: number,
Expand Down Expand Up @@ -212,7 +212,7 @@ const collect = {
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await insightsController.readMrrMovements(collect);
const { result, ...httpResponse } = await insightsController.listMrrMovements(collect);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
Expand Down
38 changes: 18 additions & 20 deletions doc/controllers/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ const invoicesController = new InvoicesController(client);
* [Read Invoice](../../doc/controllers/invoices.md#read-invoice)
* [List Invoice Events](../../doc/controllers/invoices.md#list-invoice-events)
* [Record Payment for Invoice](../../doc/controllers/invoices.md#record-payment-for-invoice)
* [Record External Payment for Invoices](../../doc/controllers/invoices.md#record-external-payment-for-invoices)
* [Record Payment for Multiple Invoices](../../doc/controllers/invoices.md#record-payment-for-multiple-invoices)
* [List Credit Notes](../../doc/controllers/invoices.md#list-credit-notes)
* [Read Credit Note](../../doc/controllers/invoices.md#read-credit-note)
* [Record Payment for Subscription](../../doc/controllers/invoices.md#record-payment-for-subscription)
* [Reopen Invoice](../../doc/controllers/invoices.md#reopen-invoice)
* [Void Invoice](../../doc/controllers/invoices.md#void-invoice)
* [List Invoice Segments](../../doc/controllers/invoices.md#list-invoice-segments)
* [List Consolidated Invoice Segments](../../doc/controllers/invoices.md#list-consolidated-invoice-segments)
* [Create Invoice](../../doc/controllers/invoices.md#create-invoice)
* [Send Invoice](../../doc/controllers/invoices.md#send-invoice)
* [Preview Customer Information Changes](../../doc/controllers/invoices.md#preview-customer-information-changes)
Expand Down Expand Up @@ -1199,7 +1199,7 @@ try {
```


# Record External Payment for Invoices
# Record Payment for Multiple Invoices

This API call should be used when you want to record an external payment against multiple invoices.

Expand Down Expand Up @@ -1229,7 +1229,7 @@ In order apply a payment to multiple invoices, at minimum, specify the `amount`
Note that the invoice payment amounts must be greater than 0. Total amount must be greater or equal to invoices payment amount sum.

```ts
async recordExternalPaymentForInvoices(
async recordPaymentForMultipleInvoices(
body?: CreateMultiInvoicePaymentRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<MultiInvoicePaymentResponse>>
Expand Down Expand Up @@ -1271,7 +1271,7 @@ const body: CreateMultiInvoicePaymentRequest = {
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await invoicesController.recordExternalPaymentForInvoices(body);
const { result, ...httpResponse } = await invoicesController.recordPaymentForMultipleInvoices(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
Expand Down Expand Up @@ -2202,12 +2202,12 @@ try {
| 422 | Unprocessable Entity (WebDAV) | [`ErrorListResponseError`](../../doc/models/error-list-response-error.md) |


# List Invoice Segments
# 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`.

```ts
async listInvoiceSegments(
async listConsolidatedInvoiceSegments(
invoiceUid: string,
page?: number,
perPage?: number,
Expand Down Expand Up @@ -2242,7 +2242,7 @@ const collect = {
try {
// @ts-expect-error: unused variables
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { result, ...httpResponse } = await invoicesController.listInvoiceSegments(collect);
const { result, ...httpResponse } = await invoicesController.listConsolidatedInvoiceSegments(collect);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
Expand Down Expand Up @@ -3243,20 +3243,18 @@ try {
],
"custom_fields": [
{
"name": "non nul",
"value": "consectetur aliqua",
"owner_type": "ad",
"owner_id": 18482224
"name": "CustomerStatus",
"value": "Gold",
"owner_type": "Customer",
"owner_id": 18482224,
"metadatum_id": 13924
},
{
"value": "anim",
"owner_type": "in"
},
{
"owner_id": -13438519
},
{
"name": "ullamco non deserunt in"
"name": "SubscriptionTag",
"value": "Special Subscriber",
"owner_type": "Subscription",
"owner_id": 21344,
"metadatum_id": 139245
}
],
"public_url": "dolo",
Expand Down
Loading

0 comments on commit dd11c4b

Please sign in to comment.