> ## 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.

# Hooks

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](/failover-sfcc) (fallback / SOTM), [Configuration](/configuration-sfcc) (`geCAPIType`: OCAPI vs SCAPI).

<Note>
  Platform hook tables below are generated from cartridge `hooks.json` files. Regenerate: `node documentation-process/integration-guide/scripts/generate-hooks-md.mjs`.
</Note>

## Platform hooks

### SiteGenesis (`int_globale_sitegenesis`)

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

| Hook Name | Hook Script | Description |
| - | - | - |
| dw\.system.request.onRequest | int\_globale\_sitegenesis/cartridge/scripts/request/OnRequest | Performs main Global-e initialization on every storefront request |
| dw\.order.calculate | int\_globale\_sitegenesis/cartridge/scripts/cart/calculate.js | Performs cart/basket price recalculation (when called from `int_globale`) |
| dw\.order.createOrderNo | int\_globale\_sitegenesis/cartridge/scripts/hooks/order | Returns the SFCC order number to use during order creation |
| dw\.ocapi.shop.order.beforePOST | int\_globale\_sitegenesis/cartridge/scripts/hooks/order | Called before an order is created from the basket |
| dw\.ocapi.shop.order.afterPOST | int\_globale\_sitegenesis/cartridge/scripts/hooks/order | Called after an order was created from the basket |

### 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.

| Hook Name | Hook Script | Description |
| - | - | - |
| dw\.system.request.onRequest | int\_globale\_sitegenesis\_popups/cartridge/scripts/request/OnRequest | Performs main Global-e initialization on every storefront request |

### SFRA (`int_globale_sfra`)

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

| Hook Name | Hook Script | Description |
| - | - | - |
| app.server.registerRoute | int\_globale\_sfra/cartridge/scripts/hooks/route | Registers SFRA routes used by Global-e controllers |
| dw\.system.request.onRequest | int\_globale\_sfra/cartridge/scripts/hooks/request/OnRequest | Performs main Global-e initialization on every storefront request |
| dw\.order.calculate | int\_globale\_sfra/cartridge/scripts/hooks/cart/calculate.js | Performs cart/basket price recalculation |
| dw\.order.createOrderNo | int\_globale\_sfra/cartridge/scripts/hooks/order | Returns the SFCC order number to use during order creation |
| dw\.ocapi.shop.order.beforePOST | int\_globale\_sfra/cartridge/scripts/hooks/order | Called before an order is created from the basket |
| dw\.ocapi.shop.order.afterPOST | int\_globale\_sfra/cartridge/scripts/hooks/order | Called after an order was created from the basket |

### 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.

| Hook Name | Hook Script | Description |
| - | - | - |
| dw\.system.request.onRequest | int\_globale\_sfra\_popups/cartridge/scripts/hooks/request/OnRequest | Performs main Global-e initialization on every storefront request |

<h3 id="headless-int_globale_headless">
  Headless (`int_globale_headless`)
</h3>

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).

| Hook Name | Hook Script | Description |
| - | - | - |
| dw\.order.createOrderNo | int\_globale\_headless/cartridge/scripts/hooks/order | Returns the SFCC order number to use during order creation |
| dw\.ocapi.shop.customer.baskets.beforeGET | int\_globale\_headless/cartridge/scripts/hooks/customer/customerBasket | Called before customer baskets are retrieved |
| dw\.ocapi.shop.customer.baskets.modifyGETResponse\_v2 | int\_globale\_headless/cartridge/scripts/hooks/customer/customerBasket | Modifies the customer baskets GET response |
| dw\.ocapi.shop.basket.beforeGET | int\_globale\_headless/cartridge/scripts/hooks/basket | Called before a basket is retrieved |
| dw\.ocapi.shop.basket.modifyGETResponse | int\_globale\_headless/cartridge/scripts/hooks/basket | Modifies the basket GET response (Global-e session/pricing context) |
| dw\.ocapi.shop.basket.beforePOST | int\_globale\_headless/cartridge/scripts/hooks/basket | Called before a basket is created |
| dw\.ocapi.shop.basket.beforePOST\_v2 | int\_globale\_headless/cartridge/scripts/hooks/basket | Called before a basket is created (v2) |
| dw\.ocapi.shop.basket.modifyPOSTResponse | int\_globale\_headless/cartridge/scripts/hooks/basket | Modifies the basket POST response |
| dw\.ocapi.shop.basket.beforePATCH | int\_globale\_headless/cartridge/scripts/hooks/basket | Called before a basket is updated |
| dw\.ocapi.shop.basket.afterPATCH | int\_globale\_headless/cartridge/scripts/hooks/basket | Called after a basket is updated; sends the cart to Global-e when `c_geGetCartToken=true` |
| dw\.ocapi.shop.basket.modifyPATCHResponse | int\_globale\_headless/cartridge/scripts/hooks/basket | Modifies the basket PATCH response |
| dw\.ocapi.shop.basket.items.beforePOST | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Called before product line items are added |
| dw\.ocapi.shop.basket.items.modifyPOSTResponse | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Modifies the product items POST response |
| dw\.ocapi.shop.basket.item.beforePATCH | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Called before a product line item is updated |
| dw\.ocapi.shop.basket.item.modifyPATCHResponse | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Modifies the product item PATCH response |
| dw\.ocapi.shop.basket.item.beforeDELETE | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Called before a product line item is removed |
| dw\.ocapi.shop.basket.item.modifyDELETEResponse | int\_globale\_headless/cartridge/scripts/hooks/basket/productItems | Modifies the product item DELETE response |
| dw\.ocapi.shop.basket.coupon.beforePOST | int\_globale\_headless/cartridge/scripts/hooks/basket/coupon | Called before a coupon is added to a basket |
| dw\.ocapi.shop.basket.coupon.modifyPOSTResponse | int\_globale\_headless/cartridge/scripts/hooks/basket/coupon | Modifies the OCAPI response after adding a coupon |
| dw\.ocapi.shop.basket.coupon.beforeDELETE | int\_globale\_headless/cartridge/scripts/hooks/basket/coupon | Called before a coupon is removed from a basket |
| dw\.ocapi.shop.basket.coupon.modifyDELETEResponse | int\_globale\_headless/cartridge/scripts/hooks/basket/coupon | Modifies the OCAPI response after removing a coupon |
| dw\.ocapi.shop.order.beforePOST | int\_globale\_headless/cartridge/scripts/hooks/order | Called before an order is created from the basket |
| dw\.ocapi.shop.order.afterPOST | int\_globale\_headless/cartridge/scripts/hooks/order | Called after an order was created from the basket |
| dw\.ocapi.shop.product.beforeGET | int\_globale\_headless/cartridge/scripts/hooks/product.js | Called before a product is retrieved |
| dw\.ocapi.shop.product.modifyGETResponse | int\_globale\_headless/cartridge/scripts/hooks/product.js | Modifies the product GET response (Global-e pricing/availability) |
| dw\.ocapi.shop.product\_search.beforeGET | int\_globale\_headless/cartridge/scripts/hooks/productSearch.js | Called before a product search is executed |
| dw\.ocapi.shop.product\_search.modifyGETResponse | int\_globale\_headless/cartridge/scripts/hooks/productSearch.js | Modifies the product search GET response |
| dw\.ocapi.shop.custom\_object.modifyGETResponse | int\_globale\_headless/cartridge/scripts/hooks/customObject.js | Modifies custom object GET responses used by Global-e data feeds |

## 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`.

<h3 id="globaleoninit">
  globale.onInit
</h3>

**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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| initData | Object | Initialization data: `geEnabled`, `geCountry`, `geCurrency`, `geCulture`, `geLocale`, `geIsOperated`, `gePriceStrategy` |

**Returns**

Void. The hook handler result is not used further.

<h3 id="globalegetguestemail">
  globale.getGuestEmail
</h3>

**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).<br />
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.

<h3 id="globalegetcustomeraddresses">
  globale.getCustomerAddresses
</h3>

**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).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | The customer’s basket |

**Returns**

The hook handler must return null or the array of all customer’s addresses.

<h3 id="globalegeturlparameters">
  globale.getUrlParameters
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to extend the Global-e UrlParameters SendCart payload property.<br />
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).<br />
OOTB the custom hook handler returns an empty object.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | The customer’s basket |

**Returns**

The hook handler must return null or the object (e.g., \{ key1: `value1`, key2: `value2` }).

<h3 id="globalegetplicustommetadata">
  globale.getPLICustomMetadata
</h3>

**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.<br />
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.).<br />
OOTB the custom hook handler returns an empty object.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| productLineItem | dw\.order.ProductLineItem | Product line item |

**Returns**

The hook handler must return null or the object (e.g., \{ key1: `value1`, key2: `value2` }).

<h3 id="globalegetpliestimateddeliverydate">
  globale.getPliEstimatedDeliveryDate
</h3>

**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.<br />
Allows displaying a new template for delivery date estimation (preorder/backorder products). The notification will be displayed next to the product, like product attributes.<br />
OOTB the custom hook handler returns null.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| productLineItem | dw\.order.ProductLineItem | Product line item |

**Returns**

The hook handler must return null or the string value using the format `YYYY-MM-DD` (e.g., 2022-05-15).

<h3 id="globalegetpliisbackordered">
  globale.getPliIsBackOrdered
</h3>

**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.<br />
OOTB the custom hook handler returns false.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| productLineItem | dw\.order.ProductLineItem | Product line item |

**Returns**

The hook handler must return boolean value.

<h3 id="globalegetcookieconsent">
  globale.getCookieConsent
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the customer cookie consent.<br />
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

<h3 id="globalegetallowmailsfrommerchant">
  globale.getAllowMailsFromMerchant
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the AllowMailsFromMerchant value.<br />
OOTB the custom hook handler returns false.

**Returns**

The hook handler must return boolean value.

<h3 id="globalegetallowdirectcommunicationfrommerchant">
  globale.getAllowDirectCommunicationFromMerchant
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the AllowDirectCommunicationFromMerchant value.<br />
OOTB the custom hook handler returns false.

**Returns**

The hook handler must return boolean value.

<h3 id="globalebeforesendcartrequest">
  globale.beforeSendCartRequest
</h3>

**Description**

The custom hook is invoked before the SendCart request.<br />
OOTB the custom hook handler is not defined.<br />
**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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | The customer’s basket |
| payload | Object | SendCart payload object |

**Returns**

Void.

<h3 id="globalegetplatformurls">
  globale.getPlatformURLs
</h3>

**Description**

The custom hook is invoked before the SendCart request to populate the `PlatformURLs` property (SiteURL, RedirectToCartURL, PaymentCallbackURL).<br />
OOTB the custom hook handler is not defined.

**Returns**

The hook handler must return an object (e.g., `{ SiteURL: '...', RedirectToCartURL: '...', PaymentCallbackURL: '...' }`) or `null`.

<h3 id="globalegetsendcartproductoriginalmerchantpriceforduties">
  globale.getSendCartProductOriginalMerchantPriceForDuties
</h3>

**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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| target | Object | SendCart product object being built |
| source | dw\.catalog.Product | SFCC product |

**Returns**

Number (wholesale price) or `null`.

<h3 id="globalegetplihubcode">
  globale.getPliHubCode
</h3>

**Description**

The custom hook is invoked for setting hub code on the product level of the SendCart request body.<br />
OOTB the custom hook handler is registered and returns `null`.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| productLineItem | dw\.order.ProductLineItem | Product line item |

**Returns**

The hook handler must return string value.

<h3 id="globalevalidatecart">
  globale.validateCart
</h3>

**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.<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| payload | Object | ValidateCart payload object |
| isPayByLinkScenario | Boolean | True when the request is part of a pay-by-link scenario |

**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 }).

<h3 id="globaleonbeforeapplycouponcode">
  globale.onBeforeApplyCouponCode
</h3>

**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).<br />
OOTB the custom hook handler is not implemented. Could be used to add additional payload data or the request headers.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| service | dw\.svc.Service | SFCC service |
| payload | Object | The Apply Coupon Code SFCC OCAPI request payload |

**Returns**

Void.

<h3 id="globaleonbeforeremovecouponcode">
  globale.onBeforeRemoveCouponCode
</h3>

**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).<br />
OOTB the custom hook handler is not implemented. Could be used to add additional payload data or the request headers.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| service | dw\.svc.Service | SFCC service |
| payload | Object | The Remove Coupon Code SFCC OCAPI request payload |

**Returns**

Void.

<h3 id="globaleongeneratebasketfrompayload">
  globale.onGenerateBasketFromPayload
</h3>

**Description**

The custom hook is invoked right after the basket is recreated on the SFCC side.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | The basket recreated from the payload |
| payload | Object | The request payload (could have different structure depending on if it’s the default or fallback order creation scenario) |

**Returns**

Void.

<h3 id="globaleonaftercreateorder">
  globale.onAfterCreateOrder
</h3>

**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).<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload (could have different structure depending on if it’s the default or fallback order creation scenario) |

**Returns**

Void.

<h3 id="globaleonaftercreatemixedorder">
  globale.onAfterCreateMixedOrder
</h3>

**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<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| isBasketExist | Boolean | The flag which indicates the state of SFCC basket. |
| payload | Object | The request payload (could have different structure depending on if it’s the default or fallback order creation scenario) |

**Returns**

Void.

<h3 id="globaleonbeforeplaceorder">
  globale.onBeforePlaceOrder
</h3>

**Description**

The custom hook is invoked right before an order is placed on the SFCC side.<br />
OOTB the SFRA/SiteGenesis handler sets `session.setTrackingAllowed(true)` when the order payload `CookieConsent` is `1` or `2`.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload (could have different structure depending on if it’s the default or fallback order creation scenario) |

**Returns**

Void.

<h3 id="globaleonafterplaceorder">
  globale.onAfterPlaceOrder
</h3>

**Description**

The custom hook is invoked right after an order is placed on the SFCC side.<br />
OOTB the custom hook handler is not implemented. Implement in a project cartridge when post-place-order logic is required.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload (could have different structure depending on if it’s the default or fallback order creation scenario) |

**Returns**

Void.

<h3 id="globaleonafterupdateorder">
  globale.onAfterUpdateOrder
</h3>

**Description**

The custom hook is invoked right after an order is updated on the SFCC side (SendOrderToMerchant request).<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonsetcustomercomments">
  globale.onSetCustomerComments
</h3>

**Description**

The custom hook is invoked during SendOrderToMerchant processing to set customer comments on the order.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |
| payload | Object | SendOrderToMerchant request payload |

**Returns**

Void.

<h3 id="globalemodifycreateupdateorderresponse">
  globale.modifyCreateUpdateOrderResponse
</h3>

**Description**

The custom hook is invoked to modify the order create/update API response returned to Global-e.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |
| response | Object | Response object to be returned |

**Returns**

The modified response object.

<h3 id="globaleonafterupdatemixedorders">
  globale.onAfterUpdateMixedOrders
</h3>

**Description**

The custom hook is invoked right after mixed orders are updated on the SFCC side (SendOrderToMerchant request).<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orders | dw\.util.ArrayList | Array of orders(main and sub orders) |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonafterpaymentupdate">
  globale.onAfterPaymentUpdate
</h3>

**Description**

The custom hook is invoked right after an order payment status is updated on the SFCC side (PaymentNotification request).<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonafterpaymentupdatemixedorders">
  globale.onAfterPaymentUpdateMixedOrders
</h3>

**Description**

The custom hook is invoked right after mixed orders payment statuses are updated on the SFCC side (PaymentNotification request).<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orders | dw\.util.ArrayList | Array of orders(main and sub orders) |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonafterstatusupdate">
  globale.onAfterStatusUpdate
</h3>

**Description**

The custom hook is invoked right after the order status is updated on the SFCC side (OrderStatusUpdate request).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonafterstatusupdatemixedorders">
  globale.onAfterStatusUpdateMixedOrders
</h3>

**Description**

The custom hook is invoked right after the mixed orders statuses are updated on the SFCC side (OrderStatusUpdate request).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orders | dw\.util.ArrayList | Array of orders(main and sub orders) |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonaftershippingupdate">
  globale.onAfterShippingUpdate
</h3>

**Description**

The custom hook is invoked right after the order shipping information is updated on the SFCC side (OrderShippingInfoUpdate request).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonafterrefund">
  globale.onAfterRefund
</h3>

**Description**

The custom hook is invoked right after the order refund information is updated on the SFCC side (OrderRefund request).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globaleonaftergermaupdate">
  globale.onAfterGeRmaUpdate
</h3>

**Description**

The custom hook is invoked right after the order RMA information is updated on the SFCC side (RMA request).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC Order |
| payload | Object | The request payload |

**Returns**

Void.

<h3 id="globalecustomerverification">
  globale.customerVerification
</h3>

**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).<br />
OOTB the custom hook handler checks if a customer has the SFCC account.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| payload | Object | The request payload |

**Returns**

Returns customer verification status (e.g., \{ success: true, registered: false, errorCode: null, eventName: 'status' }).

<h3 id="globalecustomerregistration">
  globale.customerRegistration
</h3>

**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).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| payload | Object | The request payload |

**Returns**

Returns customer registration status (e.g., \{ success: true, registered: true, errorCode: null, eventName: 'register' }).

<h3 id="globaleoutboundorderstatusupdate">
  globale.outboundOrderStatusUpdate
</h3>

**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).<br />
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orderId | String | The notification order number |
| payload | Object | The notification payload |

**Returns**

Returns the notification creation status (dw\.system.Status).

<h3 id="globaleoutboundorderdispatchupdate">
  globale.outboundOrderDispatchUpdate
</h3>

**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).<br />
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orderId | String | The notification order number |
| payload | Object | The notification payload |

**Returns**

Returns the notification creation status (dw\.system.Status).

<h3 id="globaleoutboundorderrefundupdate">
  globale.outboundOrderRefundUpdate
</h3>

**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).<br />
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orderId | String | The notification order number |
| payload | Object | The notification payload |

**Returns**

Returns the notification creation status (dw\.system.Status).

<h3 id="globaleoutboundorderrmaupdate">
  globale.outboundOrderRMAUpdate
</h3>

**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).<br />
OOTB the custom hook handler creates a notification custom object that is processed by the GlobaleOrderNotifications job further.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orderId | String | The notification order number |
| payload | Object | The notification payload |

**Returns**

Returns the notification creation status (dw\.system.Status).

<h3 id="globaleoutboundparcelstatusupdate">
  globale.outboundParcelStatusUpdate
</h3>

**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).<br />
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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| orderId | String | SFCC or Global-e order ID |
| parcelCode | String | Parcel identifier |
| payload | Object | Notification payload |

**Returns**

Returns the notification creation status (`dw.system.Status`).

<h3 id="globalegetproductinventorylistid">
  globale.getProductInventoryListId
</h3>

**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.<br />
OOTB the custom hook handler returns null value.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| product | dw\.catalog.Product | SFCC product |

**Returns**

Returns the ID of the inventory list or null.

<h3 id="globalegetproductimageurl">
  globale.getProductImageUrl
</h3>

**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`)<br />
OOTB the custom hook handler returns a null value.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| product | dw\.catalog.Product | SFCC product |

**Returns**

Returns the URL of the product or null.

<h3 id="globalegethubid">
  globale.getHubId
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the HubId value.<br />
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`.

<h3 id="globaleresetpricebooks">
  globale.resetPriceBooks
</h3>

**Description**

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

**Returns**

Void.

<h3 id="globaleonaftervoidreservation">
  globale.onAfterVoidReservation
</h3>

**Description**

The custom hook is invoked when Global-e VoidReservation notification is received on the platform side.<br />
OOTB there is no custom hook handler.

**Returns**

The hook handler must return boolean value.

<h3 id="globalegetlineitemdeliverytype">
  globale.getLineItemDeliveryType
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the LineItemDeliveryType value (relevant only for BOPIS orders).<br />
OOTB the custom hook handler returns null.

**Returns**

The hook handler must return string value (Enum: BOPIS, DelayBOPIS, BOSS, ShipIt).

<h3 id="globalegetlineitemshiptostorecode">
  globale.getLineItemShipToStoreCode
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the ShipToStoreCode value (relevant only for BOPIS orders).<br />
OOTB the custom hook handler returns null.

**Returns**

The hook handler must return string value.

<h3 id="globalegetestimateddeliverytimemessage">
  globale.getEstimatedDeliveryTimeMessage
</h3>

**Description**

The custom hook is invoked before the SendCart request and could be used to return the EstimatedDeliveryTimeMessage value (relevant only for BOPIS orders).<br />
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.<br />
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.

<h3 id="globaleongetsendcartdata">
  globale.onGetSendCartData
</h3>

**Description**

The custom hook returns checkout/SendCart preparation data for headless and express checkout flows.<br />
Registered in `int_globale/hooks.json`. OOTB the handler returns the result of the checkout show operation.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | Current basket |

**Returns**

SendCart operation result object.

<h3 id="globaleoninitapplication">
  globale.onInitApplication
</h3>

**Description**

The custom hook initializes the Global-e application context for a country/currency pair.<br />
Registered in `int_globale/hooks.json`. OOTB the handler runs `globaleInit`.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| countryCode | String | ISO country code |
| currencyCode | String | ISO currency code |

**Returns**

Void.

<h3 id="globaleongetmerchantguid">
  globale.onGetMerchantGuid
</h3>

**Description**

The custom hook returns the Global-e merchant GUID.<br />
Registered in `int_globale/hooks.json`. OOTB the handler returns the merchant GUID from service credentials via `globaleHelpers.getMerchantGuid()`.

**Returns**

String (merchant GUID).

<h3 id="globaleongetcountry">
  globale.onGetCountry
</h3>

**Description**

The custom hook returns the Global-e country object for a country code.<br />
Registered in `int_globale/hooks.json`. OOTB the handler uses `geCountryMgr.getByCountryCode`.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| countryCode | String | ISO country code |

**Returns**

Global-e country object.

### globale.webStore.getWebStoreInstanceCodeInJobContext

**Description**

The custom hook returns the WebStore instance code when Global-e settings jobs run.<br />
OOTB the custom hook handler is not implemented.

**Returns**

String (WebStore instance code) or `null`.

<h3 id="globaleonaftergiftcertificaterefund">
  globale.onAfterGiftCertificateRefund
</h3>

**Description**

The custom hook is invoked after a Global-e gift certificate refund is processed.<br />
OOTB the custom hook handler is not implemented.

**Returns**

Void.

<h3 id="globaleonaftergiftcertificateredeem">
  globale.onAfterGiftCertificateRedeem
</h3>

**Description**

The custom hook is invoked after a Global-e gift certificate is redeemed.<br />
OOTB the custom hook handler is not implemented.

**Returns**

Void.

<h3 id="globaleonaftergiftcertificatecreate">
  globale.onAfterGiftCertificateCreate
</h3>

**Description**

The custom hook is invoked after a Global-e gift certificate is created.<br />
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.<br />
**Note:** registered in code as `onAfterGiftCertificateOrderCreate` (without the `globale.` prefix). OOTB the custom hook handler is not implemented.

**Returns**

Void.

<h3 id="globaleonpaybylinkaftercreateorder">
  globale.onPayByLinkAfterCreateOrder
</h3>

**Description**

The custom hook is invoked after an order is created in a Pay-by-Link scenario.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |

**Returns**

Void.

<h3 id="globaleonpaybylinkafterplaceorder">
  globale.onPayByLinkAfterPlaceOrder
</h3>

**Description**

The custom hook is invoked after an order is placed in a Pay-by-Link scenario.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |

**Returns**

Void.

<h3 id="globaleonbeforeordervalidate">
  globale.onBeforeOrderValidate
</h3>

**Description**

The custom hook is invoked before Pay-by-Link order validation.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |

**Returns**

Void.

<h3 id="globaleonafterordervalidate">
  globale.onAfterOrderValidate
</h3>

**Description**

The custom hook is invoked after Pay-by-Link order validation.<br />
OOTB the custom hook handler is not implemented.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| order | dw\.order.Order | SFCC order |

**Returns**

Void.

<h3 id="globaleonbeforecalculate">
  globale.onBeforeCalculate
</h3>

**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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | SFCC basket |

**Returns**

The hook handler must return system Status with custom code.<br />

| Custom Code | **Description** |
| - | - |
| geContinueBaseCalculate | returned when the basket is **not** a Global-e basket — **only base calculate is executed**. |
| geStopCalculate | returned when the calculate flow should be interrupted and base calculate must not run, for the custom cases: pay-by-link scenario or CAPI order-create request. |
| geContinueGECalculate | returned for a Global-e basket in an operated country — **both the custom Global-e calculate and base calculate run**. |

<h3 id="globalecalculateproductprices">
  globale.calculateProductPrices
</h3>

**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**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | SFCC basket |

**Returns**

Void (the OOTB handler updates the basket in place).

<h3 id="globalecalculatebaseproductprices">
  globale.calculateBaseProductPrices
</h3>

**Description**

The custom hook is called to calculate prices for all product line items in the basket.

**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | SFCC basket |

**Returns**

Void (the OOTB handler updates the basket in place).

<h3 id="globalecalculatetax">
  globale.calculateTax
</h3>

**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.<br />
**Custom hooks handler arguments**

| **Argument Name** | **Argument Type** | **Description** |
| - | - | - |
| basket | dw\.order.Basket | SFCC basket |

***

## See also

* [Metadata](/metadata-sfcc) — `ge*` custom attributes and BM object definitions
* [Configuration](/configuration-sfcc) — site preferences and BM setup
* [Customization](/customization-sfcc) — implementing custom hook handlers
* [Checkout flow](/checkout-flow-sfcc) and [Failover](/failover-sfcc) — order lifecycle and fallback (SOTM)
