Developer docs
Embeddable returns form
Customers open a return without an account: they find their order, choose the items and the reason, and the case lands in SaleHero. Link to the form, or embed it in your own returns page with two lines of HTML. No API key is involved.
Turn it on
- In Settings, Organization options, switch on “Enable the public returns form” and set the return window in days (0 to 3650).
- Configure the BaseLinker return status ids. Until they are set, the form stays closed.
- To embed it, list your site under “Allowed embedding domains”. The form can only be framed by those domains; an empty list means no site may embed it, and the public link keeps working.
| Address | Use |
|---|---|
| https://salehero.ro/returns/ORG_SLUG | The public page: link to it from your emails and order pages. |
| https://salehero.ro/returns/ORG_SLUG/embed | The same form without the page around it, for the snippet below. |
Embed it
<div data-salehero-returns="https://salehero.ro/returns/ORG_SLUG/embed"></div>
<script src="https://salehero.ro/returns-embed.js" defer></script>The script puts the form in the div as a responsive frame and keeps its height in step with the form. Optional attributes on the div: data-market (the market code), data-lang (the form's opening language; otherwise the page's language is used) and data-title (the frame's accessible title).
When a customer submits, the host page receives a salehero:return-submitted event on window, with the case reference in detail.reference. Use it to show your own thank-you or to fire analytics.
window.addEventListener("salehero:return-submitted", (e) => {
console.log("Return opened:", e.detail.reference);
});What the customer sees
- Languages: Romanian, English, Bulgarian, Czech, Greek, French, Hungarian, Italian, Polish and Slovak.
- Order lookup: an order or invoice number plus the email or phone on the order.
- Lookups are rate limited: 20 per hour per address and 8 per hour per order number.
- Orders outside the return window you set, and cancelled orders, are refused.