Skip to main content
Pay By Link lets a merchant create an SFCC order on behalf of a shopper through the Global-e checkout and generate a payment link that the shopper completes later. It is typically used by customer service agents placing orders for shoppers.
This is an optional feature. It requires project code (a storefront control plus hooks) and an expiry job. See Implementation.

How it works

  1. A customer service agent shops on the shopper’s behalf — Merchant Tools → Ordering → Customer Service Center → Find customer — adds products to the basket, and proceeds to checkout.
  2. On the Global-e checkout, a control (for example Generate Payment Link) lets the agent create the order on the SFCC side via GlobalePayByLink-OrderCreate.
  3. When the agent triggers it, the order is created with order status NEW/OPEN and payment status NOT PAID. The response includes gePayByLinkUrl for the shopper.
  4. The payment link is shared with the shopper. How it is delivered is up to the merchant — for example a manual step, or an automated email sent when the order is created.
  5. When the shopper opens the link, they reach the checkout, complete the address and payment forms, and click Place Order. Global-e sends a ValidateCart request; for Pay By Link this checks the SFCC order status (specifically that it has not been CANCELLED due to expiry). If everything is fine the shopper sees the confirmation page; otherwise they see a Global-e-controlled error such as “the link is expired”.
  6. Because the order already exists on the SFCC side, the subsequent Global-e OrderCreate request is skipped. All later requests (SendOrderToMerchant, PaymentPerform, and so on) are handled exactly as for any other order, with no extra customization.

Limitations

Pay By Link works only with single orders and is not compatible with Mixed Orders.

Implementation

A payment link is generated by calling the GlobalePayByLink-OrderCreate endpoint (available in both the SFRA and SiteGenesis cartridges). For example, add a control to the checkout template for authenticated agent sessions:
Wire up the click handler in the Global-e script loader:
The click handler posts to GlobalePayByLink-OrderCreate with the cart token from the checkout iframe (#gle_iframe data-cart-token). On success, surface response.orderCreateResult.gePayByLinkUrl to the agent.

Cancel expired orders

Unpaid Pay By Link orders should be cancelled after they expire. The cartridges provide the job step type custom.GlobaleCancelExpiredPayByLinkOrders, which cancels orders still in OPEN/NEW and NOT PAID status once they pass the expiry time. Create a Business Manager job that runs this step on a schedule. The expiry window (autoCancelOrdersTime) is read from the Pay By Link Configurations Merchant Account Setting (sfccPayByLinkConfigurations). See Configuration for Global-e settings.

Customization (hooks)

Pay By Link behaviour can be extended through these hooks (see the Hooks reference for details):

See also