Localize Price
Convert prices from the native currency to the currently selected currency. This method uses the currently selected country and currency rules. InputpriceDetails object
Due to rounding rules, the individual product price must be used for the price parameter, not the line item subtotal.
localizedPrice object
De-localize Converted Price
Convert the customer’s local currency back to the original currency. This method uses the rules from the current country and currency in the calculation. ExampleRefer to
LocalizePrice method to view the structure of the priceDetails and delocalizedPrice objects. The delocalizedPrice object is structured the same as the localizedPrice object.Format Converted Price
Format an already converted price, using the currently selected currency. InputconvertedPriceDetails object
Returned
formattedPrice object
Is Operated by Global-e
Check if the currently selected shipping destination country is a Global-e-operated country. ExampleGet Checkout URL
Get the checkout URL that you want to direct customers to.urlParams is a JSON object with a single CartToken string parameter. If you have a headless Shopify site, use the ShopifyCheckoutId instead of the CartToken.
Example
Update Cart
Receive a notification when the cart needs to be updated on the client side, using this latestcartData that is passed in.
Example
- A product is added to the cart
- A product is removed from the cart
- The quantity of a product is changed
- The cart is shown to the user
cartDatais a JSON object that matches a specific schema.
Example
productsList is an array of product objects, detailed below:
Troubleshooting failed code
If you attempted to use a GEM external method and the code failed, this could be because the GEM module has not loaded yet. In this situation, you can use anExternalEventsComponent
With the ExternalEventsComponent you can set a function on the window object and Global-e’s code executes that function when a certain event is triggered.
We recommend that you listen for the GlobalE_Loaded event before executing the code. To do this, set the below function on the window object and the code will be executed when the GEM solution loads.
Example

