From 2c3d7018559720ed3e19fa205851808471d5ca90 Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Wed, 12 Aug 2026 11:48:19 +0000 Subject: [PATCH] Releasing v3.31.0 --- CHANGELOG.md | 51 +++++++++++++ VERSION | 2 +- package-lock.json | 4 +- package.json | 2 +- src/environment.ts | 2 +- src/resources/api_endpoints.ts | 55 ++++++++++++++ src/resources/webhook/content.ts | 28 +++++++ src/resources/webhook/eventType.ts | 8 ++ src/schema/coupon.schema.ts | 2 +- src/schema/credit_note.schema.ts | 10 ++- src/schema/credit_unit.schema.ts | 4 +- src/schema/entitlement.schema.ts | 8 +- src/schema/entitlement_override.schema.ts | 2 +- src/schema/event.schema.ts | 16 ++++ src/schema/export.schema.ts | 39 +++++++++- src/schema/invoice.schema.ts | 4 +- src/schema/ledger_operation.schema.ts | 4 +- src/schema/omnichannel_subscription.schema.ts | 8 +- src/schema/payment_source.schema.ts | 14 +++- src/schema/pricing_page_session.schema.ts | 2 +- src/schema/quote.schema.ts | 4 + src/schema/ramp.schema.ts | 4 +- src/schema/webhook_endpoint.schema.ts | 8 ++ types/core.d.ts | 73 ++++++++++++++++++- types/index.d.ts | 4 + types/resources/Content.d.ts | 3 + types/resources/CreditNote.d.ts | 14 ++++ types/resources/Event.d.ts | 4 + types/resources/Export.d.ts | 20 +++++ .../resources/GatewayPaymentMethodToken.d.ts | 15 ++++ types/resources/Invoice.d.ts | 2 +- .../OmnichannelSubscriptionItemMetric.d.ts | 18 +++++ types/resources/PaymentIntent.d.ts | 18 ++--- types/resources/PaymentSource.d.ts | 17 +++++ types/resources/PricingPageSession.d.ts | 2 +- types/resources/Quote.d.ts | 4 + types/resources/QuotedRamp.d.ts | 1 + types/resources/VaultedPaymentMethod.d.ts | 28 +++++++ types/resources/WebhookEvent.d.ts | 24 ++++++ 39 files changed, 488 insertions(+), 40 deletions(-) create mode 100644 types/resources/GatewayPaymentMethodToken.d.ts create mode 100644 types/resources/OmnichannelSubscriptionItemMetric.d.ts create mode 100644 types/resources/VaultedPaymentMethod.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 30b471b..866b79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +### v3.31.0 (2026-08-12) +* * * +### New Resources: +- [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens) has been added. +- [`OmnichannelSubscriptionItemMetric`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_item_metrics) has been added. +- [`VaultedPaymentMethod`](https://apidocs.chargebee.com/docs/api/vaulted_payment_methods) has been added. + + +### New Actions: +- [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) has been added to [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Attributes: +- [`vault_token`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#vault_token) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Parameters: +- [`updated_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`updated_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#limit) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#offset) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`include_deleted`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#include_deleted) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`comment`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details#comment) has been added as request body parameter to [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`ramp`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#ramp) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`export_type`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#export_type) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Events: +- [`vault_token_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_updated) has been added. +- [`vault_token_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_deleted) has been added. +- [`omnichannel_subscription_item_mrr_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_mrr_updated) has been added. +- [`vault_token_created`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_created) has been added. + + +### New Enums: +- `omnichannel_subscription_item_metric` has been added as a new value enum `EntityType`. +- `omnichannel_subscription_item_mrr_updated`, `vault_token_created`, `vault_token_updated`, and `vault_token_deleted` have been added as new values enum `EventType`. +- `chargebee`, `chargebee_payments`, `adyen`, `stripe`, `wepay`, `braintree`, `authorize_net`, `paypal_pro`, `pin`, `eway`, `eway_rapid`, `worldpay`, `balanced_payments`, `beanstream`, `bluepay`, `elavon`, `first_data_global`, `hdfc`, `migs`, `nmi`, `ogone`, `paymill`, `paypal_payflow_pro`, `sage_pay`, `tco`, `wirecard`, `amazon_payments`, `paypal_express_checkout`, `gocardless`, `orbital`, `moneris_us`, `moneris`, `bluesnap`, `cybersource`, `vantiv`, `checkout_com`, `paypal`, `ingenico_direct`, `exact`, `mollie`, `quickbooks`, `razorpay`, `global_payments`, `bank_of_america`, `ecentric`, `metrics_global`, `windcave`, `pay_com`, `ebanx`, `dlocal`, `nuvei`, `solidgate`, `paystack`, `jp_morgan`, `deutsche_bank`, `ezidebit`, `twikey`, `tempus`, `moyasar`, `payway`, and `not_applicable` have been added as new values enum `GatewayName`. +- `active`, `inactive`, and `pending_verification` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens/gateway-payment-method-token-object#status) in [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens). +- `payment_method_helper`, `card_components`, `checkout`, `collect_now`, `portal`, and `payment_components` 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). + + + ### v3.30.1 (2026-08-11) * * * ### Bug Fixes: diff --git a/VERSION b/VERSION index 72bde0a..d9351e5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.30.1 +3.31.0 diff --git a/package-lock.json b/package-lock.json index 7ede367..97ee788 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "chargebee", - "version": "3.30.1", + "version": "3.31.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "chargebee", - "version": "3.30.1", + "version": "3.31.0", "dependencies": { "zod": "^4.3.6" }, diff --git a/package.json b/package.json index 638e48d..68b7356 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chargebee", - "version": "3.30.1", + "version": "3.31.0", "description": "A library for integrating with Chargebee.", "scripts": { "prepack": "npm install && npm run build", diff --git a/src/environment.ts b/src/environment.ts index 901ec60..583ec3f 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.30.1', + clientVersion: 'v3.31.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 a208c64..11154a3 100644 --- a/src/resources/api_endpoints.ts +++ b/src/resources/api_endpoints.ts @@ -25,7 +25,9 @@ interface Endpoints { businessEntityTransfer: EndpointTuple[]; token: EndpointTuple[]; paymentSource: EndpointTuple[]; + gatewayPaymentMethodToken: EndpointTuple[]; thirdPartyPaymentMethod: EndpointTuple[]; + vaultedPaymentMethod: EndpointTuple[]; virtualBankAccount: EndpointTuple[]; card: EndpointTuple[]; promotionalCredit: EndpointTuple[]; @@ -95,6 +97,7 @@ interface Endpoints { paymentScheduleScheme: EndpointTuple[]; pricingPageSession: EndpointTuple[]; omnichannelSubscriptionItemScheduledChange: EndpointTuple[]; + omnichannelSubscriptionItemMetric: EndpointTuple[]; omnichannelSubscription: EndpointTuple[]; omnichannelTransaction: EndpointTuple[]; omnichannelSubscriptionItem: EndpointTuple[]; @@ -1071,6 +1074,17 @@ export const Endpoints: Endpoints = { isIdempotent: true, }, ], + [ + 'listGatewayTokensForPaymentSource', + 'GET', + '/payment_sources', + '/gateway_payment_method_tokens', + true, + null, + false, + {}, + {}, + ], ['retrieve', 'GET', '/payment_sources', null, true, null, false, {}, {}], ['list', 'GET', '/payment_sources', null, false, null, false, {}, {}], [ @@ -1126,7 +1140,21 @@ export const Endpoints: Endpoints = { }, ], ], + gatewayPaymentMethodToken: [], thirdPartyPaymentMethod: [], + vaultedPaymentMethod: [ + [ + 'retrieve', + 'GET', + '/vaulted_payment_methods', + null, + true, + null, + false, + {}, + {}, + ], + ], virtualBankAccount: [ [ 'createUsingPermanentToken', @@ -1902,6 +1930,19 @@ export const Endpoints: Endpoints = { isIdempotent: true, }, ], + [ + 'update', + 'POST', + '/credit_notes', + '/update', + true, + null, + false, + {}, + { + isIdempotent: true, + }, + ], [ 'removeTaxWithheldRefund', 'POST', @@ -3933,6 +3974,19 @@ export const Endpoints: Endpoints = { isIdempotent: true, }, ], + [ + 'ramps', + 'POST', + '/exports', + '/ramps', + false, + null, + false, + {}, + { + isIdempotent: true, + }, + ], ], paymentIntent: [ [ @@ -4877,6 +4931,7 @@ export const Endpoints: Endpoints = { ], ], omnichannelSubscriptionItemScheduledChange: [], + omnichannelSubscriptionItemMetric: [], omnichannelSubscription: [ [ 'retrieve', diff --git a/src/resources/webhook/content.ts b/src/resources/webhook/content.ts index 253ae00..53245e0 100644 --- a/src/resources/webhook/content.ts +++ b/src/resources/webhook/content.ts @@ -590,6 +590,14 @@ export interface OmnichannelSubscriptionItemGracePeriodStartedContent { Customer: import('chargebee').Customer; } +export interface OmnichannelSubscriptionItemMrrUpdatedContent { + OmnichannelSubscriptionItem: import('chargebee').OmnichannelSubscriptionItem; + + OmnichannelSubscription: import('chargebee').OmnichannelSubscription; + + OmnichannelSubscriptionItemMetric: import('chargebee').OmnichannelSubscriptionItemMetric; +} + export interface OmnichannelSubscriptionItemPauseScheduledContent { OmnichannelSubscriptionItem: import('chargebee').OmnichannelSubscriptionItem; @@ -1450,6 +1458,18 @@ export interface VariantDeletedContent {} export interface VariantUpdatedContent {} +export interface VaultTokenCreatedContent { + VaultedPaymentMethod: import('chargebee').VaultedPaymentMethod; +} + +export interface VaultTokenDeletedContent { + VaultedPaymentMethod: import('chargebee').VaultedPaymentMethod; +} + +export interface VaultTokenUpdatedContent { + VaultedPaymentMethod: import('chargebee').VaultedPaymentMethod; +} + export interface VirtualBankAccountAddedContent { Customer: import('chargebee').Customer; @@ -1691,6 +1711,8 @@ export type WebhookContentMap = { [WebhookEventType.OmnichannelSubscriptionItemGracePeriodStarted]: OmnichannelSubscriptionItemGracePeriodStartedContent; + [WebhookEventType.OmnichannelSubscriptionItemMrrUpdated]: OmnichannelSubscriptionItemMrrUpdatedContent; + [WebhookEventType.OmnichannelSubscriptionItemPauseScheduled]: OmnichannelSubscriptionItemPauseScheduledContent; [WebhookEventType.OmnichannelSubscriptionItemPaused]: OmnichannelSubscriptionItemPausedContent; @@ -1941,6 +1963,12 @@ export type WebhookContentMap = { [WebhookEventType.VariantUpdated]: VariantUpdatedContent; + [WebhookEventType.VaultTokenCreated]: VaultTokenCreatedContent; + + [WebhookEventType.VaultTokenDeleted]: VaultTokenDeletedContent; + + [WebhookEventType.VaultTokenUpdated]: VaultTokenUpdatedContent; + [WebhookEventType.VirtualBankAccountAdded]: VirtualBankAccountAddedContent; [WebhookEventType.VirtualBankAccountDeleted]: VirtualBankAccountDeletedContent; diff --git a/src/resources/webhook/eventType.ts b/src/resources/webhook/eventType.ts index ed0d0ac..d6f3f7b 100644 --- a/src/resources/webhook/eventType.ts +++ b/src/resources/webhook/eventType.ts @@ -207,6 +207,8 @@ export enum WebhookEventType { OmnichannelSubscriptionItemGracePeriodStarted = 'omnichannel_subscription_item_grace_period_started', + OmnichannelSubscriptionItemMrrUpdated = 'omnichannel_subscription_item_mrr_updated', + OmnichannelSubscriptionItemPauseScheduled = 'omnichannel_subscription_item_pause_scheduled', OmnichannelSubscriptionItemPaused = 'omnichannel_subscription_item_paused', @@ -457,6 +459,12 @@ export enum WebhookEventType { VariantUpdated = 'variant_updated', + VaultTokenCreated = 'vault_token_created', + + VaultTokenDeleted = 'vault_token_deleted', + + VaultTokenUpdated = 'vault_token_updated', + VirtualBankAccountAdded = 'virtual_bank_account_added', VirtualBankAccountDeleted = 'virtual_bank_account_deleted', diff --git a/src/schema/coupon.schema.ts b/src/schema/coupon.schema.ts index 21f1506..607c5ef 100644 --- a/src/schema/coupon.schema.ts +++ b/src/schema/coupon.schema.ts @@ -282,8 +282,8 @@ const ListCouponCurrencyCodeSchema = z.object({ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCouponApplicableItemPriceIdsSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCouponBodySchema = 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 a79c10b..ee8e76d 100644 --- a/src/schema/credit_note.schema.ts +++ b/src/schema/credit_note.schema.ts @@ -1,5 +1,5 @@ // Generated Zod schemas: CreditNote -// Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, creditNotesForCustomer, delete, removeTaxWithheldRefund, importCreditNote +// Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, creditNotesForCustomer, delete, update, removeTaxWithheldRefund, importCreditNote // Do not edit manually – regenerate via sdk-generator import { z } from 'zod'; @@ -376,6 +376,14 @@ const DeleteCreditNoteBodySchema = z.looseObject({ export { DeleteCreditNoteBodySchema }; export type DeleteCreditNoteBody = z.infer; +//CreditNote.update + +const UpdateCreditNoteBodySchema = z.looseObject({ + comment: z.string().max(300).optional(), +}); +export { UpdateCreditNoteBodySchema }; +export type UpdateCreditNoteBody = z.infer; + //CreditNote.removeTaxWithheldRefund const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = z.object({ diff --git a/src/schema/credit_unit.schema.ts b/src/schema/credit_unit.schema.ts index b3fd74a..c0dae98 100644 --- a/src/schema/credit_unit.schema.ts +++ b/src/schema/credit_unit.schema.ts @@ -7,12 +7,12 @@ import { z } from 'zod'; //CreditUnit.list const ListCreditUnitStatusSchema = z.object({ - in: z.enum(['active', 'archived']).optional(), is: z.enum(['active', 'archived']).optional(), + in: z.enum(['active', 'archived']).optional(), }); const ListCreditUnitIdSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListCreditUnitBodySchema = z.looseObject({ limit: z.number().int().min(1).max(100).optional(), diff --git a/src/schema/entitlement.schema.ts b/src/schema/entitlement.schema.ts index f321142..88bcd00 100644 --- a/src/schema/entitlement.schema.ts +++ b/src/schema/entitlement.schema.ts @@ -7,20 +7,20 @@ import { z } from 'zod'; //Entitlement.list const ListEntitlementFeatureIdSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListEntitlementEntityTypeSchema = z.object({ - in: z + is: z .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price']) .optional(), - is: z + in: z .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price']) .optional(), }); const ListEntitlementEntityIdSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListEntitlementBodySchema = z.looseObject({ limit: z.number().int().min(1).max(100).optional(), diff --git a/src/schema/entitlement_override.schema.ts b/src/schema/entitlement_override.schema.ts index 5307e06..8a38fe6 100644 --- a/src/schema/entitlement_override.schema.ts +++ b/src/schema/entitlement_override.schema.ts @@ -9,7 +9,7 @@ import { z } from 'zod'; const AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesSchema = z.object({ feature_id: z.array(z.string().max(50).optional()), - entity_id: z.array(z.string().max(50).optional()).optional(), + entity_id: z.array(z.string().max(100).optional()).optional(), entity_type: z .array( z diff --git a/src/schema/event.schema.ts b/src/schema/event.schema.ts index 859e480..d13f49e 100644 --- a/src/schema/event.schema.ts +++ b/src/schema/event.schema.ts @@ -293,10 +293,14 @@ const ListEventEventTypeSchema = z.object({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', ]) .optional(), is_not: z @@ -524,10 +528,14 @@ const ListEventEventTypeSchema = z.object({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', ]) .optional(), in: z @@ -755,10 +763,14 @@ const ListEventEventTypeSchema = z.object({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', ]) .optional(), not_in: z @@ -986,10 +998,14 @@ const ListEventEventTypeSchema = z.object({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', ]) .optional(), }); diff --git a/src/schema/export.schema.ts b/src/schema/export.schema.ts index 6ca2c22..fe0869a 100644 --- a/src/schema/export.schema.ts +++ b/src/schema/export.schema.ts @@ -1,5 +1,5 @@ // Generated Zod schemas: Export -// Actions: revenueRecognition, deferredRevenue, plans, addons, coupons, customers, subscriptions, invoices, creditNotes, transactions, orders, itemFamilies, items, itemPrices, attachedItems, differentialPrices, priceVariants +// Actions: revenueRecognition, deferredRevenue, plans, addons, coupons, customers, subscriptions, invoices, creditNotes, transactions, orders, itemFamilies, items, itemPrices, attachedItems, differentialPrices, priceVariants, ramps // Do not edit manually – regenerate via sdk-generator import { z } from 'zod'; @@ -1128,8 +1128,8 @@ const CouponsExportCurrencyCodeSchema = z.object({ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const CouponsExportApplicableItemPriceIdsSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const CouponsExportIdSchema = z.object({ is: z.string().min(1).optional(), @@ -3499,3 +3499,38 @@ export { PriceVariantsExportBodySchema }; export type PriceVariantsExportBody = z.infer< typeof PriceVariantsExportBodySchema >; + +//Export.ramps + +const RampsExportStatusSchema = z.object({ + is: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(), + in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(), +}); +const RampsExportSubscriptionIdSchema = z.object({ + is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), +}); +const RampsExportEffectiveFromSchema = z.object({ + after: z.string().regex(RegExp('^\\d{10}$')).optional(), + before: z.string().regex(RegExp('^\\d{10}$')).optional(), + on: z.string().regex(RegExp('^\\d{10}$')).optional(), + between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), +}); +const RampsExportUpdatedAtSchema = z.object({ + after: z.string().regex(RegExp('^\\d{10}$')).optional(), + before: z.string().regex(RegExp('^\\d{10}$')).optional(), + on: z.string().regex(RegExp('^\\d{10}$')).optional(), + between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), +}); +const RampsExportRampItemSchema = z.object({ + status: RampsExportStatusSchema.optional(), + subscription_id: RampsExportSubscriptionIdSchema.optional(), + effective_from: RampsExportEffectiveFromSchema.optional(), + updated_at: RampsExportUpdatedAtSchema.optional(), +}); +const RampsExportBodySchema = z.looseObject({ + export_type: z.enum(['data', 'import_friendly_data']).optional(), + ramp: z.array(RampsExportRampItemSchema.optional()).optional(), +}); +export { RampsExportBodySchema }; +export type RampsExportBody = z.infer; diff --git a/src/schema/invoice.schema.ts b/src/schema/invoice.schema.ts index 3d00cfe..85dfaa1 100644 --- a/src/schema/invoice.schema.ts +++ b/src/schema/invoice.schema.ts @@ -1538,12 +1538,12 @@ export type PdfInvoiceBody = z.infer; //Invoice.listPaymentReferenceNumbers const ListPaymentReferenceNumbersInvoiceIdSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListPaymentReferenceNumbersInvoiceNumberSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = z.object({ diff --git a/src/schema/ledger_operation.schema.ts b/src/schema/ledger_operation.schema.ts index 61c9665..e5b1641 100644 --- a/src/schema/ledger_operation.schema.ts +++ b/src/schema/ledger_operation.schema.ts @@ -19,7 +19,7 @@ const ListLedgerOperationsLedgerOperationCreatedAtSchema = z.object({ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), }); const ListLedgerOperationsLedgerOperationTypeSchema = z.object({ - in: z + is: z .enum([ 'allocation', 'capture', @@ -32,7 +32,7 @@ const ListLedgerOperationsLedgerOperationTypeSchema = z.object({ 'adjustment', ]) .optional(), - is: z + in: z .enum([ 'allocation', 'capture', diff --git a/src/schema/omnichannel_subscription.schema.ts b/src/schema/omnichannel_subscription.schema.ts index d8aae75..d52600b 100644 --- a/src/schema/omnichannel_subscription.schema.ts +++ b/src/schema/omnichannel_subscription.schema.ts @@ -34,12 +34,16 @@ const ListOmnichannelSubscriptionIdAtSourceSchema = z.object({ not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListOmnichannelSubscriptionUpdatedAtSchema = z.object({ - before: z.string().regex(RegExp('^\\d{10}$')).optional(), after: z.string().regex(RegExp('^\\d{10}$')).optional(), + before: z.string().regex(RegExp('^\\d{10}$')).optional(), + between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), + on: z.string().regex(RegExp('^\\d{10}$')).optional(), }); const ListOmnichannelSubscriptionPurchasedAtSchema = z.object({ - before: z.string().regex(RegExp('^\\d{10}$')).optional(), after: z.string().regex(RegExp('^\\d{10}$')).optional(), + before: z.string().regex(RegExp('^\\d{10}$')).optional(), + between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(), + on: 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_source.schema.ts b/src/schema/payment_source.schema.ts index 1b951cc..c8eb5ce 100644 --- a/src/schema/payment_source.schema.ts +++ b/src/schema/payment_source.schema.ts @@ -1,5 +1,5 @@ // Generated Zod schemas: PaymentSource -// Actions: createUsingTempToken, createUsingPermanentToken, createUsingToken, createUsingPaymentIntent, createVoucherPaymentSource, createCard, createBankAccount, updateCard, updateBankAccount, verifyBankAccount, list, switchGatewayAccount, exportPaymentSource +// Actions: createUsingTempToken, createUsingPermanentToken, createUsingToken, createUsingPaymentIntent, createVoucherPaymentSource, createCard, createBankAccount, updateCard, updateBankAccount, verifyBankAccount, listGatewayTokensForPaymentSource, list, switchGatewayAccount, exportPaymentSource // Do not edit manually – regenerate via sdk-generator import { z } from 'zod'; @@ -449,6 +449,18 @@ export type VerifyBankAccountPaymentSourceBody = z.infer< typeof VerifyBankAccountPaymentSourceBodySchema >; +//PaymentSource.listGatewayTokensForPaymentSource + +const ListGatewayTokensForPaymentSourcePaymentSourceBodySchema = z.looseObject({ + limit: z.number().int().min(1).max(100).optional(), + offset: z.string().max(1000).optional(), + include_deleted: z.boolean().default(false).optional(), +}); +export { ListGatewayTokensForPaymentSourcePaymentSourceBodySchema }; +export type ListGatewayTokensForPaymentSourcePaymentSourceBody = z.infer< + typeof ListGatewayTokensForPaymentSourcePaymentSourceBodySchema +>; + //PaymentSource.list const ListPaymentSourceCustomerIdSchema = z.object({ diff --git a/src/schema/pricing_page_session.schema.ts b/src/schema/pricing_page_session.schema.ts index 02b04f1..33c5eeb 100644 --- a/src/schema/pricing_page_session.schema.ts +++ b/src/schema/pricing_page_session.schema.ts @@ -10,7 +10,7 @@ const CreateForNewSubscriptionPricingPageSessionCustomSchema = z.looseObject( {}, ); const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = z.object({ - id: z.string().max(50), + id: z.string().max(50).optional(), }); const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = z.looseObject({ diff --git a/src/schema/quote.schema.ts b/src/schema/quote.schema.ts index 3ac17de..e463108 100644 --- a/src/schema/quote.schema.ts +++ b/src/schema/quote.schema.ts @@ -773,6 +773,7 @@ const CreateSubItemsForCustomerQuoteQuoteSubscriptionItemsSchema = z.object({ .optional(), start_date: z.array(z.number().int().optional()).optional(), end_date: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(2000).optional()).optional(), ramp_tier_id: z.array(z.string().max(105).optional()).optional(), }); const CreateSubItemsForCustomerQuoteQuoteDiscountsSchema = z.object({ @@ -953,6 +954,7 @@ const EditCreateSubCustomerQuoteForItemsQuoteSubscriptionItemsSchema = z.object( .optional(), start_date: z.array(z.number().int().optional()).optional(), end_date: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(2000).optional()).optional(), ramp_tier_id: z.array(z.string().max(105).optional()).optional(), }, ); @@ -1134,6 +1136,7 @@ const UpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema = z.object({ item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(), start_date: z.array(z.number().int().optional()).optional(), end_date: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(2000).optional()).optional(), ramp_tier_id: z.array(z.string().max(105).optional()).optional(), }); const UpdateSubscriptionQuoteForItemsQuoteDiscountsSchema = z.object({ @@ -1327,6 +1330,7 @@ const EditUpdateSubscriptionQuoteForItemsQuoteSubscriptionItemsSchema = .optional(), start_date: z.array(z.number().int().optional()).optional(), end_date: z.array(z.number().int().optional()).optional(), + description: z.array(z.string().max(2000).optional()).optional(), ramp_tier_id: z.array(z.string().max(105).optional()).optional(), }); const EditUpdateSubscriptionQuoteForItemsQuoteDiscountsSchema = z.object({ diff --git a/src/schema/ramp.schema.ts b/src/schema/ramp.schema.ts index 2800618..15f585c 100644 --- a/src/schema/ramp.schema.ts +++ b/src/schema/ramp.schema.ts @@ -235,12 +235,12 @@ export type UpdateRampBody = z.infer; //Ramp.list const ListRampStatusSchema = z.object({ - in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(), is: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(), + in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(), }); const ListRampSubscriptionIdSchema = z.object({ - in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), is: z.string().min(1).optional(), + in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(), }); const ListRampEffectiveFromSchema = z.object({ after: z.string().regex(RegExp('^\\d{10}$')).optional(), diff --git a/src/schema/webhook_endpoint.schema.ts b/src/schema/webhook_endpoint.schema.ts index de264dc..b77898b 100644 --- a/src/schema/webhook_endpoint.schema.ts +++ b/src/schema/webhook_endpoint.schema.ts @@ -245,10 +245,14 @@ const CreateWebhookEndpointBodySchema = z.looseObject({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', 'plan_created', 'plan_updated', 'plan_deleted', @@ -503,10 +507,14 @@ const UpdateWebhookEndpointBodySchema = z.looseObject({ 'alert_status_changed', 'omnichannel_subscription_item_updated', 'omnichannel_subscription_item_recovered', + 'omnichannel_subscription_item_mrr_updated', 'ledger_account_balance_updated', 'grant_blocks_created', 'grant_blocks_updated', 'ledger_updated', + 'vault_token_created', + 'vault_token_updated', + 'vault_token_deleted', 'plan_created', 'plan_updated', 'plan_deleted', diff --git a/types/core.d.ts b/types/core.d.ts index ade1628..d24bc45 100644 --- a/types/core.d.ts +++ b/types/core.d.ts @@ -160,7 +160,8 @@ declare module 'chargebee' { | 'usage_file' | 'business_rule' | 'ruleset' - | 'alert_status'; + | 'alert_status' + | 'omnichannel_subscription_item_metric'; type EventNameEnum = 'cancellation_page_loaded'; type EventTypeEnum = | 'coupon_created' @@ -377,10 +378,14 @@ declare module 'chargebee' { | 'alert_status_changed' | 'omnichannel_subscription_item_updated' | 'omnichannel_subscription_item_recovered' + | 'omnichannel_subscription_item_mrr_updated' | 'ledger_account_balance_updated' | 'grant_blocks_created' | 'grant_blocks_updated' | 'ledger_updated' + | 'vault_token_created' + | 'vault_token_updated' + | 'vault_token_deleted' | 'plan_created' | 'plan_updated' | 'plan_deleted' @@ -453,6 +458,68 @@ declare module 'chargebee' { | 'payway' | 'gocardless' | 'not_applicable'; + type GatewayNameEnum = + | 'chargebee' + | 'chargebee_payments' + | 'adyen' + | 'stripe' + | 'wepay' + | 'braintree' + | 'authorize_net' + | 'paypal_pro' + | 'pin' + | 'eway' + | 'eway_rapid' + | 'worldpay' + | 'balanced_payments' + | 'beanstream' + | 'bluepay' + | 'elavon' + | 'first_data_global' + | 'hdfc' + | 'migs' + | 'nmi' + | 'ogone' + | 'paymill' + | 'paypal_payflow_pro' + | 'sage_pay' + | 'tco' + | 'wirecard' + | 'amazon_payments' + | 'paypal_express_checkout' + | 'gocardless' + | 'orbital' + | 'moneris_us' + | 'moneris' + | 'bluesnap' + | 'cybersource' + | 'vantiv' + | 'checkout_com' + | 'paypal' + | 'ingenico_direct' + | 'exact' + | 'mollie' + | 'quickbooks' + | 'razorpay' + | 'global_payments' + | 'bank_of_america' + | 'ecentric' + | 'metrics_global' + | 'windcave' + | 'pay_com' + | 'ebanx' + | 'dlocal' + | 'nuvei' + | 'solidgate' + | 'paystack' + | 'jp_morgan' + | 'deutsche_bank' + | 'ezidebit' + | 'twikey' + | 'tempus' + | 'moyasar' + | 'payway' + | 'not_applicable'; type HierarchyOperationTypeEnum = | 'complete_hierarchy' | 'subordinates' @@ -992,10 +1059,14 @@ declare module 'chargebee' { | 'alert_status_changed' | 'omnichannel_subscription_item_updated' | 'omnichannel_subscription_item_recovered' + | 'omnichannel_subscription_item_mrr_updated' | 'ledger_account_balance_updated' | 'grant_blocks_created' | 'grant_blocks_updated' | 'ledger_updated' + | 'vault_token_created' + | 'vault_token_updated' + | 'vault_token_deleted' | 'plan_created' | 'plan_updated' | 'plan_deleted' diff --git a/types/index.d.ts b/types/index.d.ts index f4023de..0a41bb8 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -39,6 +39,7 @@ /// /// /// +/// /// /// /// @@ -67,6 +68,7 @@ /// /// /// +/// /// /// /// @@ -113,6 +115,7 @@ /// /// /// +/// /// /// /// @@ -339,6 +342,7 @@ declare module 'chargebee' { usageEvent: UsageEvent.UsageEventResource; usageFile: UsageFile.UsageFileResource; usageSummary: UsageSummary.UsageSummaryResource; + vaultedPaymentMethod: VaultedPaymentMethod.VaultedPaymentMethodResource; virtualBankAccount: VirtualBankAccount.VirtualBankAccountResource; webhookEndpoint: WebhookEndpoint.WebhookEndpointResource; diff --git a/types/resources/Content.d.ts b/types/resources/Content.d.ts index 2d71590..9b1c388 100644 --- a/types/resources/Content.d.ts +++ b/types/resources/Content.d.ts @@ -44,6 +44,7 @@ declare module 'chargebee' { feature: Feature; filter_condition: FilterCondition; gateway_error_detail: GatewayErrorDetail; + gateway_payment_method_token: GatewayPaymentMethodToken; gift: Gift; grant_block: GrantBlock; hierarchy: Hierarchy; @@ -72,6 +73,7 @@ declare module 'chargebee' { omnichannel_one_time_order_item: OmnichannelOneTimeOrderItem; omnichannel_subscription: OmnichannelSubscription; omnichannel_subscription_item: OmnichannelSubscriptionItem; + omnichannel_subscription_item_metric: OmnichannelSubscriptionItemMetric; omnichannel_subscription_item_offer: OmnichannelSubscriptionItemOffer; omnichannel_subscription_item_scheduled_change: OmnichannelSubscriptionItemScheduledChange; omnichannel_transaction: OmnichannelTransaction; @@ -118,6 +120,7 @@ declare module 'chargebee' { usage_event: UsageEvent; usage_file: UsageFile; usage_summary: UsageSummary; + vaulted_payment_method: VaultedPaymentMethod; virtual_bank_account: VirtualBankAccount; webhook_endpoint: WebhookEndpoint; } diff --git a/types/resources/CreditNote.d.ts b/types/resources/CreditNote.d.ts index 5044bb3..10f4bef 100644 --- a/types/resources/CreditNote.d.ts +++ b/types/resources/CreditNote.d.ts @@ -131,6 +131,12 @@ declare module 'chargebee' { headers?: ChargebeeRequestHeader, ): Promise>; + update( + credit_note_id: string, + input?: UpdateInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + removeTaxWithheldRefund( credit_note_id: string, input: RemoveTaxWithheldRefundInputParam, @@ -198,6 +204,10 @@ declare module 'chargebee' { credit_note: CreditNote; } + export interface UpdateResponse { + credit_note: CreditNote; + } + export interface RemoveTaxWithheldRefundResponse { credit_note: CreditNote; } @@ -531,6 +541,10 @@ declare module 'chargebee' { export interface DeleteInputParam { comment?: string; } + export interface UpdateInputParam { + comment?: string; + [key: `cf_${string}`]: unknown; + } export interface RemoveTaxWithheldRefundInputParam { tax_withheld?: TaxWithheldRemoveTaxWithheldRefundInputParam; } diff --git a/types/resources/Event.d.ts b/types/resources/Event.d.ts index 986bbd2..cd62b03 100644 --- a/types/resources/Event.d.ts +++ b/types/resources/Event.d.ts @@ -78,11 +78,13 @@ declare module 'chargebee' { SubscriptionAdvanceInvoiceScheduleUpdatedContent & ItemDeletedContent & SubscriptionRampDraftedContent & + VaultTokenUpdatedContent & DunningUpdatedContent & OmnichannelSubscriptionItemRecoveredContent & ItemEntitlementsUpdatedContent & TokenConsumedContent & HierarchyDeletedContent & + VaultTokenDeletedContent & SubscriptionCancellationScheduledContent & SubscriptionRenewedContent & FeatureUpdatedContent & @@ -127,6 +129,7 @@ declare module 'chargebee' { CardUpdatedContent & CustomerCreatedContent & SubscriptionRenewalReminderContent & + OmnichannelSubscriptionItemMrrUpdatedContent & PaymentDueReminderContent & OrderDeliveredContent & OmnichannelSubscriptionItemCancellationScheduledContent & @@ -206,6 +209,7 @@ declare module 'chargebee' { PromotionalCreditsAddedContent & SubscriptionRampUpdatedContent & LedgerAccountBalanceUpdatedContent & + VaultTokenCreatedContent & CustomerEntitlementsUpdatedContent & PaymentSourceExpiredContent & CustomerMovedOutContent & diff --git a/types/resources/Export.d.ts b/types/resources/Export.d.ts index 91a9021..7487a74 100644 --- a/types/resources/Export.d.ts +++ b/types/resources/Export.d.ts @@ -102,6 +102,11 @@ declare module 'chargebee' { input?: PriceVariantsInputParam, headers?: ChargebeeRequestHeader, ): Promise>; + + ramps( + input?: RampsInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; } export interface RetrieveResponse { @@ -176,6 +181,10 @@ declare module 'chargebee' { export: Export; } + export interface RampsResponse { + export: Export; + } + export interface Download { download_url: string; valid_till: number; @@ -291,6 +300,10 @@ declare module 'chargebee' { include_site_level_resources?: filter.Boolean; price_variant?: PriceVariantPriceVariantsInputParam; } + export interface RampsInputParam { + export_type?: ExportTypeEnum; + ramp?: RampRampsInputParam; + } export interface InvoiceRevenueRecognitionInputParam { id?: filter.String; recurring?: filter.Boolean; @@ -613,5 +626,12 @@ declare module 'chargebee' { updated_at?: filter.Timestamp; created_at?: filter.Timestamp; } + + export interface RampRampsInputParam { + status?: filter.Enum; + subscription_id?: filter.String; + effective_from?: filter.Timestamp; + updated_at?: filter.Timestamp; + } } } diff --git a/types/resources/GatewayPaymentMethodToken.d.ts b/types/resources/GatewayPaymentMethodToken.d.ts new file mode 100644 index 0000000..ffb52f6 --- /dev/null +++ b/types/resources/GatewayPaymentMethodToken.d.ts @@ -0,0 +1,15 @@ +/// +/// + +declare module 'chargebee' { + export interface GatewayPaymentMethodToken { + id: string; + gateway_account_id: string; + gateway_name: GatewayNameEnum; + gateway_customer_id?: string; + gateway_token: string; + status: 'active' | 'inactive' | 'pending_verification'; + created_at: number; + updated_at?: number; + } +} diff --git a/types/resources/Invoice.d.ts b/types/resources/Invoice.d.ts index 559148a..00c869d 100644 --- a/types/resources/Invoice.d.ts +++ b/types/resources/Invoice.d.ts @@ -689,7 +689,7 @@ declare module 'chargebee' { txn_date?: number; txn_amount?: number; txn_type: 'authorization' | 'payment' | 'refund' | 'payment_reversal'; - amount_capturable: number; + amount_capturable?: number; authorization_reason?: | 'verification' | 'blocking_funds' diff --git a/types/resources/OmnichannelSubscriptionItemMetric.d.ts b/types/resources/OmnichannelSubscriptionItemMetric.d.ts new file mode 100644 index 0000000..f52fc0a --- /dev/null +++ b/types/resources/OmnichannelSubscriptionItemMetric.d.ts @@ -0,0 +1,18 @@ +/// +/// + +declare module 'chargebee' { + export interface OmnichannelSubscriptionItemMetric { + customer_id?: string; + omnichannel_subscription_id?: string; + omnichannel_subscription_item_id?: string; + item_id_at_source: string; + mrr_currency?: string; + mrr_units?: number; + mrr_nanos?: number; + effective_from: number; + calculated_at?: number; + created_at: number; + resource_version?: number; + } +} diff --git a/types/resources/PaymentIntent.d.ts b/types/resources/PaymentIntent.d.ts index ffc161b..f9d1e27 100644 --- a/types/resources/PaymentIntent.d.ts +++ b/types/resources/PaymentIntent.d.ts @@ -69,7 +69,7 @@ declare module 'chargebee' { modified_at: number; resource_version?: number; updated_at?: number; - customer_id: string; + customer_id?: string; gateway?: string; active_payment_attempt?: PaymentIntent.PaymentAttempt; payment_attempts?: PaymentIntent.PaymentAttempt[]; @@ -252,16 +252,12 @@ declare module 'chargebee' { } 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'; + | 'payment_method_helper' + | 'card_components' + | 'checkout' + | 'collect_now' + | 'portal' + | 'payment_components'; client_ip_address?: string; user_agent?: string; created_at?: number; diff --git a/types/resources/PaymentSource.d.ts b/types/resources/PaymentSource.d.ts index 001f36d..2a15575 100644 --- a/types/resources/PaymentSource.d.ts +++ b/types/resources/PaymentSource.d.ts @@ -30,6 +30,7 @@ declare module 'chargebee' { venmo?: PaymentSource.Venmo; klarna_pay_now?: PaymentSource.KlarnaPayNow; mandates?: PaymentSource.Mandate[]; + vault_token?: any; deleted: boolean; business_entity_id?: string; } @@ -89,6 +90,12 @@ declare module 'chargebee' { headers?: ChargebeeRequestHeader, ): Promise>; + listGatewayTokensForPaymentSource( + cust_payment_source_id: string, + input?: ListGatewayTokensForPaymentSourceInputParam, + headers?: ChargebeeRequestHeader, + ): Promise>; + retrieve( cust_payment_source_id: string, headers?: ChargebeeRequestHeader, @@ -171,6 +178,11 @@ declare module 'chargebee' { payment_source: PaymentSource; } + export interface ListGatewayTokensForPaymentSourceResponse { + list: { gateway_payment_method_token: GatewayPaymentMethodToken }[]; + next_offset?: string; + } + export interface RetrieveResponse { payment_source: PaymentSource; } @@ -367,6 +379,11 @@ declare module 'chargebee' { amount1: number; amount2: number; } + export interface ListGatewayTokensForPaymentSourceInputParam { + limit?: number; + offset?: string; + include_deleted?: boolean; + } export interface ListInputParam { limit?: number; offset?: string; diff --git a/types/resources/PricingPageSession.d.ts b/types/resources/PricingPageSession.d.ts index 5468abb..7c3e7b2 100644 --- a/types/resources/PricingPageSession.d.ts +++ b/types/resources/PricingPageSession.d.ts @@ -71,7 +71,7 @@ declare module 'chargebee' { validation_status?: ValidationStatusEnum; } export interface PricingPageCreateForNewSubscriptionInputParam { - id: string; + id?: string; } export interface CustomerCreateForNewSubscriptionInputParam { id?: string; diff --git a/types/resources/Quote.d.ts b/types/resources/Quote.d.ts index 15eacc7..7bbd1d2 100644 --- a/types/resources/Quote.d.ts +++ b/types/resources/Quote.d.ts @@ -1231,6 +1231,7 @@ declare module 'chargebee' { charge_on_option?: ChargeOnOptionEnum; start_date?: number; end_date?: number; + description?: string; ramp_tier_id?: string; } export interface DiscountsCreateSubItemsForCustomerQuoteInputParam { @@ -1332,6 +1333,7 @@ declare module 'chargebee' { charge_on_option?: ChargeOnOptionEnum; start_date?: number; end_date?: number; + description?: string; ramp_tier_id?: string; } export interface DiscountsEditCreateSubCustomerQuoteForItemsInputParam { @@ -1440,6 +1442,7 @@ declare module 'chargebee' { item_type?: ItemTypeEnum; start_date?: number; end_date?: number; + description?: string; ramp_tier_id?: string; } export interface DiscountsUpdateSubscriptionQuoteForItemsInputParam { @@ -1549,6 +1552,7 @@ declare module 'chargebee' { item_type?: ItemTypeEnum; start_date?: number; end_date?: number; + description?: string; ramp_tier_id?: string; } export interface DiscountsEditUpdateSubscriptionQuoteForItemsInputParam { diff --git a/types/resources/QuotedRamp.d.ts b/types/resources/QuotedRamp.d.ts index af0332a..10e23b5 100644 --- a/types/resources/QuotedRamp.d.ts +++ b/types/resources/QuotedRamp.d.ts @@ -46,6 +46,7 @@ declare module 'chargebee' { amount_per_billing_cycle_in_decimal?: string; net_amount_per_billing_cycle?: number; net_amount_per_billing_cycle_in_decimal?: string; + description?: string; } export interface Discount { id: string; diff --git a/types/resources/VaultedPaymentMethod.d.ts b/types/resources/VaultedPaymentMethod.d.ts new file mode 100644 index 0000000..d02255f --- /dev/null +++ b/types/resources/VaultedPaymentMethod.d.ts @@ -0,0 +1,28 @@ +/// +/// + +declare module 'chargebee' { + export interface VaultedPaymentMethod { + id: string; + customer_id: string; + credit_card_id: string; + created_at: number; + modified_at: number; + } + + export namespace VaultedPaymentMethod { + export class VaultedPaymentMethodResource { + retrieve( + vaulted_payment_method_id: string, + headers?: ChargebeeRequestHeader, + ): Promise>; + } + + export interface RetrieveResponse { + vaulted_payment_method: VaultedPaymentMethod; + } + + // REQUEST PARAMS + //--------------- + } +} diff --git a/types/resources/WebhookEvent.d.ts b/types/resources/WebhookEvent.d.ts index 69642ee..fbe0f92 100644 --- a/types/resources/WebhookEvent.d.ts +++ b/types/resources/WebhookEvent.d.ts @@ -61,11 +61,13 @@ declare module 'chargebee' { SubscriptionAdvanceInvoiceScheduleUpdated = 'subscription_advance_invoice_schedule_updated', ItemDeleted = 'item_deleted', SubscriptionRampDrafted = 'subscription_ramp_drafted', + VaultTokenUpdated = 'vault_token_updated', DunningUpdated = 'dunning_updated', OmnichannelSubscriptionItemRecovered = 'omnichannel_subscription_item_recovered', ItemEntitlementsUpdated = 'item_entitlements_updated', TokenConsumed = 'token_consumed', HierarchyDeleted = 'hierarchy_deleted', + VaultTokenDeleted = 'vault_token_deleted', SubscriptionCancellationScheduled = 'subscription_cancellation_scheduled', SubscriptionRenewed = 'subscription_renewed', FeatureUpdated = 'feature_updated', @@ -110,6 +112,7 @@ declare module 'chargebee' { CardUpdated = 'card_updated', CustomerCreated = 'customer_created', SubscriptionRenewalReminder = 'subscription_renewal_reminder', + OmnichannelSubscriptionItemMrrUpdated = 'omnichannel_subscription_item_mrr_updated', PaymentDueReminder = 'payment_due_reminder', OrderDelivered = 'order_delivered', OmnichannelSubscriptionItemCancellationScheduled = 'omnichannel_subscription_item_cancellation_scheduled', @@ -189,6 +192,7 @@ declare module 'chargebee' { PromotionalCreditsAdded = 'promotional_credits_added', SubscriptionRampUpdated = 'subscription_ramp_updated', LedgerAccountBalanceUpdated = 'ledger_account_balance_updated', + VaultTokenCreated = 'vault_token_created', CustomerEntitlementsUpdated = 'customer_entitlements_updated', PaymentSourceExpired = 'payment_source_expired', CustomerMovedOut = 'customer_moved_out', @@ -293,11 +297,13 @@ declare module 'chargebee' { [WebhookEventType.SubscriptionAdvanceInvoiceScheduleUpdated]: SubscriptionAdvanceInvoiceScheduleUpdatedContent; [WebhookEventType.ItemDeleted]: ItemDeletedContent; [WebhookEventType.SubscriptionRampDrafted]: SubscriptionRampDraftedContent; + [WebhookEventType.VaultTokenUpdated]: VaultTokenUpdatedContent; [WebhookEventType.DunningUpdated]: DunningUpdatedContent; [WebhookEventType.OmnichannelSubscriptionItemRecovered]: OmnichannelSubscriptionItemRecoveredContent; [WebhookEventType.ItemEntitlementsUpdated]: ItemEntitlementsUpdatedContent; [WebhookEventType.TokenConsumed]: TokenConsumedContent; [WebhookEventType.HierarchyDeleted]: HierarchyDeletedContent; + [WebhookEventType.VaultTokenDeleted]: VaultTokenDeletedContent; [WebhookEventType.SubscriptionCancellationScheduled]: SubscriptionCancellationScheduledContent; [WebhookEventType.SubscriptionRenewed]: SubscriptionRenewedContent; [WebhookEventType.FeatureUpdated]: FeatureUpdatedContent; @@ -342,6 +348,7 @@ declare module 'chargebee' { [WebhookEventType.CardUpdated]: CardUpdatedContent; [WebhookEventType.CustomerCreated]: CustomerCreatedContent; [WebhookEventType.SubscriptionRenewalReminder]: SubscriptionRenewalReminderContent; + [WebhookEventType.OmnichannelSubscriptionItemMrrUpdated]: OmnichannelSubscriptionItemMrrUpdatedContent; [WebhookEventType.PaymentDueReminder]: PaymentDueReminderContent; [WebhookEventType.OrderDelivered]: OrderDeliveredContent; [WebhookEventType.OmnichannelSubscriptionItemCancellationScheduled]: OmnichannelSubscriptionItemCancellationScheduledContent; @@ -421,6 +428,7 @@ declare module 'chargebee' { [WebhookEventType.PromotionalCreditsAdded]: PromotionalCreditsAddedContent; [WebhookEventType.SubscriptionRampUpdated]: SubscriptionRampUpdatedContent; [WebhookEventType.LedgerAccountBalanceUpdated]: LedgerAccountBalanceUpdatedContent; + [WebhookEventType.VaultTokenCreated]: VaultTokenCreatedContent; [WebhookEventType.CustomerEntitlementsUpdated]: CustomerEntitlementsUpdatedContent; [WebhookEventType.PaymentSourceExpired]: PaymentSourceExpiredContent; [WebhookEventType.CustomerMovedOut]: CustomerMovedOutContent; @@ -806,6 +814,9 @@ declare module 'chargebee' { export type SubscriptionRampDraftedContent = { ramp: Ramp; }; + export type VaultTokenUpdatedContent = { + vaulted_payment_method: VaultedPaymentMethod; + }; export type DunningUpdatedContent = { invoice: Invoice; }; @@ -833,6 +844,9 @@ declare module 'chargebee' { export type HierarchyDeletedContent = { customer: Customer; }; + export type VaultTokenDeletedContent = { + vaulted_payment_method: VaultedPaymentMethod; + }; export type SubscriptionCancellationScheduledContent = { subscription: Subscription; @@ -1089,6 +1103,13 @@ declare module 'chargebee' { advance_invoice_schedule: AdvanceInvoiceSchedule; }; + export type OmnichannelSubscriptionItemMrrUpdatedContent = { + omnichannel_subscription_item: OmnichannelSubscriptionItem; + + omnichannel_subscription: OmnichannelSubscription; + + omnichannel_subscription_item_metric: OmnichannelSubscriptionItemMetric; + }; export type PaymentDueReminderContent = { customer: Customer; @@ -1542,6 +1563,9 @@ declare module 'chargebee' { export type LedgerAccountBalanceUpdatedContent = { ledger_account_balance: LedgerAccountBalance; }; + export type VaultTokenCreatedContent = { + vaulted_payment_method: VaultedPaymentMethod; + }; export type CustomerEntitlementsUpdatedContent = { impacted_customer: ImpactedCustomer; };