How to customize & set an auto-return URL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everyone,
Complete newbie here. Could anybody tell me how to modify the Paypal button HTML to auto return to a custom url?
I'm using the standard button for a single product. I want to tweak the code so the customer autoreturns to a url I specify.
I want to direct them to a specific Calendly booking event url after receiving their payment.
My guess is that it goes in this section but I neither know how to have it auto return, nor send them to a specified url.
// Show a success message within this page, e.g.
const element = document.getElementById('paypal-button-container');
element.innerHTML = '';
element.innerHTML = '<h3>Thank you for your payment!</h3>';
// Or go to another URL: actions.redirect('thank_you.html');
I'm as clueless & new as I probably sound, so please don't assume any HTML knowledge, just English literacy;-)
Thanks in advance,
Tim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @Raveling
Thank you for posting to the PayPal Community.
If you are using PayPal Standard you can enable auto return inside of your PayPal Account:
The Auto Return feature for PayPal Payments Standard redirects buyers back to your website after completing the payment.
https://www.paypal.com/us/cshelp/article/how-do-i-use-paypals-auto-return-feature-help197
Here's how to enable Auto Return
- Return from the PayPal website:
- Go to your Account Settings.
- Click Website payments.
- Click Update across from "Website preferences."
- Click On under "Auto Return."
- In the Return URL field, enter the URL where you want to send your buyer after the payment.
- The Return URL is applied to all Auto Return payments unless otherwise specified within the payment button or link.
- Click Save.
As long as your integration is PayPal Standard, and you are not sending a return url in your code, your PayPal buyers will be returned to the URL that you indicated in your PayPal Account.
Thank you,
Jennifer
MTS
PayPal

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Assistance Needed: Passing and Retrieving Custom Data in PayPal Webhook Payload in PayPal Payments Standard
- iDEAL payments being refunded back to customers in PayPal Payments Standard
- Charge a customer for the remaining balance after a purchase has been made? in REST APIs
- How to get the custom field from a payment with webhook/API? in REST APIs
- Customise checkout page in Braintree Client-side Integration (JS, iOS, Android SDKs)