From 363b370c1c2fe6d5766d525ece561a019e671286 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Tue, 21 Jul 2026 12:00:05 +0530 Subject: [PATCH 1/3] fix test Co-authored-by: Cursor --- test/requestWrapper.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/requestWrapper.test.ts b/test/requestWrapper.test.ts index 45c30e3..023e465 100644 --- a/test/requestWrapper.test.ts +++ b/test/requestWrapper.test.ts @@ -421,7 +421,9 @@ describe('RequestWrapper - telemetry adapter', () => { expect(capturedResult.endAttributes['http.response.status_code']).to.equal( 404, ); - expect(capturedResult.endAttributes['error.type']).to.equal('404'); + expect(capturedResult.endAttributes['error.type']).to.equal( + 'invalid_request', + ); expect(capturedResult.endAttributes['chargebee.error.code']).to.equal( 'resource_not_found', ); From 535e4c736274c2ba96ed230d1b7f0f033b1855f1 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Tue, 21 Jul 2026 12:03:41 +0530 Subject: [PATCH 2/3] Releasing v3.29.0 --- CHANGELOG.md | 82 +++++++++++++++++++++++++ VERSION | 2 +- package-lock.json | 4 +- package.json | 2 +- src/chargebee.cjs.ts | 2 +- src/environment.ts | 2 +- src/resources/api_endpoints.ts | 61 ++++++++++++++++++ src/resources/webhook/content.ts | 8 +++ src/resources/webhook/eventType.ts | 2 + src/telemetry/TelemetryAdapter.ts | 21 ++++--- types/core.d.ts | 46 ++++++++++++-- types/index.d.ts | 20 +++--- types/resources/Alert.d.ts | 19 +++++- types/resources/AsyncResponse.d.ts | 35 +++++++++++ types/resources/AsyncResponseList.d.ts | 8 +++ types/resources/ColumnDefinition.d.ts | 9 +++ types/resources/Content.d.ts | 5 ++ types/resources/CreditNote.d.ts | 15 +++++ types/resources/CreditNoteEstimate.d.ts | 5 ++ types/resources/Customer.d.ts | 10 ++- types/resources/Estimate.d.ts | 13 +++- types/resources/Event.d.ts | 1 + types/resources/Export.d.ts | 1 + types/resources/Feature.d.ts | 2 + types/resources/Gift.d.ts | 10 ++- types/resources/GrantBlock.d.ts | 2 +- types/resources/Invoice.d.ts | 36 ++++++++++- types/resources/InvoiceEstimate.d.ts | 5 ++ types/resources/LedgerOperation.d.ts | 4 +- types/resources/Meter.d.ts | 42 +++++++++++++ types/resources/MeteredFeature.d.ts | 70 +++++++++++++++++++++ types/resources/PaymentIntent.d.ts | 42 +++++++++++-- types/resources/PaymentSource.d.ts | 5 +- types/resources/PromotionalGrant.d.ts | 2 +- types/resources/Purchase.d.ts | 5 +- types/resources/Quote.d.ts | 5 ++ types/resources/QuoteLineGroup.d.ts | 5 ++ types/resources/QuotedCharge.d.ts | 3 + types/resources/Ramp.d.ts | 5 +- types/resources/RecordedPurchase.d.ts | 3 + types/resources/Subscription.d.ts | 36 ++++++++--- types/resources/WebhookEvent.d.ts | 7 +++ 42 files changed, 601 insertions(+), 61 deletions(-) create mode 100644 types/resources/AsyncResponse.d.ts create mode 100644 types/resources/AsyncResponseList.d.ts create mode 100644 types/resources/ColumnDefinition.d.ts create mode 100644 types/resources/Meter.d.ts create mode 100644 types/resources/MeteredFeature.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f81d377..9863325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,85 @@ +### v3.29.0 (2026-07-21) +* * * +### New Resources: +- [`AsyncResponse`](https://apidocs.chargebee.com/docs/api/async_responses) has been added. +- [`AsyncResponseList`](https://apidocs.chargebee.com/docs/api/async_response_lists) has been added. +- [`ColumnDefinition`](https://apidocs.chargebee.com/docs/api/column_definitions) has been added. +- [`Meter`](https://apidocs.chargebee.com/docs/api/meters) has been added. +- [`MeteredFeature`](https://apidocs.chargebee.com/docs/api/metered_features) has been added. + + +### New Attributes: +- [`currency_code`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#currency_code) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#threshold) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`filter_conditions`](https://apidocs.chargebee.com/docs/api/alerts/alert-object#filter_conditions) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`exchange_rates`](https://apidocs.chargebee.com/docs/api/credit_notes/credit-note-object#exchange_rates) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`metered`](https://apidocs.chargebee.com/docs/api/features/feature-object#metered) has been added to [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- [`exchange_rates`](https://apidocs.chargebee.com/docs/api/invoices/invoice-object#exchange_rates) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`payment_intent_metadata`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). + + +### New Parameters: +- [`metered`](https://apidocs.chargebee.com/docs/api/features/list-features#metered) has been added as query parameter to [`list_features`](https://apidocs.chargebee.com/docs/api/features/list-features) in [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- [`decommissioned`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions#decommissioned) has been added as query parameter to [`list_subscriptions`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions) in [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). +- [`currency_code`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#currency_code) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`line_items.proration_mode`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note#line_items_proration_mode) has been added as request body parameter to [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`item_prices.description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#item_prices_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`item_prices.entity_description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#item_prices_entity_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`charges.entity_description`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate#charges_entity_description) has been added as request body parameter to [`create_invoice_for_items_estimate`](https://apidocs.chargebee.com/docs/api/estimates/create-invoice-for-items-estimate) in [`Estimate`](https://apidocs.chargebee.com/docs/api/estimates). +- [`subscription.decommissioned`](https://apidocs.chargebee.com/docs/api/exports/export-subscriptions#subscription_decommissioned) has been added as request body parameter to [`export_subscriptions`](https://apidocs.chargebee.com/docs/api/exports/export-subscriptions) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`item_prices.description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#item_prices_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`item_prices.entity_description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#item_prices_entity_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`charges.entity_description`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#charges_entity_description) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`create_pending_invoice`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges#create_pending_invoice) has been added as request body parameter to [`create_invoice_for_items_and_one-time_charges`](https://apidocs.chargebee.com/docs/api/invoices/create-invoice-for-items-and-one-time-charges) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`line_items.proration_mode`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#line_items_proration_mode) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`paid_at`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice#paid_at) has been added as request body parameter to [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`discounts_to_add.quantity`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp#discounts_to_add_quantity) has been added as request body parameter to [`create_a_ramp`](https://apidocs.chargebee.com/docs/api/ramps/create-a-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`discounts_to_add.quantity`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp#discounts_to_add_quantity) has been added as request body parameter to [`update_a_subscription_ramp`](https://apidocs.chargebee.com/docs/api/ramps/update-a-subscription-ramp) in [`Ramp`](https://apidocs.chargebee.com/docs/api/ramps). +- [`customer.email`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_email) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). +- [`customer.first_name`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_first_name) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). +- [`customer.last_name`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase#customer_last_name) has been added as request body parameter to [`record_a_purchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases/record-a-purchase) in [`RecordedPurchase`](https://apidocs.chargebee.com/docs/api/recorded_purchases). + + +### Parameter Updates: +- [`metered_feature_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#metered_feature_id) has been changed from required to optional in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). + + +### New Events: +- [`payment_source_business_entity_changed`](https://apidocs.chargebee.com/docs/api/events/webhook/payment_source_business_entity_changed) has been added. + + +### Deleted Attributes: +- `start_balance` has been removed from [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). +- `end_balance` has been removed from [`LedgerOperation`](https://apidocs.chargebee.com/docs/api/ledger_operations). + + +### New Enums: +- `real_time_payments` has been added as a new value enum `DunningType`. +- `payment_source_business_entity_changed` has been added as a new value enum `EventType`. +- `paynow`, `bizum`, and `promptpay` have been added as new values enum `PaymentMethod`. +- `paynow`, `bizum`, and `promptpay` have been added as new values enum `PaymentMethodType`. +- `active`, `archived`, and `deleted` have been added as new values enum `Status`. +- `zero_rated`, `region_non_taxable`, `product_exempt`, `high_value_physical_goods`, `zero_value_item`, and `tax_not_configured_external_provider` have been added as new values enum `TaxOverrideReason`. +- `paynow`, `bizum`, `promptpay`, `simple`, `compound`, and `spend_exceeded` have been added as new values enum `Type`. +- `success` and `failed` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/async_responses/async-response-object#status) in [`AsyncResponse`](https://apidocs.chargebee.com/docs/api/async_responses). +- `number` and `string` have been added as new values to enum attribute [`data_type`](https://apidocs.chargebee.com/docs/api/column_definitions/column-definition-object#data_type) in [`ColumnDefinition`](https://apidocs.chargebee.com/docs/api/column_definitions). +- `simple` and `compound` have been added as new values to enum attribute [`type`](https://apidocs.chargebee.com/docs/api/meters/meter-object#type) in [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `active`, `archived`, and `deleted` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/meters/meter-object#status) in [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `cb_js`, `components_fields`, `checkout_v3`, `paynow_v3`, `portal_v3`, `gift_v3`, `checkout_v4`, `payment_component`, `pc_inapp_v4`, and `pc_fpc_v4` have been added as new values to enum attribute [`payment_intent_metadata.source`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata_source) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `adjusted_term`, `service_period_revision`, `delta`, and `reset` have been added as new values to enum request body parameter `line_items.proration_mode` in [`import_credit_note`](https://apidocs.chargebee.com/docs/api/credit_notes/import-credit-note) of [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- `true` and `false` have been added as new values to enum query parameter `metered.is` in [`list_features`](https://apidocs.chargebee.com/docs/api/features/list-features) of [`Feature`](https://apidocs.chargebee.com/docs/api/features). +- `adjusted_term`, `service_period_revision`, `delta`, and `reset` have been added as new values to enum request body parameter `line_items.proration_mode` in [`import_invoice`](https://apidocs.chargebee.com/docs/api/invoices/import-invoice) of [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- `updated_at`, `name`, `created_at`, and `id` have been added as new values to enum query parameter `sort_by.asc` in [`list_all_available_meters`](https://apidocs.chargebee.com/docs/api/meters/list-all-available-meters) of [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `updated_at`, `name`, `created_at`, and `id` have been added as new values to enum query parameter `sort_by.desc` in [`list_all_available_meters`](https://apidocs.chargebee.com/docs/api/meters/list-all-available-meters) of [`Meter`](https://apidocs.chargebee.com/docs/api/meters). +- `number` and `string` have been added as new values to enum request body parameter `column_definitions.data_type` in [`create_a_metered_feature`](https://apidocs.chargebee.com/docs/api/metered_features/create-a-metered-feature) of [`MeteredFeature`](https://apidocs.chargebee.com/docs/api/metered_features). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `paynow`, `bizum`, and `promptpay` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `true` and `false` have been added as new values to enum query parameter `decommissioned.is` in [`list_subscriptions`](https://apidocs.chargebee.com/docs/api/subscriptions/list-subscriptions) of [`Subscription`](https://apidocs.chargebee.com/docs/api/subscriptions). + + + ### v3.28.1 (2026-07-16) * * * ### Bug Fixes: diff --git a/VERSION b/VERSION index 54d1636..c7c9773 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.28.1 +3.29.0 diff --git a/package-lock.json b/package-lock.json index faa7c56..7895e17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chargebee", - "version": "3.28.1", + "version": "3.29.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chargebee", - "version": "3.28.1", + "version": "3.29.0", "dependencies": { "zod": "^4.3.6" }, diff --git a/package.json b/package.json index f1e1cda..410aa53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chargebee", - "version": "3.28.1", + "version": "3.29.0", "description": "A library for integrating with Chargebee.", "scripts": { "prepack": "npm install && npm run build", diff --git a/src/chargebee.cjs.ts b/src/chargebee.cjs.ts index 7afeda8..79684c0 100644 --- a/src/chargebee.cjs.ts +++ b/src/chargebee.cjs.ts @@ -9,8 +9,8 @@ import { WebhookPayloadParseError, } from './resources/webhook/handler.js'; import { basicAuthValidator } from './resources/webhook/auth.js'; -import { TelemetryAttributeKeys } from './telemetry/index.js'; import { ChargebeeZodValidationError } from './chargebeeZodValidationError.js'; +import { TelemetryAttributeKeys } from './telemetry/index.js'; const httpClient = new FetchHttpClient(); const Chargebee = CreateChargebee(httpClient); diff --git a/src/environment.ts b/src/environment.ts index 78b92db..51c3e29 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -9,7 +9,7 @@ export const Environment = { hostSuffix: '.chargebee.com', apiPath: '/api/v2', timeout: DEFAULT_TIME_OUT, - clientVersion: 'v3.28.1', + clientVersion: 'v3.29.0', port: DEFAULT_PORT, timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT, exportWaitInMillis: DEFAULT_EXPORT_WAIT, diff --git a/src/resources/api_endpoints.ts b/src/resources/api_endpoints.ts index af00b2b..c8eafe1 100644 --- a/src/resources/api_endpoints.ts +++ b/src/resources/api_endpoints.ts @@ -13,6 +13,8 @@ type EndpointTuple = [ }, ]; interface Endpoints { + asyncResponseList: EndpointTuple[]; + asyncResponse: EndpointTuple[]; subscription: EndpointTuple[]; contractTerm: EndpointTuple[]; discount: EndpointTuple[]; @@ -99,7 +101,9 @@ interface Endpoints { omnichannelOneTimeOrder: EndpointTuple[]; omnichannelOneTimeOrderItem: EndpointTuple[]; rule: EndpointTuple[]; + meter: EndpointTuple[]; usageEvent: EndpointTuple[]; + meteredFeature: EndpointTuple[]; usageFile: EndpointTuple[]; personalizedOffer: EndpointTuple[]; brand: EndpointTuple[]; @@ -120,6 +124,8 @@ interface Endpoints { subscriptionEntitlementsCreatedDetail: EndpointTuple[]; } export const Endpoints: Endpoints = { + asyncResponseList: [], + asyncResponse: [], subscription: [ [ 'create', @@ -4918,6 +4924,7 @@ export const Endpoints: Endpoints = { ], omnichannelOneTimeOrderItem: [], rule: [['retrieve', 'GET', '/rules', null, true, null, false, {}, {}]], + meter: [['list', 'GET', '/meters', null, false, null, false, {}, {}]], usageEvent: [ [ 'create', @@ -4946,6 +4953,60 @@ export const Endpoints: Endpoints = { {}, ], ], + meteredFeature: [ + [ + 'create', + 'POST', + '/metered_features', + null, + false, + null, + false, + {}, + { + isIdempotent: true, + }, + ], + [ + 'archive', + 'POST', + '/metered_features', + '/archive_command', + true, + null, + false, + {}, + { + isIdempotent: true, + }, + ], + [ + 'reactivate', + 'POST', + '/metered_features', + '/reactivate_command', + true, + null, + false, + {}, + { + isIdempotent: true, + }, + ], + [ + 'delete', + 'POST', + '/metered_features', + '/delete', + true, + null, + false, + {}, + { + isIdempotent: true, + }, + ], + ], usageFile: [ [ 'uploadUrl', diff --git a/src/resources/webhook/content.ts b/src/resources/webhook/content.ts index ee2c495..bfbe5b4 100644 --- a/src/resources/webhook/content.ts +++ b/src/resources/webhook/content.ts @@ -798,6 +798,12 @@ export interface PaymentSourceAddedContent { PaymentSource: import('chargebee').PaymentSource; } +export interface PaymentSourceBusinessEntityChangedContent { + BusinessEntityTransfer: import('chargebee').BusinessEntityTransfer; + + PaymentSource: import('chargebee').PaymentSource; +} + export interface PaymentSourceDeletedContent { Customer: import('chargebee').Customer; @@ -1723,6 +1729,8 @@ export type WebhookContentMap = { [WebhookEventType.PaymentSourceAdded]: PaymentSourceAddedContent; + [WebhookEventType.PaymentSourceBusinessEntityChanged]: PaymentSourceBusinessEntityChangedContent; + [WebhookEventType.PaymentSourceDeleted]: PaymentSourceDeletedContent; [WebhookEventType.PaymentSourceExpired]: PaymentSourceExpiredContent; diff --git a/src/resources/webhook/eventType.ts b/src/resources/webhook/eventType.ts index 866ec1d..5eb6461 100644 --- a/src/resources/webhook/eventType.ts +++ b/src/resources/webhook/eventType.ts @@ -267,6 +267,8 @@ export enum WebhookEventType { PaymentSourceAdded = 'payment_source_added', + PaymentSourceBusinessEntityChanged = 'payment_source_business_entity_changed', + PaymentSourceDeleted = 'payment_source_deleted', PaymentSourceExpired = 'payment_source_expired', diff --git a/src/telemetry/TelemetryAdapter.ts b/src/telemetry/TelemetryAdapter.ts index 4d30b95..12505ac 100644 --- a/src/telemetry/TelemetryAdapter.ts +++ b/src/telemetry/TelemetryAdapter.ts @@ -115,19 +115,17 @@ export function buildRequestEndSpanAttributes( }; if (result.error) { - // error.type is the status code on failed requests - attributes[TelemetryAttributeKeys.ERROR_TYPE] = String( - result.httpStatusCode, - ); + if (result.error.chargebeeApiErrorType) { + attributes[TelemetryAttributeKeys.ERROR_TYPE] = + result.error.chargebeeApiErrorType; + attributes[TelemetryAttributeKeys.CHARGEBEE_ERROR_TYPE] = + result.error.chargebeeApiErrorType; + } if (result.error.chargebeeErrorCode) { attributes[TelemetryAttributeKeys.CHARGEBEE_ERROR_CODE] = result.error.chargebeeErrorCode; } - if (result.error.chargebeeApiErrorType) { - attributes[TelemetryAttributeKeys.CHARGEBEE_ERROR_TYPE] = - result.error.chargebeeApiErrorType; - } if (result.error.chargebeeErrorParam) { attributes[TelemetryAttributeKeys.CHARGEBEE_ERROR_PARAM] = result.error.chargebeeErrorParam; @@ -168,6 +166,9 @@ export function extractRequestTelemetryError( err: unknown, ): RequestTelemetryError | undefined { if (err == null || typeof err !== 'object') { + if (err instanceof Error) { + return { message: err.message }; + } return undefined; } @@ -175,7 +176,9 @@ export function extractRequestTelemetryError( const message = typeof errorObj.message === 'string' ? errorObj.message - : 'Chargebee API request failed'; + : err instanceof Error + ? err.message + : 'Chargebee API request failed'; const result: RequestTelemetryError = { message }; diff --git a/types/core.d.ts b/types/core.d.ts index f3d36f8..b99e9f0 100644 --- a/types/core.d.ts +++ b/types/core.d.ts @@ -86,7 +86,11 @@ declare module 'chargebee' { | 'not_applicable'; type DiscountTypeEnum = 'fixed_amount' | 'percentage' | 'price'; type DispositionTypeEnum = 'attachment' | 'inline'; - type DunningTypeEnum = 'auto_collect' | 'offline' | 'direct_debit'; + type DunningTypeEnum = + | 'auto_collect' + | 'offline' + | 'direct_debit' + | 'real_time_payments'; type DurationTypeEnum = 'one_time' | 'forever' | 'limited_period'; type EcheckTypeEnum = 'web' | 'ppd' | 'ccd'; type EinvoicingMethodEnum = 'automatic' | 'manual' | 'site_default'; @@ -319,6 +323,7 @@ declare module 'chargebee' { | 'business_entity_deleted' | 'customer_business_entity_changed' | 'subscription_business_entity_changed' + | 'payment_source_business_entity_changed' | 'purchase_created' | 'voucher_created' | 'voucher_expired' @@ -539,7 +544,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; type PaymentMethodSavePolicyEnum = 'always' | 'ask' | 'never'; type PaymentMethodTypeEnum = | 'card' @@ -588,7 +596,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; type PaymentVoucherTypeEnum = 'boleto'; type PeriodUnitEnum = 'day' | 'week' | 'month' | 'year'; type PriceTypeEnum = 'tax_exclusive' | 'tax_inclusive'; @@ -628,7 +639,14 @@ declare module 'chargebee' { | 'js_api' | 'migration' | 'external_service'; - type StatusEnum = 'available' | 'exhausted' | 'scheduled' | 'in_grace_period'; + type StatusEnum = + | 'active' + | 'archived' + | 'deleted' + | 'available' + | 'exhausted' + | 'scheduled' + | 'in_grace_period'; type TaxExemptReasonEnum = | 'tax_not_configured' | 'region_non_taxable' @@ -649,7 +667,16 @@ declare module 'chargebee' { | 'special' | 'unincorporated' | 'other'; - type TaxOverrideReasonEnum = 'id_exempt' | 'customer_exempt' | 'export'; + type TaxOverrideReasonEnum = + | 'zero_rated' + | 'id_exempt' + | 'customer_exempt' + | 'region_non_taxable' + | 'product_exempt' + | 'export' + | 'high_value_physical_goods' + | 'zero_value_item' + | 'tax_not_configured_external_provider'; type TaxabilityEnum = 'taxable' | 'exempt'; type TaxjarExemptionCategoryEnum = 'wholesale' | 'government' | 'other'; type TrialEndActionEnum = @@ -705,10 +732,16 @@ declare module 'chargebee' { | 'paypay' | 'gcash' | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay' | 'free_trial' | 'pay_up_front' | 'pay_as_you_go' - | 'usage_exceeded'; + | 'simple' + | 'compound' + | 'usage_exceeded' + | 'spend_exceeded'; type UnbilledChargesHandlingEnum = 'no_action' | 'invoice'; type UnbilledChargesOptionEnum = 'invoice' | 'delete'; type UnpaidInvoicesHandlingEnum = 'no_action' | 'schedule_payment_collection'; @@ -884,6 +917,7 @@ declare module 'chargebee' { | 'business_entity_deleted' | 'customer_business_entity_changed' | 'subscription_business_entity_changed' + | 'payment_source_business_entity_changed' | 'purchase_created' | 'voucher_created' | 'voucher_expired' diff --git a/types/index.d.ts b/types/index.d.ts index 9862003..d37b2af 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -3,6 +3,8 @@ /// /// /// +/// +/// /// /// /// @@ -10,6 +12,7 @@ /// /// /// +/// /// /// /// @@ -53,6 +56,8 @@ /// /// /// +/// +/// /// /// /// @@ -170,14 +175,14 @@ declare module 'chargebee' { httpClient?: HttpClientInterface; /** - * @telemetryAdapter optional telemetry adapter for observability (e.g. OpenTelemetry) + * @enableValidation When true, every request's parameters are validated against each endpoint's generated Zod schema before the HTTP request is sent. Violations throw `ChargebeeZodValidationError` with structured Zod issues. Calls with no params argument are validated as `{}`. Required resource ids in the URL path are still checked separately. */ - telemetryAdapter?: TelemetryAdapter; + enableValidation?: boolean; /** - * @enableValidation When true, every request's parameters are validated against each endpoint's generated Zod schema before the HTTP request is sent. Violations throw `ChargebeeZodValidationError` with structured Zod issues. Calls with no params argument are validated as `{}`. Required resource ids in the URL path are still checked separately. + * @telemetryAdapter optional telemetry adapter for observability (e.g. OpenTelemetry) */ - enableValidation?: boolean; + telemetryAdapter?: TelemetryAdapter; }; export interface HttpClientInterface { @@ -214,10 +219,7 @@ declare module 'chargebee' { chargebeeApiVersion: 'v1' | 'v2'; sdkName: string; sdkVersion: string; - /** - * Prebuilt span attributes — pass these to your tracer. Captured `chargebee-*` request - * headers appear as `http.request.header.` with string[] values per OTel semconv. - */ + /** Prebuilt span attributes — pass these to your tracer. */ startAttributes: Record; }; @@ -297,6 +299,8 @@ declare module 'chargebee' { itemPrice: ItemPrice.ItemPriceResource; ledgerAccountBalance: LedgerAccountBalance.LedgerAccountBalanceResource; ledgerOperation: LedgerOperation.LedgerOperationResource; + meter: Meter.MeterResource; + meteredFeature: MeteredFeature.MeteredFeatureResource; nonSubscription: NonSubscription.NonSubscriptionResource; offerEvent: OfferEvent.OfferEventResource; offerFulfillment: OfferFulfillment.OfferFulfillmentResource; diff --git a/types/resources/Alert.d.ts b/types/resources/Alert.d.ts index f927fbe..2e0a2f0 100644 --- a/types/resources/Alert.d.ts +++ b/types/resources/Alert.d.ts @@ -7,12 +7,15 @@ declare module 'chargebee' { type: TypeEnum; name: string; description?: string; - metered_feature_id: string; + metered_feature_id?: string; + currency_code?: string; subscription_id?: string; status?: 'enabled' | 'disabled'; meta?: string; created_at: number; updated_at: number; + threshold?: Alert.Threshold[]; + filter_conditions?: Alert.FilterCondition[]; } export namespace Alert { @@ -76,6 +79,15 @@ declare module 'chargebee' { next_offset?: string; } + export interface Threshold { + mode: 'absolute' | 'percentage'; + value: number; + } + export interface FilterCondition { + field: 'plan_price_id'; + operator: 'equals' | 'not_equals'; + value: string; + } // REQUEST PARAMS //--------------- @@ -83,7 +95,8 @@ declare module 'chargebee' { type: TypeEnum; name: string; description?: string; - metered_feature_id: string; + metered_feature_id?: string; + currency_code?: string; subscription_id?: string; meta?: string; threshold?: ThresholdCreateInputParam; @@ -108,7 +121,7 @@ declare module 'chargebee' { type?: filter.Enum; } export interface ThresholdCreateInputParam { - mode: ModeEnum; + mode?: ModeEnum; value: number; } diff --git a/types/resources/AsyncResponse.d.ts b/types/resources/AsyncResponse.d.ts new file mode 100644 index 0000000..077d794 --- /dev/null +++ b/types/resources/AsyncResponse.d.ts @@ -0,0 +1,35 @@ +/// +/// + +declare module 'chargebee' { + export interface AsyncResponse { + api_version?: string; + created_at?: number; + completed_at?: number; + status: 'success' | 'failed'; + request?: AsyncResponse.RequestAsyncApi; + error_detail?: AsyncResponse.Error; + result?: any; + } + + export namespace AsyncResponse { + export interface RequestAsyncApi { + id: string; + resource?: string; + operation_type?: string; + method?: string; + uri?: string; + idempotency_key?: string; + } + export interface Error { + message?: string; + type?: string; + api_error_code?: string; + error_code?: string; + error_msg?: string; + http_status_code?: string; + } + // REQUEST PARAMS + //--------------- + } +} diff --git a/types/resources/AsyncResponseList.d.ts b/types/resources/AsyncResponseList.d.ts new file mode 100644 index 0000000..31a1b62 --- /dev/null +++ b/types/resources/AsyncResponseList.d.ts @@ -0,0 +1,8 @@ +/// +/// + +declare module 'chargebee' { + export interface AsyncResponseList { + list?: AsyncResponse[]; + } +} diff --git a/types/resources/ColumnDefinition.d.ts b/types/resources/ColumnDefinition.d.ts new file mode 100644 index 0000000..c342479 --- /dev/null +++ b/types/resources/ColumnDefinition.d.ts @@ -0,0 +1,9 @@ +/// +/// + +declare module 'chargebee' { + export interface ColumnDefinition { + column_name: string; + data_type: 'number' | 'string'; + } +} diff --git a/types/resources/Content.d.ts b/types/resources/Content.d.ts index c8b2a42..2a17dc7 100644 --- a/types/resources/Content.d.ts +++ b/types/resources/Content.d.ts @@ -8,6 +8,8 @@ declare module 'chargebee' { advance_invoice_schedule: AdvanceInvoiceSchedule; alert: Alert; alert_status: AlertStatus; + async_response: AsyncResponse; + async_response_list: AsyncResponseList; attached_item: AttachedItem; attribute: Attribute; billing_configuration: BillingConfiguration; @@ -15,6 +17,7 @@ declare module 'chargebee' { business_entity: BusinessEntity; business_entity_transfer: BusinessEntityTransfer; card: Card; + column_definition: ColumnDefinition; comment: Comment; configuration: Configuration; contact: Contact; @@ -58,6 +61,8 @@ declare module 'chargebee' { ledger_account_balance: LedgerAccountBalance; ledger_operation: LedgerOperation; metadata: Metadata; + meter: Meter; + metered_feature: MeteredFeature; non_subscription: NonSubscription; offer_event: OfferEvent; offer_fulfillment: OfferFulfillment; diff --git a/types/resources/CreditNote.d.ts b/types/resources/CreditNote.d.ts index 90cf1b4..5044bb3 100644 --- a/types/resources/CreditNote.d.ts +++ b/types/resources/CreditNote.d.ts @@ -58,6 +58,7 @@ declare module 'chargebee' { deleted: boolean; tax_category?: string; local_currency_exchange_rate?: number; + exchange_rates?: CreditNote.ExchangeRate[]; create_reason_code?: string; vat_number_prefix?: string; business_entity_id?: string; @@ -261,6 +262,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemTier { line_item_id?: string; @@ -388,6 +394,10 @@ declare module 'chargebee' { | 'pending'; tax_application?: 'pre_tax' | 'post_tax'; } + export interface ExchangeRate { + currency_code: string; + rate: number; + } export interface ShippingAddress { first_name?: string; last_name?: string; @@ -694,6 +704,11 @@ declare module 'chargebee' { tax9_amount?: number; tax10_name?: string; tax10_amount?: number; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } } } diff --git a/types/resources/CreditNoteEstimate.d.ts b/types/resources/CreditNoteEstimate.d.ts index da144b3..b2c189e 100644 --- a/types/resources/CreditNoteEstimate.d.ts +++ b/types/resources/CreditNoteEstimate.d.ts @@ -70,6 +70,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemTier { line_item_id?: string; diff --git a/types/resources/Customer.d.ts b/types/resources/Customer.d.ts index 5d40a9a..5a2fc08 100644 --- a/types/resources/Customer.d.ts +++ b/types/resources/Customer.d.ts @@ -774,7 +774,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -971,7 +974,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; /** * @deprecated Please refer API docs to use other attributes */ diff --git a/types/resources/Estimate.d.ts b/types/resources/Estimate.d.ts index 9606d10..79bb7cf 100644 --- a/types/resources/Estimate.d.ts +++ b/types/resources/Estimate.d.ts @@ -1070,7 +1070,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1172,7 +1175,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1298,6 +1304,7 @@ declare module 'chargebee' { avalara_service_type?: number; date_from?: number; date_to?: number; + entity_description?: string; } export interface DiscountsCreateInvoiceForItemsInputParam { percentage?: number; @@ -1325,6 +1332,8 @@ declare module 'chargebee' { unit_price_in_decimal?: string; date_from?: number; date_to?: number; + description?: string; + entity_description?: string; } export interface TaxProvidersFieldsCreateInvoiceForItemsInputParam { provider_name?: string; diff --git a/types/resources/Event.d.ts b/types/resources/Event.d.ts index 66e95de..c8c5da1 100644 --- a/types/resources/Event.d.ts +++ b/types/resources/Event.d.ts @@ -200,6 +200,7 @@ declare module 'chargebee' { OmnichannelSubscriptionItemGracePeriodStartedContent & CardExpiryReminderContent & TokenCreatedContent & + PaymentSourceBusinessEntityChangedContent & PromotionalCreditsAddedContent & SubscriptionRampUpdatedContent & CustomerEntitlementsUpdatedContent & diff --git a/types/resources/Export.d.ts b/types/resources/Export.d.ts index 8e6802c..91a9021 100644 --- a/types/resources/Export.d.ts +++ b/types/resources/Export.d.ts @@ -473,6 +473,7 @@ declare module 'chargebee' { offline_payment_method?: filter.Enum; auto_close_invoices?: filter.Boolean; channel?: filter.Enum; + decommissioned?: filter.Boolean; plan_id?: filter.String; } diff --git a/types/resources/Feature.d.ts b/types/resources/Feature.d.ts index ba9474e..2ef7ee8 100644 --- a/types/resources/Feature.d.ts +++ b/types/resources/Feature.d.ts @@ -13,6 +13,7 @@ declare module 'chargebee' { resource_version?: number; updated_at?: number; created_at: number; + metered: boolean; levels?: Feature.Level[]; } @@ -109,6 +110,7 @@ declare module 'chargebee' { id?: filter.String; status?: filter.Enum; type?: filter.Enum; + metered?: filter.Boolean; [key: `cf_${string}`]: unknown; } export interface CreateInputParam { diff --git a/types/resources/Gift.d.ts b/types/resources/Gift.d.ts index f4753f8..b4ac553 100644 --- a/types/resources/Gift.d.ts +++ b/types/resources/Gift.d.ts @@ -228,7 +228,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -324,7 +327,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes diff --git a/types/resources/GrantBlock.d.ts b/types/resources/GrantBlock.d.ts index 4ca6bb9..589ac0f 100644 --- a/types/resources/GrantBlock.d.ts +++ b/types/resources/GrantBlock.d.ts @@ -15,7 +15,6 @@ declare module 'chargebee' { voided_amount: string; origin_grant_block_id?: string; status: StatusEnum; - metadata?: string; grant_source: | 'subscription_created' | 'subscription_changed' @@ -26,6 +25,7 @@ declare module 'chargebee' { account_type?: 'provisioned' | 'overdraft'; unit_id?: string; unit_type?: 'credit_unit'; + metadata?: any; } export namespace GrantBlock { diff --git a/types/resources/Invoice.d.ts b/types/resources/Invoice.d.ts index 51c8f00..86d0a4a 100644 --- a/types/resources/Invoice.d.ts +++ b/types/resources/Invoice.d.ts @@ -43,6 +43,7 @@ declare module 'chargebee' { resource_version?: number; updated_at?: number; line_items_next_offset?: string; + exchange_rates?: Invoice.ExchangeRate[]; first_invoice?: boolean; new_sales_amount?: number; has_advance_charges?: boolean; @@ -499,6 +500,10 @@ declare module 'chargebee' { invoice: Invoice; } + export interface ExchangeRate { + currency_code: string; + rate: number; + } export interface LineItem { id?: string; subscription_id?: string; @@ -547,6 +552,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemTier { line_item_id?: string; @@ -688,7 +698,11 @@ declare module 'chargebee' { export interface DunningAttempt { attempt: number; transaction_id?: string; - dunning_type: 'auto_collect' | 'offline' | 'direct_debit'; + dunning_type: + | 'auto_collect' + | 'offline' + | 'direct_debit' + | 'real_time_payments'; created_at?: number; txn_status?: | 'in_progress' @@ -911,6 +925,7 @@ declare module 'chargebee' { auto_collection?: AutoCollectionEnum; net_term_days?: number; invoice_date?: number; + create_pending_invoice?: boolean; token_id?: string; replace_primary_payment_source?: boolean; retain_payment_source?: boolean; @@ -1022,6 +1037,7 @@ declare module 'chargebee' { net_term_days?: number; has_advance_charges?: boolean; use_for_proration?: boolean; + paid_at?: number; credit_note?: CreditNoteImportInvoiceInputParam; billing_address?: BillingAddressImportInvoiceInputParam; shipping_address?: ShippingAddressImportInvoiceInputParam; @@ -1294,7 +1310,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1465,7 +1484,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1505,6 +1527,7 @@ declare module 'chargebee' { } export interface ChargesCreateForChargeItemsAndChargesInputParam { + entity_description?: string; amount?: number; amount_in_decimal?: string; description?: string; @@ -1545,6 +1568,8 @@ declare module 'chargebee' { unit_price_in_decimal?: string; date_from?: number; date_to?: number; + description?: string; + entity_description?: string; } export interface TaxProvidersFieldsCreateForChargeItemsAndChargesInputParam { provider_name?: string; @@ -1741,6 +1766,11 @@ declare module 'chargebee' { tax9_amount?: number; tax10_name?: string; tax10_amount?: number; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; created_at?: number; } export interface TransactionsApplyPaymentsInputParam { diff --git a/types/resources/InvoiceEstimate.d.ts b/types/resources/InvoiceEstimate.d.ts index c8f3e9e..7348620 100644 --- a/types/resources/InvoiceEstimate.d.ts +++ b/types/resources/InvoiceEstimate.d.ts @@ -72,6 +72,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemTier { line_item_id?: string; diff --git a/types/resources/LedgerOperation.d.ts b/types/resources/LedgerOperation.d.ts index 251f0dc..87e4ae8 100644 --- a/types/resources/LedgerOperation.d.ts +++ b/types/resources/LedgerOperation.d.ts @@ -15,8 +15,6 @@ declare module 'chargebee' { | 'rollover' | 'adjustment'; amount: string; - start_balance: string; - end_balance: string; provisioned_start_balance: string; provisioned_end_balance: string; overdraft_start_balance: string; @@ -24,12 +22,12 @@ declare module 'chargebee' { parent_ledger_operation_id?: string; ledger_operation_timestamp?: number; auto_release_timestamp?: number; - metadata?: string; created_at?: number; modified_at?: number; subscription_id?: string; unit_id?: string; unit_type?: 'credit_unit'; + metadata?: any; } export namespace LedgerOperation { diff --git a/types/resources/Meter.d.ts b/types/resources/Meter.d.ts new file mode 100644 index 0000000..ba7f2ec --- /dev/null +++ b/types/resources/Meter.d.ts @@ -0,0 +1,42 @@ +/// +/// +/// +declare module 'chargebee' { + export interface Meter { + id: string; + name: string; + description?: string; + type: 'simple' | 'compound'; + status?: 'active' | 'archived' | 'deleted'; + query: string; + created_at: number; + updated_at?: number; + column_definitions?: ColumnDefinition[]; + features?: Feature[]; + } + + export namespace Meter { + export class MeterResource { + list( + input?: ListInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface ListResponse { + list: { meter: Meter }[]; + next_offset?: string; + } + + // REQUEST PARAMS + //--------------- + + export interface ListInputParam { + limit?: number; + offset?: string; + name?: filter.String; + 'sort_by[asc]'?: string; + 'sort_by[desc]'?: string; + } + } +} diff --git a/types/resources/MeteredFeature.d.ts b/types/resources/MeteredFeature.d.ts new file mode 100644 index 0000000..f1f9ced --- /dev/null +++ b/types/resources/MeteredFeature.d.ts @@ -0,0 +1,70 @@ +/// +/// + +declare module 'chargebee' { + export interface MeteredFeature { + id: string; + name?: string; + description?: string; + type?: TypeEnum; + status?: StatusEnum; + query?: string; + column_definitions?: ColumnDefinition[]; + features?: Feature[]; + } + + export namespace MeteredFeature { + export class MeteredFeatureResource { + create( + input: CreateInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + + archive( + metered_feature_id: string, + headers?: ChargebeeRequestHeader, + ): Promise>; + + reactivate( + metered_feature_id: string, + headers?: ChargebeeRequestHeader, + ): Promise>; + + delete( + metered_feature_id: string, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface CreateResponse { + meter: Meter; + } + + export interface ArchiveResponse { + meter: Meter; + } + + export interface ReactivateResponse { + meter: Meter; + } + + export interface DeleteResponse { + meter: Meter; + } + + // REQUEST PARAMS + //--------------- + + export interface CreateInputParam { + name: string; + description?: string; + feature_unit: string; + query: string; + column_definitions?: ColumnDefinitionsCreateInputParam[]; + } + export interface ColumnDefinitionsCreateInputParam { + column_name: string; + data_type: 'number' | 'string'; + } + } +} diff --git a/types/resources/PaymentIntent.d.ts b/types/resources/PaymentIntent.d.ts index 80d21f8..77e0e12 100644 --- a/types/resources/PaymentIntent.d.ts +++ b/types/resources/PaymentIntent.d.ts @@ -55,7 +55,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; success_url?: string; failure_url?: string; created_at: number; @@ -66,6 +69,7 @@ declare module 'chargebee' { gateway?: string; active_payment_attempt?: PaymentIntent.PaymentAttempt; payment_attempts?: PaymentIntent.PaymentAttempt[]; + payment_intent_metadata?: PaymentIntent.PaymentIntentMetadata; business_entity_id?: string; } @@ -155,7 +159,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; id_at_gateway?: string; error_code?: string; error_text?: string; @@ -219,7 +226,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; id_at_gateway?: string; error_code?: string; error_text?: string; @@ -228,6 +238,22 @@ declare module 'chargebee' { modified_at: number; error_detail?: GatewayErrorDetail; } + export interface PaymentIntentMetadata { + source: + | 'cb_js' + | 'components_fields' + | 'checkout_v3' + | 'paynow_v3' + | 'portal_v3' + | 'gift_v3' + | 'checkout_v4' + | 'payment_component' + | 'pc_inapp_v4' + | 'pc_fpc_v4'; + client_ip_address?: string; + user_agent?: string; + created_at?: number; + } // REQUEST PARAMS //--------------- @@ -284,7 +310,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; success_url?: string; failure_url?: string; } @@ -337,7 +366,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; success_url?: string; failure_url?: string; } diff --git a/types/resources/PaymentSource.d.ts b/types/resources/PaymentSource.d.ts index 4988205..17dcdd6 100644 --- a/types/resources/PaymentSource.d.ts +++ b/types/resources/PaymentSource.d.ts @@ -479,7 +479,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes diff --git a/types/resources/PromotionalGrant.d.ts b/types/resources/PromotionalGrant.d.ts index 9d50f66..6a14fc4 100644 --- a/types/resources/PromotionalGrant.d.ts +++ b/types/resources/PromotionalGrant.d.ts @@ -7,7 +7,7 @@ declare module 'chargebee' { unit_id: string; amount: string; expires_at: number; - metadata?: string; + metadata?: any; } export namespace PromotionalGrant { diff --git a/types/resources/Purchase.d.ts b/types/resources/Purchase.d.ts index da9f272..720ab6d 100644 --- a/types/resources/Purchase.d.ts +++ b/types/resources/Purchase.d.ts @@ -122,7 +122,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes diff --git a/types/resources/Quote.d.ts b/types/resources/Quote.d.ts index 21b94b6..15eacc7 100644 --- a/types/resources/Quote.d.ts +++ b/types/resources/Quote.d.ts @@ -429,6 +429,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemTier { line_item_id?: string; diff --git a/types/resources/QuoteLineGroup.d.ts b/types/resources/QuoteLineGroup.d.ts index ac5c715..05c85f8 100644 --- a/types/resources/QuoteLineGroup.d.ts +++ b/types/resources/QuoteLineGroup.d.ts @@ -74,6 +74,11 @@ declare module 'chargebee' { | 'tax_not_configured_external_provider'; entity_id?: string; customer_id?: string; + proration_mode?: + | 'reset' + | 'delta' + | 'service_period_revision' + | 'adjusted_term'; } export interface LineItemDiscount { line_item_id: string; diff --git a/types/resources/QuotedCharge.d.ts b/types/resources/QuotedCharge.d.ts index ac9ed5b..692160f 100644 --- a/types/resources/QuotedCharge.d.ts +++ b/types/resources/QuotedCharge.d.ts @@ -16,6 +16,7 @@ declare module 'chargebee' { amount?: number; amount_in_decimal?: string; description?: string; + entity_description?: string; service_period_in_days?: number; avalara_sale_type?: 'wholesale' | 'retail' | 'consumed' | 'vendor_use'; avalara_transaction_type?: number; @@ -36,6 +37,8 @@ declare module 'chargebee' { quantity_in_decimal?: string; unit_price?: number; unit_price_in_decimal?: string; + description?: string; + entity_description?: string; service_period_days?: number; } export interface ItemTier { diff --git a/types/resources/Ramp.d.ts b/types/resources/Ramp.d.ts index 61a3ded..736292f 100644 --- a/types/resources/Ramp.d.ts +++ b/types/resources/Ramp.d.ts @@ -126,9 +126,10 @@ declare module 'chargebee' { export interface DiscountsToAdd { id: string; invoice_name?: string; - type: 'fixed_amount' | 'percentage'; + type: 'fixed_amount' | 'percentage' | 'offer_quantity'; percentage?: number; amount?: number; + quantity?: number; duration_type: 'one_time' | 'forever' | 'limited_period'; period?: number; period_unit?: 'day' | 'week' | 'month' | 'year'; @@ -248,6 +249,7 @@ declare module 'chargebee' { duration_type: DurationTypeEnum; percentage?: number; amount?: number; + quantity?: number; period?: number; period_unit?: PeriodUnitEnum; included_in_mrr?: boolean; @@ -303,6 +305,7 @@ declare module 'chargebee' { duration_type: DurationTypeEnum; percentage?: number; amount?: number; + quantity?: number; period?: number; period_unit?: PeriodUnitEnum; included_in_mrr?: boolean; diff --git a/types/resources/RecordedPurchase.d.ts b/types/resources/RecordedPurchase.d.ts index 282a729..271d48a 100644 --- a/types/resources/RecordedPurchase.d.ts +++ b/types/resources/RecordedPurchase.d.ts @@ -59,6 +59,9 @@ declare module 'chargebee' { } export interface CustomerCreateInputParam { id: string; + email?: string; + first_name?: string; + last_name?: string; } export interface GooglePlayStoreCreateInputParam { purchase_token?: string; diff --git a/types/resources/Subscription.d.ts b/types/resources/Subscription.d.ts index 83974cc..6207143 100644 --- a/types/resources/Subscription.d.ts +++ b/types/resources/Subscription.d.ts @@ -882,6 +882,7 @@ declare module 'chargebee' { override_relationship?: filter.Boolean; business_entity_id?: filter.String; channel?: filter.Enum; + decommissioned?: filter.Boolean; 'sort_by[asc]'?: string; 'sort_by[desc]'?: string; [key: `cf_${string}`]: unknown; @@ -1431,7 +1432,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1583,7 +1587,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1702,7 +1709,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -1876,7 +1886,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -2064,7 +2077,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -2208,7 +2224,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes @@ -2658,7 +2677,10 @@ declare module 'chargebee' { | 'alipay_hk' | 'paypay' | 'gcash' - | 'south_korean_cards'; + | 'south_korean_cards' + | 'paynow' + | 'bizum' + | 'promptpay'; reference_id?: string; /** * @deprecated Please refer API docs to use other attributes diff --git a/types/resources/WebhookEvent.d.ts b/types/resources/WebhookEvent.d.ts index 5b29d46..4e8ec47 100644 --- a/types/resources/WebhookEvent.d.ts +++ b/types/resources/WebhookEvent.d.ts @@ -183,6 +183,7 @@ declare module 'chargebee' { OmnichannelSubscriptionItemGracePeriodStarted = 'omnichannel_subscription_item_grace_period_started', CardExpiryReminder = 'card_expiry_reminder', TokenCreated = 'token_created', + PaymentSourceBusinessEntityChanged = 'payment_source_business_entity_changed', PromotionalCreditsAdded = 'promotional_credits_added', SubscriptionRampUpdated = 'subscription_ramp_updated', CustomerEntitlementsUpdated = 'customer_entitlements_updated', @@ -410,6 +411,7 @@ declare module 'chargebee' { [WebhookEventType.OmnichannelSubscriptionItemGracePeriodStarted]: OmnichannelSubscriptionItemGracePeriodStartedContent; [WebhookEventType.CardExpiryReminder]: CardExpiryReminderContent; [WebhookEventType.TokenCreated]: TokenCreatedContent; + [WebhookEventType.PaymentSourceBusinessEntityChanged]: PaymentSourceBusinessEntityChangedContent; [WebhookEventType.PromotionalCreditsAdded]: PromotionalCreditsAddedContent; [WebhookEventType.SubscriptionRampUpdated]: SubscriptionRampUpdatedContent; [WebhookEventType.CustomerEntitlementsUpdated]: CustomerEntitlementsUpdatedContent; @@ -1504,6 +1506,11 @@ declare module 'chargebee' { export type TokenCreatedContent = { token: Token; }; + export type PaymentSourceBusinessEntityChangedContent = { + business_entity_transfer: BusinessEntityTransfer; + + payment_source: PaymentSource; + }; export type PromotionalCreditsAddedContent = { customer: Customer; From cdcb664e3c03396c8ba656c34789e2bf2501f002 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Tue, 21 Jul 2026 12:23:02 +0530 Subject: [PATCH 3/3] Validator changes --- src/schema/alert.schema.ts | 11 +++--- src/schema/credit_note.schema.ts | 7 ++++ src/schema/customer.schema.ts | 15 ++++++++ src/schema/estimate.schema.ts | 9 +++++ src/schema/event.schema.ts | 4 ++ src/schema/export.schema.ts | 24 ++++++++++-- src/schema/feature.schema.ts | 1 - src/schema/gift.schema.ts | 6 +++ src/schema/invoice.schema.ts | 36 +++++++++++++++++- src/schema/item.schema.ts | 2 +- src/schema/item_family.schema.ts | 2 +- src/schema/item_price.schema.ts | 2 +- src/schema/meter.schema.ts | 10 +++++ src/schema/omnichannel_subscription.schema.ts | 4 +- src/schema/payment_intent.schema.ts | 6 +++ src/schema/payment_source.schema.ts | 21 +++++++++++ src/schema/price_variant.schema.ts | 2 +- src/schema/purchase.schema.ts | 3 ++ src/schema/ramp.schema.ts | 2 + src/schema/recorded_purchase.schema.ts | 3 ++ src/schema/subscription.schema.ts | 37 +++++++++++++++++++ src/schema/transaction.schema.ts | 12 ++++++ src/schema/webhook_endpoint.schema.ts | 2 + 23 files changed, 204 insertions(+), 17 deletions(-) diff --git a/src/schema/alert.schema.ts b/src/schema/alert.schema.ts index 65f040f..e641d74 100644 --- a/src/schema/alert.schema.ts +++ b/src/schema/alert.schema.ts @@ -7,7 +7,7 @@ import { z } from 'zod'; //Alert.create const CreateAlertThresholdSchema = z.object({ - mode: z.enum(['absolute', 'percentage']), + mode: z.enum(['absolute', 'percentage']).optional(), value: z.number(), }); const CreateAlertFilterConditionsSchema = z.object({ @@ -16,10 +16,11 @@ const CreateAlertFilterConditionsSchema = z.object({ value: z.array(z.string().max(50).optional()).optional(), }); const CreateAlertBodySchema = z.looseObject({ - type: z.enum(['usage_exceeded']), + type: z.enum(['usage_exceeded', 'spend_exceeded']), name: z.string().max(50), description: z.string().max(65000).optional(), - metered_feature_id: z.string().max(50), + metered_feature_id: z.string().max(50).optional(), + currency_code: z.string().max(3).optional(), subscription_id: z.string().max(50).optional(), meta: z.string().max(65000).optional(), threshold: CreateAlertThresholdSchema.optional(), @@ -34,7 +35,7 @@ const ListAlertIdSchema = z.object({ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListAlertTypeSchema = z.object({ - is: z.enum(['usage_exceeded']).optional(), + is: z.enum(['usage_exceeded', 'spend_exceeded']).optional(), }); const ListAlertSubscriptionIdSchema = z.object({ is: z.string().min(1).optional(), @@ -72,7 +73,7 @@ const ApplicationAlertsforsubscriptionAlertStatusSchema = z.object({ is: z.enum(['enabled', 'disabled']).optional(), }); const ApplicationAlertsforsubscriptionAlertTypeSchema = z.object({ - is: z.enum(['usage_exceeded']).optional(), + is: z.enum(['usage_exceeded', 'spend_exceeded']).optional(), }); const ApplicationAlertsforsubscriptionAlertBodySchema = z.looseObject({ limit: z.number().int().min(1).max(100).optional(), diff --git a/src/schema/credit_note.schema.ts b/src/schema/credit_note.schema.ts index 4c87170..5305fbc 100644 --- a/src/schema/credit_note.schema.ts +++ b/src/schema/credit_note.schema.ts @@ -448,6 +448,13 @@ const ImportCreditNoteCreditNoteLineItemsSchema = z.object({ tax9_amount: z.array(z.number().int().min(0).optional()).optional(), tax10_name: z.array(z.string().max(50).optional()).optional(), tax10_amount: z.array(z.number().int().min(0).optional()).optional(), + proration_mode: z + .array( + z + .enum(['reset', 'delta', 'service_period_revision', 'adjusted_term']) + .optional(), + ) + .optional(), }); const ImportCreditNoteCreditNoteLineItemTiersSchema = z.object({ line_item_id: z.array(z.string().max(40).optional()), diff --git a/src/schema/customer.schema.ts b/src/schema/customer.schema.ts index 413c6b3..dfaa1fc 100644 --- a/src/schema/customer.schema.ts +++ b/src/schema/customer.schema.ts @@ -165,6 +165,9 @@ const CreateCustomerPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -287,6 +290,9 @@ const CreateCustomerPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -717,6 +723,9 @@ const UpdatePaymentMethodCustomerPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]), gateway: z .enum([ @@ -1056,6 +1065,9 @@ const CollectPaymentCustomerPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway_account_id: z.string().max(50).optional(), @@ -1136,6 +1148,9 @@ const CollectPaymentCustomerPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gw_payment_method_id: z.string().max(65000).optional(), diff --git a/src/schema/estimate.schema.ts b/src/schema/estimate.schema.ts index 507f0c0..0ae041a 100644 --- a/src/schema/estimate.schema.ts +++ b/src/schema/estimate.schema.ts @@ -1273,6 +1273,9 @@ const GiftSubscriptionEstimatePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -1396,6 +1399,9 @@ const GiftSubscriptionForItemsEstimatePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -1589,6 +1595,8 @@ const CreateInvoiceForItemsEstimateItemPricesSchema = z.object({ unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(), date_from: z.array(z.number().int().optional()).optional(), date_to: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(250).optional()).optional(), + entity_description: z.array(z.string().max(500).optional()).optional(), }); const CreateInvoiceForItemsEstimateItemTiersSchema = z.object({ item_price_id: z.array(z.string().max(100).optional()).optional(), @@ -1619,6 +1627,7 @@ const CreateInvoiceForItemsEstimateChargesSchema = z.object({ avalara_service_type: z.array(z.number().int().optional()).optional(), date_from: z.array(z.number().int().optional()).optional(), date_to: z.array(z.number().int().optional()).optional(), + entity_description: z.array(z.string().max(500).optional()).optional(), }); const CreateInvoiceForItemsEstimateNotesToRemoveSchema = z.object({ entity_type: z diff --git a/src/schema/event.schema.ts b/src/schema/event.schema.ts index 9732211..e8f98fd 100644 --- a/src/schema/event.schema.ts +++ b/src/schema/event.schema.ts @@ -231,6 +231,7 @@ const ListEventEventTypeSchema = z.object({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired', @@ -457,6 +458,7 @@ const ListEventEventTypeSchema = z.object({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired', @@ -683,6 +685,7 @@ const ListEventEventTypeSchema = z.object({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired', @@ -909,6 +912,7 @@ const ListEventEventTypeSchema = z.object({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired', diff --git a/src/schema/export.schema.ts b/src/schema/export.schema.ts index 63c8f98..8110b61 100644 --- a/src/schema/export.schema.ts +++ b/src/schema/export.schema.ts @@ -1676,6 +1676,9 @@ const SubscriptionsExportChannelSchema = z.object({ in: z.enum(['web', 'app_store', 'play_store']).optional(), not_in: z.enum(['web', 'app_store', 'play_store']).optional(), }); +const SubscriptionsExportDecommissionedSchema = z.object({ + is: z.enum(['true', 'false']).optional(), +}); const SubscriptionsExportPlanIdSchema = z.object({ is: z.string().min(1).optional(), is_not: z.string().min(1).optional(), @@ -1701,6 +1704,7 @@ const SubscriptionsExportSubscriptionItemSchema = z.object({ SubscriptionsExportOfflinePaymentMethodSchema.optional(), auto_close_invoices: SubscriptionsExportAutoCloseInvoicesSchema.optional(), channel: SubscriptionsExportChannelSchema.optional(), + decommissioned: SubscriptionsExportDecommissionedSchema.optional(), plan_id: SubscriptionsExportPlanIdSchema.optional(), }); const SubscriptionsExportBodySchema = z.looseObject({ @@ -2175,6 +2179,9 @@ const TransactionsExportPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), is_not: z @@ -2236,6 +2243,9 @@ const TransactionsExportPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), in: z @@ -2297,6 +2307,9 @@ const TransactionsExportPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), not_in: z @@ -2358,6 +2371,9 @@ const TransactionsExportPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), }); @@ -2970,8 +2986,8 @@ export type OrdersExportBody = z.infer; //Export.itemFamilies const ItemFamiliesExportBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ItemFamiliesExportIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), @@ -3015,8 +3031,8 @@ export type ItemFamiliesExportBody = z.infer< //Export.items const ItemsExportBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ItemsExportIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), @@ -3135,8 +3151,8 @@ const ItemPricesExportCurrencyCodeSchema = z.object({ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ItemPricesExportBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ItemPricesExportIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), @@ -3410,8 +3426,8 @@ export type DifferentialPricesExportBody = z.infer< //Export.priceVariants const PriceVariantsExportBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const PriceVariantsExportIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), diff --git a/src/schema/feature.schema.ts b/src/schema/feature.schema.ts index a8040b7..7d6efa6 100644 --- a/src/schema/feature.schema.ts +++ b/src/schema/feature.schema.ts @@ -61,7 +61,6 @@ const CreateFeatureBodySchema = z.looseObject({ description: z.string().max(500).optional(), type: z.enum(['switch', 'custom', 'quantity', 'range']).optional(), unit: z.string().max(50).optional(), - metered: z.boolean().optional(), levels: CreateFeatureLevelsSchema.optional(), }); export { CreateFeatureBodySchema }; diff --git a/src/schema/gift.schema.ts b/src/schema/gift.schema.ts index ab8b796..b9d7d72 100644 --- a/src/schema/gift.schema.ts +++ b/src/schema/gift.schema.ts @@ -70,6 +70,9 @@ const CreateGiftPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -187,6 +190,9 @@ const CreateForItemsGiftPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), diff --git a/src/schema/invoice.schema.ts b/src/schema/invoice.schema.ts index b2b64d4..70eaac3 100644 --- a/src/schema/invoice.schema.ts +++ b/src/schema/invoice.schema.ts @@ -185,6 +185,9 @@ const CreateInvoicePaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -307,6 +310,9 @@ const CreateInvoicePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -573,6 +579,9 @@ const CreateForChargeItemsAndChargesInvoicePaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -696,6 +705,9 @@ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -711,6 +723,8 @@ const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({ unit_price_in_decimal: z.array(z.string().max(39).optional()).optional(), date_from: z.array(z.number().int().optional()).optional(), date_to: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(250).optional()).optional(), + entity_description: z.array(z.string().max(500).optional()).optional(), }); const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({ item_price_id: z.array(z.string().max(100).optional()).optional(), @@ -726,6 +740,7 @@ const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({ package_size: z.array(z.number().int().min(1).optional()).optional(), }); const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({ + entity_description: z.array(z.string().max(500).optional()).optional(), amount: z.array(z.number().int().min(1).optional()).optional(), amount_in_decimal: z.array(z.string().max(39).optional()).optional(), description: z.array(z.string().max(250).optional()).optional(), @@ -787,6 +802,7 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({ auto_collection: z.enum(['on', 'off']).optional(), net_term_days: z.number().int().optional(), invoice_date: z.number().int().optional(), + create_pending_invoice: z.boolean().optional(), token_id: z.string().max(40).optional(), replace_primary_payment_source: z.boolean().default(false).optional(), retain_payment_source: z.boolean().default(true).optional(), @@ -1043,6 +1059,13 @@ const ImportInvoiceInvoiceLineItemsSchema = z.object({ tax9_amount: z.array(z.number().int().min(0).optional()).optional(), tax10_name: z.array(z.string().max(50).optional()).optional(), tax10_amount: z.array(z.number().int().min(0).optional()).optional(), + proration_mode: z + .array( + z + .enum(['reset', 'delta', 'service_period_revision', 'adjusted_term']) + .optional(), + ) + .optional(), created_at: z.array(z.number().int().optional()).optional(), }); const ImportInvoiceInvoicePaymentReferenceNumbersSchema = z.object({ @@ -1172,7 +1195,17 @@ const ImportInvoiceInvoiceBodySchema = z.looseObject({ po_number: z.string().max(100).optional(), price_type: z.enum(['tax_exclusive', 'tax_inclusive']).optional(), tax_override_reason: z - .enum(['id_exempt', 'customer_exempt', 'export']) + .enum([ + 'zero_rated', + 'id_exempt', + 'customer_exempt', + 'region_non_taxable', + 'product_exempt', + 'export', + 'high_value_physical_goods', + 'zero_value_item', + 'tax_not_configured_external_provider', + ]) .optional(), vat_number: z.string().max(20).optional(), vat_number_prefix: z.string().max(10).optional(), @@ -1191,6 +1224,7 @@ const ImportInvoiceInvoiceBodySchema = z.looseObject({ net_term_days: z.number().int().optional(), has_advance_charges: z.boolean().default(false).optional(), use_for_proration: z.boolean().default(false).optional(), + paid_at: z.number().int().optional(), credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(), billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(), shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(), diff --git a/src/schema/item.schema.ts b/src/schema/item.schema.ts index b2ed785..4db679a 100644 --- a/src/schema/item.schema.ts +++ b/src/schema/item.schema.ts @@ -164,8 +164,8 @@ const ListItemChannelSchema = z.object({ not_in: z.enum(['web', 'app_store', 'play_store']).optional(), }); const ListItemBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ListItemIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), diff --git a/src/schema/item_family.schema.ts b/src/schema/item_family.schema.ts index bec4cb2..7cc2c11 100644 --- a/src/schema/item_family.schema.ts +++ b/src/schema/item_family.schema.ts @@ -36,8 +36,8 @@ const ListItemFamilyUpdatedAtSchema = z.object({ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListItemFamilyBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ListItemFamilyIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), diff --git a/src/schema/item_price.schema.ts b/src/schema/item_price.schema.ts index e96efaa..9356504 100644 --- a/src/schema/item_price.schema.ts +++ b/src/schema/item_price.schema.ts @@ -262,8 +262,8 @@ const ListItemPriceUpdatedAtSchema = z.object({ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListItemPriceBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ListItemPriceIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), diff --git a/src/schema/meter.schema.ts b/src/schema/meter.schema.ts index 2635c40..e41f1a6 100644 --- a/src/schema/meter.schema.ts +++ b/src/schema/meter.schema.ts @@ -6,9 +6,19 @@ import { z } from 'zod'; //Meter.list +const ListMeterNameSchema = z.object({ + is: z.string().min(1).optional(), + starts_with: z.string().min(1).optional(), +}); +const ListMeterSortBySchema = z.looseObject({ + asc: z.enum(['id', 'name', 'created_at', 'updated_at']).optional(), + desc: z.enum(['id', 'name', 'created_at', 'updated_at']).optional(), +}); const ListMeterBodySchema = z.looseObject({ limit: z.number().int().min(1).max(100).optional(), offset: z.string().max(1000).optional(), + name: ListMeterNameSchema.optional(), + sort_by: ListMeterSortBySchema.optional(), }); export { ListMeterBodySchema }; export type ListMeterBody = z.infer; diff --git a/src/schema/omnichannel_subscription.schema.ts b/src/schema/omnichannel_subscription.schema.ts index 4279341..d8aae75 100644 --- a/src/schema/omnichannel_subscription.schema.ts +++ b/src/schema/omnichannel_subscription.schema.ts @@ -34,12 +34,12 @@ const ListOmnichannelSubscriptionIdAtSourceSchema = z.object({ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListOmnichannelSubscriptionUpdatedAtSchema = z.object({ - after: z.string().regex(RegExp('^\\d{10}$')).optional(), before: z.string().regex(RegExp('^\\d{10}$')).optional(), + after: z.string().regex(RegExp('^\\d{10}$')).optional(), }); const ListOmnichannelSubscriptionPurchasedAtSchema = z.object({ - after: z.string().regex(RegExp('^\\d{10}$')).optional(), before: z.string().regex(RegExp('^\\d{10}$')).optional(), + after: z.string().regex(RegExp('^\\d{10}$')).optional(), }); const ListOmnichannelSubscriptionSortBySchema = z.looseObject({ asc: z.enum(['created_at', 'updated_at']).optional(), diff --git a/src/schema/payment_intent.schema.ts b/src/schema/payment_intent.schema.ts index c17dc98..cca4942 100644 --- a/src/schema/payment_intent.schema.ts +++ b/src/schema/payment_intent.schema.ts @@ -61,6 +61,9 @@ const CreatePaymentIntentBodySchema = z.looseObject({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), success_url: z.string().max(250).optional(), @@ -124,6 +127,9 @@ const UpdatePaymentIntentBodySchema = z.looseObject({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), success_url: z.string().max(250).optional(), diff --git a/src/schema/payment_source.schema.ts b/src/schema/payment_source.schema.ts index 02e8a4b..8c93dbf 100644 --- a/src/schema/payment_source.schema.ts +++ b/src/schema/payment_source.schema.ts @@ -59,6 +59,9 @@ const CreateUsingTempTokenPaymentSourceBodySchema = z.looseObject({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]), tmp_token: z.string().max(65000), issuing_country: z.string().max(50).optional(), @@ -171,6 +174,9 @@ const CreateUsingPermanentTokenPaymentSourceBodySchema = z.looseObject({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]), gateway_account_id: z.string().max(50).optional(), reference_id: z.string().max(200).optional(), @@ -262,6 +268,9 @@ const CreateUsingPaymentIntentPaymentSourcePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -487,6 +496,9 @@ const ListPaymentSourceTypeSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), is_not: z @@ -538,6 +550,9 @@ const ListPaymentSourceTypeSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), in: z @@ -589,6 +604,9 @@ const ListPaymentSourceTypeSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), not_in: z @@ -640,6 +658,9 @@ const ListPaymentSourceTypeSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), }); diff --git a/src/schema/price_variant.schema.ts b/src/schema/price_variant.schema.ts index e3c490a..9194c2f 100644 --- a/src/schema/price_variant.schema.ts +++ b/src/schema/price_variant.schema.ts @@ -78,8 +78,8 @@ const ListPriceVariantCreatedAtSchema = z.object({ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListPriceVariantBusinessEntityIdSchema = z.object({ - is: z.string().min(1).optional(), is_present: z.enum(['true', 'false']).optional(), + is: z.string().min(1).optional(), }); const ListPriceVariantIncludeSiteLevelResourcesSchema = z.object({ is: z.enum(['true', 'false']).optional(), diff --git a/src/schema/purchase.schema.ts b/src/schema/purchase.schema.ts index 5ed08eb..88ad082 100644 --- a/src/schema/purchase.schema.ts +++ b/src/schema/purchase.schema.ts @@ -69,6 +69,9 @@ const CreatePurchasePaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), diff --git a/src/schema/ramp.schema.ts b/src/schema/ramp.schema.ts index 76f287f..15f585c 100644 --- a/src/schema/ramp.schema.ts +++ b/src/schema/ramp.schema.ts @@ -93,6 +93,7 @@ const CreateForSubscriptionRampDiscountsToAddSchema = z.object({ ), percentage: z.array(z.number().min(0.01).max(100).optional()).optional(), amount: z.array(z.number().int().min(0).optional()).optional(), + quantity: z.array(z.number().int().min(1).optional()).optional(), period: z.array(z.number().int().min(1).optional()).optional(), period_unit: z .array(z.enum(['day', 'week', 'month', 'year']).optional()) @@ -207,6 +208,7 @@ const UpdateRampDiscountsToAddSchema = z.object({ ), percentage: z.array(z.number().min(0.01).max(100).optional()).optional(), amount: z.array(z.number().int().min(0).optional()).optional(), + quantity: z.array(z.number().int().min(1).optional()).optional(), period: z.array(z.number().int().min(1).optional()).optional(), period_unit: z .array(z.enum(['day', 'week', 'month', 'year']).optional()) diff --git a/src/schema/recorded_purchase.schema.ts b/src/schema/recorded_purchase.schema.ts index 62e6ce9..60a388b 100644 --- a/src/schema/recorded_purchase.schema.ts +++ b/src/schema/recorded_purchase.schema.ts @@ -8,6 +8,9 @@ import { z } from 'zod'; const CreateRecordedPurchaseCustomerSchema = z.object({ id: z.string().max(50), + email: z.string().email().max(70).optional(), + first_name: z.string().max(150).optional(), + last_name: z.string().max(150).optional(), }); const CreateRecordedPurchaseAppleAppStoreSchema = z.object({ transaction_id: z.string().max(100).optional(), diff --git a/src/schema/subscription.schema.ts b/src/schema/subscription.schema.ts index a3802f1..7bdde6c 100644 --- a/src/schema/subscription.schema.ts +++ b/src/schema/subscription.schema.ts @@ -236,6 +236,9 @@ const CreateSubscriptionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -359,6 +362,9 @@ const CreateSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -600,6 +606,9 @@ const CreateForCustomerSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -804,6 +813,9 @@ const CreateWithItemsSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -1226,6 +1238,9 @@ const ListSubscriptionChannelSchema = z.object({ in: z.enum(['web', 'app_store', 'play_store']).optional(), not_in: z.enum(['web', 'app_store', 'play_store']).optional(), }); +const ListSubscriptionDecommissionedSchema = z.object({ + is: z.enum(['true', 'false']).optional(), +}); const ListSubscriptionPlanIdSchema = z.object({ is: z.string().min(1).optional(), is_not: z.string().min(1).optional(), @@ -1258,6 +1273,7 @@ const ListSubscriptionBodySchema = z.looseObject({ sort_by: ListSubscriptionSortBySchema.optional(), business_entity_id: ListSubscriptionBusinessEntityIdSchema.optional(), channel: ListSubscriptionChannelSchema.optional(), + decommissioned: ListSubscriptionDecommissionedSchema.optional(), plan_id: ListSubscriptionPlanIdSchema.optional(), }); export { ListSubscriptionBodySchema }; @@ -1473,6 +1489,9 @@ const UpdateSubscriptionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -1596,6 +1615,9 @@ const UpdateSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -1925,6 +1947,9 @@ const UpdateForItemsSubscriptionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -2048,6 +2073,9 @@ const UpdateForItemsSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -2348,6 +2376,9 @@ const ReactivateSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), @@ -2702,6 +2733,9 @@ const ImportSubscriptionSubscriptionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), gateway: z @@ -3527,6 +3561,9 @@ const ResumeSubscriptionPaymentIntentSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), reference_id: z.string().max(65000).optional(), diff --git a/src/schema/transaction.schema.ts b/src/schema/transaction.schema.ts index bc258db..df35be2 100644 --- a/src/schema/transaction.schema.ts +++ b/src/schema/transaction.schema.ts @@ -155,6 +155,9 @@ const ListTransactionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), is_not: z @@ -216,6 +219,9 @@ const ListTransactionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), in: z @@ -277,6 +283,9 @@ const ListTransactionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), not_in: z @@ -338,6 +347,9 @@ const ListTransactionPaymentMethodSchema = z.object({ 'paypay', 'gcash', 'south_korean_cards', + 'paynow', + 'bizum', + 'promptpay', ]) .optional(), }); diff --git a/src/schema/webhook_endpoint.schema.ts b/src/schema/webhook_endpoint.schema.ts index 3e0a857..e97a7f7 100644 --- a/src/schema/webhook_endpoint.schema.ts +++ b/src/schema/webhook_endpoint.schema.ts @@ -183,6 +183,7 @@ const CreateWebhookEndpointBodySchema = z.looseObject({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired', @@ -436,6 +437,7 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({ 'business_entity_deleted', 'customer_business_entity_changed', 'subscription_business_entity_changed', + 'payment_source_business_entity_changed', 'purchase_created', 'voucher_created', 'voucher_expired',