This pre-checkout webhook provides security against HTML modifications on your Wix site. It is triggered when a Foxy checkout request is submitted and validates all items in cart to ensure they have sufficient inventory and matched pricing in your Wix store.
It requires using Wix Stores to manage products and integrating with Foxy by following this tutorial.
- Go to Wix API Keys Manager
- Click the Generate API Key button
- Enter a name for the API key
- For Permissions, expand All site permissions by clicking the See all button
- Check the checkbox for Wix Stores
- Click the Generate Key button
- Copy the API key token and store it somewhere safe
After generating an API key, in your Wix API Keys Manager, you should see your Wix account ID on the right.
- Go to your Wix dashboard and select your site
- Get the site ID from the URL, which appears after
/dashboard/
in the URL:
- Click the Fork button at the top right corner of this page
- Go to Netlify and log in your account
- Add a new site and select the Import an existing project option
- Connect your GitHub account
- Select repository
foxy-node-netlify-functions
- On the review configuration page, under the Environment variables section, click the Add environment variables button to add the following variables:
Key Value FOXY_WIX_API_KEY Your Wix API key token FOXY_WIX_ACCOUNT_ID Your Wix account ID FOXY_WIX_SITE_ID Your Wix site ID - Click the Deploy foxy-node-netlify-functions button
- After the site is deployed successfully on Netlify, click Logs > Functions from the navigation bar on the left
- Choose the
datastore-integration-wix
function from the list - On the function logs page, copy the endpoint URL
- Log in your Foxy Admin
- Go to Settings > Payments and choose the payment set that the pre-checkout webhook should be applied to
- Click the Add fraud protection button and choose Pre-Checkout Webhook
- Toggle Enabled
- In the URL field, paste the Netlify function endpoint URL from step 3
- Select an option for the Failure handling setting
- Click the Add fraud protection button
- Run some test transactions to ensure the pre-checkout webhook is configured correctly