Skip to main content
All CollectionsWeb CheckoutManuals
How to Provide a Checkout Widget to Resellers / Referrer
How to Provide a Checkout Widget to Resellers / Referrer
Lucia Burin Sestakova avatar
Written by Lucia Burin Sestakova
Updated over a week ago

Update Data-Config

Using this method will require you to have access to the data-config.

  1. In your Ventrata dashboard, go to Resellers > Resellers.

  2. Select the reseller which should have access to your checkout widget.

  3. On the Reseller detail, copy the value in the 'Web referrers' field.
    ​


    πŸ“’ NOTE

    If the reseller does not contain a web referrer value, it needs to be filled in.
    ​


  4. Enter the web referrer value in the data-config.

    "referrer": "[your_web_referrer]"
    ​
    Data-config structure: <button type="button" data-config='{"productID":"APIKEY", "referrer": "ventrataReseller"}' ventrata-checkout > Book Now </button>
    ​



    πŸ“’ NOTE

    You can specify the referrer value in the script or directly above the required button.


Add Reseller to Web Checkout

Use this method to provide access directly from the Ventrata dashboard.

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

  2. Select the checkout where the reseller should have access.
    ​

  3. Scroll down or search for 'Resellers' in the checkout form.
    ​

    Reseller in Web Checkout settings

  4. Select the required reseller.

  5. Press the Update Checkout button.
    ​

    Update Web Checkout


Dynamic Referrer Insertion Using URL

If your resellers do not have their own websites, but you want to allow them to make sales using your web checkout, you have the option to do so with the dynamic referrer parameter. The script below pulls the referrer value from the query parameter and inserts it into the script with the data-config attribute.
​
Therefore, if your URL contains https://your-address.com/?referrer=ventrataReseller, then the data-config attribute will contain a reference to the reseller, which is set to 'WEB REFERRERS = ventrataReseller'.

πŸ“’ NOTE

Insert the two scripts below one right after the other.

<script src='https://cdn.checkout.ventrata.com/v3/production/ventrata-checkout.min.js' type='module' data-config='{"apiKey":"<YOUR_APIKEY>"}'></script> 

<script>
function updateReferrerForScript() {
let url = new URL(window.location.toString());
let script = document.querySelector('script[src="https://cdn.checkout.ventrata.com/v3/production/ventrata-checkout.min.js"]');
let referrerParam = decodeURIComponent(url.searchParams.get("referrer"));
let config = JSON.parse(script.dataset.config);
if (referrerParam) {
config.referrer = referrerParam;
script.dataset.config = JSON.stringify(config);
}
}

updateReferrerForScript();
</script>

πŸ“— TIP

If you have set everything correctly your data-config for the script should look like this.
​

<script src='https://cdn.checkout.ventrata.com/v3/production/ventrata-checkout.min.js' type='module' data-config='{"apiKey":"<YOUR_APIKEY, "referrer": "ventrataReseller">"}'></script>

πŸ“’ NOTE
This code will change the script and the same reseller will be set on all products.

Did this answer your question?