Selling abroad
Everything the delivery country drives in a Behio storefront, and the calls your template must make.
The merchant configures countries once in the admin (Shipping, Payments, VAT by country, Currencies and price lists, Languages). The storefront reads it all through the public API. This page lists what changes per delivery country and which call belongs where. SDK 1.17.0.
Before the address: the country select
getShopInfo().shippingCountries: countries the shop delivers to (null= anywhere). Build the country select from it in the cart and the checkout.getShopInfo().currencyByCountry:{SK: "EUR"}style map. When the shopper picks such a country, switch the display currency and the cart (useCurrency().setCurrency, orclient.setCurrency+client.cart.setCurrency).
As soon as the country is known: cart.setDestination
await client.cart.setDestination({ country: "SK" });The cart comes back with shippingCountry, vatMode and a recomputed
taxBreakdown:
vatMode | When | Breakdown |
|---|---|---|
DOMESTIC | home country, or no rule for the destination | home rates |
OSS | merchant has OSS on and a rule for the country | destination rates, reduced categories mapped |
EXPORT | outside the EU and the merchant exports without VAT | empty, all rates 0 |
REVERSE_CHARGE | EU business with a VIES-valid VAT ID and reverse charge on | empty, all rates 0 |
Send the VAT ID the same way ({ vatId: "SK2020000001" }, "" clears) and read
cart.vatIdValid. For EXPORT and REVERSE_CHARGE render one sentence instead
of VAT rows; the order carries vatMode too, so the thank-you page can repeat it.
Shipping and payments per country
shipping.listMethods({ country })andshipping.quote(...)return only the methods enabled for the country, in the order set for it, priced per country and currency.listPaymentMethods({ country, shippingMethodId })hides payments the merchant disabled for the country and cash on delivery for carriers that cannot collect it. Re-fetch both when the country or the shipping method changes.
Prices per country
Merchants can scope a price rule to delivery countries (a surcharge for SK, a discount for DE). The cart and checkout apply it automatically from the cart destination. To show the same price in the listing, pass the country you already know:
const products = await behio.catalog.listProducts({ currency: "EUR", country: "SK" });
const product = await behio.catalog.getProduct(slug, { currency: "EUR", country: "SK" });Without country the listing shows the neutral price; country-scoped rules
never apply to an unknown country.
The address form
shippingAddress.statefor countries that need it (US, CA, AU, BR, IN, MX).- Validate the postal code per country and add the phone prefix client-side; the
API checks presence and length only. The reference template keeps the rules in
src/lib/address-rules.ts. - Pickup points:
publicConfig.pickupWidgetis{provider: "packeta", apiKey}(carrier widget),{provider: "zaslat", carrier, territory}(Zaslat map widget; withterritory: nullpass"cz"or"sk"from the delivery country) or{provider: "behio"}(draw a map fromshipping.getPickupPoints()coordinates). SendpickupPointIdand, for widget points, thepickupPointsnapshot.
Language
getShopInfo().supportedLanguages lists the store languages. Suggest the
browser language when the store offers it, never switch on your own: SEO and
the shopper's choice come first. Product, category, page, menu, parameter,
shipping and payment texts arrive in the requested locale when the merchant
translated them (the admin measures the coverage per language).