Skip to content

Embedding the Customer Portal on Your Headless Site

Step 1: Create the container element for the embed to insert

Section titled “Step 1: Create the container element for the embed to insert”
<div id="corso-embedded-ui"></div>

You can copy your script tag in the Corso Admin by going to Settings > Theme > Customer Portal Embedded UI > Headless Embed Script > Copy.

<script
type="module"
src="https://cdn.corso.com/js/corso-embedded-ui.js?appUrl=https%3A%2F%2Fapp.corso.com/corso-store-name"
></script>

<div id="corso-embedded-ui"></div>

You can copy your script tag in the Corso Admin by going to Settings > Theme > Customer Portal Embedded UI > Headless Embed Script > Copy.

<script
type="module"
src="https://cdn.corso.com/js/corso-embedded-ui.js?appUrl=https%3A%2F%2Fapp.corso.com/corso-store-name"
></script>

While implementing, it may be helpful to pass a second query param to enable debug logging. This should be removed before going to production.

<script
type="module"
src="https://cdn.corso.com/js/corso-embedded-ui.js?appUrl=https%3A%2F%2Fapp.corso.com/corso-store-name&isDebug=true"
></script>

Once the script is embedded, you can dynamically set orderId on the host page URL (for example, https://merchant.example/returns?orderId=12345) to load that specific customer experience inside the frame. This is typically done from order confirmation emails, or other places within the flow when directing to a tracking / order editing experience.