Issuance API - Segmentation

Written By Devin O'Neill ()

Updated at April 23rd, 2025

Overview

In the Annex Cloud loyalty system, segmentation functionality works using the data received through the Order API. The Issuance API accepts orders so that all order data is available for segmentation with different metrics.

Super Admin Flag

If the super admin flag is on, these options are shown in the segmentation site.

Segmentation Options on the Order API:

  • Amount Spend
  • Product with Amount
  • Product with Quantity
  • Product Attributes
  • Order Attributes
  • Source

The Issuance API includes all specified parameters, with the exception of Product Category. The Order API meets all the criteria mentioned above.

The combination of multiple products is supported by the product quantity and spend amount, whereas the current logic only operates based on the individual quantity and amount of each product.

Below are use cases that the Issuance API supports for standalone segmentation:

Amount Spend:

In the Issuance API, there is a parameter called orderTotalSpend. Depending on the value passed to this parameter, our loyalty system supports the sending of amounts in various use cases.

Use case 1:
Set the Amount Spend value to be greater than $1000, choose the Spending Details as a single order, and select the Time Window as all time.

Example 1: If the orderTotalSpend is $900, then the segment condition is not met. Therefore, the member will not be included in the segment.

Example 2: If the orderTotalSpend amounts to $1100, the Segment condition is met by verifying the orderTotalSpend within a single order. Consequently, the member becomes part of the segment. If the segment is linked to the campaign or offer, the member will then receive the associated campaign or offer benefits.

Use Case 2:

Set the Amount Spend value to be greater than $1000, choose the Spending Details as a Multiple orders, and select the Time Window as all time.

The Multiple Orders option is currently unavailable for the Amount Spend condition. This option will only be accessible for the Issuance API, specifically based on the Super Admin Flag
 

Example 1: If the orderTotalSpend is $100, the Segment condition is not met. As a result, the loyalty member is not included in the segment.

Example 2: If the orderTotalSpend is $400, the Segment condition is not met. As a result, the loyalty member is not included in the segment.

Example 3: When the orderTotalSpend reaches $1100, the segment condition is met by verifying the total spend across multiple orders. Consequently, the member qualifies to join the segment. If the segment is linked to a campaign or offer, the loyalty member is then availing the associated benefits.

Product with Amount:

There is also an Additional Condition field that allows you to apply more Product conditions, such as time and purchase size.

Currently, this condition only works with the issuance API when the super admin flag is enabled.

Use case: Product Purchase and Amount Spent for Single Order with Individual Product Conditions:

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Single Order" with the Amount greater than 1000. Opt for the purchase condition as "Individual Product Condition" and set the time window to "All Time."

Use case1: 

The order consists of three products: P1 with a productTotalAmount of $500, P2 with a productTotalAmount of $600, and P3 with a productTotalAmount of $700. As the segment condition is not satisfied, the member must not be included in the segment.

Use case 2: 

The order consists of three products: P1 with a productTotalAmount of greater than $1000, P2 with a productTotalAmount of $700, and P3 with a productTotalAmount of $900.The segment condition is fulfilled only when one of the products' total amounts should be greater than $1000 from the order meets the segment condition. Consequently, the member should be added to the segment and receive the benefit if applicable.

Use case: Product Purchase and Amount Spent for Multiple Orders with Individual Product Conditions

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Multiple Orders" with the Amount greater than 1000. Opt for the purchase condition as "Individual Product Condition" and set the time window to "All Time."

Use case1:

The order consists of three products: P1 with a productTotalAmount of $200, P2 with a productTotalAmount of $300, and P3 with a productTotalAmount of $400. As the segment condition is not satisfied, the member must not be included in the segment.

Use case2:

The order consists of three products: P1 with a productTotalAmount of $1000, P2 with a productTotalAmount of $700, and P3 with a productTotalAmount of $900. The segment condition is fulfilled when one of the products from the order meets the segment condition. Consequently, the member should be added to the segment and receive the benefit if applicable.

Use case: Product Purchase and Amount Spent for Single Orders with Cumulative Product Condition

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Single Order" with the Amount greater than 1000. Opt for the purchase condition as "Cumulative Product Condition" and set the time window to "All Time."

Use case1:

The order consists of three products: P1 with a productTotalAmount of $300, P2 with a productTotalAmount of $300, and P3 with a productTotalAmount of $350. The segment needs to calculate the total spend across all listed products. Since the condition is not met, the member should not be included in the segment.

Use case 2:

The order consists of three products: P1 with a productTotalAmount of $500, P2 with a productTotalAmount of $400, and P3 with a productTotalAmount of $300. The segment condition has been met, as the cumulative spend on the products listed in the segment satisfies the condition. Consequently, the member will be included in the segment and will receive the benefits, if eligible.

Use case: Product Purchase and Amount Spent for Multiple Orders with Cumulative Product Condition

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Multiple Orders" with the Amount greater than 1000. Opt for the purchase condition as "Cumulative Product Condition" and set the time window to "All Time."

Use case1:

The order consists of three products: P1 with a productTotalAmount of $300, P2 with a productTotalAmount of $200, and P3 with a productTotalAmount of $300. The segment needs to calculate the total spend across all listed products. Since the condition is not met, the member should not be included in the segment.

Use case2:

The order consists of three products: P1 with a productTotalAmount of $300, P2 with a productTotalAmount of $100, and P4 with a productTotalAmount of $300. The segment should calculate the total spend by combining the expenses from past orders with the current order of the specified products.

Use case3:

The order consists of three products: P1 with a productTotalAmount of $300, P4 with a productTotalAmount of $100, and P5 with a productTotalAmount of $200. The segment condition has been fulfilled as the cumulative spend from this and previous orders meets the defined segment criteria for the listed product. Therefore, the member should be added to the segment and receive the benefit if applicable.

Product with Quantity:

Use case: Product Purchase for Single Order with Individual Product Condition and Quantity:

Set the event type to "Product" and choose the condition "Has Purchased." The list should contain the products: P1, P2, P3. Define the Purchase details as "Single Order" with a productQuantity exceeding 10. Select the purchase condition as "Individual Product Condition" and adjust the time window to "Between" 1st Jan 2024 to 31st Jan 2024.

Use case1:

A loyalty member has purchased the first order on the 10th of January 2024 with different productQuantity: P1 = 2, P2 = 5, and P3 = 9. Since none of the orders consist of 10 individual products, the segment condition is not met, and the loyalty member is not included in the segment.

Use case2:

A loyalty member purchased a second order on January 20, 2024, with different productQuantity: P1 = 5, P2 = 8, and P3 = 11. The order meets the segment criteria as one of the products purchased surpasses the segment threshold of (Product quantity greater than 10). As a result, the loyalty member meets the criteria for inclusion in the segment and is eligible to receive relevant benefits.

Use case: Product Purchase and for Single Order with Cumulative Product Condition with Quantity:

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Single Orders" with the productQuantity greater than 10. Opt for the purchase condition as "Individual Product Condition" and set the time window to "All Time".

Use case1:

A loyalty member has made purchases with varying productQuantity''s: P1=2, P2=4, and P3=3. However, the segment condition is not met because the total product quantity (accumulated from all products) in the segment is lower than the specified conditions. Therefore, the loyalty member is not included in the segment.

Use case2:

A loyalty member has made purchases with varying productQuantity''s: P1=3, P2=4, and P3=5. The segment condition is met when the total product quantity (accumulated from all products) listed in the segment satisfies the condition of having a product quantity greater than 10. Consequently, the member included in the segment and eligible to receive any applicable benefits.

Use case: Product Purchase and for Multiple Orders with Individual Product Condition with Quantity:

Set the event type as "Product" and select the condition as "Has Purchased." Include the following products in the list: P1, P2, P3. Specify the Purchase details as "Multiple Orders" with the productQuantity greater than 10. Opt for the purchase condition as "Individual Product Condition" and set the time window to "All Time".

Use case1:

A loyalty member placed order 1 with different productQuantity’s: P1=5, P2=4, and P3=3. The segment condition is not satisfied as none of the products have 10 units individually in the order. Hence, the loyalty member is not to added to the segment.

Use case2:

A loyalty member has placed order 2 with different productQuantity's: P1=4, P2=4, and P3=3. The segment condition is not satisfied as none of the products have a total quantity of 10 in the order. Consequently, the member should not be included in the segment.

Use case3:

A loyalty member has placed order 3 with varying product quantities: P1=2, P2=1, and P3=3. The segment condition is fulfilled when the total product quantity listed in the segment exceeds the defined conditions from this and the previous orders, which is an individual product quantity greater than 10. Therefore, the member should be added to the segment and receive the benefit if applicable.

Product Attributes:

The segmentation feature currently includes the product attributes option, which operates based on the predefined product attributes value in the PCM.

You have the flexibility to define any attribute name as the Attribute Key and Value within this feature.

The Product Attribute and its value are not pre-set in the site admin.

Initially, you need to establish the attribute and its value, with data retrieval possible later from the issuance API.

Implementing this for existing product attributes in the segmentation screen will impact you as a current customer. Therefore, a flag has been introduced at the super admin level to enable the new option in the segmentation criteria.

These attributes will exclusively correspond to the new issuance API.

Use case:

Set the event type to "Issuance Product Attribute" and choose the condition as "Has Purchased." Define the Attribute name as “partnerName” and set the Attribute values to SHELL. Adjust the time window to "All Time".

Use case1:

A loyalty member has placed order 1 with different partnerName’s attributes: partnerName (P1) = AL, partnerName (P2) = SHLL, partnerName (P3) = Etos. The segment criteria are not met as none of the products have the required attribute value. Therefore, the member should not be eligible for the segment or any associated campaign.

Use case2:

A loyalty member has placed order 1 with different partnerName attributes: partnerName (P1) = AL, partnerName (P2) = SHELL, partnerName (P3) = Etos. The segment criteria are met as one of the products from the order has the required attribute value SHELL. Hence, the member should be eligible for the segment and should receive the campaign benefit if applicable.

Instructions to administrators:

  • The administrator can add multiple attribute values by separating them with commas.
  • An OR conditions will be applied when there are multiple comma-separated values.
  • The attribute and its value must match exactly. For instance, "SHELL" and "SHLL" are considered different values.
  • The above example will function with various Time Windows.

Order Attributes:

Keynote on Issuance API for Order Attribute Event:

In the Issuance API, we deal with issuanceOrderAttributes. These attributes and their values are accepted dynamically without the need for any configuration. Our goal is to enable segment creation based on these issuanceOrderAttributes, whether they exist in the database or will be obtained in the future.

Similarly, just like with issuanceProductAttribute, we have added a new option to the dropdown menu. This option should only be visible if the super admin flag is active.

Source:

Keynote on Issuance API for Source Event:

  • Segment creation based on the source is currently possible through the order API. The source field should be able to receive values from the Issuance API.
  • This field will accept multiple comma-separated values with an OR condition.
  • The source will be compatible with various AND/OR conditions and other event conditions.
  • It will accommodate all Time Window selections as detailed earlier.
  • The source value is not case-sensitive and requires an exact match.

For example, WEB/WeB/wEb/weB, etc., are considered valid, while Webb/Wb/WEEB, etc., are not.