Skip to main content
All CollectionsWeb CheckoutImplementation Guide
Integrate Checkout in Embedded Mode
Integrate Checkout in Embedded Mode

The implementation of embedded mode calls for specific requirements.

Lucia Burin Sestakova avatar
Written by Lucia Burin Sestakova
Updated over 2 months ago

To successfully enable embedded mode, you will need an HTML element on your page that will serve the container for the widget.

This HTML element needs the ventrata-embedded-widget attribute to activate the functionality.


Integrate Ventrata Checkout

To enabled embedded mode you need to add the <script> and <aside> tags to your page.

  • The <script> tag loads the checkout configuration.

  • The <aside> tag specifies the widget's location and is where you add the productID to open the widget for a specific product.

Locate apiKey

  1. In your Ventrata dashboard, go to Web Checkouts > Checkouts.

  2. Select one of your existing checkouts.

  3. Your apiKey is located on the Checkout Details tab of the selected checkout.
    ​

API Key


Add <script> tag

To integrate Ventrata checkout, add the below <script> tag to the HTML pages of your website.

Live

The script will load the configuration for your specific account with the production gateway, therefore all payments and orders will be recorded as if they were orders made by customers.

<script 
src="https://cdn.checkout.ventrata.com/v3/production/ventrata-checkout.min.js"
type="module"
data-config='{"apiKey":"<YOUR_API_TOKEN>", "env": "live", "embedded": true }'>
</script>

Test

The script will load the configuration for your specific account in a test environment.

<script 
src="https://cdn.checkout.ventrata.com/v3/production/ventrata-checkout.min.js"
type="module"
data-config='{"apiKey":"<YOUR_API_TOKEN>", "env": "test", "embedded": true }'>
</script>

Attribute

Description

apiKey

replace <YOUR_API_TOKEN> with the apiKey located in your checkout

"env"

"live" - all payments and orders will be recorded as if they were orders made by customers

"test" - all payments and orders will be recorded as test and will not be included in your accounting


πŸ“— TIP

If the "env" attribute is not specified in the <script> tag, the checkout will remain in a test environment by default.


"embedded"

Allows the usage of embedded mode.

The page requires the presence of an HTML element with the ventrata-embedded-widget attribute.


Specify Widget Location and Size

To integrate the checkout in embedded mode, include a few additional lines of code where the widget will be displayed.

  1. Add the Add the below <aside> tag to the HTML of a page where the embedded widget will appear.

  2. Use the class attribute to specify the widget's width and height.

  3. Include the ventrata-embedded-widget and data-config attributes within the <aside> tag.

  4. Inside the data-config attribute, add "embedded": true.

  5. Specify product ID using "productID" : "<product_ID>".

<aside 
class="h-[50rem] w-[31.25rem]"
ventrata-embedded-widget
data-config='{"productID":"5789d12f-029c-42f3-80af-8223379d1816" }'
>
</aside>

πŸ“’ NOTE

Please note that the height and width values used in class="h-[50rem] w-[31.25rem]" may not be applicable for your web page. Please replace these values with ones that fit your web page.

πŸ“— TIP

You can use the widget in both embedded and pop-up modes at the same time. For more details, read our FAQ article.

Did this answer your question?