Checkout Failures
Symptoms
Section titled “Symptoms”- “Proceed to Checkout” button does nothing
- Checkout redirect fails or shows error page
- “Failed to generate checkout URL” error message
- Customer stuck on cart page, can’t complete purchase
Common Causes
Section titled “Common Causes”1. Cart Data Issues
Section titled “1. Cart Data Issues”- No active cart cookie found
- Cart ID expired or invalid
- Empty cart attempting checkout
- Cart-cookie domain mismatch
2. BigCommerce Connection Problems
Section titled “2. BigCommerce Connection Problems”- GraphQL API authentication failure
- Checkout URL generation API timeout
- Store channel not properly configured
- Expired or invalid access token
3. Redirect URL Failures
Section titled “3. Redirect URL Failures”- Null checkout URL returned from API
- CORS issues blocking redirect
- Browser blocking third-party cookies
- Customer logged into wrong BigCommerce account
Solutions
Section titled “Solutions”Check Cart Cookie
Section titled “Check Cart Cookie”Verify the cart cookie exists and is valid:
- Open browser DevTools (F12)
- Go to Application → Cookies
- Look for
bigcommerce_cart_idcookie - Verify cookie domain matches your WordPress® site domain
If cookie missing or domain wrong:
- Clear all cookies for the site
- Add item to cart to generate new cart
- Verify cart cookie appears with correct domain
Test GraphQL Connection
Section titled “Test GraphQL Connection”Verify BigCommerce API connectivity:
- Go to Commerce Connect → Settings → Connection
- Click “Test Connection” button
- Check API status - should show “Connected”
If connection fails:
- Verify store URL in settings matches BigCommerce store
- Check access token is valid and not expired
- Regenerate token in BigCommerce admin if needed
Debug Checkout URL Generation
Section titled “Debug Checkout URL Generation”Check if checkout URL is being created:
-
Enable WordPress® debug logging in
wp-config.php:define('WP_DEBUG', true);define('WP_DEBUG_LOG', true); -
Attempt checkout and check logs:
Terminal window tail -f wp-content/debug.log | grep "checkout" -
Look for specific errors:
No active cart found- Cart cookie missing or invalidFailed to create checkout redirect URLs- API request failedNull checkout URL returned- API returned empty response
Fix Cart Cookie Domain Issues
Section titled “Fix Cart Cookie Domain Issues”If cart works but checkout fails due to domain mismatch:
-
Verify WordPress® site URL:
Terminal window wp option get siteurl -
Check cookie domain in DevTools matches site URL
-
Clear browser cookies completely
-
Add product to cart again to regenerate cookie with correct domain
Handle Empty Cart Errors
Section titled “Handle Empty Cart Errors”If error says “No active cart found”:
-
Verify cart has items before attempting checkout
-
Check cart API response:
// In browser consolefetch('/wp-json/commerce-connect/v1/cart').then((r) => r.json()).then(console.log); -
Expected response: Cart object with line items
-
If empty or error: Clear cookies and rebuild cart
Fix CORS/Third-Party Cookie Issues
Section titled “Fix CORS/Third-Party Cookie Issues”Modern browsers block third-party cookies by default:
- Verify BigCommerce checkout domain is whitelisted
- Check browser console for CORS errors
- Test in incognito mode to rule out browser extensions
- Consider embedded checkout instead of redirect (future feature)
Verification
Section titled “Verification”After applying fixes:
- Clear browser cache and cookies completely
- Add product to cart from WordPress® site
- Click “Proceed to Checkout” button
- Verify redirect to BigCommerce checkout page
- Confirm cart items appear in checkout
- Complete test purchase (or cancel at payment step)
Success indicators:
- Smooth redirect to BigCommerce checkout URL
- Cart items display correctly in checkout
- Customer information pre-filled (if logged in)
- No JavaScript errors in browser console
Prevention
Section titled “Prevention”Monitor API Health
Section titled “Monitor API Health”- Test checkout flow weekly with test product
- Monitor error logs for checkout-related failures
- Set up uptime monitoring for BigCommerce API (optional)
- Subscribe to BigCommerce status updates at status.bigcommerce.com
Maintain Token Freshness
Section titled “Maintain Token Freshness”- BigCommerce access tokens are long-lived but can expire
- Plugin handles refresh automatically when possible
- Monitor connection status in admin dashboard
- Regenerate token manually if persistent failures occur
Optimize Cookie Configuration
Section titled “Optimize Cookie Configuration”- Use consistent domain across WordPress® and checkout
- Avoid switching between www/non-www URLs
- Ensure HTTPS is enforced site-wide
- Test cross-browser (Chrome, Safari, Firefox) regularly
Customer Communication
Section titled “Customer Communication”For customer-facing checkout issues:
- Display clear error messages when checkout fails
- Provide fallback instructions: “Try clearing cookies and adding to cart again”
- Offer support contact for persistent problems
- Consider alternate checkout link to BigCommerce directly as backup
Advanced Debugging
Section titled “Advanced Debugging”Inspect GraphQL Requests
Section titled “Inspect GraphQL Requests”Check the actual API request/response:
-
Open browser DevTools → Network tab
-
Filter by “graphql”
-
Click “Proceed to Checkout”
-
Inspect request payload:
{"query": "mutation createCartRedirectUrls...","variables": {"input": {"cartEntityId": "abc-123"}}} -
Check response for
redirectedCheckoutUrlfield
Common GraphQL Error Codes
Section titled “Common GraphQL Error Codes”| Error | Cause | Solution |
|---|---|---|
UNAUTHORIZED | Invalid/expired token | Regenerate access token |
NOT_FOUND | Cart ID doesn’t exist | Clear cookies, rebuild cart |
VALIDATION_ERROR | Invalid cart data | Check product variants/options |
INTERNAL_ERROR | BigCommerce API issue | Wait and retry, check status page |
WordPress® Error Log Patterns
Section titled “WordPress® Error Log Patterns”Key log messages to watch for:
Failed to create checkout redirect URLs→ BigCommerce API rejected the request. Check cart ID validity and connection status.
Null checkout URL returned→ API response missing expected field. Verify GraphQL query matches BigCommerce API version.
No active cart found→ Cart cookie missing or cart expired. Customer needs to rebuild cart.
Test with WP-CLI
Section titled “Test with WP-CLI”Manually test cart and checkout operations:
# Get current cart (requires cart cookie context)wp eval 'do_action("rest_api_init"); $response = rest_do_request("/commerce-connect/v1/cart"); print_r($response->get_data());'
# Check if checkout endpoint is registeredwp rest-api list-routes | grep checkoutCart Cookie Lifecycle
Section titled “Cart Cookie Lifecycle”Understanding cart persistence:
- Creation: Cookie set when first item added to cart
- Expiration: Default 30 days (configured in BigCommerce)
- Update: Cookie value updated after each cart mutation
- Deletion: Cleared after successful order or manual logout
- Validation: Checked on every cart operation
If cart cookie present but checkout fails:
- Cart may have expired on BigCommerce side
- Customer may have completed/abandoned cart previously
- Solution: Delete cart cookie and rebuild cart fresh