dodopayments-mcp 2.54.2 → 2.55.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.js +27 -27
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +27 -27
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/src/local-docs-search.ts +27 -27
package/local-docs-search.js
CHANGED
|
@@ -78,7 +78,7 @@ const EMBEDDED_METHODS = [
|
|
|
78
78
|
'tax_id?: string;',
|
|
79
79
|
],
|
|
80
80
|
response: '{ session_id: string; checkout_url?: string; client_secret?: string; payment_id?: string; publishable_key?: string; }',
|
|
81
|
-
markdown: "## create\n\n`client.checkoutSessions.create(product_cart: { product_id: string; quantity: number; addons?: attach_addon[]; amount?: number; credit_entitlements?: object[]; }[], allowed_payment_method_types?: string[], billing_address?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, billing_currency?: string, cancel_url?: string, confirm?: boolean, custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[], customer?: object | object, customer_business_name?: string, customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: theme_config; }, discount_code?: string, discount_codes?: string[], feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }, force_3ds?: boolean, mandate_min_amount_inr_paise?: number, metadata?: object, minimal_address?: boolean, payment_method_id?: string, product_collection_id?: string, return_url?: string, short_link?: boolean, show_saved_payment_methods?: boolean, subscription_data?: { on_demand?: on_demand_subscription; trial_period_days?: number; }, tax_id?: string): { session_id: string; checkout_url?: string; client_secret?: string; payment_id?: string; publishable_key?: string; }`\n\n**post** `/checkouts`\n\n### Parameters\n\n- `product_cart: { product_id: string; quantity: number; addons?: { addon_id: string; quantity: number; }[]; amount?: number; credit_entitlements?: { credit_entitlement_id: string; credits_amount: string; }[]; }[]`\n The products of the checkout. A cart holds at most 20 of them, one-time and\nsubscription products together. An empty cart is valid for the product-collection\nflow, where the customer chooses the product later.\n\n- `allowed_payment_method_types?: string[]`\n Customers will never see payment methods that are not in this list.\nHowever, adding a method here does not guarantee customers will see it.\nAvailability still depends on other factors (e.g., customer location, merchant settings).\n\nDisclaimar: Always provide 'credit' and 'debit' as a fallback.\nIf all payment methods are unavailable, checkout session will fail.\n\n- `billing_address?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n Billing address information for the session\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- `billing_currency?: string`\n The currency to charge the customer in.\n\nAdaptive pricing must be enabled for the business. The customer then pays in this\ncurrency. If you do not set it, the currency comes from the billing country.\n\nIf adaptive pricing is disabled, the API discards this field. The currency then comes\nfrom the product price, or from the billing country.\n\n- `cancel_url?: string`\n The URL to redirect the customer if they cancel or go back from the checkout.\nIf not provided, the back button will not be displayed.\n\n- `confirm?: boolean`\n If confirm is true, all the details will be finalized. If required data is missing, an API error is thrown.\n\n- `custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[]`\n Custom fields to collect from customer during checkout (max 5 fields)\n\n- `customer?: { customer_id: string; } | { email: string; name?: string; phone_number?: string; }`\n Customer details for the session\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 purchase, this name is rendered\non the invoice instead of the customer's personal name.\n\n- `customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: { dark?: theme_mode_config; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: theme_mode_config; pay_button_text?: string; radius?: string; }; }`\n Customization for the checkout session page\n - `force_language?: string`\n Force the checkout interface to render in a specific language (e.g. `en`, `es`)\n - `show_on_demand_tag?: boolean`\n Show on demand tag\n\nDefault is true\n - `show_order_details?: boolean`\n Show order details by default\n\nDefault is true\n - `theme?: 'dark' | 'light' | 'system'`\n Theme of the page (determines which mode - light/dark/system - to use)\n\nIf not provided, uses the business-configured theme from business_themes table.\n - `theme_config?: { dark?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; pay_button_text?: string; radius?: string; }`\n Optional custom theme configuration with colors for light and dark modes\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, in order. Max 20.\nCannot be used together with discount_code.\n\n- `feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }`\n - `allow_currency_selection?: boolean`\n if customer is allowed to change currency, set it to true\n\nDefault is true\n - `allow_customer_editing_business_name?: boolean`\n If true, the customer can supply or edit the business name associated\nwith the tax id during checkout. Works independently of\n`allow_customer_editing_tax_id` — either flag (or `allow_tax_id`) is\nsufficient to let the customer override the session's business name.\nTypically set together with `allow_customer_editing_tax_id`.\n\nDefault is false\n - `allow_customer_editing_city?: boolean`\n - `allow_customer_editing_country?: boolean`\n - `allow_customer_editing_email?: boolean`\n - `allow_customer_editing_name?: boolean`\n - `allow_customer_editing_state?: boolean`\n - `allow_customer_editing_street?: boolean`\n - `allow_customer_editing_tax_id?: boolean`\n - `allow_customer_editing_zipcode?: boolean`\n - `allow_discount_code?: boolean`\n If the customer is allowed to apply discount code, set it to true.\n\nDefault is true\n - `allow_editing_addons?: boolean`\n If true, the customer can add or remove addons on a subscription product\nduring checkout.\n\nDefault is false\n - `allow_phone_number_collection?: boolean`\n If phone number is collected from customer, set it to rue\n\nDefault is true\n - `allow_tax_id?: boolean`\n If the customer is allowed to add tax id, set it to true\n\nDefault is true\n - `always_create_new_customer?: boolean`\n Set to true if a new customer object should be created.\nBy default email is used to find an existing customer to attach the session to\n\nDefault is false\n - `redirect_immediately?: boolean`\n If true, redirects the customer immediately after payment completion\n\nDefault is false\n - `require_cardholder_name?: boolean`\n If true, the customer must give the name on the card to pay by card.\nApple Pay and Google Pay also collect the payer name, and the payment\nstores it as the card holder name. The checkout page enforces this.\nOther payment methods ignore it.\n\nDefault is false\n - `require_phone_number?: boolean`\n If true, the customer must provide a phone number to complete checkout.\nRequires `allow_phone_number_collection` to also be true.\n\nDefault is false\n - `require_tax_id?: boolean`\n If true, the customer must give a tax id to check out as a business.\nA tax id is the GST number in India, or the VAT number in the EU.\nYou must also set `allow_tax_id` to true.\n\nOn the checkout page, this field does not change checkout for a customer\nwho buys as an individual.\n\nA `confirm: true` request skips the checkout page. The request must\ncontain `tax_id`.\n\nDefault is false\n - `single_page?: boolean`\n If true, the session uses the single-page checkout flow: the page\ninitializes the payment at load time and confirms it in\nplace, with no separate payment page.\n\nDefault is false\n\n- `force_3ds?: boolean`\n Override merchant default 3DS behaviour for this session\n\n- `mandate_min_amount_inr_paise?: number`\n Override the merchant-level mandate floor (in INR paise) for INR\ne-mandates on Indian-card recurring payments. The mandate amount sent to\nthe processor is `max(this_floor, actual_billing_amount)`, so this is\neffectively the customer-facing authorization ceiling whenever billing is\nlower. When unset, the merchant setting applies; when that's also unset,\nthe system default of ₹15,000 applies.\n\n- `metadata?: object`\n Additional metadata associated with the payment. Defaults to empty if not provided.\n\n- `minimal_address?: boolean`\n If true, only zipcode is required when confirm is true; other address fields remain optional\n\nDefault is true when `feature_flags.single_page` is true. Otherwise, default is false.\n\n- `payment_method_id?: string`\n Optional payment method ID to use for this checkout session.\nOnly allowed when `confirm` is true.\nIf provided, existing customer id must also be provided.\n\n- `product_collection_id?: string`\n Product collection ID for collection-based checkout flow\n\n- `return_url?: string`\n The url to redirect after payment failure or success.\n\n- `short_link?: boolean`\n If true, returns a shortened checkout URL.\nDefaults to false if not specified.\n\n- `show_saved_payment_methods?: boolean`\n Display saved payment methods of a returning customer False by default\n\n- `subscription_data?: { on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: currency; product_description?: string; product_price?: number; }; trial_period_days?: number; }`\n - `on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: string; product_description?: string; product_price?: number; }`\n - `trial_period_days?: number`\n Optional trial period in days If specified, this value overrides the trial period set in the product's price Must be between 0 and 10000 days\n\n- `tax_id?: string`\n Tax ID for the customer (e.g. VAT number). Requires billing_address with country.\n\n### Returns\n\n- `{ session_id: string; checkout_url?: string; client_secret?: string; payment_id?: string; publishable_key?: string; }`\n\n - `session_id: string`\n - `checkout_url?: string`\n - `client_secret?: string`\n - `payment_id?: string`\n - `publishable_key?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst checkoutSessionResponse = await client.checkoutSessions.create({ product_cart: [{ product_id: 'product_id', quantity: 0 }] });\n\nconsole.log(checkoutSessionResponse);\n```",
|
|
81
|
+
markdown: "## create\n\n`client.checkoutSessions.create(product_cart: { product_id: string; quantity: number; addons?: attach_addon[]; amount?: number; credit_entitlements?: object[]; }[], allowed_payment_method_types?: string[], billing_address?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, billing_currency?: string, cancel_url?: string, confirm?: boolean, custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[], customer?: object | object, customer_business_name?: string, customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: theme_config; }, discount_code?: string, discount_codes?: string[], feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }, force_3ds?: boolean, mandate_min_amount_inr_paise?: number, metadata?: object, minimal_address?: boolean, payment_method_id?: string, product_collection_id?: string, return_url?: string, short_link?: boolean, show_saved_payment_methods?: boolean, subscription_data?: { on_demand?: on_demand_subscription; trial_period_days?: number; }, tax_id?: string): { session_id: string; checkout_url?: string; client_secret?: string; payment_id?: string; publishable_key?: string; }`\n\n**post** `/checkouts`\n\n### Parameters\n\n- `product_cart: { product_id: string; quantity: number; addons?: { addon_id: string; quantity: number; }[]; amount?: number; credit_entitlements?: { credit_entitlement_id: string; credits_amount: string; }[]; }[]`\n The products of the checkout. A cart holds at most 20 of them, one-time and\nsubscription products together. An empty cart is valid for the product-collection\nflow, where the customer chooses the product later.\n\n- `allowed_payment_method_types?: string[]`\n Customers will never see payment methods that are not in this list.\nHowever, adding a method here does not guarantee customers will see it.\nAvailability still depends on other factors (e.g., customer location, merchant settings).\n\nDisclaimar: Always provide 'credit' and 'debit' as a fallback.\nIf all payment methods are unavailable, checkout session will fail.\n\n- `billing_address?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n Billing address information for the session\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- `billing_currency?: string`\n The currency to charge the customer in.\n\nAdaptive pricing must be enabled for the business. The customer then pays in this\ncurrency. If you do not set it, the currency comes from the billing country.\n\nIf adaptive pricing is disabled, the API discards this field. The currency then comes\nfrom the product price, or from the billing country.\n\n- `cancel_url?: string`\n The URL to redirect the customer if they cancel or go back from the checkout.\nIf not provided, the back button will not be displayed.\n\n- `confirm?: boolean`\n If confirm is true, all the details will be finalized. If required data is missing, an API error is thrown.\n\n- `custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[]`\n Custom fields to collect from customer during checkout (max 5 fields)\n\n- `customer?: { customer_id: string; } | { email: string; name?: string; phone_number?: string; }`\n Customer details for the session\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 purchase, this name is rendered\non the invoice instead of the customer's personal name.\n\n- `customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: { dark?: theme_mode_config; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: theme_mode_config; pay_button_text?: string; radius?: string; }; }`\n Customization for the checkout session page\n - `force_language?: string`\n Force the checkout interface to render in a specific language (e.g. `en`, `es`)\n - `show_on_demand_tag?: boolean`\n Show on demand tag\n\nDefault is true\n - `show_order_details?: boolean`\n Show order details by default\n\nDefault is true\n - `theme?: 'dark' | 'light' | 'system'`\n Theme of the page (determines which mode - light/dark/system - to use)\n\nIf not provided, uses the business-configured theme from business_themes table.\n - `theme_config?: { dark?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; pay_button_text?: string; radius?: string; }`\n Optional custom theme configuration with colors for light and dark modes\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, in order. Max 20.\nCannot be used together with discount_code.\n\n- `feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }`\n - `allow_currency_selection?: boolean`\n if customer is allowed to change currency, set it to true\n\nDefault is true\n - `allow_customer_editing_business_name?: boolean`\n If true, the customer can supply or edit the business name associated\nwith the tax id during checkout. Works independently of\n`allow_customer_editing_tax_id` — either flag (or `allow_tax_id`) is\nsufficient to let the customer override the session's business name.\nTypically set together with `allow_customer_editing_tax_id`.\n\nDefault is false\n - `allow_customer_editing_city?: boolean`\n - `allow_customer_editing_country?: boolean`\n - `allow_customer_editing_email?: boolean`\n - `allow_customer_editing_name?: boolean`\n - `allow_customer_editing_state?: boolean`\n - `allow_customer_editing_street?: boolean`\n - `allow_customer_editing_tax_id?: boolean`\n - `allow_customer_editing_zipcode?: boolean`\n - `allow_discount_code?: boolean`\n If the customer is allowed to apply discount code, set it to true.\n\nIf this flag is false, the customer cannot change the discount codes.\nThe discount codes that you give when you create the session still apply.\n\nDefault is true\n - `allow_editing_addons?: boolean`\n If true, the customer can add or remove addons on a subscription product\nduring checkout.\n\nDefault is false\n - `allow_phone_number_collection?: boolean`\n If phone number is collected from customer, set it to rue\n\nDefault is true\n - `allow_tax_id?: boolean`\n If the customer is allowed to add tax id, set it to true\n\nDefault is true\n - `always_create_new_customer?: boolean`\n Set to true if a new customer object should be created.\nBy default email is used to find an existing customer to attach the session to\n\nDefault is false\n - `redirect_immediately?: boolean`\n If true, redirects the customer immediately after payment completion\n\nDefault is false\n - `require_cardholder_name?: boolean`\n If true, the customer must give the name on the card to pay by card.\nApple Pay and Google Pay also collect the payer name, and the payment\nstores it as the card holder name. The checkout page enforces this.\nOther payment methods ignore it.\n\nDefault is false\n - `require_phone_number?: boolean`\n If true, the customer must provide a phone number to complete checkout.\nRequires `allow_phone_number_collection` to also be true.\n\nDefault is false\n - `require_tax_id?: boolean`\n If true, the customer must give a tax id to check out as a business.\nA tax id is the GST number in India, or the VAT number in the EU.\nYou must also set `allow_tax_id` to true.\n\nOn the checkout page, this field does not change checkout for a customer\nwho buys as an individual.\n\nA `confirm: true` request skips the checkout page. The request must\ncontain `tax_id`.\n\nDefault is false\n - `single_page?: boolean`\n If true, the session uses the single-page checkout flow: the page\ninitializes the payment at load time and confirms it in\nplace, with no separate payment page.\n\nDefault is false\n\n- `force_3ds?: boolean`\n Override merchant default 3DS behaviour for this session\n\n- `mandate_min_amount_inr_paise?: number`\n Override the merchant-level mandate floor (in INR paise) for INR\ne-mandates on Indian-card recurring payments. The mandate amount sent to\nthe processor is `max(this_floor, actual_billing_amount)`, so this is\neffectively the customer-facing authorization ceiling whenever billing is\nlower. When unset, the merchant setting applies; when that's also unset,\nthe system default of ₹15,000 applies.\n\n- `metadata?: object`\n Additional metadata associated with the payment. Defaults to empty if not provided.\n\n- `minimal_address?: boolean`\n If true, only zipcode is required when confirm is true; other address fields remain optional\n\nDefault is true when `feature_flags.single_page` is true. Otherwise, default is false.\n\n- `payment_method_id?: string`\n Optional payment method ID to use for this checkout session.\nOnly allowed when `confirm` is true.\nIf provided, existing customer id must also be provided.\n\n- `product_collection_id?: string`\n Product collection ID for collection-based checkout flow\n\n- `return_url?: string`\n The url to redirect after payment failure or success.\n\n- `short_link?: boolean`\n If true, returns a shortened checkout URL.\nDefaults to false if not specified.\n\n- `show_saved_payment_methods?: boolean`\n Display saved payment methods of a returning customer False by default\n\n- `subscription_data?: { on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: currency; product_description?: string; product_price?: number; }; trial_period_days?: number; }`\n - `on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: string; product_description?: string; product_price?: number; }`\n - `trial_period_days?: number`\n Optional trial period in days If specified, this value overrides the trial period set in the product's price Must be between 0 and 10000 days\n\n- `tax_id?: string`\n Tax ID for the customer (e.g. VAT number). Requires billing_address with country.\n\n### Returns\n\n- `{ session_id: string; checkout_url?: string; client_secret?: string; payment_id?: string; publishable_key?: string; }`\n\n - `session_id: string`\n - `checkout_url?: string`\n - `client_secret?: string`\n - `payment_id?: string`\n - `publishable_key?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst checkoutSessionResponse = await client.checkoutSessions.create({ product_cart: [{ product_id: 'product_id', quantity: 0 }] });\n\nconsole.log(checkoutSessionResponse);\n```",
|
|
82
82
|
perLanguage: {
|
|
83
83
|
typescript: {
|
|
84
84
|
method: 'client.checkoutSessions.create',
|
|
@@ -201,7 +201,7 @@ const EMBEDDED_METHODS = [
|
|
|
201
201
|
'tax_id?: string;',
|
|
202
202
|
],
|
|
203
203
|
response: '{ billing_country: string; currency: string; current_breakup: { discount: number; subtotal: number; total_amount: number; tax?: number; }; is_byop: boolean; payment_method_required: boolean; product_cart: { credit_entitlements: object[]; currency: currency; discounted_price: number; is_subscription: boolean; is_usage_based: boolean; meters: object[]; og_currency: currency; og_price: number; product_id: string; quantity: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; addons?: object[]; description?: string; discount_amount?: number; discount_cycle?: number; name?: string; tax?: number; }[]; total_price: number; next_billing_date?: string; recurring_breakup?: { discount: number; subtotal: number; total_amount: number; tax?: number; }; subscriptions?: { amount_due_now: number; product_id: string; recurring_amount: number; next_billing_date?: string; recurring_tax?: number; tax_due_now?: number; trial_period_days?: number; }[]; tax_id_business_name?: string; tax_id_err_msg?: string; tax_id_format_name?: string; total_tax?: number; trial_amount?: number; trial_period_days?: number; }',
|
|
204
|
-
markdown: "## preview\n\n`client.checkoutSessions.preview(product_cart: { product_id: string; quantity: number; addons?: attach_addon[]; amount?: number; credit_entitlements?: object[]; }[], allowed_payment_method_types?: string[], billing_address?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, billing_currency?: string, cancel_url?: string, confirm?: boolean, custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[], customer?: object | object, customer_business_name?: string, customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: theme_config; }, discount_code?: string, discount_codes?: string[], feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }, force_3ds?: boolean, mandate_min_amount_inr_paise?: number, metadata?: object, minimal_address?: boolean, payment_method_id?: string, product_collection_id?: string, return_url?: string, short_link?: boolean, show_saved_payment_methods?: boolean, subscription_data?: { on_demand?: on_demand_subscription; trial_period_days?: number; }, tax_id?: string): { billing_country: country_code; currency: currency; current_breakup: object; is_byop: boolean; payment_method_required: boolean; product_cart: object[]; total_price: number; next_billing_date?: string; recurring_breakup?: object; subscriptions?: object[]; tax_id_business_name?: string; tax_id_err_msg?: string; tax_id_format_name?: string; total_tax?: number; trial_amount?: number; trial_period_days?: number; }`\n\n**post** `/checkouts/preview`\n\n### Parameters\n\n- `product_cart: { product_id: string; quantity: number; addons?: { addon_id: string; quantity: number; }[]; amount?: number; credit_entitlements?: { credit_entitlement_id: string; credits_amount: string; }[]; }[]`\n The products of the checkout. A cart holds at most 20 of them, one-time and\nsubscription products together. An empty cart is valid for the product-collection\nflow, where the customer chooses the product later.\n\n- `allowed_payment_method_types?: string[]`\n Customers will never see payment methods that are not in this list.\nHowever, adding a method here does not guarantee customers will see it.\nAvailability still depends on other factors (e.g., customer location, merchant settings).\n\nDisclaimar: Always provide 'credit' and 'debit' as a fallback.\nIf all payment methods are unavailable, checkout session will fail.\n\n- `billing_address?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n Billing address information for the session\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- `billing_currency?: string`\n The currency to charge the customer in.\n\nAdaptive pricing must be enabled for the business. The customer then pays in this\ncurrency. If you do not set it, the currency comes from the billing country.\n\nIf adaptive pricing is disabled, the API discards this field. The currency then comes\nfrom the product price, or from the billing country.\n\n- `cancel_url?: string`\n The URL to redirect the customer if they cancel or go back from the checkout.\nIf not provided, the back button will not be displayed.\n\n- `confirm?: boolean`\n If confirm is true, all the details will be finalized. If required data is missing, an API error is thrown.\n\n- `custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[]`\n Custom fields to collect from customer during checkout (max 5 fields)\n\n- `customer?: { customer_id: string; } | { email: string; name?: string; phone_number?: string; }`\n Customer details for the session\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 purchase, this name is rendered\non the invoice instead of the customer's personal name.\n\n- `customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: { dark?: theme_mode_config; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: theme_mode_config; pay_button_text?: string; radius?: string; }; }`\n Customization for the checkout session page\n - `force_language?: string`\n Force the checkout interface to render in a specific language (e.g. `en`, `es`)\n - `show_on_demand_tag?: boolean`\n Show on demand tag\n\nDefault is true\n - `show_order_details?: boolean`\n Show order details by default\n\nDefault is true\n - `theme?: 'dark' | 'light' | 'system'`\n Theme of the page (determines which mode - light/dark/system - to use)\n\nIf not provided, uses the business-configured theme from business_themes table.\n - `theme_config?: { dark?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; pay_button_text?: string; radius?: string; }`\n Optional custom theme configuration with colors for light and dark modes\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, in order. Max 20.\nCannot be used together with discount_code.\n\n- `feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }`\n - `allow_currency_selection?: boolean`\n if customer is allowed to change currency, set it to true\n\nDefault is true\n - `allow_customer_editing_business_name?: boolean`\n If true, the customer can supply or edit the business name associated\nwith the tax id during checkout. Works independently of\n`allow_customer_editing_tax_id` — either flag (or `allow_tax_id`) is\nsufficient to let the customer override the session's business name.\nTypically set together with `allow_customer_editing_tax_id`.\n\nDefault is false\n - `allow_customer_editing_city?: boolean`\n - `allow_customer_editing_country?: boolean`\n - `allow_customer_editing_email?: boolean`\n - `allow_customer_editing_name?: boolean`\n - `allow_customer_editing_state?: boolean`\n - `allow_customer_editing_street?: boolean`\n - `allow_customer_editing_tax_id?: boolean`\n - `allow_customer_editing_zipcode?: boolean`\n - `allow_discount_code?: boolean`\n If the customer is allowed to apply discount code, set it to true.\n\nDefault is true\n - `allow_editing_addons?: boolean`\n If true, the customer can add or remove addons on a subscription product\nduring checkout.\n\nDefault is false\n - `allow_phone_number_collection?: boolean`\n If phone number is collected from customer, set it to rue\n\nDefault is true\n - `allow_tax_id?: boolean`\n If the customer is allowed to add tax id, set it to true\n\nDefault is true\n - `always_create_new_customer?: boolean`\n Set to true if a new customer object should be created.\nBy default email is used to find an existing customer to attach the session to\n\nDefault is false\n - `redirect_immediately?: boolean`\n If true, redirects the customer immediately after payment completion\n\nDefault is false\n - `require_cardholder_name?: boolean`\n If true, the customer must give the name on the card to pay by card.\nApple Pay and Google Pay also collect the payer name, and the payment\nstores it as the card holder name. The checkout page enforces this.\nOther payment methods ignore it.\n\nDefault is false\n - `require_phone_number?: boolean`\n If true, the customer must provide a phone number to complete checkout.\nRequires `allow_phone_number_collection` to also be true.\n\nDefault is false\n - `require_tax_id?: boolean`\n If true, the customer must give a tax id to check out as a business.\nA tax id is the GST number in India, or the VAT number in the EU.\nYou must also set `allow_tax_id` to true.\n\nOn the checkout page, this field does not change checkout for a customer\nwho buys as an individual.\n\nA `confirm: true` request skips the checkout page. The request must\ncontain `tax_id`.\n\nDefault is false\n - `single_page?: boolean`\n If true, the session uses the single-page checkout flow: the page\ninitializes the payment at load time and confirms it in\nplace, with no separate payment page.\n\nDefault is false\n\n- `force_3ds?: boolean`\n Override merchant default 3DS behaviour for this session\n\n- `mandate_min_amount_inr_paise?: number`\n Override the merchant-level mandate floor (in INR paise) for INR\ne-mandates on Indian-card recurring payments. The mandate amount sent to\nthe processor is `max(this_floor, actual_billing_amount)`, so this is\neffectively the customer-facing authorization ceiling whenever billing is\nlower. When unset, the merchant setting applies; when that's also unset,\nthe system default of ₹15,000 applies.\n\n- `metadata?: object`\n Additional metadata associated with the payment. Defaults to empty if not provided.\n\n- `minimal_address?: boolean`\n If true, only zipcode is required when confirm is true; other address fields remain optional\n\nDefault is true when `feature_flags.single_page` is true. Otherwise, default is false.\n\n- `payment_method_id?: string`\n Optional payment method ID to use for this checkout session.\nOnly allowed when `confirm` is true.\nIf provided, existing customer id must also be provided.\n\n- `product_collection_id?: string`\n Product collection ID for collection-based checkout flow\n\n- `return_url?: string`\n The url to redirect after payment failure or success.\n\n- `short_link?: boolean`\n If true, returns a shortened checkout URL.\nDefaults to false if not specified.\n\n- `show_saved_payment_methods?: boolean`\n Display saved payment methods of a returning customer False by default\n\n- `subscription_data?: { on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: currency; product_description?: string; product_price?: number; }; trial_period_days?: number; }`\n - `on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: string; product_description?: string; product_price?: number; }`\n - `trial_period_days?: number`\n Optional trial period in days If specified, this value overrides the trial period set in the product's price Must be between 0 and 10000 days\n\n- `tax_id?: string`\n Tax ID for the customer (e.g. VAT number). Requires billing_address with country.\n\n### Returns\n\n- `{ billing_country: string; currency: string; current_breakup: { discount: number; subtotal: number; total_amount: number; tax?: number; }; is_byop: boolean; payment_method_required: boolean; product_cart: { credit_entitlements: { credit_entitlement_id: string; credit_entitlement_name: string; credit_entitlement_unit: string; credits_amount: string; }[]; currency: string; discounted_price: number; is_subscription: boolean; is_usage_based: boolean; meters: { measurement_unit: string; name: string; price_per_unit: string; description?: string; free_threshold?: number; }[]; og_currency: string; og_price: number; product_id: string; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; addons?: { addon_id: string; currency: currency; discounted_price: number; name: string; og_currency: currency; og_price: number; quantity: number; single_quantity_price: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; description?: string; discount_amount?: number; tax?: number; }[]; description?: string; discount_amount?: number; discount_cycle?: number; name?: string; tax?: number; }[]; total_price: number; next_billing_date?: string; recurring_breakup?: { discount: number; subtotal: number; total_amount: number; tax?: number; }; subscriptions?: { amount_due_now: number; product_id: string; recurring_amount: number; next_billing_date?: string; recurring_tax?: number; tax_due_now?: number; trial_period_days?: number; }[]; tax_id_business_name?: string; tax_id_err_msg?: string; tax_id_format_name?: string; total_tax?: number; trial_amount?: number; trial_period_days?: number; }`\n Data returned by the calculate checkout session API\n\n - `billing_country: string`\n - `currency: string`\n - `current_breakup: { discount: number; subtotal: number; total_amount: number; tax?: number; }`\n - `is_byop: boolean`\n - `payment_method_required: boolean`\n - `product_cart: { credit_entitlements: { credit_entitlement_id: string; credit_entitlement_name: string; credit_entitlement_unit: string; credits_amount: string; }[]; currency: string; discounted_price: number; is_subscription: boolean; is_usage_based: boolean; meters: { measurement_unit: string; name: string; price_per_unit: string; description?: string; free_threshold?: number; }[]; og_currency: string; og_price: number; product_id: string; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; addons?: { addon_id: string; currency: string; discounted_price: number; name: string; og_currency: string; og_price: number; quantity: number; single_quantity_price: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; description?: string; discount_amount?: number; tax?: number; }[]; description?: string; discount_amount?: number; discount_cycle?: number; name?: string; tax?: number; }[]`\n - `total_price: number`\n - `next_billing_date?: string`\n - `recurring_breakup?: { discount: number; subtotal: number; total_amount: number; tax?: number; }`\n - `subscriptions?: { amount_due_now: number; product_id: string; recurring_amount: number; next_billing_date?: string; recurring_tax?: number; tax_due_now?: number; trial_period_days?: number; }[]`\n - `tax_id_business_name?: string`\n - `tax_id_err_msg?: string`\n - `tax_id_format_name?: string`\n - `total_tax?: number`\n - `trial_amount?: number`\n - `trial_period_days?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst response = await client.checkoutSessions.preview({ product_cart: [{ product_id: 'product_id', quantity: 0 }] });\n\nconsole.log(response);\n```",
|
|
204
|
+
markdown: "## preview\n\n`client.checkoutSessions.preview(product_cart: { product_id: string; quantity: number; addons?: attach_addon[]; amount?: number; credit_entitlements?: object[]; }[], allowed_payment_method_types?: string[], billing_address?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, billing_currency?: string, cancel_url?: string, confirm?: boolean, custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[], customer?: object | object, customer_business_name?: string, customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: theme_config; }, discount_code?: string, discount_codes?: string[], feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }, force_3ds?: boolean, mandate_min_amount_inr_paise?: number, metadata?: object, minimal_address?: boolean, payment_method_id?: string, product_collection_id?: string, return_url?: string, short_link?: boolean, show_saved_payment_methods?: boolean, subscription_data?: { on_demand?: on_demand_subscription; trial_period_days?: number; }, tax_id?: string): { billing_country: country_code; currency: currency; current_breakup: object; is_byop: boolean; payment_method_required: boolean; product_cart: object[]; total_price: number; next_billing_date?: string; recurring_breakup?: object; subscriptions?: object[]; tax_id_business_name?: string; tax_id_err_msg?: string; tax_id_format_name?: string; total_tax?: number; trial_amount?: number; trial_period_days?: number; }`\n\n**post** `/checkouts/preview`\n\n### Parameters\n\n- `product_cart: { product_id: string; quantity: number; addons?: { addon_id: string; quantity: number; }[]; amount?: number; credit_entitlements?: { credit_entitlement_id: string; credits_amount: string; }[]; }[]`\n The products of the checkout. A cart holds at most 20 of them, one-time and\nsubscription products together. An empty cart is valid for the product-collection\nflow, where the customer chooses the product later.\n\n- `allowed_payment_method_types?: string[]`\n Customers will never see payment methods that are not in this list.\nHowever, adding a method here does not guarantee customers will see it.\nAvailability still depends on other factors (e.g., customer location, merchant settings).\n\nDisclaimar: Always provide 'credit' and 'debit' as a fallback.\nIf all payment methods are unavailable, checkout session will fail.\n\n- `billing_address?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n Billing address information for the session\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- `billing_currency?: string`\n The currency to charge the customer in.\n\nAdaptive pricing must be enabled for the business. The customer then pays in this\ncurrency. If you do not set it, the currency comes from the billing country.\n\nIf adaptive pricing is disabled, the API discards this field. The currency then comes\nfrom the product price, or from the billing country.\n\n- `cancel_url?: string`\n The URL to redirect the customer if they cancel or go back from the checkout.\nIf not provided, the back button will not be displayed.\n\n- `confirm?: boolean`\n If confirm is true, all the details will be finalized. If required data is missing, an API error is thrown.\n\n- `custom_fields?: { field_type: 'text' | 'number' | 'email' | 'url' | 'date' | 'dropdown' | 'boolean'; key: string; label: string; options?: string[]; placeholder?: string; required?: boolean; }[]`\n Custom fields to collect from customer during checkout (max 5 fields)\n\n- `customer?: { customer_id: string; } | { email: string; name?: string; phone_number?: string; }`\n Customer details for the session\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 purchase, this name is rendered\non the invoice instead of the customer's personal name.\n\n- `customization?: { force_language?: string; show_on_demand_tag?: boolean; show_order_details?: boolean; theme?: 'dark' | 'light' | 'system'; theme_config?: { dark?: theme_mode_config; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: theme_mode_config; pay_button_text?: string; radius?: string; }; }`\n Customization for the checkout session page\n - `force_language?: string`\n Force the checkout interface to render in a specific language (e.g. `en`, `es`)\n - `show_on_demand_tag?: boolean`\n Show on demand tag\n\nDefault is true\n - `show_order_details?: boolean`\n Show order details by default\n\nDefault is true\n - `theme?: 'dark' | 'light' | 'system'`\n Theme of the page (determines which mode - light/dark/system - to use)\n\nIf not provided, uses the business-configured theme from business_themes table.\n - `theme_config?: { dark?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; font_primary_url?: string; font_secondary_url?: string; font_size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'; font_weight?: 'normal' | 'medium' | 'bold' | 'extraBold'; light?: { bg_primary?: string; bg_secondary?: string; border_primary?: string; border_secondary?: string; button_primary?: string; button_primary_hover?: string; button_secondary?: string; button_secondary_hover?: string; button_text_primary?: string; button_text_secondary?: string; input_focus_border?: string; text_error?: string; text_placeholder?: string; text_primary?: string; text_secondary?: string; text_success?: string; }; pay_button_text?: string; radius?: string; }`\n Optional custom theme configuration with colors for light and dark modes\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, in order. Max 20.\nCannot be used together with discount_code.\n\n- `feature_flags?: { allow_currency_selection?: boolean; allow_customer_editing_business_name?: boolean; allow_customer_editing_city?: boolean; allow_customer_editing_country?: boolean; allow_customer_editing_email?: boolean; allow_customer_editing_name?: boolean; allow_customer_editing_state?: boolean; allow_customer_editing_street?: boolean; allow_customer_editing_tax_id?: boolean; allow_customer_editing_zipcode?: boolean; allow_discount_code?: boolean; allow_editing_addons?: boolean; allow_phone_number_collection?: boolean; allow_tax_id?: boolean; always_create_new_customer?: boolean; redirect_immediately?: boolean; require_cardholder_name?: boolean; require_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; }`\n - `allow_currency_selection?: boolean`\n if customer is allowed to change currency, set it to true\n\nDefault is true\n - `allow_customer_editing_business_name?: boolean`\n If true, the customer can supply or edit the business name associated\nwith the tax id during checkout. Works independently of\n`allow_customer_editing_tax_id` — either flag (or `allow_tax_id`) is\nsufficient to let the customer override the session's business name.\nTypically set together with `allow_customer_editing_tax_id`.\n\nDefault is false\n - `allow_customer_editing_city?: boolean`\n - `allow_customer_editing_country?: boolean`\n - `allow_customer_editing_email?: boolean`\n - `allow_customer_editing_name?: boolean`\n - `allow_customer_editing_state?: boolean`\n - `allow_customer_editing_street?: boolean`\n - `allow_customer_editing_tax_id?: boolean`\n - `allow_customer_editing_zipcode?: boolean`\n - `allow_discount_code?: boolean`\n If the customer is allowed to apply discount code, set it to true.\n\nIf this flag is false, the customer cannot change the discount codes.\nThe discount codes that you give when you create the session still apply.\n\nDefault is true\n - `allow_editing_addons?: boolean`\n If true, the customer can add or remove addons on a subscription product\nduring checkout.\n\nDefault is false\n - `allow_phone_number_collection?: boolean`\n If phone number is collected from customer, set it to rue\n\nDefault is true\n - `allow_tax_id?: boolean`\n If the customer is allowed to add tax id, set it to true\n\nDefault is true\n - `always_create_new_customer?: boolean`\n Set to true if a new customer object should be created.\nBy default email is used to find an existing customer to attach the session to\n\nDefault is false\n - `redirect_immediately?: boolean`\n If true, redirects the customer immediately after payment completion\n\nDefault is false\n - `require_cardholder_name?: boolean`\n If true, the customer must give the name on the card to pay by card.\nApple Pay and Google Pay also collect the payer name, and the payment\nstores it as the card holder name. The checkout page enforces this.\nOther payment methods ignore it.\n\nDefault is false\n - `require_phone_number?: boolean`\n If true, the customer must provide a phone number to complete checkout.\nRequires `allow_phone_number_collection` to also be true.\n\nDefault is false\n - `require_tax_id?: boolean`\n If true, the customer must give a tax id to check out as a business.\nA tax id is the GST number in India, or the VAT number in the EU.\nYou must also set `allow_tax_id` to true.\n\nOn the checkout page, this field does not change checkout for a customer\nwho buys as an individual.\n\nA `confirm: true` request skips the checkout page. The request must\ncontain `tax_id`.\n\nDefault is false\n - `single_page?: boolean`\n If true, the session uses the single-page checkout flow: the page\ninitializes the payment at load time and confirms it in\nplace, with no separate payment page.\n\nDefault is false\n\n- `force_3ds?: boolean`\n Override merchant default 3DS behaviour for this session\n\n- `mandate_min_amount_inr_paise?: number`\n Override the merchant-level mandate floor (in INR paise) for INR\ne-mandates on Indian-card recurring payments. The mandate amount sent to\nthe processor is `max(this_floor, actual_billing_amount)`, so this is\neffectively the customer-facing authorization ceiling whenever billing is\nlower. When unset, the merchant setting applies; when that's also unset,\nthe system default of ₹15,000 applies.\n\n- `metadata?: object`\n Additional metadata associated with the payment. Defaults to empty if not provided.\n\n- `minimal_address?: boolean`\n If true, only zipcode is required when confirm is true; other address fields remain optional\n\nDefault is true when `feature_flags.single_page` is true. Otherwise, default is false.\n\n- `payment_method_id?: string`\n Optional payment method ID to use for this checkout session.\nOnly allowed when `confirm` is true.\nIf provided, existing customer id must also be provided.\n\n- `product_collection_id?: string`\n Product collection ID for collection-based checkout flow\n\n- `return_url?: string`\n The url to redirect after payment failure or success.\n\n- `short_link?: boolean`\n If true, returns a shortened checkout URL.\nDefaults to false if not specified.\n\n- `show_saved_payment_methods?: boolean`\n Display saved payment methods of a returning customer False by default\n\n- `subscription_data?: { on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: currency; product_description?: string; product_price?: number; }; trial_period_days?: number; }`\n - `on_demand?: { mandate_only: boolean; adaptive_currency_fees_inclusive?: boolean; product_currency?: string; product_description?: string; product_price?: number; }`\n - `trial_period_days?: number`\n Optional trial period in days If specified, this value overrides the trial period set in the product's price Must be between 0 and 10000 days\n\n- `tax_id?: string`\n Tax ID for the customer (e.g. VAT number). Requires billing_address with country.\n\n### Returns\n\n- `{ billing_country: string; currency: string; current_breakup: { discount: number; subtotal: number; total_amount: number; tax?: number; }; is_byop: boolean; payment_method_required: boolean; product_cart: { credit_entitlements: { credit_entitlement_id: string; credit_entitlement_name: string; credit_entitlement_unit: string; credits_amount: string; }[]; currency: string; discounted_price: number; is_subscription: boolean; is_usage_based: boolean; meters: { measurement_unit: string; name: string; price_per_unit: string; description?: string; free_threshold?: number; }[]; og_currency: string; og_price: number; product_id: string; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; addons?: { addon_id: string; currency: currency; discounted_price: number; name: string; og_currency: currency; og_price: number; quantity: number; single_quantity_price: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; description?: string; discount_amount?: number; tax?: number; }[]; description?: string; discount_amount?: number; discount_cycle?: number; name?: string; tax?: number; }[]; total_price: number; next_billing_date?: string; recurring_breakup?: { discount: number; subtotal: number; total_amount: number; tax?: number; }; subscriptions?: { amount_due_now: number; product_id: string; recurring_amount: number; next_billing_date?: string; recurring_tax?: number; tax_due_now?: number; trial_period_days?: number; }[]; tax_id_business_name?: string; tax_id_err_msg?: string; tax_id_format_name?: string; total_tax?: number; trial_amount?: number; trial_period_days?: number; }`\n Data returned by the calculate checkout session API\n\n - `billing_country: string`\n - `currency: string`\n - `current_breakup: { discount: number; subtotal: number; total_amount: number; tax?: number; }`\n - `is_byop: boolean`\n - `payment_method_required: boolean`\n - `product_cart: { credit_entitlements: { credit_entitlement_id: string; credit_entitlement_name: string; credit_entitlement_unit: string; credits_amount: string; }[]; currency: string; discounted_price: number; is_subscription: boolean; is_usage_based: boolean; meters: { measurement_unit: string; name: string; price_per_unit: string; description?: string; free_threshold?: number; }[]; og_currency: string; og_price: number; product_id: string; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; addons?: { addon_id: string; currency: string; discounted_price: number; name: string; og_currency: string; og_price: number; quantity: number; single_quantity_price: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; description?: string; discount_amount?: number; tax?: number; }[]; description?: string; discount_amount?: number; discount_cycle?: number; name?: string; tax?: number; }[]`\n - `total_price: number`\n - `next_billing_date?: string`\n - `recurring_breakup?: { discount: number; subtotal: number; total_amount: number; tax?: number; }`\n - `subscriptions?: { amount_due_now: number; product_id: string; recurring_amount: number; next_billing_date?: string; recurring_tax?: number; tax_due_now?: number; trial_period_days?: number; }[]`\n - `tax_id_business_name?: string`\n - `tax_id_err_msg?: string`\n - `tax_id_format_name?: string`\n - `total_tax?: number`\n - `trial_amount?: number`\n - `trial_period_days?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst response = await client.checkoutSessions.preview({ product_cart: [{ product_id: 'product_id', quantity: 0 }] });\n\nconsole.log(response);\n```",
|
|
205
205
|
perLanguage: {
|
|
206
206
|
typescript: {
|
|
207
207
|
method: 'client.checkoutSessions.preview',
|
|
@@ -260,8 +260,8 @@ const EMBEDDED_METHODS = [
|
|
|
260
260
|
'status?: string;',
|
|
261
261
|
'subscription_id?: string;',
|
|
262
262
|
],
|
|
263
|
-
response: "{ brand_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; dispute_status?: string; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: 'partial' | 'full'; status?: string; subscription_id?: string; }",
|
|
264
|
-
markdown: "## list\n\n`client.payments.list(brand_id?: string, created_at_gte?: string, created_at_lte?: string, currency?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: string, subscription_id?: string): { brand_id: string; created_at: string; currency: currency; customer: customer_limited_details; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: metadata; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; dispute_status?: dispute_status; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: payment_refund_status; status?: intent_status; subscription_id?: string; }`\n\n**get** `/payments`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\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- `currency?: string`\n Filter by currency\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0. Capped to bound OFFSET-based deep pagination,\nwhich forces Postgres to scan and discard every preceding row.\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?: string`\n Filter by status\n\n- `subscription_id?: string`\n Filter by subscription id\n\n### Returns\n\n- `{ brand_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; dispute_status?: string; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: 'partial' | 'full'; status?: string; subscription_id?: string; }`\n\n - `brand_id: string`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `digital_products_delivered: boolean`\n - `has_license_key: boolean`\n - `is_multi_subscription: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `payment_provider: 'stripe' | 'adyen' | 'dodo'`\n - `subscription_ids: string[]`\n - `total_amount: number`\n - `card_last_four?: string`\n - `card_network?: string`\n - `dispute_status?: string`\n - `invoice_id?: string`\n - `invoice_url?: string`\n - `payment_method?: string`\n - `payment_method_type?: string`\n - `refund_status?: 'partial' | 'full'`\n - `status?: string`\n - `subscription_id?: string`\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 paymentListResponse of client.payments.list()) {\n console.log(paymentListResponse);\n}\n```",
|
|
263
|
+
response: "{ brand_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; retry_attempt: number; service_periods: { ends_at: string; starts_at: string; subscription_id: string; }[]; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; checkout_session_id?: string; dispute_status?: string; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: 'partial' | 'full'; status?: string; subscription_id?: string; }",
|
|
264
|
+
markdown: "## list\n\n`client.payments.list(brand_id?: string, created_at_gte?: string, created_at_lte?: string, currency?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: string, subscription_id?: string): { brand_id: string; created_at: string; currency: currency; customer: customer_limited_details; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: metadata; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; retry_attempt: number; service_periods: subscription_service_period[]; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; checkout_session_id?: string; dispute_status?: dispute_status; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: payment_refund_status; status?: intent_status; subscription_id?: string; }`\n\n**get** `/payments`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\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- `currency?: string`\n Filter by currency\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0. Capped to bound OFFSET-based deep pagination,\nwhich forces Postgres to scan and discard every preceding row.\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?: string`\n Filter by status\n\n- `subscription_id?: string`\n Filter by subscription id\n\n### Returns\n\n- `{ brand_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; has_license_key: boolean; is_multi_subscription: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; retry_attempt: number; service_periods: { ends_at: string; starts_at: string; subscription_id: string; }[]; subscription_ids: string[]; total_amount: number; card_last_four?: string; card_network?: string; checkout_session_id?: string; dispute_status?: string; invoice_id?: string; invoice_url?: string; payment_method?: string; payment_method_type?: string; refund_status?: 'partial' | 'full'; status?: string; subscription_id?: string; }`\n\n - `brand_id: string`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `digital_products_delivered: boolean`\n - `has_license_key: boolean`\n - `is_multi_subscription: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `payment_provider: 'stripe' | 'adyen' | 'dodo'`\n - `retry_attempt: number`\n - `service_periods: { ends_at: string; starts_at: string; subscription_id: string; }[]`\n - `subscription_ids: string[]`\n - `total_amount: number`\n - `card_last_four?: string`\n - `card_network?: string`\n - `checkout_session_id?: string`\n - `dispute_status?: string`\n - `invoice_id?: string`\n - `invoice_url?: string`\n - `payment_method?: string`\n - `payment_method_type?: string`\n - `refund_status?: 'partial' | 'full'`\n - `status?: string`\n - `subscription_id?: string`\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 paymentListResponse of client.payments.list()) {\n console.log(paymentListResponse);\n}\n```",
|
|
265
265
|
perLanguage: {
|
|
266
266
|
typescript: {
|
|
267
267
|
method: 'client.payments.list',
|
|
@@ -378,8 +378,8 @@ const EMBEDDED_METHODS = [
|
|
|
378
378
|
stainlessPath: '(resource) payments > (method) retrieve',
|
|
379
379
|
qualified: 'client.payments.retrieve',
|
|
380
380
|
params: ['payment_id: string;'],
|
|
381
|
-
response: "{ billing: object; brand_id: string; business_id: string; created_at: string; currency: string; customer: object; digital_products_delivered: boolean; disputes: object[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: object[]; retry_attempt: number; settlement_amount: number; settlement_currency: string; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: string; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: object[]; discount_id?: string; discounts?: object[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: { product_id: string; quantity: number; }[]; refund_status?: 'partial' | 'full'; settlement_tax?: number; status?: string; subscription_id?: string; tax?: number; updated_at?: string; }",
|
|
382
|
-
markdown: "## retrieve\n\n`client.payments.retrieve(payment_id: string): { billing: billing_address; brand_id: string; business_id: string; created_at: string; currency: currency; customer: customer_limited_details; digital_products_delivered: boolean; disputes: dispute[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: metadata; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: refund_list_item[]; retry_attempt: number; settlement_amount: number; settlement_currency: currency; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: country_code; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: custom_field_response[]; discount_id?: string; discounts?: discount_detail[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: object[]; refund_status?: payment_refund_status; settlement_tax?: number; status?: intent_status; subscription_id?: string; tax?: number; updated_at?: string; }`\n\n**get** `/payments/{payment_id}`\n\n### Parameters\n\n- `payment_id: string`\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; business_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; disputes: { amount: string; business_id: string; created_at: string; currency: string; dispute_id: string; dispute_stage: dispute_stage; dispute_status: dispute_status; payment_id: string; is_resolved_by_rdr?: boolean; remarks?: string; }[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; reason?: string; }[]; retry_attempt: number; settlement_amount: number; settlement_currency: string; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: string; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: { key: string; value: string; }[]; 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; }[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: { product_id: string; quantity: number; }[]; refund_status?: 'partial' | 'full'; settlement_tax?: number; status?: string; subscription_id?: string; tax?: number; updated_at?: string; }`\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `digital_products_delivered: boolean`\n - `disputes: { amount: string; business_id: string; created_at: string; currency: string; dispute_id: string; dispute_stage: 'pre_dispute' | 'dispute' | 'pre_arbitration'; dispute_status: string; payment_id: string; is_resolved_by_rdr?: boolean; remarks?: string; }[]`\n - `is_multi_subscription: boolean`\n - `is_update_payment_method: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `payment_provider: 'stripe' | 'adyen' | 'dodo'`\n - `refunds: { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }[]`\n - `retry_attempt: number`\n - `settlement_amount: number`\n - `settlement_currency: string`\n - `subscription_ids: string[]`\n - `total_amount: number`\n - `card_holder_name?: string`\n - `card_issuing_country?: string`\n - `card_last_four?: string`\n - `card_network?: string`\n - `card_type?: string`\n - `checkout_session_id?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\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 - `error_code?: string`\n - `error_message?: string`\n - `invoice_id?: string`\n - `invoice_url?: string`\n - `payment_link?: string`\n - `payment_method?: string`\n - `payment_method_id?: string`\n - `payment_method_type?: string`\n - `product_cart?: { product_id: string; quantity: number; }[]`\n - `refund_status?: 'partial' | 'full'`\n - `settlement_tax?: number`\n - `status?: string`\n - `subscription_id?: string`\n - `tax?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst payment = await client.payments.retrieve('pay_gr4RizvMOXFJ6xca3y2tU');\n\nconsole.log(payment);\n```",
|
|
381
|
+
response: "{ billing: object; brand_id: string; business_id: string; created_at: string; currency: string; customer: object; digital_products_delivered: boolean; disputes: object[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: object[]; retry_attempt: number; service_periods: object[]; settlement_amount: number; settlement_currency: string; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: string; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: object[]; discount_id?: string; discounts?: object[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: { product_id: string; quantity: number; }[]; refund_status?: 'partial' | 'full'; settlement_tax?: number; status?: string; subscription_id?: string; tax?: number; updated_at?: string; }",
|
|
382
|
+
markdown: "## retrieve\n\n`client.payments.retrieve(payment_id: string): { billing: billing_address; brand_id: string; business_id: string; created_at: string; currency: currency; customer: customer_limited_details; digital_products_delivered: boolean; disputes: dispute[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: metadata; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: refund_list_item[]; retry_attempt: number; service_periods: subscription_service_period[]; settlement_amount: number; settlement_currency: currency; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: country_code; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: custom_field_response[]; discount_id?: string; discounts?: discount_detail[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: object[]; refund_status?: payment_refund_status; settlement_tax?: number; status?: intent_status; subscription_id?: string; tax?: number; updated_at?: string; }`\n\n**get** `/payments/{payment_id}`\n\n### Parameters\n\n- `payment_id: string`\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; business_id: string; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; digital_products_delivered: boolean; disputes: { amount: string; business_id: string; created_at: string; currency: string; dispute_id: string; dispute_stage: dispute_stage; dispute_status: dispute_status; payment_id: string; is_resolved_by_rdr?: boolean; remarks?: string; }[]; is_multi_subscription: boolean; is_update_payment_method: boolean; metadata: object; payment_id: string; payment_provider: 'stripe' | 'adyen' | 'dodo'; refunds: { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; network_reference_updated_at?: string; reason?: string; }[]; retry_attempt: number; service_periods: { ends_at: string; starts_at: string; subscription_id: string; }[]; settlement_amount: number; settlement_currency: string; subscription_ids: string[]; total_amount: number; card_holder_name?: string; card_issuing_country?: string; card_last_four?: string; card_network?: string; card_type?: string; checkout_session_id?: string; custom_field_responses?: { key: string; value: string; }[]; 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; }[]; error_code?: string; error_message?: string; invoice_id?: string; invoice_url?: string; payment_link?: string; payment_method?: string; payment_method_id?: string; payment_method_type?: string; product_cart?: { product_id: string; quantity: number; }[]; refund_status?: 'partial' | 'full'; settlement_tax?: number; status?: string; subscription_id?: string; tax?: number; updated_at?: string; }`\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `digital_products_delivered: boolean`\n - `disputes: { amount: string; business_id: string; created_at: string; currency: string; dispute_id: string; dispute_stage: 'pre_dispute' | 'dispute' | 'pre_arbitration'; dispute_status: string; payment_id: string; is_resolved_by_rdr?: boolean; remarks?: string; }[]`\n - `is_multi_subscription: boolean`\n - `is_update_payment_method: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `payment_provider: 'stripe' | 'adyen' | 'dodo'`\n - `refunds: { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }[]`\n - `retry_attempt: number`\n - `service_periods: { ends_at: string; starts_at: string; subscription_id: string; }[]`\n - `settlement_amount: number`\n - `settlement_currency: string`\n - `subscription_ids: string[]`\n - `total_amount: number`\n - `card_holder_name?: string`\n - `card_issuing_country?: string`\n - `card_last_four?: string`\n - `card_network?: string`\n - `card_type?: string`\n - `checkout_session_id?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\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 - `error_code?: string`\n - `error_message?: string`\n - `invoice_id?: string`\n - `invoice_url?: string`\n - `payment_link?: string`\n - `payment_method?: string`\n - `payment_method_id?: string`\n - `payment_method_type?: string`\n - `product_cart?: { product_id: string; quantity: number; }[]`\n - `refund_status?: 'partial' | 'full'`\n - `settlement_tax?: number`\n - `status?: string`\n - `subscription_id?: string`\n - `tax?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst payment = await client.payments.retrieve('pay_gr4RizvMOXFJ6xca3y2tU');\n\nconsole.log(payment);\n```",
|
|
383
383
|
perLanguage: {
|
|
384
384
|
typescript: {
|
|
385
385
|
method: 'client.payments.retrieve',
|
|
@@ -525,8 +525,8 @@ const EMBEDDED_METHODS = [
|
|
|
525
525
|
stainlessPath: '(resource) payments > (method) retrieve_retry_state',
|
|
526
526
|
qualified: 'client.payments.retrieveRetryState',
|
|
527
527
|
params: ['payment_id: string;'],
|
|
528
|
-
response: '{ can_retry: boolean; sends_allowed: number; sends_used: number; reason?: string; retry_available_at?: string; }',
|
|
529
|
-
markdown: "## retrieve_retry_state\n\n`client.payments.retrieveRetryState(payment_id: string): { can_retry: boolean; sends_allowed: number; sends_used: number; reason?: string; retry_available_at?: string; }`\n\n**get** `/payments/{payment_id}/retry`\n\n### Parameters\n\n- `payment_id: string`\n\n### Returns\n\n- `{ can_retry: boolean; sends_allowed: number; sends_used: number; reason?: string; retry_available_at?: string; }`\n\n - `can_retry: boolean`\n - `sends_allowed: number`\n - `sends_used: number`\n - `reason?: string`\n - `retry_available_at?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst manualRetryState = await client.payments.retrieveRetryState('payment_id');\n\nconsole.log(manualRetryState);\n```",
|
|
528
|
+
response: '{ can_retry: boolean; sends_allowed: number; sends_used: number; automatic_retry_number?: number; automatic_retry_total?: number; next_automatic_retry_at?: string; reason?: string; retry_available_at?: string; }',
|
|
529
|
+
markdown: "## retrieve_retry_state\n\n`client.payments.retrieveRetryState(payment_id: string): { can_retry: boolean; sends_allowed: number; sends_used: number; automatic_retry_number?: number; automatic_retry_total?: number; next_automatic_retry_at?: string; reason?: string; retry_available_at?: string; }`\n\n**get** `/payments/{payment_id}/retry`\n\n### Parameters\n\n- `payment_id: string`\n\n### Returns\n\n- `{ can_retry: boolean; sends_allowed: number; sends_used: number; automatic_retry_number?: number; automatic_retry_total?: number; next_automatic_retry_at?: string; reason?: string; retry_available_at?: string; }`\n\n - `can_retry: boolean`\n - `sends_allowed: number`\n - `sends_used: number`\n - `automatic_retry_number?: number`\n - `automatic_retry_total?: number`\n - `next_automatic_retry_at?: string`\n - `reason?: string`\n - `retry_available_at?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst manualRetryState = await client.payments.retrieveRetryState('payment_id');\n\nconsole.log(manualRetryState);\n```",
|
|
530
530
|
perLanguage: {
|
|
531
531
|
typescript: {
|
|
532
532
|
method: 'client.payments.retrieveRetryState',
|
|
@@ -882,7 +882,7 @@ const EMBEDDED_METHODS = [
|
|
|
882
882
|
params: [
|
|
883
883
|
'subscription_id: string;',
|
|
884
884
|
'product_id: string;',
|
|
885
|
-
|
|
885
|
+
'proration_billing_mode: string;',
|
|
886
886
|
'quantity: number;',
|
|
887
887
|
'adaptive_currency_fees_inclusive?: boolean;',
|
|
888
888
|
'addons?: { addon_id: string; quantity: number; }[];',
|
|
@@ -897,7 +897,7 @@ const EMBEDDED_METHODS = [
|
|
|
897
897
|
'return_url?: string;',
|
|
898
898
|
],
|
|
899
899
|
response: '{ client_secret?: string; expires_on?: string; payment_id?: string; payment_link?: string; }',
|
|
900
|
-
markdown: "## change_plan\n\n`client.subscriptions.changePlan(subscription_id: string, product_id: string, proration_billing_mode:
|
|
900
|
+
markdown: "## change_plan\n\n`client.subscriptions.changePlan(subscription_id: string, product_id: string, proration_billing_mode: string, quantity: number, adaptive_currency_fees_inclusive?: boolean, addons?: { addon_id: string; quantity: number; }[], cancel_older_payment_link?: boolean, cancel_scheduled_change_plan?: boolean, collect_via_payment_link?: boolean, discount_code?: string, discount_codes?: string[], effective_at?: 'immediately' | 'next_billing_date', metadata?: object, on_payment_failure?: 'prevent_change' | 'apply_change', return_url?: string): { client_secret?: string; expires_on?: string; payment_id?: string; payment_link?: string; }`\n\n**post** `/subscriptions/{subscription_id}/change-plan`\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: string`\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- `cancel_older_payment_link?: boolean`\n Cancel the payment link of a pending plan change, so that this change\ncan replace it.\n\nThe link is cancelled only if the customer has not started to pay. A\npaid or in-progress payment gives a `409`. A failed cancel gives a\n`503`, and a retry is safe.\n\nThe request is validated before the cancel. A later failure, for example\nan amount below the minimum, leaves the subscription on its current plan\nwith no open link. A retry is safe.\n\nThe preview route shares this request body and ignores this field.\n\n- `cancel_scheduled_change_plan?: boolean`\n Replace a scheduled plan change with this one.\n\nThe scheduled change is cancelled by the transaction that applies this\nchange. A change that never applies leaves the schedule in place.\n\n`effective_at: next_billing_date` is allowed. The new schedule then\nreplaces the old one in the request transaction.\n\nA pending plan change still gets a `409`. This field does not affect it.\n\nThe preview route shares this request body, so a preview that sets this\nfield also passes the scheduled-change `409`.\n\n- `collect_via_payment_link?: boolean`\n Collect the plan-change amount with a payment link. The customer then\npays on a checkout page.\n\nThe business needs the `allow_plan_change_via_payment_link` capability.\nThe request needs `effective_at: immediately`. The request also needs\n`on_payment_failure: prevent_change`.\n\nThe preview route shares this request body and ignores this field.\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- `return_url?: string`\n The URL that receives the customer after they pay the payment link.\nNeeds `collect_via_payment_link: true`. Without it, the request gets a\n`422`. A change that collects no money issues no link and does not use\nthe URL. The preview route validates this field but does not use it.\n\nThe redirect adds `subscription_id`, `payment_id` and `status`. The\n`status` value is the status of the plan-change payment. It is not the\nstatus of the subscription. When that payment fails, the subscription\nstays active on its current plan. To try again, call this endpoint\nagain to get a new link. The new plan can apply after the redirect,\nwhen the payment webhook arrives.\n\n### Returns\n\n- `{ client_secret?: string; expires_on?: string; payment_id?: string; payment_link?: string; }`\n Handles for a hosted checkout page that settles a plan change.\n\nThe four fields repeat `UpdatePaymentMethodResponse` and a subset of\n`CreateSubscriptionResponse`. A shared type would rename the generated SDK\ntypes for all three routes, so each route keeps its own.\n\n - `client_secret?: string`\n - `expires_on?: string`\n - `payment_id?: string`\n - `payment_link?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst response = await client.subscriptions.changePlan('sub_Iuaq622bbmmfOGrVTqdXv', {\n product_id: 'product_id',\n proration_billing_mode: 'prorated_immediately',\n quantity: 0,\n});\n\nconsole.log(response);\n```",
|
|
901
901
|
perLanguage: {
|
|
902
902
|
typescript: {
|
|
903
903
|
method: 'client.subscriptions.changePlan',
|
|
@@ -1055,7 +1055,7 @@ const EMBEDDED_METHODS = [
|
|
|
1055
1055
|
params: [
|
|
1056
1056
|
'subscription_id: string;',
|
|
1057
1057
|
'product_id: string;',
|
|
1058
|
-
|
|
1058
|
+
'proration_billing_mode: string;',
|
|
1059
1059
|
'quantity: number;',
|
|
1060
1060
|
'adaptive_currency_fees_inclusive?: boolean;',
|
|
1061
1061
|
'addons?: { addon_id: string; quantity: number; }[];',
|
|
@@ -1070,7 +1070,7 @@ const EMBEDDED_METHODS = [
|
|
|
1070
1070
|
'return_url?: string;',
|
|
1071
1071
|
],
|
|
1072
1072
|
response: '{ immediate_charge: { effective_at: string; line_items: object | object | object[]; summary: object; }; new_plan: object; }',
|
|
1073
|
-
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; }[], cancel_older_payment_link?: boolean, cancel_scheduled_change_plan?: boolean, collect_via_payment_link?: boolean, discount_code?: string, discount_codes?: string[], effective_at?: 'immediately' | 'next_billing_date', metadata?: object, on_payment_failure?: 'prevent_change' | 'apply_change', return_url?: string): { 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- `cancel_older_payment_link?: boolean`\n Cancel the payment link of a pending plan change, so that this change\ncan replace it.\n\nThe link is cancelled only if the customer has not started to pay. A\npaid or in-progress payment gives a `409`. A failed cancel gives a\n`503`, and a retry is safe.\n\nThe request is validated before the cancel. A later failure, for example\nan amount below the minimum, leaves the subscription on its current plan\nwith no open link. A retry is safe.\n\nThe preview route shares this request body and ignores this field.\n\n- `cancel_scheduled_change_plan?: boolean`\n Replace a scheduled plan change with this one.\n\nThe scheduled change is cancelled by the transaction that applies this\nchange. A change that never applies leaves the schedule in place.\n\n`effective_at: next_billing_date` is allowed. The new schedule then\nreplaces the old one in the request transaction.\n\nA pending plan change still gets a `409`. This field does not affect it.\n\nThe preview route shares this request body, so a preview that sets this\nfield also passes the scheduled-change `409`.\n\n- `collect_via_payment_link?: boolean`\n Collect the plan-change amount with a payment link. The customer then\npays on a checkout page.\n\nThe business needs the `allow_plan_change_via_payment_link` capability.\nThe request needs `effective_at: immediately`. The request also needs\n`on_payment_failure: prevent_change`.\n\nThe preview route shares this request body and ignores this field.\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- `return_url?: string`\n The URL that receives the customer after they pay the payment link.\nNeeds `collect_via_payment_link: true`. Without it, the request gets a\n`422`. A change that collects no money issues no link and does not use\nthe URL. The preview route validates this field but does not use it.\n\nThe redirect adds `subscription_id`, `payment_id` and `status`. The\n`status` value is the status of the plan-change payment. It is not the\nstatus of the subscription. When that payment fails, the subscription\nstays active on its current plan. To try again, call this endpoint\nagain to get a new link. The new plan can apply after the redirect,\nwhen the payment webhook arrives.\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; customer_credits_currency: currency; 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; has_payment_method: boolean; 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; cancelled_by?: subscription_cancelled_by; 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; customer_credits_currency: string; 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; }; has_payment_method: boolean; 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' | 'past_due'; 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; cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: 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```",
|
|
1073
|
+
markdown: "## preview_change_plan\n\n`client.subscriptions.previewChangePlan(subscription_id: string, product_id: string, proration_billing_mode: string, quantity: number, adaptive_currency_fees_inclusive?: boolean, addons?: { addon_id: string; quantity: number; }[], cancel_older_payment_link?: boolean, cancel_scheduled_change_plan?: boolean, collect_via_payment_link?: boolean, discount_code?: string, discount_codes?: string[], effective_at?: 'immediately' | 'next_billing_date', metadata?: object, on_payment_failure?: 'prevent_change' | 'apply_change', return_url?: string): { 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: string`\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- `cancel_older_payment_link?: boolean`\n Cancel the payment link of a pending plan change, so that this change\ncan replace it.\n\nThe link is cancelled only if the customer has not started to pay. A\npaid or in-progress payment gives a `409`. A failed cancel gives a\n`503`, and a retry is safe.\n\nThe request is validated before the cancel. A later failure, for example\nan amount below the minimum, leaves the subscription on its current plan\nwith no open link. A retry is safe.\n\nThe preview route shares this request body and ignores this field.\n\n- `cancel_scheduled_change_plan?: boolean`\n Replace a scheduled plan change with this one.\n\nThe scheduled change is cancelled by the transaction that applies this\nchange. A change that never applies leaves the schedule in place.\n\n`effective_at: next_billing_date` is allowed. The new schedule then\nreplaces the old one in the request transaction.\n\nA pending plan change still gets a `409`. This field does not affect it.\n\nThe preview route shares this request body, so a preview that sets this\nfield also passes the scheduled-change `409`.\n\n- `collect_via_payment_link?: boolean`\n Collect the plan-change amount with a payment link. The customer then\npays on a checkout page.\n\nThe business needs the `allow_plan_change_via_payment_link` capability.\nThe request needs `effective_at: immediately`. The request also needs\n`on_payment_failure: prevent_change`.\n\nThe preview route shares this request body and ignores this field.\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- `return_url?: string`\n The URL that receives the customer after they pay the payment link.\nNeeds `collect_via_payment_link: true`. Without it, the request gets a\n`422`. A change that collects no money issues no link and does not use\nthe URL. The preview route validates this field but does not use it.\n\nThe redirect adds `subscription_id`, `payment_id` and `status`. The\n`status` value is the status of the plan-change payment. It is not the\nstatus of the subscription. When that payment fails, the subscription\nstays active on its current plan. To try again, call this endpoint\nagain to get a new link. The new plan can apply after the redirect,\nwhen the payment webhook arrives.\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; customer_credits_currency: currency; 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; has_payment_method: boolean; 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; cancelled_by?: subscription_cancelled_by; 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; customer_credits_currency: string; 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; }; has_payment_method: boolean; 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' | 'past_due'; 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; cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: 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```",
|
|
1074
1074
|
perLanguage: {
|
|
1075
1075
|
typescript: {
|
|
1076
1076
|
method: 'client.subscriptions.previewChangePlan',
|
|
@@ -2938,8 +2938,8 @@ const EMBEDDED_METHODS = [
|
|
|
2938
2938
|
"status?: 'succeeded' | 'failed' | 'pending' | 'review';",
|
|
2939
2939
|
'subscription_id?: string;',
|
|
2940
2940
|
],
|
|
2941
|
-
response: "{ business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }",
|
|
2942
|
-
markdown: "## list\n\n`client.refunds.list(created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, status?: 'succeeded' | 'failed' | 'pending' | 'review', subscription_id?: string): { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; reason?: string; }`\n\n**get** `/refunds`\n\n### Parameters\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- `status?: 'succeeded' | 'failed' | 'pending' | 'review'`\n Filter by status\n\n- `subscription_id?: string`\n Filter by subscription id\n\n### Returns\n\n- `{ business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }`\n\n - `business_id: string`\n - `created_at: string`\n - `is_partial: boolean`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `reason?: string`\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 refundListItem of client.refunds.list()) {\n console.log(refundListItem);\n}\n```",
|
|
2941
|
+
response: "{ business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }",
|
|
2942
|
+
markdown: "## list\n\n`client.refunds.list(created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, status?: 'succeeded' | 'failed' | 'pending' | 'review', subscription_id?: string): { business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; network_reference_updated_at?: string; reason?: string; }`\n\n**get** `/refunds`\n\n### Parameters\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- `status?: 'succeeded' | 'failed' | 'pending' | 'review'`\n Filter by status\n\n- `subscription_id?: string`\n Filter by subscription id\n\n### Returns\n\n- `{ business_id: string; created_at: string; is_partial: boolean; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }`\n\n - `business_id: string`\n - `created_at: string`\n - `is_partial: boolean`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `network_reference_updated_at?: string`\n - `reason?: string`\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 refundListItem of client.refunds.list()) {\n console.log(refundListItem);\n}\n```",
|
|
2943
2943
|
perLanguage: {
|
|
2944
2944
|
typescript: {
|
|
2945
2945
|
method: 'client.refunds.list',
|
|
@@ -2992,8 +2992,8 @@ const EMBEDDED_METHODS = [
|
|
|
2992
2992
|
'metadata?: object;',
|
|
2993
2993
|
'reason?: string;',
|
|
2994
2994
|
],
|
|
2995
|
-
response: "{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }",
|
|
2996
|
-
markdown: "## create\n\n`client.refunds.create(payment_id: string, items?: { item_id: string; amount?: number; tax_inclusive?: boolean; }[], metadata?: object, reason?: string): { brand_id: string; business_id: string; created_at: string; customer: customer_limited_details; is_partial: boolean; metadata: metadata; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; reason?: string; }`\n\n**post** `/refunds`\n\n### Parameters\n\n- `payment_id: string`\n The unique identifier of the payment to be refunded.\n\n- `items?: { item_id: string; amount?: number; tax_inclusive?: boolean; }[]`\n Partially Refund an Individual Item\n\n- `metadata?: object`\n Additional metadata associated with the refund.\n\n- `reason?: string`\n The reason for the refund, if any. Maximum length is 3000 characters. Optional.\n\n### Returns\n\n- `{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }`\n\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `is_partial: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `reason?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst refund = await client.refunds.create({ payment_id: 'payment_id' });\n\nconsole.log(refund);\n```",
|
|
2995
|
+
response: "{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }",
|
|
2996
|
+
markdown: "## create\n\n`client.refunds.create(payment_id: string, items?: { item_id: string; amount?: number; tax_inclusive?: boolean; }[], metadata?: object, reason?: string): { brand_id: string; business_id: string; created_at: string; customer: customer_limited_details; is_partial: boolean; metadata: metadata; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; network_reference_updated_at?: string; reason?: string; }`\n\n**post** `/refunds`\n\n### Parameters\n\n- `payment_id: string`\n The unique identifier of the payment to be refunded.\n\n- `items?: { item_id: string; amount?: number; tax_inclusive?: boolean; }[]`\n Partially Refund an Individual Item\n\n- `metadata?: object`\n Additional metadata associated with the refund.\n\n- `reason?: string`\n The reason for the refund, if any. Maximum length is 3000 characters. Optional.\n\n### Returns\n\n- `{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }`\n\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `is_partial: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `network_reference_updated_at?: string`\n - `reason?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst refund = await client.refunds.create({ payment_id: 'payment_id' });\n\nconsole.log(refund);\n```",
|
|
2997
2997
|
perLanguage: {
|
|
2998
2998
|
typescript: {
|
|
2999
2999
|
method: 'client.refunds.create',
|
|
@@ -3041,8 +3041,8 @@ const EMBEDDED_METHODS = [
|
|
|
3041
3041
|
stainlessPath: '(resource) refunds > (method) retrieve',
|
|
3042
3042
|
qualified: 'client.refunds.retrieve',
|
|
3043
3043
|
params: ['refund_id: string;'],
|
|
3044
|
-
response: "{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }",
|
|
3045
|
-
markdown: "## retrieve\n\n`client.refunds.retrieve(refund_id: string): { brand_id: string; business_id: string; created_at: string; customer: customer_limited_details; is_partial: boolean; metadata: metadata; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; reason?: string; }`\n\n**get** `/refunds/{refund_id}`\n\n### Parameters\n\n- `refund_id: string`\n\n### Returns\n\n- `{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; reason?: string; }`\n\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `is_partial: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `reason?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst refund = await client.refunds.retrieve('ref_F0gZetLvTxxBrMU2CZcmy');\n\nconsole.log(refund);\n```",
|
|
3044
|
+
response: "{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }",
|
|
3045
|
+
markdown: "## retrieve\n\n`client.refunds.retrieve(refund_id: string): { brand_id: string; business_id: string; created_at: string; customer: customer_limited_details; is_partial: boolean; metadata: metadata; payment_id: string; refund_id: string; status: refund_status; amount?: number; currency?: currency; network_reference?: string; network_reference_type?: refund_network_reference_type; network_reference_updated_at?: string; reason?: string; }`\n\n**get** `/refunds/{refund_id}`\n\n### Parameters\n\n- `refund_id: string`\n\n### Returns\n\n- `{ brand_id: string; business_id: string; created_at: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; is_partial: boolean; metadata: object; payment_id: string; refund_id: string; status: 'succeeded' | 'failed' | 'pending' | 'review'; amount?: number; currency?: string; network_reference?: string; network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'; network_reference_updated_at?: string; reason?: string; }`\n\n - `brand_id: string`\n - `business_id: string`\n - `created_at: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `is_partial: boolean`\n - `metadata: object`\n - `payment_id: string`\n - `refund_id: string`\n - `status: 'succeeded' | 'failed' | 'pending' | 'review'`\n - `amount?: number`\n - `currency?: string`\n - `network_reference?: string`\n - `network_reference_type?: 'acquirer_reference_number' | 'system_trace_audit_number' | 'retrieval_reference_number' | 'other'`\n - `network_reference_updated_at?: string`\n - `reason?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst refund = await client.refunds.retrieve('ref_F0gZetLvTxxBrMU2CZcmy');\n\nconsole.log(refund);\n```",
|
|
3046
3046
|
perLanguage: {
|
|
3047
3047
|
typescript: {
|
|
3048
3048
|
method: 'client.refunds.retrieve',
|
|
@@ -7217,11 +7217,11 @@ const EMBEDDED_METHODS = [
|
|
|
7217
7217
|
"effective_at_on_downgrade?: 'immediately' | 'next_billing_date';",
|
|
7218
7218
|
"effective_at_on_upgrade?: 'immediately' | 'next_billing_date';",
|
|
7219
7219
|
"on_payment_failure?: 'prevent_change' | 'apply_change';",
|
|
7220
|
-
|
|
7221
|
-
|
|
7220
|
+
'proration_billing_mode_on_downgrade?: string;',
|
|
7221
|
+
'proration_billing_mode_on_upgrade?: string;',
|
|
7222
7222
|
],
|
|
7223
|
-
response: "{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?:
|
|
7224
|
-
markdown: "## create\n\n`client.productCollections.create(groups: { products: group_product[]; group_name?: string; status?: boolean; }[], name: string, brand_id?: string, description?: string, effective_at_on_downgrade?: 'immediately' | 'next_billing_date', effective_at_on_upgrade?: 'immediately' | 'next_billing_date', on_payment_failure?: 'prevent_change' | 'apply_change', proration_billing_mode_on_downgrade?:
|
|
7223
|
+
response: "{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }",
|
|
7224
|
+
markdown: "## create\n\n`client.productCollections.create(groups: { products: group_product[]; group_name?: string; status?: boolean; }[], name: string, brand_id?: string, description?: string, effective_at_on_downgrade?: 'immediately' | 'next_billing_date', effective_at_on_upgrade?: 'immediately' | 'next_billing_date', on_payment_failure?: 'prevent_change' | 'apply_change', proration_billing_mode_on_downgrade?: string, proration_billing_mode_on_upgrade?: string): { id: string; brand_id: string; created_at: string; groups: product_collection_group_response[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }`\n\n**post** `/product-collections`\n\n### Parameters\n\n- `groups: { products: { product_id: string; status?: boolean; }[]; group_name?: string; status?: boolean; }[]`\n Groups of products in this collection\n\n- `name: string`\n Name of the product collection\n\n- `brand_id?: string`\n Brand id for the collection, if not provided will default to primary brand\n\n- `description?: string`\n Optional description of the product collection\n\n- `effective_at_on_downgrade?: 'immediately' | 'next_billing_date'`\n Default effective_at setting for subscription plan downgrades (NULL = inherit from business)\n\n- `effective_at_on_upgrade?: 'immediately' | 'next_billing_date'`\n Default effective_at setting for subscription plan upgrades (NULL = inherit from business)\n\n- `on_payment_failure?: 'prevent_change' | 'apply_change'`\n Default behavior for subscription plan changes on payment failure (NULL = inherit from business)\n\n- `proration_billing_mode_on_downgrade?: string`\n Default proration billing mode for subscription plan downgrades (NULL = inherit from business)\n\n- `proration_billing_mode_on_upgrade?: string`\n Default proration billing mode for subscription plan upgrades (NULL = inherit from business)\n\n### Returns\n\n- `{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }`\n\n - `id: string`\n - `brand_id: string`\n - `created_at: string`\n - `groups: { group_id: string; products: { id: string; addons_count: number; files_count: number; has_credit_entitlements: boolean; is_recurring: boolean; license_key_enabled: boolean; meters_count: number; product_id: string; status: boolean; currency?: currency; description?: string; name?: string; price?: number; price_detail?: price; tax_category?: tax_category; tax_inclusive?: boolean; }[]; status: boolean; group_name?: string; }[]`\n - `name: string`\n - `updated_at: string`\n - `description?: string`\n - `effective_at_on_downgrade?: 'immediately' | 'next_billing_date'`\n - `effective_at_on_upgrade?: 'immediately' | 'next_billing_date'`\n - `image?: string`\n - `on_payment_failure?: 'prevent_change' | 'apply_change'`\n - `proration_billing_mode_on_downgrade?: string`\n - `proration_billing_mode_on_upgrade?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst productCollection = await client.productCollections.create({ groups: [{ products: [{ product_id: 'product_id' }] }], name: 'name' });\n\nconsole.log(productCollection);\n```",
|
|
7225
7225
|
perLanguage: {
|
|
7226
7226
|
typescript: {
|
|
7227
7227
|
method: 'client.productCollections.create',
|
|
@@ -7269,8 +7269,8 @@ const EMBEDDED_METHODS = [
|
|
|
7269
7269
|
stainlessPath: '(resource) product_collections > (method) retrieve',
|
|
7270
7270
|
qualified: 'client.productCollections.retrieve',
|
|
7271
7271
|
params: ['id: string;'],
|
|
7272
|
-
response: "{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?:
|
|
7273
|
-
markdown: "## retrieve\n\n`client.productCollections.retrieve(id: string): { id: string; brand_id: string; created_at: string; groups: product_collection_group_response[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?:
|
|
7272
|
+
response: "{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }",
|
|
7273
|
+
markdown: "## retrieve\n\n`client.productCollections.retrieve(id: string): { id: string; brand_id: string; created_at: string; groups: product_collection_group_response[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }`\n\n**get** `/product-collections/{id}`\n\n### Parameters\n\n- `id: string`\n\n### Returns\n\n- `{ id: string; brand_id: string; created_at: string; groups: { group_id: string; products: product_collection_product[]; status: boolean; group_name?: string; }[]; name: string; updated_at: string; description?: string; effective_at_on_downgrade?: 'immediately' | 'next_billing_date'; effective_at_on_upgrade?: 'immediately' | 'next_billing_date'; image?: string; on_payment_failure?: 'prevent_change' | 'apply_change'; proration_billing_mode_on_downgrade?: string; proration_billing_mode_on_upgrade?: string; }`\n\n - `id: string`\n - `brand_id: string`\n - `created_at: string`\n - `groups: { group_id: string; products: { id: string; addons_count: number; files_count: number; has_credit_entitlements: boolean; is_recurring: boolean; license_key_enabled: boolean; meters_count: number; product_id: string; status: boolean; currency?: currency; description?: string; name?: string; price?: number; price_detail?: price; tax_category?: tax_category; tax_inclusive?: boolean; }[]; status: boolean; group_name?: string; }[]`\n - `name: string`\n - `updated_at: string`\n - `description?: string`\n - `effective_at_on_downgrade?: 'immediately' | 'next_billing_date'`\n - `effective_at_on_upgrade?: 'immediately' | 'next_billing_date'`\n - `image?: string`\n - `on_payment_failure?: 'prevent_change' | 'apply_change'`\n - `proration_billing_mode_on_downgrade?: string`\n - `proration_billing_mode_on_upgrade?: string`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst productCollection = await client.productCollections.retrieve('pdc_8BWv0hojwUH7iCDabr0NI');\n\nconsole.log(productCollection);\n```",
|
|
7274
7274
|
perLanguage: {
|
|
7275
7275
|
typescript: {
|
|
7276
7276
|
method: 'client.productCollections.retrieve',
|
|
@@ -7375,10 +7375,10 @@ const EMBEDDED_METHODS = [
|
|
|
7375
7375
|
'image_id?: string;',
|
|
7376
7376
|
'name?: string;',
|
|
7377
7377
|
"on_payment_failure?: 'prevent_change' | 'apply_change';",
|
|
7378
|
-
|
|
7379
|
-
|
|
7378
|
+
'proration_billing_mode_on_downgrade?: string;',
|
|
7379
|
+
'proration_billing_mode_on_upgrade?: string;',
|
|
7380
7380
|
],
|
|
7381
|
-
markdown: "## update\n\n`client.productCollections.update(id: string, brand_id?: string, description?: string, effective_at_on_downgrade?: 'immediately' | 'next_billing_date', effective_at_on_upgrade?: 'immediately' | 'next_billing_date', group_order?: string[], image_id?: string, name?: string, on_payment_failure?: 'prevent_change' | 'apply_change', proration_billing_mode_on_downgrade?:
|
|
7381
|
+
markdown: "## update\n\n`client.productCollections.update(id: string, brand_id?: string, description?: string, effective_at_on_downgrade?: 'immediately' | 'next_billing_date', effective_at_on_upgrade?: 'immediately' | 'next_billing_date', group_order?: string[], image_id?: string, name?: string, on_payment_failure?: 'prevent_change' | 'apply_change', proration_billing_mode_on_downgrade?: string, proration_billing_mode_on_upgrade?: string): void`\n\n**patch** `/product-collections/{id}`\n\n### Parameters\n\n- `id: string`\n\n- `brand_id?: string`\n Optional brand_id update\n\n- `description?: string`\n Optional description update - pass null to remove, omit to keep unchanged\n\n- `effective_at_on_downgrade?: 'immediately' | 'next_billing_date'`\n Effective_at setting for downgrades: Some(Some(val)) = set, Some(None) = clear (inherit), None = no change\n\n- `effective_at_on_upgrade?: 'immediately' | 'next_billing_date'`\n Effective_at setting for upgrades: Some(Some(val)) = set, Some(None) = clear (inherit), None = no change\n\n- `group_order?: string[]`\n Optional new order for groups (array of group UUIDs in desired order)\n\n- `image_id?: string`\n Optional image update - pass null to remove, omit to keep unchanged\n\n- `name?: string`\n Optional new name for the collection\n\n- `on_payment_failure?: 'prevent_change' | 'apply_change'`\n On payment failure behavior: Some(Some(val)) = set, Some(None) = clear (inherit), None = no change\n\n- `proration_billing_mode_on_downgrade?: string`\n Proration billing mode for downgrades: Some(Some(val)) = set, Some(None) = clear (inherit), None = no change\n\n- `proration_billing_mode_on_upgrade?: string`\n Proration billing mode for upgrades: Some(Some(val)) = set, Some(None) = clear (inherit), None = no change\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nawait client.productCollections.update('pdc_8BWv0hojwUH7iCDabr0NI')\n```",
|
|
7382
7382
|
perLanguage: {
|
|
7383
7383
|
typescript: {
|
|
7384
7384
|
method: 'client.productCollections.update',
|