Automatically set default payment methods in Stripe for subscriptions
How to set up a webhook in Stripe so that, when a payment method is first added to a customer’s subscription, it is automatically set as the default payment method.
This guide is only relevant for Subscription checkout mode.For Payment mode, all you need to do is set “Setup Future Usage” to “Off Session” in the Stripe component options.For Setup mode, you don’t need to do anything - payment methods are automatically set as default in this mode.
When a customer enters their credit card or other payment method for a subscription in Stripe, that payment method is not automatically set as the default payment method.Without this, the next payment in the customer’s subscription may fail, unless you manually set the payment method as the default in your Stripe Dashboard.This guide explains how to set up a Webhook to ensure that when a new payment method is added to a Stripe customer, it is automatically set as the default payment method.
Example: The top customer has a default payment method set; the bottom customer does not, which can cause payment issues.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Embeddables Docs","colors":{"primary":"#6254f3","light":"#9389ff","dark":"#6254f3"},"logo":{"light":"https://mintcdn.com/embeddables/f00lqPv7EEUt_xOC/logo/embeddables-light.png?fit=max\u0026auto=format\u0026n=f00lqPv7EEUt_xOC\u0026q=85\u0026s=74ee666ed55ce763c36f79319ff24449","dark":"https://mintcdn.com/embeddables/f00lqPv7EEUt_xOC/logo/embeddables-dark.png?fit=max\u0026auto=format\u0026n=f00lqPv7EEUt_xOC\u0026q=85\u0026s=b076007628400fd1d518e18ed5ee8973"},"favicon":"https://mintcdn.com/embeddables/f00lqPv7EEUt_xOC/favicon.png?fit=max\u0026auto=format\u0026n=f00lqPv7EEUt_xOC\u0026q=85\u0026s=f79f67b7dde6f379c7c86fdc019071ad","api":{"openapi":["openapi.yml"]},"navbar":{"links":[{"href":"https://embeddables.com","label":"Embeddables.com"},{"href":"mailto:team@embeddables.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.embeddables.com"}},"footer":{"socials":{"twitter":"https://twitter.com/embeddables_","linkedin":"https://www.linkedin.com/company/embeddables"}},"interaction":{"drilldown":false},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"embeddables","hasAudioNarration":false,"actualSubdomain":"embeddables","customDomains":["docs.embeddables.com"],"gitSource":{"type":"github","owner":"heysavvy","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a58c76c6a3d1c512adeaf65","collectionId":"1619dccc-e384-4088-87ff-ad10dafc1022","schemaVersion":"v3"},"feedback":{"thumbs":true,"issues":true,"edits":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae91d7c85c0c2fd2e24ad0a:success","clientVersion":"0.0.4067","searchFilterCounts":[{"language":"default","tag":"Documentation","count":45},{"language":"default","tag":"Implementations","count":26},{"language":"default","tag":"API","count":12},{"language":"default","tag":"How To's","count":12},{"language":"default","tag":"Features","count":11},{"language":"default","tag":"Publish to your site","count":9},{"language":"default","tag":"Environments","count":8},{"language":"default","tag":"CLI","count":6},{"language":"default","tag":"Guides \u0026 Best Practices","count":6},{"language":"default","tag":"Integration and Analytics","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#navigation-items>ul.list-none>li.embeddables-anchor-item{position:relative;padding-right:1.75rem}.embeddables-anchor-item>a.nav-anchor{margin-left:0!important;margin-bottom:0.35rem!important}.embeddables-anchor-chevron{position:absolute;top:0.1rem;right:0.15rem;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:1.75rem;height:1.75rem;border:0;border-radius:0.375rem;background:transparent;color:rgb(55 65 81);cursor:pointer;padding:0}.embeddables-anchor-chevron:hover{color:rgb(17 24 39);background:rgb(243 244 246)}.dark .embeddables-anchor-chevron{color:rgb(209 213 219)}.dark .embeddables-anchor-chevron:hover{color:rgb(255 255 255);background:rgb(31 41 55)}.embeddables-anchor-chevron-icon{width:0.75rem;height:0.75rem;transition:transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);transform:rotate(0deg)}.embeddables-anchor-chevron--expanded .embeddables-anchor-chevron-icon{transform:rotate(90deg)}#navigation-items>:not(ul.list-none):not(.embeddables-subsections-panel){display:none!important}#navigation-items{transition:opacity 0.15s ease}#navigation-items:not([data-embeddables-ready=\"true\"]){opacity:0;pointer-events:none}.embeddables-anchor-item>.embeddables-subsections-panel{margin:0 0.15rem 0 0.75rem;padding-left:0;border-left:2px solid transparent}.embeddables-anchor-item>.embeddables-subsections-panel--expanded{margin:0.25rem 0.15rem 0.5rem 0.75rem;padding-left:0.65rem;border-left-color:rgb(209 213 219)}.dark .embeddables-anchor-item>.embeddables-subsections-panel--expanded{border-left-color:rgb(75 85 99)}.embeddables-subsections-panel__inner>:first-child{margin-top:0.35rem!important;padding-top:0!important}.embeddables-subsections-panel__inner .mt-6{margin-top:0.75rem!important}.embeddables-subsections-panel__inner .lg\\:mt-8{margin-top:0.75rem!important}.embeddables-subsections-panel__inner>:first-child.mt-6,.embeddables-subsections-panel__inner>:first-child.lg\\:mt-8{margin-top:0.35rem!important}.embeddables-subsections-panel__inner .sidebar-group-header{margin-bottom:0.5rem!important}.embeddables-subsections-panel{display:grid;grid-template-rows:0fr;opacity:0;overflow:hidden;transition:grid-template-rows 0.45s cubic-bezier(0.22, 1, 0.36, 1),\n opacity 0.35s ease,\n margin 0.45s cubic-bezier(0.22, 1, 0.36, 1),\n padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),\n border-color 0.35s ease}.embeddables-subsections-panel--expanded{grid-template-rows:1fr;opacity:1}.embeddables-subsections-panel__inner{min-height:0;overflow:hidden}.embeddables-subsections-panel--instant{transition:none!important}#sidebar-content li>button svg[width=\"8\"]{width:11px!important;height:11px!important;color:rgb(55 65 81);transform-origin:center;transition:transform 0.45s cubic-bezier(0.22, 1, 0.36, 1)!important}.dark #sidebar-content li>button svg[width=\"8\"]{color:rgb(209 213 219)}#sidebar-content li>button svg[width=\"8\"].rotate-90{transform:rotate(90deg)!important}#sidebar-content li[data-title]>ul{overflow:hidden}.tella-video{position:relative;padding-bottom:56.25%;height:0}.tella-video>iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;border-radius:10px}"}],"page":{"pagePath":"how-to/assign-default-payment-methods","slug":"/how-to/assign-default-payment-methods","pageMetadata":{"title":"Automatically set default payment methods in Stripe for subscriptions","sidebarTitle":"Automatically set default payment methods","description":"How to set up a webhook in Stripe so that, when a payment method is first added to a customer's subscription, it is automatically set as the default payment method.","href":"/how-to/assign-default-payment-methods"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How to set up a webhook in Stripe so that, when a payment method is first added to a customer’s subscription, it is automatically set as the default payment method.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,hr:`hr`,img:`img`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,Step,Steps,Tab,Tabs,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(Note,{children:[_jsxs(_components.p,{children:[`This guide is only relevant for `,_jsx(_components.strong,{children:`Subscription`}),` checkout mode.`]}),_jsxs(_components.p,{children:[`For `,_jsx(_components.strong,{children:`Payment`}),` mode, all you need to do is set “Setup Future Usage” to “Off Session” in the Stripe component options.`]}),_jsxs(_components.p,{children:[`For `,_jsx(_components.strong,{children:`Setup`}),` mode, you don’t need to do anything - payment methods are automatically set as default in this mode.`]})]}),`\n`,_jsxs(_components.p,{children:[`When a customer enters their credit card or other payment method for a subscription in Stripe, that payment method is not automatically set as the `,_jsx(`strong`,{children:`default`}),` payment method.`]}),`\n`,_jsx(_components.p,{children:`Without this, the next payment in the customer’s subscription may fail, unless you manually set the payment method as the default in your Stripe Dashboard.`}),`\n`,_jsx(_components.p,{children:`This guide explains how to set up a Webhook to ensure that when a new payment method is added to a Stripe customer, it is automatically set as the default payment method.`}),`\n`,_jsx(Frame,{caption:`Example: The top customer has a default payment method set; the bottom customer does not, which can cause payment issues.`,children:_jsx(_components.p,{children:_jsx(_components.img,{src:`https://assets.embeddables.com/Screenshot2025-07-21at9_19167427955247518.33.08am.png`,alt:`Example: Top customer has a default payment method set; bottom customer does\nnot, which can cause payment\nissues.`})})}),`\n`,_jsx(Heading,{level:`2`,id:`adding-a-webhook-to-automatically-set-the-default-payment-method-in-stripe`,children:`Adding a webhook to automatically set the default payment method in Stripe`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`You have Workbench enabled`,id:`you-have-workbench-enabled`,children:[` `,_jsx(Note,{children:_jsxs(_components.p,{children:[`Note: This requires a Stripe component that is set up to create`,` `,`\n`,_jsx(`strong`,{children:`subscriptions`})]})}),_jsxs(Steps,{children:[_jsx(Step,{title:`Create a new webhook in Stripe`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Log in to your Stripe Dashboard.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Open the Workbench.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Navigate to the Webhooks tab.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click `,_jsx(`strong`,{children:`+ Add destination`}),`.`]}),`\n`]}),`\n`]})}),_jsx(Step,{title:`Configure your webhook settings`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Make sure “Events” is set to as “Your account”.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Make sure “API version” is set to “Your current version”.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Under “Events”, find the `,_jsx(_components.code,{children:`payment_method.attached`}),` event and select it.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click `,_jsx(`strong`,{children:`Continue`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Make sure “Webhook endpoint” is selected and click `,_jsx(`strong`,{children:`Continue`}),`.`]}),`\n`]}),`\n`]})}),_jsxs(Step,{title:`Add your endpoint and create the webhook`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Grab your Project ID from the URL in the Embeddables Web App - it’s the ID after `,_jsx(_components.code,{children:`/project/`}),` that starts with `,_jsx(_components.code,{children:`pr_`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`In the “Endpoint URL” field in Stripe, paste the following URL, replacing `,_jsx(_components.code,{children:`\u003cYOUR_PROJECT_ID>`}),` with your Project ID:`]}),`\n`]}),`\n`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://webhooks.embeddables.com/webhooks/stripe/payment_method.attached?project_id=\u003cYOUR_PROJECT_ID>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`If you’re setting up a webhook for Stripe’s test environment, add `,_jsx(_components.code,{children:`\u0026test=true`}),` to the end of the endpoint URL.`]})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Click `,_jsx(`strong`,{children:`Create destination`}),`.`]}),`\n`]})]})]})]}),_jsxs(Tab,{title:`You don't have Workbench enabled`,id:`you-dont-have-workbench-enabled`,children:[` `,_jsx(Note,{children:_jsxs(_components.p,{children:[`Note: This requires a Stripe component that is set up to create`,` `,`\n`,_jsx(`strong`,{children:`subscriptions`})]})}),_jsxs(Steps,{children:[_jsx(Step,{title:`Create a new webhook in Stripe`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Log in to your Stripe Dashboard.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Go to the Developers section (bottom-left in your sidebar).`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Navigate to the Webhooks tab.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click `,_jsx(`strong`,{children:`+ Add endpoint`}),`.`]}),`\n`]}),`\n`]})}),_jsxs(Step,{title:`Add your endpoint`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Grab your Project ID from the URL in the Embeddables Web App - it’s the ID after `,_jsx(_components.code,{children:`/project/`}),` that starts with `,_jsx(_components.code,{children:`pr_`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`In the “Endpoint URL” field in Stripe, paste the following URL, replacing `,_jsx(_components.code,{children:`\u003cYOUR_PROJECT_ID>`}),` with your Project ID:`]}),`\n`]}),`\n`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://webhooks.embeddables.com/webhooks/stripe/payment_method.attached?project_id=\u003cYOUR_PROJECT_ID>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`If you’re setting up a webhook for Stripe’s test environment, add `,_jsx(_components.code,{children:`\u0026test=true`}),` to the end of the endpoint URL.`]})}),_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Add a description of what the endpoint is for.`}),`\n`]})]}),_jsx(Step,{title:`Configure your webhook settings`,children:_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Make sure “Listen to” is set to as “Events on your account”.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Make sure “Version” is set to “Your current version”.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click “Select events”, find the `,_jsx(_components.code,{children:`payment_method.attached`}),` event and select it.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click `,_jsx(`strong`,{children:`Add endpoint`})]}),`\n`]}),`\n`]})})]})]})]}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`migrating-from-the-old-webhook-url-to-the-new-format`,children:`Migrating from the old webhook URL to the new format`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`You have Workbench enabled`,id:`you-have-workbench-enabled-2`,\"data-child-heading-ids\":`[\"migrating-to-the-new-webhook-url-with-workbench-enabled\"]`,children:[_jsx(Heading,{level:`4`,id:`migrating-to-the-new-webhook-url-with-workbench-enabled`,children:`Migrating to the new webhook URL with Workbench enabled`}),_jsx(Steps,{children:_jsxs(Step,{title:`Update your webhook endpoint URL`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Go to your Stripe Dashboard and open the Workbench.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Navigate to the Webhooks tab and find your existing webhook for `,_jsx(_components.code,{children:`payment_method.attached`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Edit the endpoint URL to use the new format:`}),`\n`]}),`\n`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://webhooks.embeddables.com/webhooks/stripe/payment_method.attached?project_id=\u003cYOUR_PROJECT_ID>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`If you’re setting up a webhook for Stripe’s test environment, add `,_jsx(_components.code,{children:`\u0026test=true`}),` to the end of the endpoint URL.`]})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You can get your project ID from the URL in the Embeddables Web App - it’s the ID after `,_jsx(_components.code,{children:`/project/`}),` that starts with `,_jsx(_components.code,{children:`pr_`}),`.`]}),`\n`,_jsx(_components.li,{children:`Save your changes.`}),`\n`]})]})})]}),_jsxs(Tab,{title:`You don't have Workbench enabled`,id:`you-dont-have-workbench-enabled-2`,\"data-child-heading-ids\":`[\"migrating-to-the-new-webhook-url-with-workbench-disabled\"]`,children:[_jsx(Heading,{level:`4`,id:`migrating-to-the-new-webhook-url-with-workbench-disabled`,children:`Migrating to the new webhook URL with Workbench disabled`}),_jsx(Steps,{children:_jsxs(Step,{title:`Update your webhook endpoint URL`,children:[_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Go to your Stripe Dashboard and open the Developers > Webhooks section.`}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Find your existing webhook for `,_jsx(_components.code,{children:`payment_method.attached`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Edit the endpoint URL to use the new format:`}),`\n`]}),`\n`]}),_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`https://webhooks.embeddables.com/webhooks/stripe/payment_method.attached?project_id=\u003cYOUR_PROJECT_ID>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),_jsx(Tip,{children:_jsxs(_components.p,{children:[`If you’re setting up a webhook for Stripe’s test environment, add `,_jsx(_components.code,{children:`\u0026test=true`}),` to the end of the endpoint URL.`]})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You can get your project ID from the URL in the Embeddables Web App - it’s the ID after `,_jsx(_components.code,{children:`/project/`}),` that starts with `,_jsx(_components.code,{children:`pr_`}),`.`]}),`\n`,_jsx(_components.li,{children:`Save your changes.`}),`\n`]})]})})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Automatically set default payment methods in Stripe for subscriptions","sidebarTitle":"Automatically set default payment methods","description":"How to set up a webhook in Stripe so that, when a payment method is first added to a customer's subscription, it is automatically set as the default payment method.","href":"/how-to/assign-default-payment-methods"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Adding a webhook to automatically set the default payment method in Stripe","slug":"adding-a-webhook-to-automatically-set-the-default-payment-method-in-stripe","depth":2,"children":[]},{"title":"Migrating from the old webhook URL to the new format","slug":"migrating-from-the-old-webhook-url-to-the-new-format","depth":2,"children":[{"title":"Migrating to the new webhook URL with Workbench enabled","slug":"migrating-to-the-new-webhook-url-with-workbench-enabled","depth":4,"children":[],"tabId":"you-have-workbench-enabled-2"},{"title":"Migrating to the new webhook URL with Workbench disabled","slug":"migrating-to-the-new-webhook-url-with-workbench-disabled","depth":4,"children":[],"tabId":"you-dont-have-workbench-enabled-2"}]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/embeddables/8c59e11d0eb0755e/sidebar-collapse.js"],"subdomain":"embeddables","siteName":"Embeddables Docs","title":"Automatically set default payment methods in Stripe for subscriptions - Embeddables Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-07-16T11:59:10.610Z","originalFileLocation":"how-to/assign-default-payment-methods.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to set up a webhook in Stripe so that, when a payment method is first added to a customer\u0026#x27;s subscription, it is automatically set as the default payment method.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Embeddables Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Automatically set default payment methods in Stripe for subscriptions - Embeddables Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to set up a webhook in Stripe so that, when a payment method is first added to a customer\u0026#x27;s subscription, it is automatically set as the default payment method.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Embeddables Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.embeddables.com/how-to/assign-default-payment-methods\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://embeddables.mintlify.app/_mintlify/api/og/v2?division=Stripe\u0026amp;title=Automatically+set+default+payment+methods+in+Stripe+for+subscriptions\u0026amp;description=How+to+set+up+a+webhook+in+Stripe+so+that%2C+when+a+payment+method+is+first+added+to+a+customer%27s+subscription%2C+it+is+automatically+set+as+the+default+payment+met\u0026amp;theme=69672745cafa73448f7fac30\u0026amp;signature=e4386fd01723497c803f11d23c4eb22a4f104bff2c8b5c9cf4e9f1804311766a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Automatically set default payment methods in Stripe for subscriptions - Embeddables Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to set up a webhook in Stripe so that, when a payment method is first added to a customer\u0026#x27;s subscription, it is automatically set as the default payment method.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://embeddables.mintlify.app/_mintlify/api/og/v2?division=Stripe\u0026amp;title=Automatically+set+default+payment+methods+in+Stripe+for+subscriptions\u0026amp;description=How+to+set+up+a+webhook+in+Stripe+so+that%2C+when+a+payment+method+is+first+added+to+a+customer%27s+subscription%2C+it+is+automatically+set+as+the+default+payment+met\u0026amp;theme=69672745cafa73448f7fac30\u0026amp;signature=e4386fd01723497c803f11d23c4eb22a4f104bff2c8b5c9cf4e9f1804311766a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/embeddables/RQz9nCRzyy_WTKxy/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Embeddables Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6254f3\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.embeddables.com/how-to/assign-default-payment-methods\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/how-to/assign-default-payment-methods.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.embeddables.com/#organization\",\"name\":\"Embeddables Docs\",\"url\":\"https://docs.embeddables.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/embeddables/f00lqPv7EEUt_xOC/logo/embeddables-light.png?fit=max\u0026auto=format\u0026n=f00lqPv7EEUt_xOC\u0026q=85\u0026s=74ee666ed55ce763c36f79319ff24449\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.embeddables.com#website\",\"name\":\"Embeddables Docs\",\"url\":\"https://docs.embeddables.com\",\"publisher\":{\"@id\":\"https://docs.embeddables.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods#webpage\",\"url\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods\",\"name\":\"Automatically set default payment methods in Stripe for subscriptions\",\"description\":\"How to set up a webhook in Stripe so that, when a payment method is first added to a customer's subscription, it is automatically set as the default payment method.\",\"dateModified\":\"2026-07-16T11:59:10.610Z\",\"isPartOf\":{\"@id\":\"https://docs.embeddables.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Implementations\",\"item\":\"https://docs.embeddables.com/features/split-testing\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Payments\",\"item\":\"https://docs.embeddables.com/features/payments/stripe/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Stripe\",\"item\":\"https://docs.embeddables.com/features/payments/stripe/overview\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Automatically set default payment methods in Stripe for subscriptions\",\"item\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods#article\",\"headline\":\"Automatically set default payment methods in Stripe for subscriptions\",\"name\":\"Automatically set default payment methods in Stripe for subscriptions\",\"description\":\"How to set up a webhook in Stripe so that, when a payment method is first added to a customer's subscription, it is automatically set as the default payment method.\",\"url\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods\",\"mainEntityOfPage\":{\"@id\":\"https://docs.embeddables.com/how-to/assign-default-payment-methods#webpage\"},\"dateModified\":\"2026-07-16T11:59:10.610Z\",\"publisher\":{\"@id\":\"https://docs.embeddables.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.embeddables.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Embeddables Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Embeddables Docs","nav":{"global":null,"anchors":[{"anchor":"Welcome","icon":"hand-wave","pages":[{"title":"Welcome","href":"/welcome"}]},{"anchor":"Documentation","icon":"book-open","pages":[{"group":"Environments","expanded":false,"pages":[{"group":"CLI","icon":"terminal","expanded":false,"pages":[{"title":"Embeddables CLI","sidebarTitle":"Overview","icon":"terminal","href":"/cli/overview"},{"title":"Command Reference","sidebarTitle":"Commands","icon":"rectangle-terminal","href":"/cli/commands"},{"title":"Development Workflow","sidebarTitle":"Development","icon":"code","href":"/cli/development"},{"title":"Using the CLI with AI","sidebarTitle":"AI Assistants","icon":"wand-magic-sparkles","href":"/cli/ai"},{"title":"Troubleshooting","sidebarTitle":"Troubleshooting","icon":"wrench","href":"/cli/troubleshooting"},{"title":"CLI Changelog","sidebarTitle":"Changelog","icon":"list-timeline","href":"/reference/changelog/cli-changelog"}]},{"group":"Builder","icon":"cube","expanded":false,"pages":[{"title":"Embeddables Builder","sidebarTitle":"Overview","icon":"cube","href":"/builder/overview"}]},{"group":"Webapp","icon":"globe","expanded":false,"pages":[{"title":"Embeddables Web App","sidebarTitle":"Overview","icon":"globe","href":"/webapp/overview"}]}]},{"group":"Features","expanded":false,"pages":[{"title":"Design in Embeddables","sidebarTitle":"Design","icon":"paintbrush","href":"/features/design"},{"title":"User Data in Embeddables","sidebarTitle":"User Data","icon":"database","href":"/features/user-data"},{"title":"Using Conditions in Embeddables","sidebarTitle":"Conditions","icon":"split","href":"/features/conditions"},{"title":"Using Computed Fields in Embeddables","sidebarTitle":"Computed Fields","icon":"brackets-curly","href":"/features/computed-fields"},{"title":"Using Actions in Embeddables","sidebarTitle":"Actions","icon":"code","href":"/features/actions"},{"title":"Saving and Version Control in Embeddables","sidebarTitle":"Saving and Version Control","icon":"floppy-disk","href":"/features/saving-and-version-control"},{"title":"User Roles \u0026 Permissions","icon":"lock","href":"/guides/user-roles-permissions"},{"title":"HIPAA Compliance in Embeddables","sidebarTitle":"HIPAA Compliance","icon":"shield-check","href":"/guides/hipaa-compliance"},{"title":"Storing data, Local Storage and Cookies","icon":"database","href":"/guides/storing-data-cookies"},{"title":"Testing and URL Params","icon":"vial","href":"/features/url-params"},{"group":"Components","icon":"cube","expanded":false,"pages":[{"title":"Components: Input Box","sidebarTitle":"Input Box","href":"/guides/components/input-box"}]}]},{"group":"Implementations","expanded":false,"pages":[{"title":"Split Testing in Embeddables","sidebarTitle":"A/B Testing or Experiments","icon":"flask","href":"/features/split-testing"},{"group":"Payments","icon":"credit-card","expanded":false,"pages":[{"group":"Stripe","icon":"credit-card","expanded":false,"pages":[{"title":"Accepting Stripe Payments in Embeddables","sidebarTitle":"Overview","href":"/features/payments/stripe/overview"},{"title":"Control Stripe Prices from the Embeddables CMS","sidebarTitle":"Control Stripe Prices from the Embeddables CMS","href":"/how-to/control-stripe-prices-from-cms"},{"title":"Place a Hold on a Payment","sidebarTitle":"Place a Hold on a Payment","href":"/how-to/place-a-hold-on-payment"},{"title":"Use Stripe Coupons and Promo Codes","sidebarTitle":"Use Stripe Coupons and Promo Codes","description":"How to implement and apply Stripe coupons and promo codes in your Embeddable","href":"/how-to/use-stripe-coupons-and-promo-codes"},{"title":"Automatically set default payment methods in Stripe for subscriptions","sidebarTitle":"Automatically set default payment methods","href":"/how-to/assign-default-payment-methods"}]},{"title":"PayPal","description":"How our PayPal integration works, and how to use it","icon":"paypal","href":"/features/payments/paypal"}]},{"title":"Embeddables CMS","sidebarTitle":"CMS","icon":"table","href":"/features/cms"},{"title":"Translations in Embeddables","sidebarTitle":"Translations","icon":"language","href":"/features/translations"},{"title":"Debugger","sidebarTitle":"Testing","icon":"vial","href":"/features/testing-and-debugging/debugger"},{"group":"Publish to your site","icon":"rocket-launch","expanded":false,"pages":[{"title":"Embed in your site","href":"/how-to/embed-in-your-site"},{"title":"Embed in your Webflow site","href":"/how-to/embed-in-your-webflow-site"},{"title":"Embed in your WordPress site","href":"/how-to/embed-in-your-wordpress-site"},{"title":"Embed in your Framer site","href":"/how-to/embed-in-your-framer-site"},{"title":"Embed in a React app","href":"/how-to/embed-in-react"},{"title":"Embed in a React Native app","href":"/how-to/embed-in-react-native"},{"title":"Publish your Embeddable via a Reverse Proxy","sidebarTitle":"Publish via a Reverse Proxy","href":"/how-to/reverse-proxy-setup"},{"title":"Embed via backend integration","href":"/how-to/embed-backend-integration"},{"title":"Upgrade to the Embed Code 2.0","href":"/how-to/embed-code-2-0"}]},{"title":"How To: Set up Webhooks in Embeddables","sidebarTitle":"Webhooks","icon":"webhook","href":"/how-to/set-up-webhooks"},{"group":"Integration and Analytics","icon":"puzzle-piece","expanded":false,"pages":[{"title":"Embeddables and Tellescope","sidebarTitle":"Embeddables and Tellescope","href":"/how-to/send-data-to-tellescope"},{"title":"Embeddables and Telegra MD","sidebarTitle":"Embeddables and Telegra MD","href":"/how-to/send-data-to-telegra-md"},{"title":"Embeddables and Klaviyo","sidebarTitle":"Embeddables and Klaviyo","href":"/how-to/send-data-to-klaviyo"},{"title":"Embeddables and Customer.io","sidebarTitle":"Embeddables and Customer.io","href":"/how-to/send-data-to-customer-io"},{"title":"Embeddables and Hotjar","sidebarTitle":"Embeddables and Hotjar","href":"/how-to/set-up-hotjar"},{"title":"Tracking Analytics in Embeddables","sidebarTitle":"Analytics","icon":"chart-line-up","href":"/features/analytics"}]}]}]},{"anchor":"API","icon":"code","pages":[{"title":"API","href":"/api-reference/introduction"}]},{"anchor":"Guides \u0026 Best Practices","icon":"book-open-reader","pages":[{"title":"Guides \u0026 Best Practices","href":"/faqs"}]},{"anchor":"How To's","icon":"circle-question","pages":[{"title":"How To's","href":"/how-to/display-answers-back-to-user"}]},{"anchor":"Resources","icon":"folder-open","pages":[{"title":"Resources","href":"/reference/glossary/glossary"}]},{"anchor":"About These Docs","icon":"circle-info","pages":[{"title":"About These Docs","href":"/about/who-are-these-docs-for"}]},{"anchor":"Contact Support","icon":"headset","href":"mailto:team@embeddables.com"}]},"basePath":"","title":"Automatically set default payment methods in Stripe for subscriptions - Embeddables Docs","buildId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","deploymentId":"dpl_9VVk5y1P8k1ATeJguVngy9Q3cmbD","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-BdiBGm0H.js","DynamicMarkdown-CbqEDjbV.js","zoom-image-lightbox-CvtNkYOX.js","lightbox-handle-r17bVUz3.js"]}