---
schema_version: "1"
id: aced44cc6d61af456394efe25174696692558c859948664b4cae60c2d58201d7
title: Configure One-Click Checkout for Your B2C Commerce Composable Storefronts
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/pwa-kit-managed-runtime/guides/one-click-checkout.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/one-click-checkout.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7f08671d58c7c737eb9b8673a9cc138528887e844c74aa20730011d1a603b250
products:
  - Composable Storefront
  - Salesforce APIs
---
# Configure One-Click Checkout for Your B2C Commerce Composable Storefronts

One-click checkout streamlines the checkout experience for shoppers in your B2C Commerce Composable storefronts. When a first-time shopper checks out, they can save their checkout information for future use. If the shopper selects **Create an account to check out faster,** a one-time password (OTP) window appears where they can enter the code sent to their email address. After the shopper verifies their email address, the system creates an account for them with your store and saves their shipping and payment information for future use.

![Save payment, address, and contact information for future use with one-click checkout](https://developer.salesforce.com/docs/media/pwa-kit-managed-runtime/one_click_checkout.png '{"class": "image-xl"}')

If a registered shopper returns to make another purchase, the shopper only needs to enter their email address and a verification code to check out. Their default or first saved shipping address and payment information is automatically filled in.

Shoppers always have the option to check out as a guest. Additionally, shoppers can log into their account to view their saved shipping and payment information.

Set up one-click checkout for B2C Commerce Composable storefronts.

1. If your PWA Kit isn’t version 3.17 or later, [Upgrade to v3](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-to-v3.html).

2. In `packages/template-retail-react-app/config/default.js`, set `oneClickCheckout.enabled` to `true`.

```
//config/default.js
app: {
    // …existing config
    oneClickCheckout: {
        enabled: true
    }
}
```

3. Create a SLAS private client. See [Use a SLAS Private Client](https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/use-a-slas-private-client.html#configure-the-pwa-kit).
4. In `packages/template-retail-react-app/ssr.js`, add the `onSLASPrivateProxyRes` callback to the runtime options to handle the passwordless login responses.

```
onSLASPrivateProxyRes: (responseBuffer, proxyRes, req, res) => {
    // Undo the 404 → 200 masking for /oauth2/passwordless/login
    if (req.path?.match(/\/oauth2\/passwordless\/login/) && proxyRes.statusCode === 404) {
        res.statusCode = 404
        res.statusMessage = 'Not Found'
    }
    return responseBuffer
},
```

5. To send shoppers a one-time password via email, [Configure Email Templates](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas-passwordless-login-email.html#3-configure-email-templates).
6. To maintain security, we recommend that you implement these safegaurds.

   a. Captcha - Protects the passwordless login from bots.

   b. OTP for Email Changes - Verifies your identity before an email update, prevents accidental account lockouts from typos, and prevents unauthorized users from gaining access to saved payment methods.
