Customize return URL

SDKCurrentLast updated: June 7th 2021, @ 11:35:12 am


A return URL redirects users back to the originating page during a checkout flow. For most integrations, using your application ID + ://paypalpay is the simplest and best returnUrl to use as part of the CheckoutConfig. However, there are circumstances when you may require greater control over the returnUrl, such as when your application ID has underscores.

1. Choose your custom return URL

Custom return URLs must end with ://paypalpay. You can customize anything that comes before.

In order to allow for seamless app switches, make the custom return URL unique. We recommend using reverse domain name notation.

If you're creating a custom return URL because your application ID contains underscores, then you can simply replace the underscores with periods. For example, you can change com.paypal.example_payment_application to com.paypal.example.paypal.application.

2. Add a new activity

Use the <activity> tag in the android manifest file to register a new activity that can respond to your custom redirect URL.

Sample Native Checkout SDK code


        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

            android:scheme="YOUR-CUSTOM-SCHEME" />

Modify the code

  1. Copy the sample Native Checkout SDK code and paste it into the code for your mobile checkout page.
  2. Replace YOUR-CUSTOM-SCHEME with the custom return URL that you chose in Step 1. In our example above, we would use com.paypal.example.paypal.application.

Step result

Your app can now respond to authentication deep links.

3. Register the custom return URL

class YourApp : Application() {
    override fun onCreate() {
        val config = CheckoutConfig(
            returnUrl = "YOUR-CUSTOM-SCHEME://paypalpay"
public class YourApp extends Application {
    public void onCreate() {
        CheckoutConfig config = new CheckoutConfig(
            String.format("%s://paypalpay", YOUR-CUSTOM-SCHEME),

Note: Be sure to pass the custom return URL you created in Step 1, instead of your application ID.

4. Update the Developer Dashboard

Enter your custom return URL for your app on the Developer Dashboard. For details, see the Know before you code section of Set up Native Checkout SDK for Android.