On this page
No Headings
Last updated: June 26, 2026
Fastlane is PayPal's quick guest checkout solution. It securely saves and retrieves payment and shipping information for Fastlane members. Fastlane members enter their email and receive prefilled checkout forms.
Set up your client side to integrate Fastlane.
Initialize the SDK through the following script tag on your HTML page.
<script>
src="https://www.paypal.com/sdk/js?client-id=<CLIENT_ID>>&components=buttons,fastlane"
data-sdk-client-token="<SDK_CLIENT_TOKEN>"
</script>Fastlane is initialized with a call to paypal.Fastlane. You must pass a configuration object passed during initialization.
client-iddata-sdk-client-token from setting up your server.// instantiates the Fastlane module
const fastlane = await window.paypal.Fastlane({
FastlanePaymentComponent, // used for quick start integration
FastlaneCardComponent, // used for flexible integration
FastlaneWatermarkComponent
// For more details about available options parameters, see the Reference section.
});
// Convenience parameters for calling later on
const { identity, profile } = fastlane;You can specify the language in which the Fastlane components are rendered. After you initialize the Fastlane component, you can set the locale.
fastlane.setLocale("en_us"); // en_us is the default valueen_us - English, defaultes_us - Spanishfr_us - Frenchzh_us - MandarinPayPal is a data controller and business under the California Consumer Privacy Act. You'll be sharing consumer's email addresses with PayPal. We recommend you make PayPal known to your consumers by leveraging our SDK to render the "Powered by Fastlane" logo and information tooltip. If you have any questions about this feature or your compliance with data protection laws, consult your legal advisors.
You'll need to render your own email field to capture the payer's email address.
Because the email address is shared with PayPal, it is crucial to inform the payer. We recommend displaying the Fastlane watermark below the email field.
After collecting the email address, PayPal determines whether the email is associated with a Fastlane profile or if it belongs to a PayPal member. Use the following code snippet to look up the customer's email.
const {
customerContextId
} = await identity.lookupCustomerByEmail( /* email address */ );If the user is identified with a Fastlane profile, they need to authenticate before Fastlane retrieves their saved payment and address information. The user is presented with a screen to authenticate themselves by entering a one-time password sent to their registered mobile number.
You can use the following code to trigger the authentication flow and handle the response:
Note: The following code sets a variable called renderFastlaneMemberExperience to simplify the conditional logic. Feel free to use this or any other method to handle this in your implementation.
const {
customerContextId
} = await identity.lookupCustomerByEmail(document.getElementById("email").value);
//this variable will turn to True if user authenticates successfully with OTP
//will remain False by default
let renderFastlaneMemberExperience = false;
if (customerContextId) {
// Email is associated with a Fastlane member or a PayPal member,
// send customerContextId to trigger the authentication flow.
const {
authenticationState,
profileData
} = await identity.triggerAuthenticationFlow(customerContextId);
if (authenticationState === "succeeded") {
// Fastlane member successfully authenticated themselves
// profileData contains their profile details
renderFastlaneMemberExperience = true;
const name = profileData.name;
const shippingAddress = profileData.shippingAddress;
const card = profileData.card;
} else {
// Member failed or canceled authentication. Treat them as a guest payer
renderFastlaneMemberExperience = false;
}
} else {
// No profile found with this email address. This is a guest payer
renderFastlaneMemberExperience = false;
}The triggerAuthenticationFlow() method returns an AuthenticatedCustomerResult object. Use the authenticationState property in the AuthenticatedCustomerResult object to check if the payer has been authenticated.
On authentication:
profileData object contents.renderFastlaneMemberExperience is set to True.If a user fails or declines to authenticate, render the same experience as you would for a guest payer.
showShippingAddressSelector(). This helps the payer change or add a new address as needed.Note: Shipping is available to merchants in the US only. However, PayPal doesn't have restrictions on shipping addresses, so the merchant can decide who they want to ship to. This can be done using the allowedShippingLocations parameter in the SDK. The merchant can disallow either countries or regions, states, or provinces and PayPal will honor that in our shipping address component and forms.
If the user addes a new address to their Fastlane profile, send the new address in the Orders v2 server-side request.
The following code renders a shipping address for Fastlane members and guest users:
// Code to execute when a user clicks on changeAddressButton
if (renderFastlaneMemberExperience) {
if (profileData.shippingAddress) {
// Render shipping address from the profile
const {
selectedAddress,
selectionChanged
} = await profile.showShippingAddressSelector();
if (selectionChanged) {
// selectedAddress contains the new address
} else {
// Selection modal was dismissed without selection
}
} else {
// Render your shipping address form
}
} else {
// Render your shipping address form
}Fastlane offers two different integration patterns to accept payments; quick start and flexible.
The quick start payment integration loads a pre-built template form to collect payments, requiring less integration effort. It is also PCI DSS compliant, ensuring that customer payment information is handled securely.
The pre-built payment UI component automatically renders the following:
<!-- Div container for the Payment Component -->
<div id="payment-container"></div>
<!-- Submit Button -->
<button id="submit-button">Submit Order</button>const shippingAddress = {
firstName: "Jen",
lastName: "Smith",
company: "Braintree",
streetAddress: "1 E 1st St",
extendedAddress: "5th Floor",
locality: "Bartlett",
region: "IL", // must be sent in 2-letter format
postalCode: "60103",
countryCodeAlpha2: "US",
phoneNumber: "14155551212"
}
const options = {
fields: {
phoneNumber: {
// Example of how to prefill the phone number field in the FastlanePaymentComponent
prefill: "4026607986"
}
},
styles: {
root: { //specify styles here
backgroundColorPrimary: "#ffffff"
}
}
};
const fastlanePaymentComponent = await fastlane.FastlanePaymentComponent({
options,
shippingAddress
});
await fastlanePaymentComponent.render("#payment-container");
// event listener when the user clicks to place the order
const submitButton = document.getElementById("submit-button");
submitButton.addEventListener("click", async ()=> {
const { id } = await fastlanePaymentComponent.getPaymentToken();
// Send the paymentToken and previously captured device data to server
// to complete checkout
});After you receive the paymentTokenId from the paymentToken object, send the paymentTokenId to your server to create a transaction with it.
For more information on the options you can pass to the functions in the previous code sample, see Customize your integration.
When displaying the card from the payer's Fastlane profile, you must inform them by displaying the Fastlane watermark below the card.
For a better payer experience of Fastlane, preload the watermark asset by adding the following code to the <head> section of the page:
<link rel="preload" href="https://www.paypalobjects.com/fastlane-v1/assets/fastlane-with-tooltip_en_sm_light.0808.svg" as="image" type="image/avif" />
<link rel="preload" href="https://www.paypalobjects.com/fastlane-v1/assets/fastlane_en_sm_light" />The flexible payment integration enables you to customize and style the payment page to the look and feel of your website. You can customize how you render:
You'll need to vary your integration for each use case.
profile objectshowCardSelector()FastlaneCardComponent to accept new card information.Pass the billing address and cardholder name in the getPaymentToken() method. When calling the getPaymentToken() method, include the billing address in the request.
If the cardholderName field is disabled in your checkout process, it must still be sent in the getPaymentToken() request.
const name = profileData.name;
const shippingAddress = profileData.shippingAddress;
const card = profileData.card;
var selectedCardForCheckout = card;
if (memberAuthenticatedSuccessfully && card) {
// render the card here
// render Fastlane watermark
// render a change button and call `profile.showCardSelector()` when it is clicked
} else {
// User is a guest, failed to authenticate or does not have a card in the profile.
// render the card fields
const fastlaneCardComponentOptions = {
fields: {
phoneNumber: {
// Example of how to prefill the phone number field in the FastlaneCardComponent
prefill: "4026607986"
},
cardholderName: {
//Example of enabling and prefilling the cardholder name field
prefill: "John Doe",
enabled: true
}
},
styles: {
root: { //specify styles here
backgroundColorPrimary: "#ffffff"
}
}
};
const fastlaneCardComponent = await fastlane.FastlaneCardComponent(
fastlaneCardComponentOptions
);
fastlaneCardComponent.render("#card-container");
}
// Handle changes to the card selection
const changeCardButton = document.getElementById("change-card-button");
changeCardButton.addEventListener("click", async ()=> {
const { selectionChanged, selectedCard } = await profile.showCardSelector();
if (selectionChanged) {
// selectedCard contains the new card
// selectedCard.id contains the paymentToken
// selectedCard.paymentSource.card contains more details such as last 4 card dits
selectedCardForCheckout = selectedCard
// re-render the selected card UI if required
} else {
// selection modal was dismissed without selection
}
});
// Handle form submission
const submitButton = document.getElementById("submit-button");
submitButton.addEventListener("click", async ()=> {
var paymentToken = null;
// if the card component is rendered, pass the billing address and get the payment token
if (selectedCardForCheckout) {
paymentToken = selectedCardForCheckout.id;
} else {
paymentToken = await fastlaneCardComponent.getPaymentToken({
billingAddress: {
addressLine1: "2211 North 1st St",
adminArea1: "CA",
adminArea2: "San Jose",
postalCode: "95131",
countryCode: "US"
}
});
}
// Send the paymentToken ID and previously captured device data to server
// to complete checkout
});When displaying the card from the payer's Fastlane profile, you must inform them by displaying the Fastlane watermark below the card.
For a better payer experience of Fastlane, preload the watermark asset by adding the following code to the <head> section of the page:
<link rel="preload" href="https://www.paypalobjects.com/fastlane-v1/assets/fastlane-with-tooltip_en_sm_light.0808.svg" as="image" type="image/avif" />
<link rel="preload" href="https://www.paypalobjects.com/fastlane-v1/assets/fastlane_en_sm_light" />The image tag in the watermark container div allows the watermark to render instantly.
<!-- add a div where the watermark will render -->
<div id="watermark-container">
<img src="https://www.paypalobjects.com/fastlane-v1/assets/fastlane-with-tooltip_en_sm_light.0808.svg" />
</div>The image tag in the watermark container div allows the watermark to render instantly.
The mouse-over tooltip functionality is added to the image when the Watermark component completes loading. After it loads, the information is displayed when the user hovers over the i icon.
Load card assets for the selected card so that the payer can see their card brand.
<!-- add a div where the watermark will render -->
<div id="watermark-container">
<img src="https://www.paypalobjects.com/fastlane-v1/assets/fastlane_en_sm_light.0296.svg" />
</div>On your server, create an order by calling the Orders API and passing the single-use token, along with the item details and the shipping address.
curl -v -k -X POST 'https://api-m.sandbox.paypal.com/v2/checkout/orders' \
-H 'PayPal-Request-Id: UNIQUE_ID' \
-H 'PayPal-Partner-Attribution-ID: BN-CODE' \
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-TOKEN' \
-H 'Authorization: Bearer PAYPAL_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-H 'PayPal-Client-Metadata-Id: <CM_ID>' \
-d '{
"intent": "CAPTURE",
"payment_source": {
"card": {
"single_use_token": "1h371660pr490622k" //paymentToken from the client
}
},
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": "50.00",
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": "40.00"
},
"shipping": {
"currency_code": "USD",
"value": "10.00"
}
}
},
"items": [
{
"name": "Coffee",
"description": "1 lb Kona Island Beans",
"sku": "sku03",
"unit_amount": {
"currency_code": "USD",
"value": "40.00"
},
"quantity": "1",
"category": "PHYSICAL_GOODS",
"image_url": "https://example.com/static/images/items/1/kona_coffee_beans.jpg",
"url": "https://example.com/items/1/kona_coffee_beans",
"upc": {
"type": "UPC-A",
"code": "987654321015"
}
}
],
"shipping": {
"type": "SHIPPING",
"name": {
"full_name": "Lawrence David"
},
"address": {
"address_line_1": "585 Moreno Ave",
"admin_area_2": "Los Angeles",
"admin_area_1": "CA", //must be sent in 2-letter format
"postal_code": "90049",
"country_code": "US"
},
"phone_number": {
"country_code": "1",
"national_number": "5555555555"
}
}
}
]
}'Store pick-up: If the buyer is picking up the item from a storefront, modify the shipping type parameter in the call and ensure the shipping method is set to PICKUP_IN_STORE. This ensures that buyer profiles aren't created with the address of your store as their shipping address.
Vaulting: You can save a payment method with or without a transaction.
paymentToken returned by the Fastlane SDK at the time of transaction, you can do so only when using the store_in_vault attribute in the request to /v2/orders on your server. This returns a payment token, which can be vaulted before or after a transaction and used for future transactions. See the Orders v2 documentation for more details.paymentToken returned by the Fastlane SDK without completing the transaction, then the payment token is generated but the Fastlane profile is not created for the customer. The Fastlane profile is created only for vaulting customers if they also complete a transaction during checkout.You'll need to test your integration for guest payers and Fastlane members, with and without the consent toggle on. Testing varies depending on whether your integration is quick start or flexible.
Guest payers enter an email not associated with a PayPal account or Fastlane profile. Make sure you have the following before you start testing the guest payer flow:
111-111-1111. No SMS is sent in sandbox mode.When you complete the transaction with the consent toggle on, a Fastlane profile is created. Use that profile to test transactions as a Fastlane member.
| User flow | Result |
|---|---|
The FastlanePaymentComponent renders card fields and the consent toggle. The buyer turns the consent toggle off and completes the order. | The payment is completed successfully and no Fastlane profile is created. |
| User flow | Result |
|---|---|
The FastlanePaymentComponent renders card fields and the consent toggle. The buyer completes the order with the consent toggle on. | The payment is completed successfully and a Fastlane profile is created for the email the guest entered. |
A Fastlane member enters a recognized email at checkout.
A Fastlane member enters a recognized email at checkout.
111111 to trigger a successful authentication and any other 6-digit number to simulate a failed authentication.Note: Make sure to test the payer's ability to update the addresses and cards associated with their profile.
| Scenario | User flow | Result |
|---|---|---|
| Happy path |
| The buyer completes the order. |
| OTP failed or cancelled |
|
|
| New address |
|
|
| New card |
|
|
| Change address |
| The buyer completes the order with changed address. |
| Change card |
| The buyer completes the order with selected card. |
| No card or unsupported card |
|
|
| No address or address in unsupported region |
|
|
PayPal members who choose not to save their profile are treated as guest users.
PayPal members who choose to save their profile are treated as returning Fastlane members for future transactions.
PayPal members do not require any additional handling within your integration because our client SDK handles this use case for you in the following ways:
lookupCustomerByEmail method, we return a customerContextId as if this were a Fastlane member.triggerAuthenticationFlow method, our SDK displays a call to action to the buyer explaining that they can create a Fastlane profile populated with information from their PayPal account with one click.profileData exactly as we would for a Fastlane member.profileData object and you would handle this as you would any Fastlane guest member.| Brand | Card number |
|---|---|
| Visa | 4005 5192 0000 0004 |
| Visa | 4012 0000 3333 0026 |
| Visa | 4012 0000 7777 7777 |
| Mastercard | 5555 5555 5555 4444 |
| American Express | 3782 822463 10005 |
Guest payers enter an email not associated with a PayPal account or Fastlane profile. Make sure you have the following before you start testing the guest payer flow:
When you complete the transaction with the consent toggle on, a Fastlane profile is created. Use that profile to test transactions as a Fastlane member.
| User flow | Result |
|---|---|
Shipping address fields are rendered. The FastlaneCardComponent renders card fields and the consent toggle. The buyer turns the consent toggle off and completes the order. | The payment is completed successfully and no Fastlane profile is created. |
| User flow | Result |
|---|---|
Shipping address fields are rendered. The FastlaneCardComponent renders card fields and the consent toggle. The buyer turns the consent toggle on and completes the order. | The payment is completed successfully and a Fastlane profile is created for the email the guest entered. |
A Fastlane member enters a recognized email at checkout.
| Scenario | User flow | Result |
|---|---|---|
| Happy path |
| The buyer completes the order. |
| OTP failed or cancelled |
|
|
| New address |
|
|
| New card |
|
|
| Change address |
| The buyer completes the order with changed address. |
| Change card |
| The buyer completes the order with selected card. |
| No card or unsupported card |
|
|
| No address or address in unsupported region |
|
|
PayPal members who choose not to save their profile are treated as guest users.
PayPal members who choose to save their profile are treated as returning Fastlane members for future transactions.
PayPal members do not require any additional handling within your integration because our client SDK handles this use case for you in the following ways:
lookupCustomerByEmail method, we return a customerContextId as if this were a Fastlane member.triggerAuthenticationFlow method, our SDK displays a call to action to the buyer explaining that they can create a Fastlane profile populated with information from their PayPal account with one click.profileData exactly as we would for a Fastlane member.profileData object and you would handle this as you would any Fastlane guest member.| Brand | Card number |
|---|---|
| Visa | 4005 5192 0000 0004 |
| Visa | 4012 0000 3333 0026 |
| Visa | 4012 0000 7777 7777 |
| Mastercard | 5555 5555 5555 4444 |
| American Express | 3782 822463 10005 |
If you have fulfilled the requirements for accepting card payments via Fastlane for your business account, review Move your app to production to test and go live.
Select Advanced Credit and Debit Card Payments on your REST app. The merchant will be signed up for advanced credit and debit after onboarding through the Partner Referral API.
Optionally customize your Fastlane integration.
Troubleshooting, FAQs, and how to customize your integration.