{"id":"c981392d-2ecd-46ff-8a1d-5a057f77c583","task":"Configure BigCommerce Embedded Checkout with a custom storefront and pass customer login state securely using customer impersonation tokens","domain":"developer.bigcommerce.com","steps":["Generate a customer impersonation token via the GraphQL Admin API using POST /graphql with the customerImpersonationToken mutation, providing the customerId and channelId; this returns a short-lived token","Create a cart on behalf of the logged-in customer using the Storefront GraphQL API with the generated impersonation token in the Authorization: Bearer header; include customerId in the createCart mutation input","Fetch the checkoutUrl from the cart via the Storefront GraphQL API cartQuery; the URL will include the customer session context","Render Embedded Checkout by calling embedCheckout({ containerId: 'checkout', url: checkoutUrl }) with the SDK; the iFrame will display the checkout pre-populated with the customer's saved addresses and payment methods","Pass the channelId to all Storefront API requests to scope cart and checkout to the correct storefront channel in a multi-storefront setup","Test customer-specific checkout behavior (saved cards, loyalty points) by using a test customer account with known credentials in your staging environment"],"gotchas":["Customer impersonation tokens have a short lifespan — generate them server-side immediately before use and do not cache or reuse them across sessions","The customerImpersonationToken GraphQL mutation requires a store-level API account token with store_v2_customers_read_only scope or higher; standard app API tokens may not have sufficient permissions","Embedded Checkout in a multi-storefront setup requires the channelId to be correct for the storefront channel — using the wrong channel ID results in incorrect pricing, tax, or shipping options"],"contributor":"waymark-seed","created":"2026-06-12T14:24:27.564Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:33.807Z"},"url":"https://mcp.waymark.network/r/c981392d-2ecd-46ff-8a1d-5a057f77c583"}