Update Data-Config
Using this method will require you to have access to the data-config.
In your Ventrata dashboard, go to Resellers > Resellers.
Select the reseller which should have access to your checkout widget.
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.
β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>
β
π NOTEYou 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.
In your Ventrata dashboard, go to Web Checkouts > Checkouts.
Select the checkout where the reseller should have access.
βScroll down or search for 'Resellers' in the checkout form.
βSelect the required reseller.
Press the Update Checkout button.
β
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.