Skip to main content
Global-e registers platform hooks (SFCC dw.* / app.*) in storefront cartridges and custom hooks (globale.*) invoked from int_globale. Storefront cartridges declare custom hooks in their hooks.json when an OOTB handler ships with the cartridge; all other globale.* hooks are extension points you implement in a project cartridge. See also: Failover and recovery (fallback / SOTM), Configuration (geCAPIType: OCAPI vs SCAPI).
Platform hook tables below are generated from cartridge hooks.json files. Regenerate: node documentation-process/integration-guide/scripts/generate-hooks-md.mjs.

Platform hooks

SiteGenesis (int_globale_sitegenesis)

Registration: int_globale_sitegenesis/package.json, int_globale_sitegenesis/cartridge/scripts/hooks.json

SiteGenesis Popups (int_globale_sitegenesis_popups)

Registration: int_globale_sitegenesis_popups/package.json, int_globale_sitegenesis_popups/cartridge/scripts/hooks.json Optional popups-only cartridge. It registers its own dw.system.request.onRequest to perform Global-e initialization when the standard storefront cartridge is not deployed (welcome/shipping-switcher popups). Layer above the matching storefront cartridge.

SFRA (int_globale_sfra)

Registration: int_globale_sfra/package.json, int_globale_sfra/hooks.json

SFRA Popups (int_globale_sfra_popups)

Registration: int_globale_sfra_popups/package.json, int_globale_sfra_popups/hooks.json Optional popups-only cartridge. It registers its own dw.system.request.onRequest to perform Global-e initialization when the standard storefront cartridge is not deployed (welcome/shipping-switcher popups). Layer above the matching storefront cartridge.

Headless (int_globale_headless)

Registration: int_globale_headless/package.json, int_globale_headless/hooks.json Use with int_globale for PWA, mobile, or other headless clients that consume Shop OCAPI. Pair with site preference geCAPIType = OCAPI (or SCAPI where applicable).

Custom hooks

Custom hooks use the globale.* namespace. They are invoked from int_globale via HookMgr. Register handlers in your project cartridge hooks.json (or in the storefront cartridge when extending OOTB behavior). Registered in int_globale/hooks.json (core): globale.calculateBaseProductPrices, globale.calculateProductPrices, globale.calculateTax, globale.onBeforeCalculate, globale.onGetCountry, globale.onGetMerchantGuid, globale.onGetSendCartData, globale.onInitApplication, globale.outboundOrderDispatchUpdate, globale.outboundOrderRMAUpdate, globale.outboundOrderRefundUpdate, globale.outboundOrderStatusUpdate, globale.outboundParcelStatusUpdate. Registered in SFRA / SiteGenesis hooks.json (OOTB handlers): globale.customerRegistration, globale.customerVerification, globale.getAllowDirectCommunicationFromMerchant, globale.getAllowMailsFromMerchant, globale.getCookieConsent, globale.getGuestEmail, globale.getHubId, globale.getPliHubCode, globale.getProductImageUrl, globale.getProductInventoryListId, globale.getSendCartProductOriginalMerchantPriceForDuties, globale.getUrlParameters, globale.onBeforePlaceOrder, globale.onInit, globale.resetPriceBooks, globale.validateCart.

globale.onInit

Description The custom hook is invoked after the integration initialization (on the first customer visit or when the country/currency is changed). OOTB it’s used to recalculate basket prices for the SGJC (SiteGenesis) architecture; the SFRA handler only stores the values on the session. Custom hooks handler arguments Returns Void. The hook handler result is not used further.

globale.getGuestEmail

Description The custom hook is invoked before the SendCart request and should be used to pre-populate the customer’s email field in the Global-e checkout (guest checkout scenario).
OOTB the custom hook handler returns null.
Custom hooks handler arguments No arguments are submitted to the hook handler. Returns The hook handler must return the guest customer email address if it was filled in by the customer before proceeding to the Global-e checkout or null.

globale.getCustomerAddresses

Description The custom hook is invoked before the SendCart request and should be used to return all the customer’s addresses (logged-in checkout scenario).
OOTB the custom hook handler returns all the addresses stored in the SFCC customer’s address book and, if the address book is empty, falls back to the address stored on the customer profile.
Custom hooks handler arguments Returns The hook handler must return null or the array of all customer’s addresses.

globale.getUrlParameters

Description The custom hook is invoked before the SendCart request and could be used to extend the Global-e UrlParameters SendCart payload property.
It might be helpful in case some additional basket-related data should be restored if Global-e invokes the fallback order creation scenario (an order is created from a new basket and all the original basket custom attributes are lost in this case).
OOTB the custom hook handler returns an empty object.
Custom hooks handler arguments Returns The hook handler must return null or the object (e.g., { key1: value1, key2: value2 }).

globale.getPLICustomMetadata

Description The custom hook is invoked before the SendCart request for each product line item in the basket and could be used to extend the Global-e ProductLineItem Metadata property in the SendCart payload.
It might be helpful in case some additional product line item-related data should be restored if Global-e invokes the fallback order creation scenario (an order is created from a new basket and all the original product line item custom attributes are lost in this case) or in the case if it’s required to pass additional metadata (flash sale products, etc.).
OOTB the custom hook handler returns an empty object.
Custom hooks handler arguments Returns The hook handler must return null or the object (e.g., { key1: value1, key2: value2 }).

globale.getPliEstimatedDeliveryDate

Description The custom hook is invoked before the SendCart request for each product line item in the basket and could be used to return the estimated delivery date value.
Allows displaying a new template for delivery date estimation (preorder/backorder products). The notification will be displayed next to the product, like product attributes.
OOTB the custom hook handler returns null.
Custom hooks handler arguments Returns The hook handler must return null or the string value using the format YYYY-MM-DD (e.g., 2022-05-15).

globale.getPliIsBackOrdered

Description The custom hook is invoked before the SendCart request for each product line item in the basket and could be used to return the IsBackOrdered value.
OOTB the custom hook handler returns false.
Custom hooks handler arguments Returns The hook handler must return boolean value.

globale.getCookieConsent

Description The custom hook is invoked before the SendCart request and could be used to return the customer cookie consent.
OOTB the custom hook handler returns 1 or 0 depending on whether the customer has accepted the cookie consent.
Returns The hook handler must return integer value. The possible values are:
  •  0 - No consent
  • 1 - Consent to all cookies
  • 2 - Consent to the essential cookies only

globale.getAllowMailsFromMerchant

Description The custom hook is invoked before the SendCart request and could be used to return the AllowMailsFromMerchant value.
OOTB the custom hook handler returns false.
Returns The hook handler must return boolean value.

globale.getAllowDirectCommunicationFromMerchant

Description The custom hook is invoked before the SendCart request and could be used to return the AllowDirectCommunicationFromMerchant value.
OOTB the custom hook handler returns false.
Returns The hook handler must return boolean value.

globale.beforeSendCartRequest

Description The custom hook is invoked before the SendCart request.
OOTB the custom hook handler is not defined.
Note: be careful with the hook handler since it allows modifying the payload object before the SendCart request which might lead to the SendCart API error (in this case the Global-e checkout is not loaded).
Custom hooks handler arguments Returns Void.

globale.getPlatformURLs

Description The custom hook is invoked before the SendCart request to populate the PlatformURLs property (SiteURL, RedirectToCartURL, PaymentCallbackURL).
OOTB the custom hook handler is not defined.
Returns The hook handler must return an object (e.g., { SiteURL: '...', RedirectToCartURL: '...', PaymentCallbackURL: '...' }) or null.

globale.getSendCartProductOriginalMerchantPriceForDuties

Description This hook is intended to supply the original merchant wholesale price used for duties calculation when building the SendCart product payload. It is registered as an extension point (SFRA/SiteGenesis handlers delegate to the int_globale fallback), but core 24.6.0 does not currently invoke it during SendCart payload build — treat it as a reserved extension point. Custom hooks handler arguments Returns Number (wholesale price) or null.

globale.getPliHubCode

Description The custom hook is invoked for setting hub code on the product level of the SendCart request body.
OOTB the custom hook handler is registered and returns null.
Custom hooks handler arguments Returns The hook handler must return string value.

globale.validateCart

Description The custom hook is invoked on the ValidateCart request that is sent by Global-e once a customer clicks the “Place Order“ CTA to check if all the products are still in stock.
OOTB the custom hook handler logic can check product availability using the SFCC inventory lists. Depending on the configuration can check the product availability using ProductMgr or in the OCAPI basket context.
Custom hooks handler arguments Returns The hook handler must return the object that contains these properties: errorCode, errorMessage, amendedProducts, reservationRequestId (e.g., { errorCode: null, errorMessage: null, amendedProducts: [], reservationRequestId: null }).

globale.onBeforeApplyCouponCode

Description The custom hook is invoked before the Apply Coupon Code SFCC OCAPI request (the feature requires additional configuration on both Global-e and SFCC sides).
OOTB the custom hook handler is not implemented. Could be used to add additional payload data or the request headers.
Custom hooks handler arguments Returns Void.

globale.onBeforeRemoveCouponCode

Description The custom hook is invoked before the Remove Coupon Code SFCC OCAPI request (the feature requires additional configuration on both Global-e and SFCC sides).
OOTB the custom hook handler is not implemented. Could be used to add additional payload data or the request headers.
Custom hooks handler arguments Returns Void.

globale.onGenerateBasketFromPayload

Description The custom hook is invoked right after the basket is recreated on the SFCC side.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterCreateOrder

Description The custom hook is invoked right after an order is created on the SFCC side (could be triggered not only on the OrderClientCreate request but also on the SendOrderToMerchant request if the fallback order creation scenario is applied).
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterCreateMixedOrder

Description The custom hook is invoked only if “Mixed Orders“ feature is used and right after processing on Global-e “Order Create“ request on the SFCC side
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onBeforePlaceOrder

Description The custom hook is invoked right before an order is placed on the SFCC side.
OOTB the SFRA/SiteGenesis handler sets session.setTrackingAllowed(true) when the order payload CookieConsent is 1 or 2.
Custom hooks handler arguments Returns Void.

globale.onAfterPlaceOrder

Description The custom hook is invoked right after an order is placed on the SFCC side.
OOTB the custom hook handler is not implemented. Implement in a project cartridge when post-place-order logic is required.
Custom hooks handler arguments Returns Void.

globale.onAfterUpdateOrder

Description The custom hook is invoked right after an order is updated on the SFCC side (SendOrderToMerchant request).
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onSetCustomerComments

Description The custom hook is invoked during SendOrderToMerchant processing to set customer comments on the order.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.modifyCreateUpdateOrderResponse

Description The custom hook is invoked to modify the order create/update API response returned to Global-e.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns The modified response object.

globale.onAfterUpdateMixedOrders

Description The custom hook is invoked right after mixed orders are updated on the SFCC side (SendOrderToMerchant request).
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterPaymentUpdate

Description The custom hook is invoked right after an order payment status is updated on the SFCC side (PaymentNotification request).
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterPaymentUpdateMixedOrders

Description The custom hook is invoked right after mixed orders payment statuses are updated on the SFCC side (PaymentNotification request).
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterStatusUpdate

Description The custom hook is invoked right after the order status is updated on the SFCC side (OrderStatusUpdate request).
OOTB the custom hook handler is not implemented. Could be used to apply any required custom logic when Global-e sends order status update request.
Custom hooks handler arguments Returns Void.

globale.onAfterStatusUpdateMixedOrders

Description The custom hook is invoked right after the mixed orders statuses are updated on the SFCC side (OrderStatusUpdate request).
OOTB the custom hook handler is not implemented. Could be used to apply any required custom logic when Global-e sends order status update request.
Custom hooks handler arguments Returns Void.

globale.onAfterShippingUpdate

Description The custom hook is invoked right after the order shipping information is updated on the SFCC side (OrderShippingInfoUpdate request).
OOTB the custom hook handler is not implemented. Could be used to apply any required custom logic when Global-e sends order shipping information update request.
Custom hooks handler arguments Returns Void.

globale.onAfterRefund

Description The custom hook is invoked right after the order refund information is updated on the SFCC side (OrderRefund request).
OOTB the custom hook handler is not implemented. Could be used to apply any required custom logic when Global-e sends an order refund request.
Custom hooks handler arguments Returns Void.

globale.onAfterGeRmaUpdate

Description The custom hook is invoked right after the order RMA information is updated on the SFCC side (RMA request).
OOTB the custom hook handler is not implemented. Could be used to apply any required custom logic when Global-e sends an order RMA request.
Custom hooks handler arguments Returns Void.

globale.customerVerification

Description The custom hook is invoked once Global-e sends a customer verification request (additional configuration is required on the Global-e side for this feature).
OOTB the custom hook handler checks if a customer has the SFCC account.
Custom hooks handler arguments Returns Returns customer verification status (e.g., { success: true, registered: false, errorCode: null, eventName: ‘status’ }).

globale.customerRegistration

Description The custom hook is invoked once Global-e sends a customer registration request (additional configuration is required on the Global-e side for this feature).
OOTB the custom hook handler creates the SFCC account, assigns the last order to the customer and creates addresses in the SFCC address book.
Custom hooks handler arguments Returns Returns customer registration status (e.g., { success: true, registered: true, errorCode: null, eventName: ‘register’ }).

globale.outboundOrderStatusUpdate

Description The custom hook is not invoked OOTB, instead should be used to initiate OrderStatusUpdate notification from SFCC to Global-e (if the feature is in the integration scope).
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.
Custom hooks handler arguments Returns Returns the notification creation status (dw.system.Status).

globale.outboundOrderDispatchUpdate

Description The custom hook is not invoked OOTB, instead should be used to initiate OrderDispatchUpdate notification from SFCC to Global-e (if the feature is in the integration scope).
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.
Custom hooks handler arguments Returns Returns the notification creation status (dw.system.Status).

globale.outboundOrderRefundUpdate

Description The custom hook is not invoked OOTB, instead should be used to initiate OrderRefundUpdate notification from SFCC to Global-e (if the feature is in the integration scope).
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.
Custom hooks handler arguments Returns Returns the notification creation status (dw.system.Status).

globale.outboundOrderRMAUpdate

Description The custom hook is not invoked OOTB, instead should be used to initiate OrderRMAUpdate notification from SFCC to Global-e (if the feature is in the integration scope).
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.
Custom hooks handler arguments Returns Returns the notification creation status (dw.system.Status).

globale.outboundParcelStatusUpdate

Description The custom hook is not invoked OOTB; use it to initiate a parcel status update notification from SFCC to Global-e (when parcel tracking is in scope).
Registered in int_globale/hooks.json. OOTB the handler calls the Global-e parcel API and may create a GLOBALE_ORDER_NOTIFICATION custom object for async processing.
Custom hooks handler arguments Returns Returns the notification creation status (dw.system.Status).

globale.getProductInventoryListId

Description The custom hook is invoked only when the site preference “Use Custom Product Inventory Lists” (geUseCustomProductInventoryLists) is enabled; otherwise the cartridge returns null without calling the hook.
OOTB the custom hook handler returns null value.
Custom hooks handler arguments Returns Returns the ID of the inventory list or null.

globale.getProductImageUrl

Description The custom hook is invoked when it needs to get the product’s image URL (before the SendCart request and on run of SFCC job GlobaleCatalogFeed)
OOTB the custom hook handler returns a null value.
Custom hooks handler arguments Returns Returns the URL of the product or null.

globale.getHubId

Description The custom hook is invoked before the SendCart request and could be used to return the HubId value.
OOTB the custom hook handler returns null or the active Global-e Hub ID when AppSettings sfccSendCartSendHubId is enabled.
Returns The hook handler must return a string (Hub ID) or null.

globale.resetPriceBooks

Description The custom hook is invoked when Global-e resets price books (for example on country or currency change).
OOTB the SFRA/SiteGenesis handler aligns session currency with the current locale country configuration.
Returns Void.

globale.onAfterVoidReservation

Description The custom hook is invoked when Global-e VoidReservation notification is received on the platform side.
OOTB there is no custom hook handler.
Returns The hook handler must return boolean value.

globale.getLineItemDeliveryType

Description The custom hook is invoked before the SendCart request and could be used to return the LineItemDeliveryType value (relevant only for BOPIS orders).
OOTB the custom hook handler returns null.
Returns The hook handler must return string value (Enum: BOPIS, DelayBOPIS, BOSS, ShipIt).

globale.getLineItemShipToStoreCode

Description The custom hook is invoked before the SendCart request and could be used to return the ShipToStoreCode value (relevant only for BOPIS orders).
OOTB the custom hook handler returns null.
Returns The hook handler must return string value.

globale.getEstimatedDeliveryTimeMessage

Description The custom hook is invoked before the SendCart request and could be used to return the EstimatedDeliveryTimeMessage value (relevant only for BOPIS orders).
OOTB the custom hook handler returns null.
Returns The hook handler must return string value.

globale.webStore.getWebStoreCode

Description The custom hook is invoked before the SendCart request and should be used in case if OOTB logic should be replaced with a custom one.
OOTB the fallback returns the current site ID (Site.current.ID).
Returns The hook handler must return string value.

globale.webStore.getWebStoreInstanceCode

Description The custom hook is invoked before the SendCart request and should be used in case if OOTB logic should be replaced with a custom one. Returns The hook handler must return string value.

globale.onGetSendCartData

Description The custom hook returns checkout/SendCart preparation data for headless and express checkout flows.
Registered in int_globale/hooks.json. OOTB the handler returns the result of the checkout show operation.
Custom hooks handler arguments Returns SendCart operation result object.

globale.onInitApplication

Description The custom hook initializes the Global-e application context for a country/currency pair.
Registered in int_globale/hooks.json. OOTB the handler runs globaleInit.
Custom hooks handler arguments Returns Void.

globale.onGetMerchantGuid

Description The custom hook returns the Global-e merchant GUID.
Registered in int_globale/hooks.json. OOTB the handler returns the merchant GUID from service credentials via globaleHelpers.getMerchantGuid().
Returns String (merchant GUID).

globale.onGetCountry

Description The custom hook returns the Global-e country object for a country code.
Registered in int_globale/hooks.json. OOTB the handler uses geCountryMgr.getByCountryCode.
Custom hooks handler arguments Returns Global-e country object.

globale.webStore.getWebStoreInstanceCodeInJobContext

Description The custom hook returns the WebStore instance code when Global-e settings jobs run.
OOTB the custom hook handler is not implemented.
Returns String (WebStore instance code) or null.

globale.onAfterGiftCertificateRefund

Description The custom hook is invoked after a Global-e gift certificate refund is processed.
OOTB the custom hook handler is not implemented.
Returns Void.

globale.onAfterGiftCertificateRedeem

Description The custom hook is invoked after a Global-e gift certificate is redeemed.
OOTB the custom hook handler is not implemented.
Returns Void.

globale.onAfterGiftCertificateCreate

Description The custom hook is invoked after a Global-e gift certificate is created.
OOTB the custom hook handler is not implemented.
Returns Void.

onAfterGiftCertificateOrderCreate

Description The custom hook is invoked after an order containing a gift certificate is created.
Note: registered in code as onAfterGiftCertificateOrderCreate (without the globale. prefix). OOTB the custom hook handler is not implemented.
Returns Void.

globale.onPayByLinkAfterCreateOrder

Description The custom hook is invoked after an order is created in a Pay-by-Link scenario.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onPayByLinkAfterPlaceOrder

Description The custom hook is invoked after an order is placed in a Pay-by-Link scenario.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onBeforeOrderValidate

Description The custom hook is invoked before Pay-by-Link order validation.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onAfterOrderValidate

Description The custom hook is invoked after Pay-by-Link order validation.
OOTB the custom hook handler is not implemented.
Custom hooks handler arguments Returns Void.

globale.onBeforeCalculate

Description The custom hook is called right before the original calculate is called. It enables customizations for the calculation of the basket. Custom hooks handler arguments Returns The hook handler must return system Status with custom code.

globale.calculateProductPrices

Description The custom hook is called to reset product prices and calculate prices for all product line items in the basket. This hook is called in the calculate hook and is used to calculate prices for product line items. It handles bonus product line items and updates totals. Custom hooks handler arguments Returns Void (the OOTB handler updates the basket in place).

globale.calculateBaseProductPrices

Description The custom hook is called to calculate prices for all product line items in the basket. Custom hooks handler arguments Returns Void (the OOTB handler updates the basket in place).

globale.calculateTax

Description Determines tax rates for all line items of the basket. Uses the shipping addresses associated with the basket shipments to determine the appropriate tax jurisdiction. Uses the tax class assigned to products and shipping methods to lookup tax rates. Sets the tax-related fields of the line items. Handles gift certificates, which aren’t taxable. Note that the function implements a fallback to the default tax jurisdiction if no other jurisdiction matches the specified shipping location/shipping address. Note that the function implements a fallback to the default tax class if a product or a shipping method does explicitly define a tax class.
Custom hooks handler arguments

See also