# Custom Units Expiration & Pending Settings

### **Why Customize This**

By enabling this option, you can create dynamic expiration or pending dates based on a variety of conditions, ensuring that the campaign's incentives align with strategic business objectives such as encouraging quicker customer spending or rewarding long-term loyalty. These methods let you create urgency or tie expirations to loyalty milestones.

{% hint style="info" %}
Advanced settings override [default wallet settings](/main-features/wallets/wallet-types-and-configuration.md#unit-settings), making it possible to customize campaigns at a very detailed level.&#x20;
{% endhint %}

### **How to Configure**

<figure><img src="/files/pf0a6E7zwAnBhdnYRiHf" alt=""><figcaption></figcaption></figure>

* Select effect **Add Units**
* In **Override units settings**, enable **Expiration settings** or **Pending settings**.
* Use templates to set expiration (e.g., fixed date, X days from transaction).<br>

  <figure><img src="/files/X0cJ21a77Y9UScrKZdaB" alt=""><figcaption></figcaption></figure>
* Use variables to reference system timestamps, transaction dates, or member attribute dates.\
  The list of available variables depends on the campaign trigger.<br>

  <figure><img src="/files/jWR0twGdkMrN5v9dYNj2" alt=""><figcaption></figcaption></figure>

### Examples

The example: `add_days_to_date(executionContext.processedAt, 15)`. The transaction got into the OL on the 1st of Feb, 2024, so the expiration date of the points will be 16.02.2024 (+15).

* **Transaction document date** - e.g `add_days_to_date(transaction.purchasedAt, 5)`.
* **Member custom attribute** - points will expire on the date of what’s in the member custom attribute value. (`to_date` - converts the key to date). Example custom attribute:

<figure><img src="/files/wvoajaxgV97sRx70allj" alt=""><figcaption></figcaption></figure>

\
If you use the variable below, the points will expire on 2025-08-24.

<figure><img src="/files/rnIxMsnj49vY0OheP3T3" alt=""><figcaption></figcaption></figure>

* But if you want to add days to the point expiration to the end date of the custom attribute, you can use one of the templates and the following formula: `add_days_to_date(to_date(agg(customer.labels).getLabelValue('subscription_end_date)),6)`. Then the expiration date of points will be on 30.08.2025.
* e.g. transaction took place at transaction date 2024-03-01 16:30 → formula days: add\_days\_to\_date(transaction.purchasedAt, 3) → points expire at (2024-03-04 16:30)&#x20;

→ IMPORTANT: it’s not by the end of the day, it’s always the same time as the event/ transaction date


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.openloyalty.io/main-features/campaigns/custom-units-expiration-and-pending-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
