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

# Loyalty Points Cards

The Global-e cartridges support **earning and redeeming loyalty points on the Global-e checkout**. As with the other alternative payments ([Gift Cards](/gift-cards-sfcc), [Native Gift Certificates](/native-gift-certificates-sfcc)), the cartridges include the framework plus a **demo implementation** based on SFCC custom objects of type `DEMO_GLOBALE_LOYALTY_CARDS`. **Replace the demo with a real provider before production.** Do **not** import demo custom-object data from `metadata/demo/` into production.

<Note>
  This is an optional feature. It requires project code (a provider and a SendCart decorator). See [Required customization](#required-customization).
</Note>

## Sending loyalty data to the checkout

For a registered shopper who has loyalty points, the **SendCart** request tells Global-e how many points can be earned and spent on the checkout. Populate this by overriding the SendCart decorator:

`int_globale/cartridge/models/globale/sendCart/decorators/loyaltyPoints.js`

The decorator should set:

| SendCart attribute | Meaning |
| - | - |
| `LoyaltyCreditPointsEarned` | Points to be earned from the purchase |
| `LoyaltyPointOriginalValueForSpend` | Points expressed as money, in the currency of `LoyaltyPointOriginalCurrencyForSpend` |
| `LoyaltyPointOriginalCurrencyForSpend` | Currency code for the value above |
| `LoyaltyCreditCode` | Loyalty card ID |

These attributes are included in the **SendCart** payload so Global-e can show earn/spend options on checkout.

## Redeeming points on checkout

On the Global-e checkout, the shopper enters the number of points to redeem and clicks **Redeem**.

The flow uses the standard alternative-payment requests:

| Request | When it is sent | What happens |
| - | - | - |
| **Validate** | When the shopper redeems points | Validation is handled on the Global-e side using the data sent in SendCart. Invalid amounts show an error. A valid amount is converted to the checkout currency and the totals refresh. |
| **Redeem** | After **Pay and Place Order**, when Global-e creates the order on its side (before the SFCC order is created) | SFCC (or an external loyalty system) performs the redeem operation. If it fails, the shopper sees an error and no SFCC order is created. If it succeeds, the confirmation page is shown and the SFCC order is created. |
| **Refund** | When a refund case is created on the Global-e side (for example the order is cancelled) | Reverses the redemption. |

After a successful redeem, checkout totals update to show how much of the order the points cover.

* If the redeemed points cover the full order total, the shopper can place the order with no additional payment.
* If they cover only part of the total, the shopper selects a payment method for the remainder.

Details of the cards used are added to the **SendOrderToMerchant** and **PaymentNotification** payloads.

## Required customization

The demo uses SFCC custom objects of type `DEMO_GLOBALE_LOYALTY_CARDS`. For production, override both of the following:

1. **Loyalty card provider** — `int_globale/cartridge/scripts/globale/alternativePayments/providers/LoyaltyCardProvider.js`
2. **Loyalty points SendCart decorator** — `int_globale/cartridge/models/globale/sendCart/decorators/loyaltyPoints.js`

## Summary

The demo (based on SFCC custom objects) is a minimal reference showing the core moving parts. Production projects supply a provider that integrates their loyalty system and a decorator that reports earn/spend data in SendCart. Never deploy the demo `DEMO_GLOBALE_LOYALTY_CARDS` provider or demo object data to production.

## See also

* [Gift Cards](/gift-cards-sfcc) · [Native Gift Certificates](/native-gift-certificates-sfcc)
* [Metadata reference](/metadata-sfcc) — `DEMO_GLOBALE_LOYALTY_CARDS`
