WooCommerce 10 Shareable Checkout URLs: Complete Guide with Examples

WooCommerce 10, scheduled for release on July 7, 2025, introduces a game-changing feature that will revolutionize how merchants share products: Shareable Checkout URLs. This powerful new functionality allows you to create custom links that automatically populate customers' carts with specific products and redirect them straight to checkout.

Whether you're running email campaigns, sharing on social media, or creating targeted landing pages, shareable checkout URLs eliminate friction and streamline the path to purchase. Let's dive deep into how this feature works and explore practical implementation strategies.

What Are Shareable Checkout URLs?

Shareable checkout URLs are specially formatted links that can:

  • Pre-populate carts with specific products and quantities
  • Apply coupon codes automatically
  • Redirect customers directly to the checkout page
  • Create persistent sessions that work across devices and browsers
  • Handle complex scenarios with multiple products and variations

This feature builds upon WooCommerce's existing cart functionality but adds sophisticated session management and error handling that makes it production-ready for marketing campaigns.

The closest extension I found on WooCommerce.com that provides similar features (and more) is Smartlink Discount URLs.

How Shareable Checkout URLs Work

The new system introduces a dedicated /checkout-link endpoint that processes specially formatted URLs and creates temporary cart sessions. Here's the basic flow:

  1. Customer clicks the shareable checkout URL
  2. WooCommerce processes the products and coupons in the URL
  3. Cart is populated with the specified items
  4. Customer is redirected to checkout with pre-filled cart
  5. Session persists across browsers via unique tokens

URL Structure and Format

The basic format for shareable checkout URLs is:

https://yourstore.com/checkout-link/?products=ID:QTY,ID:QTY&coupon=COUPONCODE

Single Product Example:

https://store.com/checkout-link/?products=123

Multiple Products with Quantities:

https://store.com/checkout-link/?products=123:2,456:1,789:3

Products with Coupon:

https://store.com/checkout-link/?products=123:2,456:1&coupon=SUMMER25

URL Encoded Version:

https://store.com/checkout-link/?products=123%3A2%2C456%3A1&coupon=SUMMER25

Key Features and Benefits

1. Advanced Session Management

According to the GitHub PR #58140, the new system includes sophisticated session handling:

  • Token-based sessions that work across devices
  • Session cloning for sharing between logged-in and guest users
  • Persistent cart state that survives browser restarts
  • Security measures to prevent session hijacking

2. Intelligent Error Handling

The system provides user-friendly error messages for common scenarios:

  • Invalid products: "Product with ID '999999' was not found and cannot be added to the cart."
  • Invalid coupons: "Coupon 'INVALID_COUPON' cannot be applied because it does not exist."
  • Mixed scenarios: Valid products are added while invalid ones show appropriate errors
  • Complete failure: "The provided checkout link was out of date or invalid. No products were added to the cart."

3. Marketing Campaign Integration

Perfect for various marketing channels:

  • Email campaigns: Create product-specific links for newsletters
  • Social media: Share ready-to-buy bundles on Instagram, Facebook
  • Landing pages: Convert visitors with one-click checkout flows
  • Affiliate marketing: Provide partners with trackable product links
  • SMS marketing: Send short, actionable purchase links

Practical Implementation Examples

Let's explore real-world scenarios where shareable checkout URLs shine:

Email Marketing Campaign

<!-- Summer Sale Email Template -->
<h2>🌞 Summer Sale Bundle - Ready to Checkout!</h2>
<p>We've pre-selected our best summer products for you:</p>

<a href="https://yourstore.com/checkout-link/?products=summer-hat:1,sunglasses:1,beach-towel:2&coupon=SUMMER30"
   style="background: #ff6b35; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px;">
   Buy Summer Bundle - 30% Off 🏖️
</a>

<p><small>Includes: Summer Hat, Sunglasses, 2x Beach Towels + 30% discount</small></p>

Social Media Posts

🔥 FLASH SALE: Get our bestselling trio for just $49!

✨ Premium Face Cream
✨ Vitamin C Serum
✨ Gentle Cleanser

One-click checkout: https://yourstore.com/checkout-link/?products=face-cream:1,vitamin-c:1,cleanser:1&coupon=FLASH49

⏰ Limited time only!
#skincare #flashsale #beauty

Landing Page Integration

<!DOCTYPE html>
<html>
<head>
    <title>Holiday Gift Bundle</title>
</head>
<body>
    <div class="hero">
        <h1>Perfect Holiday Gift Bundle</h1>
        <p>Everything you need for the perfect gift, pre-selected and ready to buy.</p>

        <!-- Single product bundle -->
        <a href="https://yourstore.com/checkout-link/?products=gift-box-deluxe:1&coupon=HOLIDAY20"
           class="cta-button">
           Buy Deluxe Gift Box - $120 $96
        </a>

        <!-- Custom bundle -->
        <a href="https://yourstore.com/checkout-link/?products=scarf:1,candle:2,chocolate:1&coupon=BUNDLE15"
           class="cta-button-secondary">
           Create Custom Bundle - Save 15%
        </a>
    </div>
</body>
</html>

Advanced Use Cases

Note: The following examples assume you've created the corresponding coupon codes in your WooCommerce admin (WooCommerce > Marketing > Coupons). For example: WELCOME_BACK, BESTSELLER10, PREVIEW15, FACEBOOK10, etc.

1. Personalized Recommendations

Based on customer purchase history from core WooCommerce data, you can create personalized checkout links:

// Generate personalized checkout URL based on customer's actual order history
function generate_personalized_checkout_url( $customer_id ) {
    $customer = new WC_Customer( $customer_id );

    // Get customer's order history using core WooCommerce
    $orders = wc_get_orders( array(
        'customer' => $customer_id,
        'status' => 'completed',
        'limit' => 5, // Last 5 orders
    ) );

    $purchased_products = array();
    $purchased_categories = array();

    // Analyze purchase history
    foreach ( $orders as $order ) {
        foreach ( $order->get_items() as $item ) {
            $product_id = $item->get_product_id();
            $product = wc_get_product( $product_id );

            if ( $product ) {
                $purchased_products[] = $product_id;

                // Get product categories
                $category_ids = $product->get_category_ids();
                $purchased_categories = array_merge( $purchased_categories, $category_ids );
            }
        }
    }

    // Find related products from frequently purchased categories
    $category_counts = array_count_values( $purchased_categories );
    arsort( $category_counts );
    $top_category = key( $category_counts );

    if ( $top_category ) {
        // Get products from the customer's favorite category
        $recommended_products = wc_get_products( array(
            'category' => array( $top_category ),
            'exclude' => $purchased_products, // Don't recommend already purchased
            'limit' => 3,
            'status' => 'publish',
            'stock_status' => 'instock',
        ) );

        if ( ! empty( $recommended_products ) ) {
            $product_string = implode( ',', array_map( function( $product ) {
                return $product->get_id() . ':1';
            }, $recommended_products ) );

            // Use a generic returning customer coupon (you'd create this in WooCommerce admin)
            $coupon_code = 'WELCOME_BACK';

            return home_url( "/checkout-link/?products={$product_string}&coupon={$coupon_code}" );
        }
    }

    // Fallback: recommend best-selling products
    $bestsellers = wc_get_products( array(
        'meta_key' => 'total_sales',
        'orderby' => 'meta_value_num',
        'order' => 'DESC',
        'limit' => 3,
        'status' => 'publish',
        'stock_status' => 'instock',
    ) );

    if ( ! empty( $bestsellers ) ) {
        $product_string = implode( ',', array_map( function( $product ) {
            return $product->get_id() . ':1';
        }, $bestsellers ) );

        return home_url( "/checkout-link/?products={$product_string}&coupon=BESTSELLER10" );
    }

    return home_url( '/shop' ); // Fallback to shop page
}

2. Abandoned Cart Recovery

Convert abandoned carts into shareable checkout URLs for remarketing:

// Convert abandoned cart to shareable URL
function create_checkout_url_from_abandoned_cart( $cart_data ) {
    $products = array();

    foreach ( $cart_data as $item ) {
        $products[] = $item['product_id'] . ':' . $item['quantity'];
    }

    $product_string = implode( ',', $products );
    $coupon = 'COMEBACK10'; // Special return coupon

    return home_url( "/checkout-link/?products={$product_string}&coupon={$coupon}" );
}

3. Subscription Box Previews

Allow customers to preview and purchase subscription boxes using product categories:

// Generate subscription box checkout URL based on product categories
function generate_subscription_preview_url( $box_type, $month ) {
    // Map box types to WooCommerce product categories (you'd set these up in admin)
    $category_mapping = array(
        'beauty' => 'beauty-box',
        'food' => 'gourmet-box',
        'books' => 'book-club',
        'tech' => 'gadget-box'
    );

    if ( ! isset( $category_mapping[ $box_type ] ) ) {
        return home_url( '/shop' );
    }

    $category_slug = $category_mapping[ $box_type ];

    // Get products from the subscription box category
    $box_products = wc_get_products( array(
        'category' => array( $category_slug ),
        'limit' => 5, // Typical box size
        'status' => 'publish',
        'stock_status' => 'instock',
        'orderby' => 'rand', // Random selection for variety
    ) );

    if ( empty( $box_products ) ) {
        return home_url( '/shop' );
    }

    $products = array_map( function( $product ) {
        return $product->get_id() . ':1';
    }, $box_products );

    $product_string = implode( ',', $products );

    // Use a preview-specific coupon (create this in WooCommerce admin)
    $coupon_code = 'PREVIEW15';

    return home_url( "/checkout-link/?products={$product_string}&coupon={$coupon_code}" );
}

// Example usage:
// $beauty_box_url = generate_subscription_preview_url( 'beauty', '2025-07' );
// $food_box_url = generate_subscription_preview_url( 'food', '2025-07' );

Session Token Management

One of the most powerful aspects of this feature is the session token system. When customers visit a checkout link, WooCommerce creates a unique session token that allows the cart to persist across:

Cross-Device Shopping

Original link: https://store.com/checkout-link/?products=123:2&coupon=TEST
Persistent link: https://store.com/checkout/?session=abc123def456

Customers can:

  • Start checkout on mobile
  • Continue on desktop
  • Share the session link with family members
  • Complete purchase later without losing cart contents

Implementation for Developers

// Detect if customer arrived via checkout link
if ( window.location.pathname === '/checkout' &&
     new URLSearchParams( window.location.search ).get( 'session' ) ) {

    // Track checkout link conversion
    gtag( 'event', 'checkout_link_conversion', {
        'session_token': new URLSearchParams( window.location.search ).get( 'session' ),
        'referrer': document.referrer
    });

    // Customize checkout experience for linked customers
    document.body.classList.add( 'checkout-via-link' );
}

Security Considerations

The new shareable checkout URLs include several security measures:

1. Session Isolation

  • Each checkout link creates an isolated session
  • Sessions don't interfere with existing customer sessions
  • Logged-in customers get session cloning, not session replacement

2. Token Expiration

  • Session tokens have configurable expiration times
  • Expired links redirect to cart with appropriate messaging
  • Prevents long-term session hijacking

3. Validation and Sanitization

  • All product IDs are validated before cart addition
  • Coupon codes are checked for validity and applicability
  • Quantities are sanitized to prevent exploitation

Best Practices for Implementation

1. URL Structure Best Practices

// Good: Clear, readable structure
https://store.com/checkout-link/?products=laptop:1,mouse:1&coupon=TECH20

// Better: Use product SKUs for clarity
https://store.com/checkout-link/?products=SKU123:1,SKU456:1&coupon=TECH20

// Best: Include tracking parameters
https://store.com/checkout-link/?products=SKU123:1&coupon=EMAIL15&utm_source=newsletter&utm_campaign=weekly

2. Error Handling Strategy

// Custom error handling for checkout links
function handle_checkout_link_errors() {
    if ( isset( $_GET['checkout_link_error'] ) ) {
        $error_type = sanitize_text_field( $_GET['checkout_link_error'] );

        switch ( $error_type ) {
            case 'invalid_products':
                wc_add_notice(
                    __( 'Some products in your link were unavailable. We\'ve added what we could find.', 'textdomain' ),
                    'notice'
                );
                break;

            case 'invalid_coupon':
                wc_add_notice(
                    __( 'The coupon in your link has expired, but your products are still available.', 'textdomain' ),
                    'notice'
                );
                break;

            case 'complete_failure':
                wc_add_notice(
                    __( 'This checkout link has expired. Please browse our current products.', 'textdomain' ),
                    'error'
                );
                wp_redirect( wc_get_page_permalink( 'shop' ) );
                exit;
        }
    }
}
add_action( 'template_redirect', 'handle_checkout_link_errors' );

3. Performance Optimization

// Cache product validation for frequently used checkout links
function validate_checkout_link_products( $product_string ) {
    $cache_key = 'checkout_link_products_' . md5( $product_string );
    $cached_result = wp_cache_get( $cache_key );

    if ( false !== $cached_result ) {
        return $cached_result;
    }

    $products = array();
    $product_pairs = explode( ',', $product_string );

    foreach ( $product_pairs as $pair ) {
        list( $id, $qty ) = explode( ':', $pair . ':1' );

        $product = wc_get_product( $id );
        if ( $product && $product->is_purchasable() ) {
            $products[] = array(
                'id' => $id,
                'qty' => absint( $qty ),
                'valid' => true
            );
        } else {
            $products[] = array(
                'id' => $id,
                'qty' => absint( $qty ),
                'valid' => false
            );
        }
    }

    wp_cache_set( $cache_key, $products, '', HOUR_IN_SECONDS );
    return $products;
}

Analytics and Tracking

1. Google Analytics 4 Integration

// Track checkout link performance
function trackCheckoutLinkUsage() {
    // Check if user arrived via checkout link
    const urlParams = new URLSearchParams( window.location.search );
    const hasSession = urlParams.get( 'session' );
    const utmSource = urlParams.get( 'utm_source' );

    if ( hasSession ) {
        gtag( 'event', 'checkout_link_used', {
            'session_token': hasSession,
            'utm_source': utmSource || 'direct',
            'page_location': window.location.href
        });
    }
}

// Track successful conversions
function trackCheckoutLinkConversion( orderData ) {
    if ( orderData.session_token ) {
        gtag( 'event', 'purchase_via_checkout_link', {
            'transaction_id': orderData.order_id,
            'session_token': orderData.session_token,
            'value': orderData.total,
            'currency': orderData.currency
        });
    }
}

2. Campaign Performance Tracking

// Track checkout link performance by campaign
function track_checkout_link_campaign( $session_token, $utm_data ) {
    global $wpdb;

    $wpdb->insert(
        $wpdb->prefix . 'checkout_link_campaigns',
        array(
            'session_token' => $session_token,
            'utm_source' => $utm_data['source'],
            'utm_medium' => $utm_data['medium'],
            'utm_campaign' => $utm_data['campaign'],
            'created_at' => current_time( 'mysql' ),
            'converted' => 0
        ),
        array( '%s', '%s', '%s', '%s', '%s', '%d' )
    );
}

// Update conversion status
function update_checkout_link_conversion( $session_token ) {
    global $wpdb;

    $wpdb->update(
        $wpdb->prefix . 'checkout_link_campaigns',
        array( 'converted' => 1, 'converted_at' => current_time( 'mysql' ) ),
        array( 'session_token' => $session_token ),
        array( '%d', '%s' ),
        array( '%s' )
    );
}

Integration with Popular Marketing Tools

1. Mailchimp Integration

// Generate Mailchimp-compatible checkout links
function generate_mailchimp_checkout_links( $campaign_data ) {
    $base_url = home_url( '/checkout-link/' );
    $products = $campaign_data['products'];
    $coupon = $campaign_data['coupon'];

    $product_string = implode( ',', array_map( function( $p ) {
        return $p['id'] . ':' . $p['qty'];
    }, $products ) );

    $tracking_params = array(
        'utm_source' => 'mailchimp',
        'utm_medium' => 'email',
        'utm_campaign' => $campaign_data['campaign_name']
    );

    $url = add_query_arg( array(
        'products' => $product_string,
        'coupon' => $coupon
    ), $base_url );

    return add_query_arg( $tracking_params, $url );
}

2. Facebook/Instagram Shopping

// Create social commerce checkout links with platform-specific coupons
function create_social_commerce_links( $product_id, $platform ) {
    $product = wc_get_product( $product_id );

    if ( ! $product ) {
        return home_url( '/shop' );
    }

    // Map social platforms to specific coupon codes (create these in WooCommerce admin)
    $platform_coupons = array(
        'facebook' => 'FACEBOOK10',
        'instagram' => 'INSTA15',
        'twitter' => 'TWITTER5',
        'pinterest' => 'PINTEREST10',
        'tiktok' => 'TIKTOK20'
    );

    // Get the appropriate coupon for the platform, or use default
    $coupon_code = isset( $platform_coupons[ $platform ] )
        ? $platform_coupons[ $platform ]
        : 'SOCIAL10';

    $base_url = home_url( '/checkout-link/' );
    $tracking_params = array(
        'utm_source' => $platform,
        'utm_medium' => 'social',
        'utm_campaign' => 'social_commerce'
    );

    $url = add_query_arg( array(
        'products' => $product_id . ':1',
        'coupon' => $coupon_code
    ), $base_url );

    return add_query_arg( $tracking_params, $url );
}

// Example usage:
// $instagram_link = create_social_commerce_links( 123, 'instagram' );
// $facebook_link = create_social_commerce_links( 123, 'facebook' );

Testing and Quality Assurance

WooCommerce 10 includes comprehensive E2E tests for the shareable checkout URLs feature. Here's how to test your implementation:

1. Manual Testing Checklist

✅ Valid single product link
✅ Valid multiple products with quantities
✅ Valid products with coupon code
✅ Invalid coupon handling
✅ Invalid product handling (mixed scenario)
✅ Complete invalid link handling
✅ Session persistence across browsers
✅ Mobile responsiveness
✅ Performance with large product lists
✅ Security validation

2. Automated Testing

// Example Playwright test
const { test, expect } = require( '@playwright/test' );

test( 'Shareable checkout URL with valid products and coupon', async ({ page }) => {
    // Visit checkout link
    await page.goto( '/checkout-link/?products=18:2,19:1&coupon=TEST' );

    // Should redirect to checkout
    await expect( page ).toHaveURL( /\/checkout/ );

    // Verify products in cart
    await expect( page.locator( '.cart-item' ) ).toHaveCount( 2 );

    // Verify coupon applied
    await expect( page.locator( '.coupon-test' ) ).toBeVisible();

    // Verify total calculation
    const total = await page.locator( '.order-total .amount' ).textContent();
    expect( total ).toMatch( /\$[\d,]+\.\d{2}/ );
});

Migration from Existing Solutions

If you're currently using custom add-to-cart URLs or third-party solutions:

1. From Simple Add-to-Cart URLs

// Old format: /?add-to-cart=123
// New format: /checkout-link/?products=123

function migrate_old_cart_urls() {
    if ( isset( $_GET['add-to-cart'] ) && ! isset( $_GET['products'] ) ) {
        $product_id = intval( $_GET['add-to-cart'] );
        $quantity = isset( $_GET['quantity'] ) ? intval( $_GET['quantity'] ) : 1;

        $new_url = home_url( "/checkout-link/?products={$product_id}:{$quantity}" );

        wp_redirect( $new_url );
        exit;
    }
}
add_action( 'template_redirect', 'migrate_old_cart_urls' );

2. From Third-Party Plugins

// Migrate from popular cart link plugins
function migrate_third_party_cart_links() {
    // Example: CartFlows or similar plugins
    if ( isset( $_GET['cartflows_cart'] ) ) {
        $products = sanitize_text_field( $_GET['cartflows_cart'] );
        $coupon = isset( $_GET['cartflows_coupon'] ) ? sanitize_text_field( $_GET['cartflows_coupon'] ) : '';

        $redirect_url = home_url( "/checkout-link/?products={$products}" );
        if ( $coupon ) {
            $redirect_url .= "&coupon={$coupon}";
        }

        wp_redirect( $redirect_url );
        exit;
    }
}

Future-Proofing Your Implementation

WooCommerce's shareable checkout URLs are designed to evolve. Here's how to future-proof your implementation:

1. Extensible URL Parameters

// Use action hooks for custom parameters
function handle_custom_checkout_link_params( $params ) {
    if ( isset( $params['gift_message'] ) ) {
        WC()->session->set( 'gift_message', sanitize_textarea_field( $params['gift_message'] ) );
    }

    if ( isset( $params['delivery_date'] ) ) {
        WC()->session->set( 'preferred_delivery', sanitize_text_field( $params['delivery_date'] ) );
    }
}
add_action( 'woocommerce_checkout_link_process_params', 'handle_custom_checkout_link_params' );

2. API Integration Hooks

// Hook into checkout link creation for external systems
function log_checkout_link_creation( $products, $coupon, $session_token ) {
    // Send to analytics
    // Update CRM
    // Trigger webhooks

    do_action( 'custom_checkout_link_created', $products, $coupon, $session_token );
}
add_action( 'woocommerce_checkout_link_created', 'log_checkout_link_creation', 10, 3 );

Conclusion

WooCommerce 10's shareable checkout URLs represent a significant leap forward in e-commerce user experience and marketing capabilities. By eliminating the traditional "browse → add to cart → checkout" flow, these URLs create frictionless purchase paths that can dramatically improve conversion rates.

Key Takeaways:

  1. Simplified purchasing: Customers go from link click to checkout in one step
  2. Enhanced marketing: Create targeted campaigns with pre-filled carts
  3. Cross-device continuity: Session tokens enable seamless shopping experiences
  4. Robust error handling: Graceful degradation for invalid products or coupons
  5. Security-first design: Built-in protections against common exploits

Getting Started:

  1. Update to WooCommerce 10 when it releases on July 7, 2025
  2. Test the basic functionality with simple product links
  3. Integrate with your marketing tools and campaigns
  4. Monitor performance and optimize based on analytics
  5. Plan advanced implementations for personalization and automation