less than a minute read • Updated 44 minutes ago
Set up a Custom Tax Endpoint
How to use a custom tax endpoint to calculate taxes with your own system, including the Netlify starter function code.
Overview
If you have specific tax requirements or use a system Foxy does not support natively, you can use a custom tax endpoint. It works like the custom shipping endpoint: Foxy sends a payload to your endpoint, and your endpoint returns the tax to apply. Common cases include pulling rates from an ERP or applying highly specific rates or thresholds.
How it works
Foxy sends a payload (mirroring the API format) to your endpoint for each relevant event, and your endpoint responds with the tax to apply. The events and the response format are documented in Custom tax endpoint reference.
Steps
Starter code
Foxy provides a Netlify function code to help you get started. With a Netlify account, follow the readme in Foxy's Netlify functions repository (https://github.com/Foxy/foxy-node-netlify-functions) to deploy the example custom tax function and tailor it to your needs.