dodopayments-mcp 2.45.1 → 2.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +11 -10
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +11 -10
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/local-docs-search.ts +11 -10
- package/src/server.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AA8kRF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AA8kRF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
package/local-docs-search.js
CHANGED
|
@@ -484,10 +484,10 @@ const EMBEDDED_METHODS = [
|
|
|
484
484
|
'page_number?: number;',
|
|
485
485
|
'page_size?: number;',
|
|
486
486
|
'product_id?: string;',
|
|
487
|
-
"status?: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired';",
|
|
487
|
+
"status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired';",
|
|
488
488
|
],
|
|
489
|
-
response: "{ billing: object; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: object; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; payment_method_id?: string; product_name?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
490
|
-
markdown: "## list\n\n`client.subscriptions.list(brand_id?: string, cancel_at_next_billing_date?: boolean, created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'): { billing: billing_address; cancel_at_next_billing_date: boolean; created_at: string; currency: currency; customer: customer_limited_details; discounts: object[]; metadata: metadata; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; payment_method_id?: string; product_name?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\n\n- `cancel_at_next_billing_date?: boolean`\n Filter by cancel_at_next_billing_date (subscriptions scheduled for cancellation)\n\n- `created_at_gte?: string`\n Get events after this created time\n\n- `created_at_lte?: string`\n Get events created before this time\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0\n\n- `page_size?: number`\n Page size default is 10 max is 100\n\n- `product_id?: string`\n Filter by product id\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'`\n Filter by status\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; payment_method_id?: string; product_name?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `discounts: { discount_id: string; discount_cycles_remaining?: number; }[]`\n - `metadata: object`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancelled_at?: string`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `payment_method_id?: string`\n - `product_name?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionListResponse of client.subscriptions.list()) {\n console.log(subscriptionListResponse);\n}\n```",
|
|
489
|
+
response: "{ billing: object; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: object; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
490
|
+
markdown: "## list\n\n`client.subscriptions.list(brand_id?: string, cancel_at_next_billing_date?: boolean, created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'): { billing: billing_address; cancel_at_next_billing_date: boolean; created_at: string; currency: currency; customer: customer_limited_details; discounts: object[]; metadata: metadata; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\n\n- `cancel_at_next_billing_date?: boolean`\n Filter by cancel_at_next_billing_date (subscriptions scheduled for cancellation)\n\n- `created_at_gte?: string`\n Get events after this created time\n\n- `created_at_lte?: string`\n Get events created before this time\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0\n\n- `page_size?: number`\n Page size default is 10 max is 100\n\n- `product_id?: string`\n Filter by product id\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'`\n Filter by status\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `discounts: { discount_id: string; discount_cycles_remaining?: number; }[]`\n - `metadata: object`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancelled_at?: string`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `product_name?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionListResponse of client.subscriptions.list()) {\n console.log(subscriptionListResponse);\n}\n```",
|
|
491
491
|
perLanguage: {
|
|
492
492
|
typescript: {
|
|
493
493
|
method: 'client.subscriptions.list',
|
|
@@ -609,8 +609,8 @@ const EMBEDDED_METHODS = [
|
|
|
609
609
|
stainlessPath: '(resource) subscriptions > (method) retrieve',
|
|
610
610
|
qualified: 'client.subscriptions.retrieve',
|
|
611
611
|
params: ['subscription_id: string;'],
|
|
612
|
-
response: "{ addons: object[]; billing: object; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: object[]; currency: string; customer: object; metadata: object; meter_credit_entitlement_cart: object[]; meters: object[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: object[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: object[]; expires_at?: string; payment_method_id?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
613
|
-
markdown: "## retrieve\n\n`client.subscriptions.retrieve(subscription_id: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.retrieve('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
612
|
+
response: "{ addons: object[]; billing: object; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: object[]; currency: string; customer: object; metadata: object; meter_credit_entitlement_cart: object[]; meters: object[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: object[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: object[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
613
|
+
markdown: "## retrieve\n\n`client.subscriptions.retrieve(subscription_id: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.retrieve('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
614
614
|
perLanguage: {
|
|
615
615
|
typescript: {
|
|
616
616
|
method: 'client.subscriptions.retrieve',
|
|
@@ -670,13 +670,14 @@ const EMBEDDED_METHODS = [
|
|
|
670
670
|
'disable_on_demand?: { next_billing_date: string; };',
|
|
671
671
|
'metadata?: object;',
|
|
672
672
|
'next_billing_date?: string;',
|
|
673
|
-
|
|
673
|
+
'pause?: boolean;',
|
|
674
|
+
"status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired';",
|
|
674
675
|
'subscription_period_count?: number;',
|
|
675
676
|
"subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year';",
|
|
676
677
|
'tax_id?: string;',
|
|
677
678
|
],
|
|
678
|
-
response: "{ addons: object[]; billing: object; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: object[]; currency: string; customer: object; metadata: object; meter_credit_entitlement_cart: object[]; meters: object[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: object[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: object[]; expires_at?: string; payment_method_id?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
679
|
-
markdown: "## update\n\n`client.subscriptions.update(subscription_id: string, billing?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, cancel_at_next_billing_date?: boolean, cancel_reason?: string, cancellation_comment?: string, cancellation_feedback?: string, credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[], customer_business_name?: string, customer_name?: string, disable_on_demand?: { next_billing_date: string; }, metadata?: object, next_billing_date?: string, status?: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired', subscription_period_count?: number, subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year', tax_id?: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**patch** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `billing?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `country: string`\n Two-letter ISO country code (ISO 3166-1 alpha-2)\n - `city?: string`\n City name\n - `state?: string`\n State or province name\n - `street?: string`\n Street address including house number and unit/apartment if applicable\n - `zipcode?: string`\n Postal code or ZIP code\n\n- `cancel_at_next_billing_date?: boolean`\n When set, the subscription will remain active until the end of billing period\n\n- `cancel_reason?: string`\n\n- `cancellation_comment?: string`\n Free-text cancellation comment (only valid when cancelling or scheduling cancellation).\n\n- `cancellation_feedback?: string`\n Customer-supplied churn reason (only valid when cancelling or scheduling cancellation).\n\n- `credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n Update credit entitlement cart settings\n\n- `customer_business_name?: string`\n Optional business / legal name associated with the tax id. When provided\ntogether with a valid tax id for a B2B subscription, this name is rendered\non the invoice instead of the customer's personal name. Send `null` to\nexplicitly clear the business name.\n\n- `customer_name?: string`\n\n- `disable_on_demand?: { next_billing_date: string; }`\n - `next_billing_date: string`\n\n- `metadata?: object`\n Arbitrary key-value metadata. Values can be string, integer, number, or boolean.\n\n- `next_billing_date?: string`\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'`\n\n- `subscription_period_count?: number`\n New number of `subscription_period_interval` units the subscription\nentitlement should span. Used together with `subscription_period_interval`\nto extend the subscription period. The resulting period must not be\nshorter than the current one (this endpoint only extends).\n\n- `subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year'`\n New interval unit for the subscription period. When changing the period,\nthis may be supplied alongside `subscription_period_count`; if omitted the\nexisting interval is retained.\n\n- `tax_id?: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.update('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
679
|
+
response: "{ addons: object[]; billing: object; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: object[]; currency: string; customer: object; metadata: object; meter_credit_entitlement_cart: object[]; meters: object[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: object[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: object[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
680
|
+
markdown: "## update\n\n`client.subscriptions.update(subscription_id: string, billing?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, cancel_at_next_billing_date?: boolean, cancel_reason?: string, cancellation_comment?: string, cancellation_feedback?: string, credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[], customer_business_name?: string, customer_name?: string, disable_on_demand?: { next_billing_date: string; }, metadata?: object, next_billing_date?: string, pause?: boolean, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired', subscription_period_count?: number, subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year', tax_id?: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**patch** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `billing?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `country: string`\n Two-letter ISO country code (ISO 3166-1 alpha-2)\n - `city?: string`\n City name\n - `state?: string`\n State or province name\n - `street?: string`\n Street address including house number and unit/apartment if applicable\n - `zipcode?: string`\n Postal code or ZIP code\n\n- `cancel_at_next_billing_date?: boolean`\n When set, the subscription will remain active until the end of billing period\n\n- `cancel_reason?: string`\n\n- `cancellation_comment?: string`\n Free-text cancellation comment (only valid when cancelling or scheduling cancellation).\n\n- `cancellation_feedback?: string`\n Customer-supplied churn reason (only valid when cancelling or scheduling cancellation).\n\n- `credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n Update credit entitlement cart settings\n\n- `customer_business_name?: string`\n Optional business / legal name associated with the tax id. When provided\ntogether with a valid tax id for a B2B subscription, this name is rendered\non the invoice instead of the customer's personal name. Send `null` to\nexplicitly clear the business name.\n\n- `customer_name?: string`\n\n- `disable_on_demand?: { next_billing_date: string; }`\n - `next_billing_date: string`\n\n- `metadata?: object`\n Arbitrary key-value metadata. Values can be string, integer, number, or boolean.\n\n- `next_billing_date?: string`\n\n- `pause?: boolean`\n `Some(true)` pauses an active subscription; `Some(false)` unpauses a\n`Paused` (or abandoned `OnHold`) subscription. Exclusive of every other field.\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'`\n\n- `subscription_period_count?: number`\n New number of `subscription_period_interval` units the subscription\nentitlement should span. Used together with `subscription_period_interval`\nto extend the subscription period. The resulting period must not be\nshorter than the current one (this endpoint only extends).\n\n- `subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year'`\n New interval unit for the subscription period. When changing the period,\nthis may be supplied alongside `subscription_period_count`; if omitted the\nexisting interval is retained.\n\n- `tax_id?: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.update('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
680
681
|
perLanguage: {
|
|
681
682
|
typescript: {
|
|
682
683
|
method: 'client.subscriptions.update',
|
|
@@ -707,7 +708,7 @@ const EMBEDDED_METHODS = [
|
|
|
707
708
|
},
|
|
708
709
|
php: {
|
|
709
710
|
method: 'subscriptions->update',
|
|
710
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$subscription = $client->subscriptions->update(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n billing: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n cancelAtNextBillingDate: true,\n cancelReason: 'cancelled_by_customer',\n cancellationComment: 'cancellation_comment',\n cancellationFeedback: CancellationFeedback::TOO_EXPENSIVE,\n creditEntitlementCart: [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n 'expiresAfterDays' => 0,\n 'lowBalanceThresholdPercent' => 0,\n 'maxRolloverCount' => 0,\n 'overageEnabled' => true,\n 'overageLimit' => 'overage_limit',\n 'rolloverEnabled' => true,\n 'rolloverPercentage' => 0,\n 'rolloverTimeframeCount' => 0,\n 'rolloverTimeframeInterval' => TimeInterval::DAY,\n ],\n ],\n customerBusinessName: 'customer_business_name',\n customerName: 'customer_name',\n disableOnDemand: [\n 'nextBillingDate' => new \\DateTimeImmutable('2019-12-27T18:11:19.117Z')\n ],\n metadata: ['foo' => 'string'],\n nextBillingDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n status: SubscriptionStatus::PENDING,\n subscriptionPeriodCount: 0,\n subscriptionPeriodInterval: TimeInterval::DAY,\n taxID: 'tax_id',\n);\n\nvar_dump($subscription);",
|
|
711
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$subscription = $client->subscriptions->update(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n billing: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n cancelAtNextBillingDate: true,\n cancelReason: 'cancelled_by_customer',\n cancellationComment: 'cancellation_comment',\n cancellationFeedback: CancellationFeedback::TOO_EXPENSIVE,\n creditEntitlementCart: [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n 'expiresAfterDays' => 0,\n 'lowBalanceThresholdPercent' => 0,\n 'maxRolloverCount' => 0,\n 'overageEnabled' => true,\n 'overageLimit' => 'overage_limit',\n 'rolloverEnabled' => true,\n 'rolloverPercentage' => 0,\n 'rolloverTimeframeCount' => 0,\n 'rolloverTimeframeInterval' => TimeInterval::DAY,\n ],\n ],\n customerBusinessName: 'customer_business_name',\n customerName: 'customer_name',\n disableOnDemand: [\n 'nextBillingDate' => new \\DateTimeImmutable('2019-12-27T18:11:19.117Z')\n ],\n metadata: ['foo' => 'string'],\n nextBillingDate: new \\DateTimeImmutable('2019-12-27T18:11:19.117Z'),\n pause: true,\n status: SubscriptionStatus::PENDING,\n subscriptionPeriodCount: 0,\n subscriptionPeriodInterval: TimeInterval::DAY,\n taxID: 'tax_id',\n);\n\nvar_dump($subscription);",
|
|
711
712
|
},
|
|
712
713
|
csharp: {
|
|
713
714
|
method: 'Subscriptions.Update',
|
|
@@ -962,7 +963,7 @@ const EMBEDDED_METHODS = [
|
|
|
962
963
|
"on_payment_failure?: 'prevent_change' | 'apply_change';",
|
|
963
964
|
],
|
|
964
965
|
response: '{ immediate_charge: { effective_at: string; line_items: object | object | object[]; summary: object; }; new_plan: object; }',
|
|
965
|
-
markdown: "## preview_change_plan\n\n`client.subscriptions.previewChangePlan(subscription_id: string, product_id: string, proration_billing_mode: 'prorated_immediately' | 'full_immediately' | 'difference_immediately' | 'do_not_bill', quantity: number, adaptive_currency_fees_inclusive?: boolean, addons?: { addon_id: string; quantity: number; }[], discount_code?: string, discount_codes?: string[], effective_at?: 'immediately' | 'next_billing_date', metadata?: object, on_payment_failure?: 'prevent_change' | 'apply_change'): { immediate_charge: object; new_plan: subscription; }`\n\n**post** `/subscriptions/{subscription_id}/change-plan/preview`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `product_id: string`\n Unique identifier of the product to subscribe to\n\n- `proration_billing_mode: 'prorated_immediately' | 'full_immediately' | 'difference_immediately' | 'do_not_bill'`\n Proration Billing Mode\n\n- `quantity: number`\n Number of units to subscribe for. Must be at least 1.\n\n- `adaptive_currency_fees_inclusive?: boolean`\n Whether adaptive currency fees should be included in the price (true) or added on top (false).\nIf not specified, uses the subscription's stored setting.\n\n- `addons?: { addon_id: string; quantity: number; }[]`\n Addons for the new plan.\nNote : Leaving this empty would remove any existing addons\n\n- `discount_code?: string`\n DEPRECATED: Use discount_codes instead. Cannot be used together with discount_codes.\n\n- `discount_codes?: string[]`\n Stacked discount codes to apply to the new plan. Max 20.\nCannot be used together with discount_code.\nIf provided, replaces any existing discount codes.\nEmpty array removes all discounts.\nIf not provided (None), existing discounts with preserve_on_plan_change=true are preserved.\n\n- `effective_at?: 'immediately' | 'next_billing_date'`\n When to apply the plan change.\n- `immediately` (default): Apply the plan change right away\n- `next_billing_date`: Schedule the change for the next billing date\n\n- `metadata?: object`\n Metadata for the payment. If not passed, the metadata of the subscription will be taken\n\n- `on_payment_failure?: 'prevent_change' | 'apply_change'`\n Controls behavior when the plan change payment fails.\n- `prevent_change`: Keep subscription on current plan until payment succeeds\n- `apply_change` (default): Apply plan change immediately regardless of payment outcome\n\nIf not specified, uses the business-level default setting.\n\n### Returns\n\n- `{ immediate_charge: { effective_at: string; line_items: { id: string; currency: currency; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: currency; name: string; proration_factor: number; quantity: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: currency; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: currency; customer_credits: number; settlement_amount: number; settlement_currency: currency; total_amount: number; settlement_tax?: number; tax?: number; }; }; new_plan: { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }; }`\n\n - `immediate_charge: { effective_at: string; line_items: { id: string; currency: string; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: string; name: string; proration_factor: number; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: string; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: string; customer_credits: number; settlement_amount: number; settlement_currency: string; total_amount: number; settlement_tax?: number; tax?: number; }; }`\n - `new_plan: { addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst response = await client.subscriptions.previewChangePlan('sub_Iuaq622bbmmfOGrVTqdXv', {\n product_id: 'product_id',\n proration_billing_mode: 'prorated_immediately',\n quantity: 0,\n});\n\nconsole.log(response);\n```",
|
|
966
|
+
markdown: "## preview_change_plan\n\n`client.subscriptions.previewChangePlan(subscription_id: string, product_id: string, proration_billing_mode: 'prorated_immediately' | 'full_immediately' | 'difference_immediately' | 'do_not_bill', quantity: number, adaptive_currency_fees_inclusive?: boolean, addons?: { addon_id: string; quantity: number; }[], discount_code?: string, discount_codes?: string[], effective_at?: 'immediately' | 'next_billing_date', metadata?: object, on_payment_failure?: 'prevent_change' | 'apply_change'): { immediate_charge: object; new_plan: subscription; }`\n\n**post** `/subscriptions/{subscription_id}/change-plan/preview`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `product_id: string`\n Unique identifier of the product to subscribe to\n\n- `proration_billing_mode: 'prorated_immediately' | 'full_immediately' | 'difference_immediately' | 'do_not_bill'`\n Proration Billing Mode\n\n- `quantity: number`\n Number of units to subscribe for. Must be at least 1.\n\n- `adaptive_currency_fees_inclusive?: boolean`\n Whether adaptive currency fees should be included in the price (true) or added on top (false).\nIf not specified, uses the subscription's stored setting.\n\n- `addons?: { addon_id: string; quantity: number; }[]`\n Addons for the new plan.\nNote : Leaving this empty would remove any existing addons\n\n- `discount_code?: string`\n DEPRECATED: Use discount_codes instead. Cannot be used together with discount_codes.\n\n- `discount_codes?: string[]`\n Stacked discount codes to apply to the new plan. Max 20.\nCannot be used together with discount_code.\nIf provided, replaces any existing discount codes.\nEmpty array removes all discounts.\nIf not provided (None), existing discounts with preserve_on_plan_change=true are preserved.\n\n- `effective_at?: 'immediately' | 'next_billing_date'`\n When to apply the plan change.\n- `immediately` (default): Apply the plan change right away\n- `next_billing_date`: Schedule the change for the next billing date\n\n- `metadata?: object`\n Metadata for the payment. If not passed, the metadata of the subscription will be taken\n\n- `on_payment_failure?: 'prevent_change' | 'apply_change'`\n Controls behavior when the plan change payment fails.\n- `prevent_change`: Keep subscription on current plan until payment succeeds\n- `apply_change` (default): Apply plan change immediately regardless of payment outcome\n\nIf not specified, uses the business-level default setting.\n\n### Returns\n\n- `{ immediate_charge: { effective_at: string; line_items: { id: string; currency: currency; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: currency; name: string; proration_factor: number; quantity: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: currency; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: currency; customer_credits: number; settlement_amount: number; settlement_currency: currency; total_amount: number; settlement_tax?: number; tax?: number; }; }; new_plan: { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; metadata: metadata; meter_credit_entitlement_cart: meter_credit_entitlement_cart_response[]; meters: meter_cart_response_item[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: cancellation_feedback; cancelled_at?: string; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }; }`\n\n - `immediate_charge: { effective_at: string; line_items: { id: string; currency: string; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: string; name: string; proration_factor: number; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: string; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: string; customer_credits: number; settlement_amount: number; settlement_currency: string; total_amount: number; settlement_tax?: number; tax?: number; }; }`\n - `new_plan: { addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; metadata: object; meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]; meters: { currency: currency; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancellation_comment?: string; cancellation_feedback?: string; cancelled_at?: string; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst response = await client.subscriptions.previewChangePlan('sub_Iuaq622bbmmfOGrVTqdXv', {\n product_id: 'product_id',\n proration_billing_mode: 'prorated_immediately',\n quantity: 0,\n});\n\nconsole.log(response);\n```",
|
|
966
967
|
perLanguage: {
|
|
967
968
|
typescript: {
|
|
968
969
|
method: 'client.subscriptions.previewChangePlan',
|