dodopayments-mcp 2.50.0 → 2.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/local-docs-search.js +8 -8
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +8 -8
- 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 +8 -8
- package/src/server.ts +1 -1
package/local-docs-search.js
CHANGED
|
@@ -64,7 +64,7 @@ const EMBEDDED_METHODS = [
|
|
|
64
64
|
"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; }; };",
|
|
65
65
|
'discount_code?: string;',
|
|
66
66
|
'discount_codes?: string[];',
|
|
67
|
-
'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_phone_number?: boolean; single_page?: boolean; };',
|
|
67
|
+
'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_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; };',
|
|
68
68
|
'force_3ds?: boolean;',
|
|
69
69
|
'mandate_min_amount_inr_paise?: number;',
|
|
70
70
|
'metadata?: object;',
|
|
@@ -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_phone_number?: 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\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_phone_number?: 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_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 - `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_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\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_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_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```",
|
|
82
82
|
perLanguage: {
|
|
83
83
|
typescript: {
|
|
84
84
|
method: 'client.checkoutSessions.create',
|
|
@@ -109,7 +109,7 @@ const EMBEDDED_METHODS = [
|
|
|
109
109
|
},
|
|
110
110
|
php: {
|
|
111
111
|
method: 'checkoutSessions->create',
|
|
112
|
-
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$checkoutSessionResponse = $client->checkoutSessions->create(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowEditingAddons' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n 'singlePage' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($checkoutSessionResponse);",
|
|
112
|
+
example: "<?php\n\nrequire_once dirname(__DIR__) . '/vendor/autoload.php';\n\n$client = new Client(bearerToken: 'My Bearer Token', environment: 'test_mode');\n\n$checkoutSessionResponse = $client->checkoutSessions->create(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowEditingAddons' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n 'requireTaxID' => true,\n 'singlePage' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($checkoutSessionResponse);",
|
|
113
113
|
},
|
|
114
114
|
csharp: {
|
|
115
115
|
method: 'CheckoutSessions.Create',
|
|
@@ -187,7 +187,7 @@ const EMBEDDED_METHODS = [
|
|
|
187
187
|
"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; }; };",
|
|
188
188
|
'discount_code?: string;',
|
|
189
189
|
'discount_codes?: string[];',
|
|
190
|
-
'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_phone_number?: boolean; single_page?: boolean; };',
|
|
190
|
+
'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_phone_number?: boolean; require_tax_id?: boolean; single_page?: boolean; };',
|
|
191
191
|
'force_3ds?: boolean;',
|
|
192
192
|
'mandate_min_amount_inr_paise?: number;',
|
|
193
193
|
'metadata?: object;',
|
|
@@ -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; }; 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_phone_number?: 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; 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\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_phone_number?: 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_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 - `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; }; 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 - `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_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; 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\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_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_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; }; 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 - `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',
|
|
@@ -232,7 +232,7 @@ const EMBEDDED_METHODS = [
|
|
|
232
232
|
},
|
|
233
233
|
php: {
|
|
234
234
|
method: 'checkoutSessions->preview',
|
|
235
|
-
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->checkoutSessions->preview(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowEditingAddons' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n 'singlePage' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($response);",
|
|
235
|
+
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->checkoutSessions->preview(\n productCart: [\n [\n 'productID' => 'product_id',\n 'quantity' => 0,\n 'addons' => [['addonID' => 'addon_id', 'quantity' => 0]],\n 'amount' => 0,\n 'creditEntitlements' => [\n [\n 'creditEntitlementID' => 'credit_entitlement_id',\n 'creditsAmount' => 'credits_amount',\n ],\n ],\n ],\n ],\n allowedPaymentMethodTypes: [PaymentMethodTypes::ACH],\n billingAddress: [\n 'country' => CountryCode::AF,\n 'city' => 'city',\n 'state' => 'state',\n 'street' => 'street',\n 'zipcode' => 'zipcode',\n ],\n billingCurrency: Currency::AED,\n cancelURL: 'cancel_url',\n confirm: true,\n customFields: [\n [\n 'fieldType' => 'text',\n 'key' => 'key',\n 'label' => 'label',\n 'options' => ['string'],\n 'placeholder' => 'placeholder',\n 'required' => true,\n ],\n ],\n customer: ['customerID' => 'customer_id'],\n customerBusinessName: 'customer_business_name',\n customization: [\n 'forceLanguage' => 'force_language',\n 'showOnDemandTag' => true,\n 'showOrderDetails' => true,\n 'theme' => 'dark',\n 'themeConfig' => [\n 'dark' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'fontPrimaryURL' => 'font_primary_url',\n 'fontSecondaryURL' => 'font_secondary_url',\n 'fontSize' => 'xs',\n 'fontWeight' => 'normal',\n 'light' => [\n 'bgPrimary' => 'bg_primary',\n 'bgSecondary' => 'bg_secondary',\n 'borderPrimary' => 'border_primary',\n 'borderSecondary' => 'border_secondary',\n 'buttonPrimary' => 'button_primary',\n 'buttonPrimaryHover' => 'button_primary_hover',\n 'buttonSecondary' => 'button_secondary',\n 'buttonSecondaryHover' => 'button_secondary_hover',\n 'buttonTextPrimary' => 'button_text_primary',\n 'buttonTextSecondary' => 'button_text_secondary',\n 'inputFocusBorder' => 'input_focus_border',\n 'textError' => 'text_error',\n 'textPlaceholder' => 'text_placeholder',\n 'textPrimary' => 'text_primary',\n 'textSecondary' => 'text_secondary',\n 'textSuccess' => 'text_success',\n ],\n 'payButtonText' => 'pay_button_text',\n 'radius' => 'radius',\n ],\n ],\n discountCode: 'discount_code',\n discountCodes: ['string'],\n featureFlags: [\n 'allowCurrencySelection' => true,\n 'allowCustomerEditingBusinessName' => true,\n 'allowCustomerEditingCity' => true,\n 'allowCustomerEditingCountry' => true,\n 'allowCustomerEditingEmail' => true,\n 'allowCustomerEditingName' => true,\n 'allowCustomerEditingState' => true,\n 'allowCustomerEditingStreet' => true,\n 'allowCustomerEditingTaxID' => true,\n 'allowCustomerEditingZipcode' => true,\n 'allowDiscountCode' => true,\n 'allowEditingAddons' => true,\n 'allowPhoneNumberCollection' => true,\n 'allowTaxID' => true,\n 'alwaysCreateNewCustomer' => true,\n 'redirectImmediately' => true,\n 'requirePhoneNumber' => true,\n 'requireTaxID' => true,\n 'singlePage' => true,\n ],\n force3DS: true,\n mandateMinAmountInrPaise: 0,\n metadata: ['foo' => 'string'],\n minimalAddress: true,\n paymentMethodID: 'payment_method_id',\n productCollectionID: 'product_collection_id',\n returnURL: 'return_url',\n shortLink: true,\n showSavedPaymentMethods: true,\n subscriptionData: [\n 'onDemand' => [\n 'mandateOnly' => true,\n 'adaptiveCurrencyFeesInclusive' => true,\n 'productCurrency' => Currency::AED,\n 'productDescription' => 'product_description',\n 'productPrice' => 0,\n ],\n 'trialPeriodDays' => 0,\n ],\n taxID: 'tax_id',\n);\n\nvar_dump($response);",
|
|
236
236
|
},
|
|
237
237
|
csharp: {
|
|
238
238
|
method: 'CheckoutSessions.Preview',
|
|
@@ -2529,8 +2529,8 @@ const EMBEDDED_METHODS = [
|
|
|
2529
2529
|
stainlessPath: '(resource) customers.emails > (method) list',
|
|
2530
2530
|
qualified: 'client.customers.emails.list',
|
|
2531
2531
|
params: ['customer_id: string;', 'page_number?: number;', 'page_size?: number;'],
|
|
2532
|
-
response: "{ category: string; created_at: string; email_log_id: string; email_type: string; has_preview: boolean; policies: { requires_different_address: boolean; resend_allowed: boolean; resends_remaining: number; retry_allowed: boolean; }; status: 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked'; failure_code?: string; failure_reason?: string; from?: string;
|
|
2533
|
-
markdown: "## list\n\n`client.customers.emails.list(customer_id: string, page_number?: number, page_size?: number): { category: string; created_at: string; email_log_id: string; email_type: string; has_preview: boolean; policies: email_policies; status: email_log_status; failure_code?: email_failure_code; failure_reason?: string; from?: string;
|
|
2532
|
+
response: "{ category: string; created_at: string; email_log_id: string; email_type: string; has_preview: boolean; policies: { requires_different_address: boolean; resend_allowed: boolean; resends_remaining: number; retry_allowed: boolean; superseded: boolean; }; status: 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked'; failure_code?: string; failure_reason?: string; from?: string; recipient?: string; subject?: string; }",
|
|
2533
|
+
markdown: "## list\n\n`client.customers.emails.list(customer_id: string, page_number?: number, page_size?: number): { category: string; created_at: string; email_log_id: string; email_type: string; has_preview: boolean; policies: email_policies; status: email_log_status; failure_code?: email_failure_code; failure_reason?: string; from?: string; recipient?: string; subject?: string; }`\n\n**get** `/customers/{customer_id}/emails`\n\nReturns every transactional email sent to this customer in the last 180\ndays, newest first, with its delivery outcome. Delivery status comes from\nthe email provider and is as fresh as replication, typically seconds.\n\n### Parameters\n\n- `customer_id: string`\n\n- `page_number?: number`\n Which page to return. The default is 0.\n\n- `page_size?: number`\n How many emails to return. The default is 10 and the maximum is 100.\n\n### Returns\n\n- `{ category: string; created_at: string; email_log_id: string; email_type: string; has_preview: boolean; policies: { requires_different_address: boolean; resend_allowed: boolean; resends_remaining: number; retry_allowed: boolean; superseded: boolean; }; status: 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked'; failure_code?: string; failure_reason?: string; from?: string; recipient?: string; subject?: string; }`\n\n - `category: string`\n - `created_at: string`\n - `email_log_id: string`\n - `email_type: string`\n - `has_preview: boolean`\n - `policies: { requires_different_address: boolean; resend_allowed: boolean; resends_remaining: number; retry_allowed: boolean; superseded: boolean; }`\n - `status: 'sent' | 'delivered' | 'failed' | 'complained' | 'blocked'`\n - `failure_code?: string`\n - `failure_reason?: string`\n - `from?: string`\n - `recipient?: string`\n - `subject?: 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 emailLogItem of client.customers.emails.list('customer_id')) {\n console.log(emailLogItem);\n}\n```",
|
|
2534
2534
|
perLanguage: {
|
|
2535
2535
|
typescript: {
|
|
2536
2536
|
method: 'client.customers.emails.list',
|