
Example: The top customer has a default payment method set; the bottom customer does not, which can cause payment issues.
Adding a webhook to automatically set the default payment method in Stripe
Note: This requires a Stripe component that is set up to create
subscriptions
1
Create a new webhook in Stripe
- Log in to your Stripe Dashboard.
- Open the Workbench.
- Navigate to the Webhooks tab.
- Click + Add destination.
2
Configure your webhook settings
- Make sure “Events” is set to as “Your account”.
- Make sure “API version” is set to “Your current version”.
-
Under “Events”, find the
payment_method.attached
event and select it. - Click Continue.
- Make sure “Webhook endpoint” is selected and click Continue.
3
Add your endpoint and create the webhook
-
Grab your Project ID from the URL in the Embeddables Web App - it’s the ID after
/project/
that starts withpr_
. -
In the “Endpoint URL” field in Stripe, paste the following URL, replacing
<YOUR_PROJECT_ID>
with your Project ID:
If you’re setting up a webhook for Stripe’s test environment, add
&test=true
to the end of the endpoint URL.- Click Create destination.
Migrating from the old webhook URL to the new format
Migrating to the new webhook URL with Workbench enabled
1
Update your webhook endpoint URL
- Go to your Stripe Dashboard and open the Workbench.
-
Navigate to the Webhooks tab and find your existing webhook for
payment_method.attached
. - Edit the endpoint URL to use the new format:
If you’re setting up a webhook for Stripe’s test environment, add
&test=true
to the end of the endpoint URL.- You can get your project ID from the URL in the Embeddables Web App - it’s the ID after
/project/
that starts withpr_
. - Save your changes.