Skip to main content

Documentation Portal

Storefront Configuration

This page describes the following elements:

Global-e Module Javascript

Below is a suggested way of loading the Bespoke JavaScript library asynchronously on your site:

Integration Environment

<script id="globaleScript">
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//intgepi.bglobale.com/includes/js/{merchant id}';
document.getElementsByTagName('head')[0].appendChild(s);
})();
</script>

Production Environment

<script id="globaleScript">
(function () {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//gepi.global-e.com/includes/js/{merchant id}';
document.getElementsByTagName('head')[0].appendChild(s);
})();
</script>

The above snippets will ensure that the Bespoke JavaScript module will load asynchronously and not block your current page rendering.

Note

Replace {merchant id} at the end of the URL with the merchant ID provided to you by Global-e.

The Global-e Module CSS

You must place the Bespoke CSS on your site’s header.

The following example is the Bespoke CSS you must use in your Integration environment:

<link id="GEPIStyles" rel="stylesheet" href="//intgepi.bglobale.com/includes/css/{merchant id}" />

The following example is the Bespoke CSS you must use in your Production environment:

<link id="GEPIStyles" rel="stylesheet" href="//gepi.global-e.com/includes/css/{merchant id}" />

Note

Replace {merchant id} at the end of the URL with the merchant ID that Global-e gave you.

Mandatory Developments

The following table shows the mandatory developments:

Feature

Description

Pricelist

You must be able to retrieve the country from the Global-e Module cookie to use the relevant pricelist on the front-end

My account currency conversion

The following parameters are required to correctly convert currencies in the My Account or My Orders sections:

  • Customer ID: dedicated cookie

  • Global-e order ID: in the Document Object Model (DOM) of the relevant pages in the section

Client analytics

See the GEM client snippet.

Google Shopping feed

See the Marketing Feeds and Tax/Shipping Rates.

Cookies

Global-e uses cookies in API requests between your client, our servers, and Centra. These cookies help identify the active cart and customer so that data stays consistent across the checkout flow:

  • token – Identifies the shopping cart. It allows you to retrieve cart details on the client side (for showing prices on the cart page) and on the server side (when sending the cart to checkout).

  • Customer_id – Identifies the logged-in customer. It is used on the My Account page to fetch their past orders and to display prices based on the international rates they paid.

Both cookies should match the cart and customer identifiers stored in Centra. You can store them as one combined cookie or as two separate cookies, depending on your implementation.

The cookie must follow this structure so Global-e can extract the token and customer_id:

ge_frontend_data = {“token”:”asfd444ggv44677870jhv”,”customer_id”:”123456”}

Requirements:

  • The cookie must be classified as Essential.

  • The cookie must not be set as httpOnly (Global-e's client-side scripts need to read it).

Browsing

This section describes Centra's browsing elements.

Global-e Browsing Elements

Global-e supports the following browsing elements:

  • Welcome pop-up

  • Country switcher

  • Free shipping banner

For more information, see Site Customization.

Global-e Storefront Attributes

The Global-e storefront attributes are described on the Storefront Attributes page.

Calculating Prices

Global-e supports calculating both dynamic prices and fixed prices.

Dynamic price calculations are based on pricelists created by merchants using Centra's back-office.

You must use this set of configurations to properly support price conversions:

  • All Global-e markets must be assigned to a pricelist. Global-e automatically assigns Centra's default pricelist for unassigned markets.

  • All pricelists used for Global-e markets must be set in your base currency.

Fixed price calculations are supported per country and is based on Centra's native pricelist creation.

You must follow these rules when setting their fixed prices:

  • Each country's fixed prices must be set with its respective currency as configured by Global-e.

  • The geolocation must be set according to the country's fixed prices.

  • All fixed prices must be set on the country's catalog.

Products

Product Restrictions

As with other Global-e Module (GEM) integrations, we support merchants restricting purchases of checkout items to specific countries based on regulations or commercial restrictions. We support restrictions at the Checkout level.

For more information on product restrictions, see. Restricted Products

Pre-Ordering Items

You can sell pre-order items if needed, and can enable them by selecting the stock section checkbox for the required item.

Merchants must pass the pre-order attribute indication for the relevant products.

Note the following:

  • We do not validate stock in the order stock validation phase for items identified as pre-order.

  • Items identified as pre-order must be marked in Centra as PreOrder. Items not marked as PreOrder will be a Failed Transfer to Merchant (FTM). Merchants must mark pre-order items in both Global-e and Centra.

Product Attributes

Global-e supports the following product attributes:

  • Product name

  • HS code

  • Country of origin

  • Weight

  • Brand

  • Description

Note

We do not support custom fields.

Cart

Sending Language to Checkout

Global-e supports sending language to Checkout with GEM capabilities. For more information, see Global-e Checkout Language.

Clearing Your Cart

Global-e supports clearing your cart with GEM capabilities. For more information, see Clearing your Cart.

Applying Discounts

Centra supports several discount types that may include multiple rules and dependencies. You can specify these conditions while creating both vouchers and campaigns.

Calculating Cart Prices

The GetCheckoutCartInfo API retrieves cart information for international checkout processing. This API:

  • Is triggered when the cart page loads or when a checkout attempt is made

  • Only returns products that are in stock

  • Requires proper cart token validation

  • Is part of Global-e's extensions (custom integration only)

This method is called from a Global-e server with the cart token rendered in a cookie or HTML.DOM. The client's session calculates the price totals. The GetCheckoutCartInfo API returns all cart contents, including customer information for logged-in customers

This API only returns products that are in stock. If special handling is required for stock validation on your side, for products in the basket (for example, calls to an external system), Global-e can specify an additional URL for this method, to indicate that stock validation is specifically required.

If the cart data is unavailable, the checkout will not open and an error message will appear in the browser development console.

The GetCheckoutCartInfo API is only triggered upon the cart page loading, or when a checkout attempt is made.

Note

This API is part of Global-e's extensions and plug-ins. Merchants do not need to implement this API unless a custom integration in required.

Method/URL

Client-side: GET

GET https://www.merchant-site-domain.com/get-checkout-cart-info-url
POST https://www.merchant-site-domain.com/get-checkout-cart-info-url
Parameters

Request

Requests can contain more parameters than listed.

Name

Type

Description

Mandatory

countryCode

String

2-char ISO code for the country to which shipped

No

currencyCode

String

3-char currency code for the country to which shipped

No

merchantCartToken

String

Identifier used for the cart by the Merchant’s site

No

Response

Returns all cart contents, including customer information for logged-in customers.

Note

Some values are encoded and require the merchant to decode them, for example URLs, addresses, emails, and phone numbers.

Name

Type

Description

CheckoutCartInfo

Object CheckoutCartInfo

Retrieves cart information

Examples
Checkout

Stock Validation

When you place an order in Checkout, the Global-e plug-in runs a stock validation based on Centra's stock to see if the item is available. This process does not occur for pre-order items.

Discounts

The supported discount types described in Applying Discounts apply to the Checkout capabilities as well. Only voucher code discounts are available, and consumers use these codes during Checkout, and discounts are applied when the checkout is complete.