dodopayments-mcp 2.52.0 → 2.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +23 -19
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +23 -19
- package/local-docs-search.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +1 -1
- package/server.mjs +1 -1
- package/src/local-docs-search.ts +23 -21
- package/src/server.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAw2SF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AAw2SF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
package/local-docs-search.js
CHANGED
|
@@ -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 This field is ingored if adaptive pricing is disabled\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.\nThe checkout page enforces this. Other 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\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\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 This field is ingored if adaptive pricing is disabled\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.\nThe checkout page enforces this. Other 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\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\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',
|
|
@@ -379,7 +379,7 @@ const EMBEDDED_METHODS = [
|
|
|
379
379
|
qualified: 'client.payments.retrieve',
|
|
380
380
|
params: ['payment_id: string;'],
|
|
381
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; 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; 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```",
|
|
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```",
|
|
383
383
|
perLanguage: {
|
|
384
384
|
typescript: {
|
|
385
385
|
method: 'client.payments.retrieve',
|
|
@@ -584,8 +584,8 @@ const EMBEDDED_METHODS = [
|
|
|
584
584
|
'product_id?: string;',
|
|
585
585
|
"status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due';",
|
|
586
586
|
],
|
|
587
|
-
response: "{ billing: object; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: object; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; has_payment_method: boolean; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
588
|
-
markdown: "## list\n\n`client.subscriptions.list(brand_id?: string, cancel_at_next_billing_date?: boolean, created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'): { billing: billing_address; cancel_at_next_billing_date: boolean; created_at: string; currency: currency; customer: customer_limited_details; discounts: object[]; has_payment_method: boolean; metadata: metadata; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\n\n- `cancel_at_next_billing_date?: boolean`\n Filter by cancel_at_next_billing_date (subscriptions scheduled for cancellation)\n\n- `created_at_gte?: string`\n Get events after this created time\n\n- `created_at_lte?: string`\n Get events created before this time\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0\n\n- `page_size?: number`\n Page size default is 10 max is 100\n\n- `product_id?: string`\n Filter by product id\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n Filter by status\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; has_payment_method: boolean; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `discounts: { discount_id: string; discount_cycles_remaining?: number; }[]`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancelled_at?: string`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `product_name?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionListResponse of client.subscriptions.list()) {\n console.log(subscriptionListResponse);\n}\n```",
|
|
587
|
+
response: "{ billing: object; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: object; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; has_payment_method: boolean; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; cancelled_by?: object; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: object; tax_id?: string; trial_amount?: number; }",
|
|
588
|
+
markdown: "## list\n\n`client.subscriptions.list(brand_id?: string, cancel_at_next_billing_date?: boolean, created_at_gte?: string, created_at_lte?: string, customer_id?: string, page_number?: number, page_size?: number, product_id?: string, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'): { billing: billing_address; cancel_at_next_billing_date: boolean; created_at: string; currency: currency; customer: customer_limited_details; discounts: object[]; has_payment_method: boolean; metadata: metadata; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: time_interval; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: subscription_status; subscription_id: string; subscription_period_count: number; subscription_period_interval: time_interval; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; cancelled_by?: subscription_cancelled_by; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions`\n\n### Parameters\n\n- `brand_id?: string`\n filter by Brand id\n\n- `cancel_at_next_billing_date?: boolean`\n Filter by cancel_at_next_billing_date (subscriptions scheduled for cancellation)\n\n- `created_at_gte?: string`\n Get events after this created time\n\n- `created_at_lte?: string`\n Get events created before this time\n\n- `customer_id?: string`\n Filter by customer id\n\n- `page_number?: number`\n Page number default is 0\n\n- `page_size?: number`\n Page size default is 10 max is 100\n\n- `product_id?: string`\n Filter by product id\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n Filter by status\n\n### Returns\n\n- `{ billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; cancel_at_next_billing_date: boolean; created_at: string; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; discounts: { discount_id: string; discount_cycles_remaining?: number; }[]; has_payment_method: boolean; metadata: object; next_billing_date: string; on_demand: boolean; payment_frequency_count: number; payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'; previous_billing_date: string; product_id: string; quantity: number; recurring_pre_tax_amount: number; status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'; subscription_id: string; subscription_period_count: number; subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'; tax_inclusive: boolean; trial_period_days: number; cancelled_at?: string; cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: string; }; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; paused_at?: string; payment_method_id?: string; product_name?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `discounts: { discount_id: string; discount_cycles_remaining?: number; }[]`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancelled_at?: string`\n - `cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: string; }`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `product_name?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\n// Automatically fetches more pages as needed.\nfor await (const subscriptionListResponse of client.subscriptions.list()) {\n console.log(subscriptionListResponse);\n}\n```",
|
|
589
589
|
perLanguage: {
|
|
590
590
|
typescript: {
|
|
591
591
|
method: 'client.subscriptions.list',
|
|
@@ -707,8 +707,8 @@ const EMBEDDED_METHODS = [
|
|
|
707
707
|
stainlessPath: '(resource) subscriptions > (method) retrieve',
|
|
708
708
|
qualified: 'client.subscriptions.retrieve',
|
|
709
709
|
params: ['subscription_id: string;'],
|
|
710
|
-
response:
|
|
711
|
-
markdown: "## retrieve\n\n`client.subscriptions.retrieve(subscription_id: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; 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; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**get** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; 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; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.retrieve('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
710
|
+
response: 'object',
|
|
711
|
+
markdown: "## retrieve\n\n`client.subscriptions.retrieve(subscription_id: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; 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**get** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; 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 Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: string; }`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.retrieve('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
712
712
|
perLanguage: {
|
|
713
713
|
typescript: {
|
|
714
714
|
method: 'client.subscriptions.retrieve',
|
|
@@ -774,8 +774,8 @@ const EMBEDDED_METHODS = [
|
|
|
774
774
|
"subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year';",
|
|
775
775
|
'tax_id?: string;',
|
|
776
776
|
],
|
|
777
|
-
response:
|
|
778
|
-
markdown: "## update\n\n`client.subscriptions.update(subscription_id: string, billing?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, cancel_at_next_billing_date?: boolean, cancel_reason?: string, cancellation_comment?: string, cancellation_feedback?: string, credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[], customer_business_name?: string, customer_name?: string, disable_on_demand?: { next_billing_date: string; }, metadata?: object, next_billing_date?: string, pause?: boolean, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due', subscription_period_count?: number, subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year', tax_id?: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; 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; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }`\n\n**patch** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `billing?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `country: string`\n Two-letter ISO country code (ISO 3166-1 alpha-2)\n - `city?: string`\n City name\n - `state?: string`\n State or province name\n - `street?: string`\n Street address including house number and unit/apartment if applicable\n - `zipcode?: string`\n Postal code or ZIP code\n\n- `cancel_at_next_billing_date?: boolean`\n When set, the subscription will remain active until the end of billing period\n\n- `cancel_reason?: string`\n\n- `cancellation_comment?: string`\n Free-text cancellation comment (only valid when cancelling or scheduling cancellation).\n\n- `cancellation_feedback?: string`\n Customer-supplied churn reason (only valid when cancelling or scheduling cancellation).\n\n- `credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n Update credit entitlement cart settings\n\n- `customer_business_name?: string`\n Optional business / legal name associated with the tax id. When provided\ntogether with a valid tax id for a B2B subscription, this name is rendered\non the invoice instead of the customer's personal name. Send `null` to\nexplicitly clear the business name.\n\n- `customer_name?: string`\n\n- `disable_on_demand?: { next_billing_date: string; }`\n - `next_billing_date: string`\n\n- `metadata?: object`\n Arbitrary key-value metadata. Values can be string, integer, number, or boolean.\n\n- `next_billing_date?: string`\n\n- `pause?: boolean`\n Removed. Use `status: paused` to pause and `status: active` to resume.\nThis field always fails with 422, so a caller still on it gets a loud\nerror instead of a silent no-op.\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n Set to `cancelled` to cancel the subscription. See `cancel_reason`,\n`cancellation_feedback`, `cancellation_comment`, and\n`cancel_at_next_billing_date` for cancellation options.\n\nSet to `paused` to pause an active subscription.\nSet to `active` to resume a `paused` subscription.\n`active` also resumes an `on_hold` subscription that has an unpaid pause invoice.\nThis voids that invoice.\n\nSend `paused` or `active` alone. A request that combines either with any\nother field fails with 422. `cancelled` is not exclusive this way — see\n`cancel_reason` and friends below.\n\n- `subscription_period_count?: number`\n New number of `subscription_period_interval` units the subscription\nentitlement should span. Used together with `subscription_period_interval`\nto extend the subscription period. The resulting period must not be\nshorter than the current one (this endpoint only extends).\n\n- `subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year'`\n New interval unit for the subscription period. When changing the period,\nthis may be supplied alongside `subscription_period_count`; if omitted the\nexisting interval is retained.\n\n- `tax_id?: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; 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; custom_field_responses?: { key: string; value: string; }[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: metadata; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: discount_type; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: { id: string; addons: object[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }; tax_id?: string; trial_amount?: number; }`\n Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.update('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
777
|
+
response: 'object',
|
|
778
|
+
markdown: "## update\n\n`client.subscriptions.update(subscription_id: string, billing?: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }, cancel_at_next_billing_date?: boolean, cancel_reason?: string, cancellation_comment?: string, cancellation_feedback?: string, credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[], customer_business_name?: string, customer_name?: string, disable_on_demand?: { next_billing_date: string; }, metadata?: object, next_billing_date?: string, pause?: boolean, status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due', subscription_period_count?: number, subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year', tax_id?: string): { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; 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**patch** `/subscriptions/{subscription_id}`\n\n### Parameters\n\n- `subscription_id: string`\n\n- `billing?: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `country: string`\n Two-letter ISO country code (ISO 3166-1 alpha-2)\n - `city?: string`\n City name\n - `state?: string`\n State or province name\n - `street?: string`\n Street address including house number and unit/apartment if applicable\n - `zipcode?: string`\n Postal code or ZIP code\n\n- `cancel_at_next_billing_date?: boolean`\n When set, the subscription will remain active until the end of billing period\n\n- `cancel_reason?: string`\n\n- `cancellation_comment?: string`\n Free-text cancellation comment (only valid when cancelling or scheduling cancellation).\n\n- `cancellation_feedback?: string`\n Customer-supplied churn reason (only valid when cancelling or scheduling cancellation).\n\n- `credit_entitlement_cart?: { credit_entitlement_id: string; credits_amount?: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_enabled?: boolean; overage_limit?: string; rollover_enabled?: boolean; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n Update credit entitlement cart settings\n\n- `customer_business_name?: string`\n Optional business / legal name associated with the tax id. When provided\ntogether with a valid tax id for a B2B subscription, this name is rendered\non the invoice instead of the customer's personal name. Send `null` to\nexplicitly clear the business name.\n\n- `customer_name?: string`\n\n- `disable_on_demand?: { next_billing_date: string; }`\n - `next_billing_date: string`\n\n- `metadata?: object`\n Arbitrary key-value metadata. Values can be string, integer, number, or boolean.\n\n- `next_billing_date?: string`\n\n- `pause?: boolean`\n Removed. Use `status: paused` to pause and `status: active` to resume.\nThis field always fails with 422, so a caller still on it gets a loud\nerror instead of a silent no-op.\n\n- `status?: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n Set to `cancelled` to cancel the subscription. See `cancel_reason`,\n`cancellation_feedback`, `cancellation_comment`, and\n`cancel_at_next_billing_date` for cancellation options.\n\nSet to `paused` to pause an active subscription.\nSet to `active` to resume a `paused` subscription.\n`active` also resumes an `on_hold` subscription that has an unpaid pause invoice.\nThis voids that invoice.\n\nSend `paused` or `active` alone. A request that combines either with any\nother field fails with 422. `cancelled` is not exclusive this way — see\n`cancel_reason` and friends below.\n\n- `subscription_period_count?: number`\n New number of `subscription_period_interval` units the subscription\nentitlement should span. Used together with `subscription_period_interval`\nto extend the subscription period. The resulting period must not be\nshorter than the current one (this endpoint only extends).\n\n- `subscription_period_interval?: 'Day' | 'Week' | 'Month' | 'Year'`\n New interval unit for the subscription period. When changing the period,\nthis may be supplied alongside `subscription_period_count`; if omitted the\nexisting interval is retained.\n\n- `tax_id?: string`\n\n### Returns\n\n- `{ addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; 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 Response struct representing subscription details\n\n - `addons: { addon_id: string; quantity: number; }[]`\n - `billing: { country: string; city?: string; state?: string; street?: string; zipcode?: string; }`\n - `brand_id: string`\n - `cancel_at_next_billing_date: boolean`\n - `created_at: string`\n - `credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: 'forgive_at_reset' | 'invoice_at_billing' | 'carry_deficit' | 'carry_deficit_auto_repay'; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: 'Day' | 'Week' | 'Month' | 'Year'; }[]`\n - `currency: string`\n - `customer: { customer_id: string; email: string; name: string; metadata?: object; phone_number?: string; }`\n - `has_payment_method: boolean`\n - `metadata: object`\n - `meter_credit_entitlement_cart: { credit_entitlement_id: string; meter_id: string; meter_name: string; meter_units_per_credit: string; product_id: string; }[]`\n - `meters: { currency: string; free_threshold: number; measurement_unit: string; meter_id: string; name: string; description?: string; price_per_unit?: string; }[]`\n - `next_billing_date: string`\n - `on_demand: boolean`\n - `payment_frequency_count: number`\n - `payment_frequency_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `previous_billing_date: string`\n - `product_id: string`\n - `quantity: number`\n - `recurring_pre_tax_amount: number`\n - `status: 'pending' | 'active' | 'on_hold' | 'paused' | 'cancelled' | 'failed' | 'expired' | 'past_due'`\n - `subscription_id: string`\n - `subscription_period_count: number`\n - `subscription_period_interval: 'Day' | 'Week' | 'Month' | 'Year'`\n - `tax_inclusive: boolean`\n - `trial_period_days: number`\n - `cancellation_comment?: string`\n - `cancellation_feedback?: string`\n - `cancelled_at?: string`\n - `cancelled_by?: { actor_type: 'customer' | 'merchant_user' | 'api_key' | 'dodo_team'; email?: string; name?: string; }`\n - `custom_field_responses?: { key: string; value: string; }[]`\n - `customer_business_name?: string`\n - `discount_cycles_remaining?: number`\n - `discount_id?: string`\n - `discounts?: { amount: number; business_id: string; code: string; created_at: string; discount_id: string; metadata: object; position: number; preserve_on_plan_change: boolean; restricted_to: string[]; times_used: number; type: 'flat' | 'percentage'; cycles_remaining?: number; expires_at?: string; name?: string; subscription_cycles?: number; usage_limit?: number; }[]`\n - `expires_at?: string`\n - `paused_at?: string`\n - `payment_method_id?: string`\n - `scheduled_change?: { id: string; addons: { addon_id: string; name: string; quantity: number; }[]; created_at: string; effective_at: string; product_id: string; quantity: number; product_description?: string; product_name?: string; }`\n - `tax_id?: string`\n - `trial_amount?: number`\n\n### Example\n\n```typescript\nimport DodoPayments from 'dodopayments';\n\nconst client = new DodoPayments();\n\nconst subscription = await client.subscriptions.update('sub_Iuaq622bbmmfOGrVTqdXv');\n\nconsole.log(subscription);\n```",
|
|
779
779
|
perLanguage: {
|
|
780
780
|
typescript: {
|
|
781
781
|
method: 'client.subscriptions.update',
|
|
@@ -886,6 +886,7 @@ const EMBEDDED_METHODS = [
|
|
|
886
886
|
'quantity: number;',
|
|
887
887
|
'adaptive_currency_fees_inclusive?: boolean;',
|
|
888
888
|
'addons?: { addon_id: string; quantity: number; }[];',
|
|
889
|
+
'cancel_older_payment_link?: boolean;',
|
|
889
890
|
'cancel_scheduled_change_plan?: boolean;',
|
|
890
891
|
'collect_via_payment_link?: boolean;',
|
|
891
892
|
'discount_code?: string;',
|
|
@@ -893,9 +894,10 @@ const EMBEDDED_METHODS = [
|
|
|
893
894
|
"effective_at?: 'immediately' | 'next_billing_date';",
|
|
894
895
|
'metadata?: object;',
|
|
895
896
|
"on_payment_failure?: 'prevent_change' | 'apply_change';",
|
|
897
|
+
'return_url?: string;',
|
|
896
898
|
],
|
|
897
899
|
response: '{ client_secret?: string; expires_on?: string; payment_id?: string; payment_link?: string; }',
|
|
898
|
-
markdown: "## change_plan\n\n`client.subscriptions.changePlan(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_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'): { 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: '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_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### 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```",
|
|
900
|
+
markdown: "## change_plan\n\n`client.subscriptions.changePlan(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): { 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: '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- `{ 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```",
|
|
899
901
|
perLanguage: {
|
|
900
902
|
typescript: {
|
|
901
903
|
method: 'client.subscriptions.changePlan',
|
|
@@ -926,7 +928,7 @@ const EMBEDDED_METHODS = [
|
|
|
926
928
|
},
|
|
927
929
|
php: {
|
|
928
930
|
method: 'subscriptions->changePlan',
|
|
929
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->changePlan(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n cancelScheduledChangePlan: true,\n collectViaPaymentLink: true,\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n);\n\nvar_dump($response);",
|
|
931
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->changePlan(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n cancelOlderPaymentLink: true,\n cancelScheduledChangePlan: true,\n collectViaPaymentLink: true,\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n returnURL: 'return_url',\n);\n\nvar_dump($response);",
|
|
930
932
|
},
|
|
931
933
|
csharp: {
|
|
932
934
|
method: 'Subscriptions.ChangePlan',
|
|
@@ -1057,6 +1059,7 @@ const EMBEDDED_METHODS = [
|
|
|
1057
1059
|
'quantity: number;',
|
|
1058
1060
|
'adaptive_currency_fees_inclusive?: boolean;',
|
|
1059
1061
|
'addons?: { addon_id: string; quantity: number; }[];',
|
|
1062
|
+
'cancel_older_payment_link?: boolean;',
|
|
1060
1063
|
'cancel_scheduled_change_plan?: boolean;',
|
|
1061
1064
|
'collect_via_payment_link?: boolean;',
|
|
1062
1065
|
'discount_code?: string;',
|
|
@@ -1064,9 +1067,10 @@ const EMBEDDED_METHODS = [
|
|
|
1064
1067
|
"effective_at?: 'immediately' | 'next_billing_date';",
|
|
1065
1068
|
'metadata?: object;',
|
|
1066
1069
|
"on_payment_failure?: 'prevent_change' | 'apply_change';",
|
|
1070
|
+
'return_url?: string;',
|
|
1067
1071
|
],
|
|
1068
1072
|
response: '{ immediate_charge: { effective_at: string; line_items: object | object | object[]; summary: object; }; new_plan: object; }',
|
|
1069
|
-
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_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'): { 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_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### Returns\n\n- `{ immediate_charge: { effective_at: string; line_items: { id: string; currency: currency; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: currency; name: string; proration_factor: number; quantity: number; tax_category: tax_category; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: currency; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: currency; customer_credits: number; settlement_amount: number; settlement_currency: currency; total_amount: number; settlement_tax?: number; tax?: number; }; }; new_plan: { addons: addon_cart_response_item[]; billing: billing_address; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: credit_entitlement_cart_response[]; currency: currency; customer: customer_limited_details; 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; custom_field_responses?: custom_field_response[]; customer_business_name?: string; discount_cycles_remaining?: number; discount_id?: string; discounts?: discount_detail[]; expires_at?: string; paused_at?: string; payment_method_id?: string; scheduled_change?: scheduled_plan_change; tax_id?: string; trial_amount?: number; }; }`\n\n - `immediate_charge: { effective_at: string; line_items: { id: string; currency: string; product_id: string; proration_factor: number; quantity: number; tax_inclusive: boolean; type: 'subscription'; unit_price: number; description?: string; name?: string; tax?: number; tax_rate?: number; } | { id: string; currency: string; name: string; proration_factor: number; quantity: number; tax_category: 'digital_products' | 'saas' | 'e_book' | 'edtech' | 'live_tutoring'; tax_inclusive: boolean; tax_rate: number; type: 'addon'; unit_price: number; description?: string; tax?: number; } | { id: string; chargeable_units: string; currency: string; free_threshold: number; name: string; price_per_unit: string; subtotal: number; tax_inclusive: boolean; tax_rate: number; type: 'meter'; units_consumed: string; description?: string; tax?: number; }[]; summary: { currency: string; customer_credits: number; settlement_amount: number; settlement_currency: string; total_amount: number; settlement_tax?: number; tax?: number; }; }`\n - `new_plan: { addons: { addon_id: string; quantity: number; }[]; billing: { country: country_code; city?: string; state?: string; street?: string; zipcode?: string; }; brand_id: string; cancel_at_next_billing_date: boolean; created_at: string; credit_entitlement_cart: { credit_entitlement_id: string; credit_entitlement_name: string; credits_amount: string; overage_balance: string; overage_behavior: cbb_overage_behavior; overage_enabled: boolean; product_id: string; remaining_balance: string; rollover_enabled: boolean; unit: string; expires_after_days?: number; low_balance_threshold_percent?: number; max_rollover_count?: number; overage_limit?: string; rollover_percentage?: number; rollover_timeframe_count?: number; rollover_timeframe_interval?: time_interval; }[]; currency: string; customer: { customer_id: string; email: string; name: string; metadata?: metadata; phone_number?: string; }; 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; 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: '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```",
|
|
1070
1074
|
perLanguage: {
|
|
1071
1075
|
typescript: {
|
|
1072
1076
|
method: 'client.subscriptions.previewChangePlan',
|
|
@@ -1097,7 +1101,7 @@ const EMBEDDED_METHODS = [
|
|
|
1097
1101
|
},
|
|
1098
1102
|
php: {
|
|
1099
1103
|
method: 'subscriptions->previewChangePlan',
|
|
1100
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->previewChangePlan(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n cancelScheduledChangePlan: true,\n collectViaPaymentLink: true,\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n);\n\nvar_dump($response);",
|
|
1104
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$response = $client->subscriptions->previewChangePlan(\n 'sub_Iuaq622bbmmfOGrVTqdXv',\n productID: 'product_id',\n prorationBillingMode: 'prorated_immediately',\n quantity: 0,\n adaptiveCurrencyFeesInclusive: true,\n addons: [['addonID' => 'addon_id', 'quantity' => 0]],\n cancelOlderPaymentLink: true,\n cancelScheduledChangePlan: true,\n collectViaPaymentLink: true,\n discountCode: 'discount_code',\n discountCodes: ['string'],\n effectiveAt: 'immediately',\n metadata: ['foo' => 'string'],\n onPaymentFailure: 'prevent_change',\n returnURL: 'return_url',\n);\n\nvar_dump($response);",
|
|
1101
1105
|
},
|
|
1102
1106
|
csharp: {
|
|
1103
1107
|
method: 'Subscriptions.PreviewChangePlan',
|
|
@@ -2934,8 +2938,8 @@ const EMBEDDED_METHODS = [
|
|
|
2934
2938
|
"status?: 'succeeded' | 'failed' | 'pending' | 'review';",
|
|
2935
2939
|
'subscription_id?: string;',
|
|
2936
2940
|
],
|
|
2937
|
-
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; reason?: string; }",
|
|
2938
|
-
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; 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; 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 - `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'; 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```",
|
|
2939
2943
|
perLanguage: {
|
|
2940
2944
|
typescript: {
|
|
2941
2945
|
method: 'client.refunds.list',
|
|
@@ -2988,8 +2992,8 @@ const EMBEDDED_METHODS = [
|
|
|
2988
2992
|
'metadata?: object;',
|
|
2989
2993
|
'reason?: string;',
|
|
2990
2994
|
],
|
|
2991
|
-
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; reason?: string; }",
|
|
2992
|
-
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; 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; 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 - `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'; 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```",
|
|
2993
2997
|
perLanguage: {
|
|
2994
2998
|
typescript: {
|
|
2995
2999
|
method: 'client.refunds.create',
|
|
@@ -3037,8 +3041,8 @@ const EMBEDDED_METHODS = [
|
|
|
3037
3041
|
stainlessPath: '(resource) refunds > (method) retrieve',
|
|
3038
3042
|
qualified: 'client.refunds.retrieve',
|
|
3039
3043
|
params: ['refund_id: string;'],
|
|
3040
|
-
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; reason?: string; }",
|
|
3041
|
-
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; 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; 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 - `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'; 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```",
|
|
3042
3046
|
perLanguage: {
|
|
3043
3047
|
typescript: {
|
|
3044
3048
|
method: 'client.refunds.retrieve',
|