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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v3.33.0 (2026-09-09)
* * *
### Bug Fixes
* PC-V1 attributes (`plan_id`, `plan_quantity`, `plan_constraint`, `addon_constraint`, `embed`, etc.) are now typed as optional across all affected resources (`Subscription`, `Coupon`, `HostedPage`, `Quote`, `QuotedSubscription`, `Estimate`, `Gift`). PC-V1 and PC-V2 APIs coexist — these fields are absent in PC-V2 responses, so requiring them caused incorrect type errors for PC-V2 users.


### v3.32.0 (2026-09-08)
* * *
### New Features
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.32.0
3.33.0
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chargebee",
"version": "3.32.0",
"version": "3.33.0",
"description": "A library for integrating with Chargebee.",
"scripts": {
"prepack": "npm ci && npm run build",
Expand Down
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Environment = {
hostSuffix: '.chargebee.com',
apiPath: '/api/v2',
timeout: DEFAULT_TIME_OUT,
clientVersion: 'v3.32.0',
clientVersion: 'v3.33.0',
port: DEFAULT_PORT,
timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
exportWaitInMillis: DEFAULT_EXPORT_WAIT,
Expand Down
6 changes: 3 additions & 3 deletions src/schema/estimate.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { z } from 'zod';

const CreateSubscriptionEstimateSubscriptionSchema = z.object({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -380,7 +380,7 @@ export type CreateSubItemEstimateEstimateBody = z.infer<

const CreateSubForCustomerEstimateEstimateSubscriptionSchema = z.object({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -1307,7 +1307,7 @@ const GiftSubscriptionEstimateShippingAddressSchema = z.object({
.optional(),
});
const GiftSubscriptionEstimateSubscriptionSchema = z.object({
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
});
Expand Down
2 changes: 1 addition & 1 deletion src/schema/gift.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const CreateGiftShippingAddressSchema = z.object({
.optional(),
});
const CreateGiftSubscriptionSchema = z.looseObject({
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
});
Expand Down
4 changes: 2 additions & 2 deletions src/schema/hosted_page.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { z } from 'zod';

const CheckoutNewHostedPageSubscriptionSchema = z.looseObject({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -1635,7 +1635,7 @@ const CheckoutGiftHostedPageGifterSchema = z.object({
customer_id: z.string().max(50).optional(),
});
const CheckoutGiftHostedPageSubscriptionSchema = z.looseObject({
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
coupon: z.string().max(100).optional(),
Expand Down
12 changes: 7 additions & 5 deletions src/schema/omnichannel_subscription.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const ListOmnichannelSubscriptionIdAtSourceSchema = z.object({
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
});
const ListOmnichannelSubscriptionUpdatedAtSchema = z.object({
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
on: 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(),
});
const ListOmnichannelSubscriptionPurchasedAtSchema = z.object({
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
});
const ListOmnichannelSubscriptionPurchasedAtSchema = z.object({
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
});
const ListOmnichannelSubscriptionSortBySchema = z.looseObject({
asc: z.enum(['created_at', 'updated_at']).optional(),
Expand Down Expand Up @@ -125,7 +125,9 @@ const OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBo
limit: z.number().int().min(1).max(100).optional(),
offset: z.string().max(1000).optional(),
});
export { OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBodySchema };
export {
OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBodySchema,
};
export type OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBody =
z.infer<
typeof OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBodySchema
Expand Down
4 changes: 2 additions & 2 deletions src/schema/quote.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { z } from 'zod';
const CreateSubForCustomerQuoteQuoteSubscriptionSchema = z.object({
id: z.string().max(50).optional(),
po_number: z.string().max(100).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -126,7 +126,7 @@ export type CreateSubForCustomerQuoteQuoteBody = z.infer<
const EditCreateSubForCustomerQuoteQuoteSubscriptionSchema = z.object({
id: z.string().max(50).optional(),
po_number: z.string().max(100).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down
8 changes: 4 additions & 4 deletions src/schema/subscription.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const CreateSubscriptionCouponsSchema = z.object({
});
const CreateSubscriptionBodySchema = z.looseObject({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -672,7 +672,7 @@ const CreateForCustomerSubscriptionCouponsSchema = z.object({
});
const CreateForCustomerSubscriptionBodySchema = z.looseObject({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -2946,7 +2946,7 @@ const ImportSubscriptionSubscriptionCouponsSchema = z.object({
const ImportSubscriptionSubscriptionBodySchema = z.looseObject({
id: z.string().max(50).optional(),
client_profile_id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down Expand Up @@ -3101,7 +3101,7 @@ const ImportForCustomerSubscriptionCouponsSchema = z.object({
});
const ImportForCustomerSubscriptionBodySchema = z.looseObject({
id: z.string().max(50).optional(),
plan_id: z.string().max(100),
plan_id: z.string().max(100).optional(),
plan_quantity: z.number().int().min(1).optional(),
plan_quantity_in_decimal: z.string().max(33).optional(),
plan_unit_price: z.number().int().min(0).optional(),
Expand Down
8 changes: 6 additions & 2 deletions src/schema/subscription_entitlement.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementBodySchema =
embed: z.string().max(1000).optional(),
include_scheduled_overrides: z.boolean().default(false).optional(),
});
export { SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementBodySchema };
export {
SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementBodySchema,
};
export type SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementBody =
z.infer<
typeof SubscriptionEntitlementsForSubscriptionSubscriptionEntitlementBodySchema
Expand All @@ -32,7 +34,9 @@ const SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementBodySchema =
subscription_entitlements:
SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementSubscriptionEntitlementsSchema.optional(),
});
export { SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementBodySchema };
export {
SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementBodySchema,
};
export type SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementBody =
z.infer<
typeof SetSubscriptionEntitlementAvailabilitySubscriptionEntitlementBodySchema
Expand Down
4 changes: 2 additions & 2 deletions types/resources/Coupon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ declare module 'chargebee' {
| 'plans_with_quantity'
| 'not_applicable';
apply_on: 'invoice_amount' | 'each_specified_item';
plan_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
addon_constraint: 'none' | 'all' | 'specific' | 'not_applicable';
plan_constraint?: 'none' | 'all' | 'specific' | 'not_applicable';
addon_constraint?: 'none' | 'all' | 'specific' | 'not_applicable';
created_at: number;
archived_at?: number;
resource_version?: number;
Expand Down
6 changes: 3 additions & 3 deletions types/resources/Estimate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ declare module 'chargebee' {
}
export interface SubscriptionCreateSubscriptionInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -667,7 +667,7 @@ declare module 'chargebee' {
}
export interface SubscriptionCreateSubForCustomerEstimateInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ declare module 'chargebee' {
additional_information?: any;
}
export interface SubscriptionGiftSubscriptionInputParam {
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion types/resources/Gift.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ declare module 'chargebee' {
additional_information?: any;
}
export interface SubscriptionCreateInputParam {
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
}
Expand Down
6 changes: 3 additions & 3 deletions types/resources/HostedPage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ declare module 'chargebee' {
| 'acknowledged';
failure_reason?: 'card_error' | 'server_error';
pass_thru_content?: string;
embed: boolean;
embed?: boolean;
created_at?: number;
expires_at?: number;
layout?: LayoutEnum;
Expand Down Expand Up @@ -532,7 +532,7 @@ declare module 'chargebee' {
}
export interface SubscriptionCheckoutNewInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -1097,7 +1097,7 @@ declare module 'chargebee' {
customer_id?: string;
}
export interface SubscriptionCheckoutGiftInputParam {
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
/**
Expand Down
4 changes: 2 additions & 2 deletions types/resources/Quote.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ declare module 'chargebee' {
export interface SubscriptionCreateSubForCustomerQuoteInputParam {
id?: string;
po_number?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -898,7 +898,7 @@ declare module 'chargebee' {
export interface SubscriptionEditCreateSubForCustomerQuoteInputParam {
id?: string;
po_number?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down
4 changes: 2 additions & 2 deletions types/resources/QuotedSubscription.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
declare module 'chargebee' {
export interface QuotedSubscription {
id: string;
plan_id: string;
plan_quantity: number;
plan_id?: string;
plan_quantity?: number;
plan_unit_price?: number;
setup_fee?: number;
billing_period?: number;
Expand Down
12 changes: 6 additions & 6 deletions types/resources/Subscription.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declare module 'chargebee' {
[key: string]: unknown;
id: string;
currency_code: string;
plan_id: string;
plan_quantity: number;
plan_id?: string;
plan_quantity?: number;
plan_unit_price?: number;
setup_fee?: number;
billing_period?: number;
Expand Down Expand Up @@ -715,7 +715,7 @@ declare module 'chargebee' {

export interface CreateInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -769,7 +769,7 @@ declare module 'chargebee' {
}
export interface CreateForCustomerInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -1087,7 +1087,7 @@ declare module 'chargebee' {
export interface ImportSubscriptionInputParam {
id?: string;
client_profile_id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down Expand Up @@ -1135,7 +1135,7 @@ declare module 'chargebee' {
}
export interface ImportForCustomerInputParam {
id?: string;
plan_id: string;
plan_id?: string;
plan_quantity?: number;
plan_quantity_in_decimal?: string;
plan_unit_price?: number;
Expand Down
Loading