> ## Documentation Index
> Fetch the complete documentation index at: https://docs.global-e.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shipping country change on checkout

When a shopper changes **shipping country** on Global-e checkout, the storefront can reload in the **locale that is mapped to the new country** (URL, language, currency, and locale-specific configuration). Out of the box the cartridges send locale-aware **SendCartV2 `PlatformURLs`** and, when Global-e reports a country change, **302** the shopper back to SFCC checkout (`Checkout-Begin`) with `glCountry` and `glCurrency`.

See also: [Checkout flow](/checkout-flow-sfcc), [Hooks → `globale.getPlatformURLs`](/hooks-sfcc#globalegetplatformurls), [Client JS SDK](/client-js-sdk-sfcc), [Metadata → GLOBALE\_COUNTRIES](/metadata-sfcc#globale_countries)

<Warning>
  This is an **optional** feature. The SFCC cartridges include the storefront behaviour, but it is **not available in production** until Global-e enables shipping-country change for your merchant account. Contact **Global-e Merchant Support** to request enablement before go-live. There is **no** SFCC site preference to turn it on.
</Warning>

## Overview

1. SendCartV2 includes **`PlatformURLs`**: home (`Home-Show` / SEO home), cart (`Cart-Show` / SEO cart), and payment callback (`Globale-PaymentRedirect`), built in the **current request locale**.
2. If the shopper changes shipping country on Global-e checkout, Global-e calls **`Globale-PaymentRedirect`** with `shippingCountryChanged=true`, `glCountry`, and `glCurrency`.
3. SFCC resolves the destination from **`GLOBALE_COUNTRIES.siteUrl`** for that country (pipeline form `action|SiteID|locale`) and redirects to **`Checkout-Begin`** with `glCountry` / `glCurrency` so Global-e init and SendCart run again in the matching locale.

`Globale-CheckoutPaymentRedirect` (the SFCC include used when checkout already has a cart token) does **not** issue this locale 302.

## Prerequisites

| Side | Required |
| - | - |
| Global-e | Shipping-country change enabled for the merchant (including the query parameters Global-e sends on country change). Contact **Global-e Merchant Support** before SFCC go-live. |
| SFCC | Cartridge version that includes locale-aware `PlatformURLs` and the PaymentRedirect country-change 302. Country records in **`GLOBALE_COUNTRIES`** (from **GlobaleSettings**) with **`siteUrl`** set when you need a locale (or site) other than the current request. |
| Storefront | Operated Global-e country on SFRA or SiteGenesis for the OOTB 302. Headless storefronts must supply storefront URLs via **`globale.getPlatformURLs`** if they do not use SFCC pipeline URLs. |

## Configuration

### Global-e

Contact **Global-e Merchant Support** to enable shipping-country change on your merchant account before configuring SFCC.

### Country site URL

**Merchant Tools → Custom Objects → GLOBALE\_COUNTRIES** (populated by the **GlobaleSettings** job)

The **`siteUrl`** attribute controls where SFCC sends the shopper after a country change:

| `siteUrl` value | Result |
| - | - |
| Empty or unknown country code | 302 still goes to **`Checkout-Begin`** on the **current** site and locale, with `glCountry` / `glCurrency` on the query string |
| Pipe form `Home-Show\|YourSiteID\|fr_FR` | Locale (and optionally site / host) is taken from the pipe segments; the redirect **action** is still **`Checkout-Begin`** |
| Absolute `https://…` URL | That URL is used as-is (no `Checkout-Begin` rewrite) |

Example pipe values (same convention as the country switcher):

```text theme={null}
Home-Show|RefArchGlobal|default
Home-Show|RefArchGlobal|fr_FR
Home-Show|RefArchGlobal|default|www.example.com
```

Keep **`siteUrl`** in sync with how you map operated countries to storefront locales. Run **GlobaleSettings** after Global-e country configuration changes.

### Custom PlatformURLs

Register **`globale.getPlatformURLs`** only when the OOTB home / cart / `Globale-PaymentRedirect` URLs are wrong for your storefront (typical for **headless**). The handler must return `{ SiteURL, RedirectToCartURL, PaymentCallbackURL }` or `null`. See [Hooks → `globale.getPlatformURLs`](/hooks-sfcc#globalegetplatformurls).

Do **not** put a literal `@@LOCALE@@` token in these URLs. Global-e does not substitute that token on MAS storefront URLs.

## Storefront architectures

| Architecture | OOTB behaviour |
| - | - |
| SFRA | `Globale-PaymentRedirect` 302s to SFRA **`Checkout-Begin`**. Empty basket after the 302 follows the existing checkout prepend (redirect to cart). |
| SiteGenesis | Same PaymentRedirect 302 to **`Checkout-Begin`**. SiteGenesis checkout (`COShipping-Start`) still sends an empty cart to **`Cart-Show`**. |
| Headless | SendCart still fills `PlatformURLs` from the fallback or your hook. Implement **`globale.getPlatformURLs`** so home, cart, and payment-callback URLs match the headless storefront. |

## Limitations

* If the **SFCC shopper session expires** before the shopper changes shipping country (the platform hard session timeout, typically **8 hours**), the country-change 302 still runs, then checkout finds **no basket** and sends the shopper to the **empty cart** page.
* An **unknown or invalid** `glCountry` does not fail closed: SFCC still 302s to **`Checkout-Begin`** on the current locale. Global-e init ignores a country code that is not in **`GLOBALE_COUNTRIES`** (or not allowed for the site) and falls back to geo / default country.
* The country-change 302 does **not** pass the cart token. SendCart on the following checkout request issues a new token.

## See also

* [Checkout flow](/checkout-flow-sfcc)
* [Client JS SDK](/client-js-sdk-sfcc) — country `siteUrl` on the country switcher
* [Hooks → `globale.getPlatformURLs`](/hooks-sfcc#globalegetplatformurls)
* [Metadata → GLOBALE\_COUNTRIES](/metadata-sfcc#globale_countries)
* [GlobaleSettings](/globale-settings-sfcc)
