Embed calculator widget
A customs calculator for brokers' sites with a script and a lead form. State: in development.
In development: the widget does not exist yet
The margin-web app that serves the widget script is not created yet. There is no widget.js file, so
there is no working code sample yet. Below is what is coming per the spec (specs/B3-importos-margin.md) so
you can plan the integration.
What is coming
A script that embeds a customs calculator in your site:
- Connecting with a single tag, with your company identifier (per the spec a
data-tenantattribute). - Branded for your company: name, colors, logo.
- A lead form: a visitor leaves contacts and the lead lands in your company's Desk with the source
widget. - The free widget carries a "Powered by ImportOS" label. This is a distribution channel for the product.
- The same calculation as in the API and the extension (
@core/pricing).
An approximate shape (does not work, the format may change):
<script src="https://<margin domain>/widget.js" data-tenant="<your company slug>" async></script>What you can do right now
- Calculate turnkey cost on your server through
POST /v1/landed-costand show the result in your own form. The key stays on the server. - Use the Margin extension's calculation for internal use.
- Accept enquiries from your site: the
widgetlead source already exists in the Desk vocabulary.