Preparation
Prepare your Voucherify account for a functional loyalty v2 integration.1
Prepare the project
Prepare your test environment in Voucherify, for example the Sandbox project.Use an existing API key/token or create a new pair. Go to Project settings > Application keys to get
X-App-Id and X-App-Token. Keep these keys on the server side only. See Authentication and Security.Make sure the API key can call loyalty, campaign, voucher, customer, product, and order endpoints used by your integration.Choose the correct regional API base URL from API overview (Europe, United States, or Asia).2
Create loyalty v2 program
User guidesFollow Tutorial – Create basic program for a step-by-step dashboard setup. Read the Loyalty v2 overview for the program model and rollout context.
lprg_...). This is required for all member-related API calls.Set the program status to ACTIVE.3
Customer data
Your loyalty program members must first exist as customers in Voucherify to have a Voucherify customer ID (
cust_...).You can:- Import your customer base with the Customer import or POST Import and Update Customers using CSV API endpoint.
- Use a CDP or CRM tool to synchronize your customers with Voucherify.
4
Product data
If you plan to use products as loyalty program rewards, you have to create them in Voucherify first.You can:
- Import your product database with the Product import in the Voucherify dashboard.
- Use the API with POST Import Products using CSV and POST Update products in bulk endpoints.
5
Data schemas: Metadata and custom events
If you’re going to combine the loyalty v2 program with metadata (custom attributes for point wallets, loyalty members, and more) or custom events (for example, to trigger when points are earned), you’ll have to create relevant schemas.Read more about creating metadata schemas and custom events.
Acquisition
Use the POST Create member or POST Create member in batch (asynchronous action) with the Voucherify customer ID to add the customer as a member to a loyalty v2 program. By default, the customer is added as anACTIVE member, who can immediately earn points and fully participate in the loyalty program.
Optionally, you can add the customer as an INACTIVE member. An inactive member will have to be activated later with the POST Activate member endpoint to participate in the loyalty program.
- Loyalty program member ID with a unique member ID (
lmbr_...) (line 2). - The loyalty card(s) generated for the member with a unique loyalty card ID (
lcrd_...) and the card definition (point wallet) ID. If your program uses multiple point wallets, the member will automatically receive a separate card for each card definition (cards[].card.idandcards[].card.card_definition_idin lines 16, 17, 54, and 55).
Discovery
Once you enroll your members, use the following endpoints so the members can learn more about your loyalty program: How they can earn and spend their points.Examine earning rules
Use the POST Examine earning rules endpoint to estimate how many points a customer will earn in a given scenario. This simulation calculates the precise number of points and material or digital benefits a customer can earn based on specific operational business triggers. Because this evaluation is a dry-run execution, Voucherify calculates these opportunities dynamically without writing transactions to card balances or modifying customer states.The POST Examine earning rules endpoint is an estimation of points to be earned. It doesn’t take into account additional earning rule triggers that may occur. For example, this can happen when a member pays for an order, earns points, and reaches a higher loyalty tier that will trigger additional points.
ALLmode: Simulates a parallel “what-if” scenario across all active earning rule configurations simultaneously.SPECIFICmode: Limits evaluation to one event context, like order paid, segment entered, or custom event.
ALL trigger
Use the trigger typeALL mode to create “Ways to earn” loyalty portals or customer dashboards. This option displays all available marketing paths to your customer simultaneously.
When you pass the type ALL, Voucherify sets the top-level event parameter value to null (response line 2). Voucherify processes every earning rule active within the customer’s program.
The simulation lists all earning rules (in the response example, the earning_rules array in lines 9–40) across distinct card definitions (the memberships[].cards array in lines 56–128, loyalty cards with names AnnualTime, AutumnTime, SummerTime). The response displays the total number of points to be earned on a card (points_estimation in line 65) and for individual earning rules that trigger the earning (points_estimation in lines 72 and 80). Voucherify also lists material rewards, such as the “Coffee sample Ethiopia” item, which is a MATERIAL benefit type (benefits[].benefit in lines 130–136).
Order paid earning rules with proportional calculationTo return an estimation for order paid earning rules which calculate points proportionally, you need to pass the
customer_order_paid object with required data, like order.items array.SPECIFIC trigger: Order paid
Use theSPECIFIC trigger type customer.order.paid inside digital shopping carts to estimate customer point collection right before final billing.
The simulation isolates rules linked directly to PAID transaction states. Voucherify processes the order details from your request context, including items, metadata, catalog categories, and amount values.
In the example, Voucherify resolves the EarningRule-OrderPaid rule (response example, earning_rules array, first object in lines 10–15) and returns an explicit balance projection of 25500 points for the primary AnnualTime loyalty card (memberships[].cards[].points_estimation in line 53). Also, the response lists earnings for AutumnPaid and SummerPaid earning rules (earning_rules array, objects in lines 16–27) that are used for the AutumnTime and SummerTime loyalty cards (memberships[].cards[].points_estimation in lines 74 and 95). The calculation reflects the current shopping cart properties without adding points to the active card yet.
SPECIFIC trigger: Customer entered segment
Prerequisite: Customer segmentThis scenario requires an earning rule that uses a customer segment as a trigger.Read the Customer segments guide to learn more about customer segments.
SPECIFIC trigger type customer.segment.entered to forecast reward outcomes when a member moves into a high-tier profile segment, like a VIP club. You can display this as an achievable milestone in the member profile.
The evaluation matches metadata configurations in the customer reference object. In this case, passing the metadata key-value pair "VIP": true simulates a segment transition (request example, customer_segment_entered.customer.metadata in line 15).
Voucherify identifies the EnterVipSegment rule schema (response example, the earning_rules array, first object in lines 12–17). The response isolates the member’s AnnualTime loyalty card and lists a milestone award valuation of 150 points (memberships[].cards[].points_estimation in line 43). Other purchase-dependent rules are omitted from the calculation automatically.
SPECIFIC trigger: Custom event
Prerequisite: Custom event schemaThis scenario requires an earning rule that uses a custom event as a trigger.Read the Custom events guide to learn more about custom events.
SPECIFIC trigger type customer.custom_event to evaluate custom behaviors outside standard purchase workflows, such as writing product reviews, bringing reusable cups to a coffee shop, or using mobile apps.
The calculation evaluates rules that trigger on unique business schemas rather than order parameters or segment fields. The custom event is passed as a schema_id inside the customer_custom_event object (request example, customer_custom_event.specific.custom_event.schema_id in line 16).
In the example below, the earning rule (response example, the object in the earning_rules array, lines 10–15) awards a benefit rather than loyalty points on a card. As a result, the simulation bypasses regular point cards completely, meaning the cards array returns empty (line 32). Instead, the response fills the benefits array, which shows that once this action is completed, the member will receive the “Coffee sample Ethiopia” product (lines 34–40).
Examine rewards
Prerequisite: Create and add rewards to point walletsCreated rewards must be added to relevant point wallets to be redeemable by your members. When you add the reward to a point wallet, you also define its price in points.You can create rewards through the dashboard or the API.
rewards array. The endpoint returns only active rewards (response example, lines 8–30) and draft rewards are ignored.
AVAILABLE status
When a reward returns anAVAILABLE status, the loyalty program member meets all eligibility criteria for reward redemption. This status guarantees that:
- The member has an active loyalty card belonging to the required card definition.
- The current point balance on that specific loyalty card is equal to or greater than the resolved point cost.
- The reward assignment has sufficient stock and is currently active.
AnnualTime-7M7ShPGfme contains two AVAILABLE reward opportunities: the “Free item coupon” (requiring 300 points; the memberships[].cards[].card.rewards object lines 91–102) and the “Minas Gerais 500” material reward (requiring 150 points; the memberships[].cards[].card.rewards object in lines 103–114).
UNAVAILABLE status
When a reward returns anUNAVAILABLE status, the member can’t redeem it at that moment. To prevent integration guesswork and support frontend user guidance, the Voucherify API provides a structured unavailability_reasons array detailing the exact failure point.
The evaluation engine identifies five primary reasons for reward unavailability:
insufficient_balance: The loyalty card balance is lower than the required reward cost. The API returns explicit context in thedetailsobject showingrequired,available, andmissingpoint values.out_of_stock: The reward assignment stock is depleted.no_matching_cost: No applicable point cost configuration is found or the cost configuration is locked.no_card_for_cost: The member profile lacks an active card for the required card definition.reward_inactive: The parent reward object is paused or inactive.
SummerTime-7z8dWawICd is marked UNAVAILABLE (line 61) due to insufficient_balance because the member possesses only 50 points out of the required 250 points (the memberships[].cards[].card.rewards.unavailability_reasons object in lines 66–75).
Examine rewards: Example request and response
Check the following request and response payloads to learn howAVAILABLE and UNAVAILABLE rewards are returned.
Activity
Your customers need to perform activities to meet earning rules and earn points or other benefits.Create order
If your customers earn points or benefits when they finalize transaction in your system (customer.order.paid event), Voucherify relies on the condition that the POST Create order request has the status field set to PAID.
When the Order API processes a payload with status set to PAID (line 3), the loyalty engine evaluates the line items and order amount to add points or benefits. Submitting orders with other statuses (such as CREATED or FULFILLED) will fail to activate the earnings.
Order paid request payload
Custom events
If your members earn points or benefits when performing specific custom activities, like subscribing to a newsletter, leaving a review, or unlocking a daily perk, use the POST Track custom event endpoint (/v1/events).
The request payload must include:
customer.idand/orcustomer.source_id(lines 3 and 4) to link the event to a specific customer in Voucherify database. The customer must be a member in the loyalty program.- Name of the custom event that triggers the earning rule passed as the value of the
eventproperty (line 6).
Enter segment
Read the Customer segments article to learn more about customer segments and how to create them.
Retention
Use the following endpoints and data to build a member profile view, which helps retaining your member base and keeps them engaged.Get program membership
Use the GET program membership endpoint (GET/v2/loyalties/programs/{programId}/memberships/{customerId}?identification_type=member_id) to create a member profile that will show:
- The member’s identity and status in the program.
- All loyalty cards the member has in the program.
- Current point balance, pending points, and other life time point data.
- Dates for point expiration and activation.
- Current progress in the tier structure.
membership object that groups three top-level fields:
member: The member’s profile in the program (lines 3–10).program: A summary of the loyalty program the member belongs to (lines 13–17). This is useful when your integration handles several programs and needs to identify the program referred to in the response.cards: The list of loyalty cards issued to the member (starting at line 19), used to render points and tier progress.
Get membership response
Member
Themember object (lines 2–11 of the response above) holds the profile data you use to identify the member in your system and reflect their status in the program:
id: The loyalty member ID assigned by Voucherify (line 3). Store it alongside your own customer record and pass it back on subsequent calls to this endpoint.customer_id: Links the member to a Voucherify customer (line 4), which you can use to correlate loyalty activity with the customer profile in your CRM.program_id: Identifies the loyalty program the member belongs to (line 5). Combined with the top-levelprogramobject, this lets you support integrations that manage several programs at once.status: Shows whether the member isACTIVEorINACTIVE(line 6). Use it to gate loyalty features in your UI. For example, hide the “Redeem points” action for inactive members.metadata: Returns any custom attributes you added to the member (line 7), such as an internal loyalty tier from another system or the enrollment channel.created_atandupdated_atare timestamps for when the member was created and last modified (lines 8, 9).
Points
With the Get membership endpoint you can create a member profile that lists points available to a member. Each of the member’s loyalty cards is returned in thecards array (starting at line 19). The details regarding points are stored in the following objects (referenced here from the first card, SummerTime-7z8dWawICd):
lifetime_bucket: Stores historical details regardingpointsandpending_points(lines 29–47). For example, you can use the data to show how many points wereearned,spent,expired, and so on.balance: Stores the details about the current number of available points (balance.points) for spending and the current number ofpending_points(lines 50, 51).next_expiration: Stores the details about the number of points that are about to expire and the nearest date (lines 54, 55). If you configured point expiration, you can use this data to nudge your members to spend the points before they expire.next_activation: Stores the details about the date and number of points that are about to be activated from the pending state as well as the type of the activation (lines 58–60).
Tiers
If your program runs loyalty tiers, you can also use the Get membership endpoint to return the details about the current tier progress for a given loyalty card. Use the data from thetier_progress object on the relevant card in the cards array (lines 115–151 of the response above, on the third card AnnualTime-7M7ShPGfme) to build a member profile that will display the active tier, and also risks and opportunities:
current: Returns the loyalty tier the member is currently on, including the tier ID, name, when the member achieved it and the point range (lines 116–126).risks: Returns data for tier expiration and downgrade (line 132). In this example the array is empty, meaning the member is not scheduled to lose their current tier.opportunities: Returns the number of points the member must earn to reach higher tiers (lines 133–149).
List transactions
Use the GET List transactions endpoint to extend the member profile in your system with details about all point movements on a member’s card. If your loyalty program uses several card definitions (point wallets), create a separate transaction list for each card that’s governed by a given wallet. The list card transactions endpoint lists many types (type) of transactions to match your business case. The transactions list the date of occurrence (created_at), number of points affected (points object), and other details. In a simple loyalty program, the key transactions types are:
POINTS_SPENT_ON_REWARD: Points spent to buy a reward. Thedetailsobject lists the number of points and thereward.id(lines 11–24)PENDING_POINTS_ACTIVATED: Points that were in a pending state, but they were activated manually or automatically as set in the card definition configuration (thedetailsobject in lines 38–47).PENDING_POINTS_ADDED: Pending points that were added to the loyalty card under the point wallet settings (thedetailsobject in lines 61–76).POINTS_EXPIRED: Points that expired under the card definition settings (thedetailsobject in lines 90–108).POINTS_EARNED: Points earned and instantly added to the loyalty card (thedetailsobject in the Point earned example, line 11–24).
List reward purchases
Use the GET List reward purchases endpoint to show your members the rewards they have purchased. This endpoint lists purchases for all cards the member has. Thedetails (lines 12–33 and 47–68) object lists more information about the reward purchase, like the number of points spent or the reward type.
List reward purchases response
Fulfillment
Your loyalty program needs a way for your members to spend the loyalty points they’ve earned. In a typical loyalty program, members can spend points to:- Use the points as currency to pay for their orders.
- Purchase rewards.
Pay with points
Prerequisite: Settings of pay with points in the point walletThe point-to-currency exchange ratio is defined in the point wallet that governs the behavior of the loyalty card.
- POST Create order to create an order in Voucherify.
- POST Pay for an order with points to use the existing order ID in this endpoint.
Qualifying, validating, and redeeming incentivesIf you want to combine your loyalty program with qualification, validation, and redemption of incentives, these should happen before the POST Pay with points endpoint is used.If you use the redemption endpoint (POST
v1/redemptions), it can create an order in Voucherify if an order object is passed. You can then skip the POST Create order endpoint, but you’ll need to retrieve the order ID from the v1/redemptions response.- Two required fields:
- The
card_idstring of the loyalty card (lcrd_...) whose points will be used in the transaction (line 2 in the examples). - The
orderobject that contains theidorsource_idof the order to be paid (line 4).
- The
- Two optional fields:
- The
modestring that defines if the request is used to simulate the transaction or to actually pay for the order (line 6). Pass the following values:DRY_RUNto perform a simulation of the transaction. No points are spent from the member loyalty card and no transaction records are created.TRANSACTIONto create an actual transaction. Points are spent to lower the total amount of the order.
- The
payment_limitobject that defines a limit on the transaction by providing atype(line 6):CARD_BALANCE: Default setting that allows the automatic payment up to the maximum of the total balance of the loyalty card. This setting is used when nopayment_limitobject is sent.POINTS_LIMIT: Uses thepoints_limitobject to define how many points will be spent in the transaction. In the example below, the amount to be spent equals100points (line 10). If the card has fewer points than the set value formax, all available points will be used.AMOUNT_LIMIT: Uses theamount_limitobject to define how much of the order amount can be paid for with points. Themaxvalue is defined in the smallest currency amount (line 10), so100means $1, for example.
- The
mode used:
200for theDRY_RUNmode.202for theTRANSACTIONmode. Usually, returns aPENDINGtransaction to be processed asynchronously.
The transaction details regarding the point or amount limit and the actual number of points spent (or to be spent for the
DRY_RUN) are returned in the details.payment object (lines 18–22).
423 – “Card balance is zero”.
Pay with points response: No balance – error 423
Purchase reward
Use the POST Purchase reward endpoint to create a store where your loyalty program members can buy rewards. In the request body, send the reward ID (reward_id) to be purchased. Since rewards are assigned to specific card definitions, Voucherify will subtract the required number of points from a loyalty card that’s governed by the card definition.
Use the details object (response lines 11–19) to display how many points were spent on the reward purchase. If the loyalty program uses several card definitions, use the card_id (line 4) to tie the purchase to a specific loyalty card.
Cancellation
Your loyalty program should also support situations when a member wants to stop participating in the program, have their member profile deleted altogether, or cases when you need to temporarily suspend member activity when suspecting program fraud.Deactivate
Use the POST Deactivate member endpoint to suspend a member’s participation in the program. A suspended member can’t earn points or spend them on rewards or orders.Delete
If you need a mechanism for deleting member data, use the DELETE Member endpoint to soft-delete the member and all their associated cards within the program.Customer data in VoucherifyThe DELETE Member endpoint deletes only the data regarding the member profile. However, the member still has a customer profile in Voucherify.Read how to delete customer data from Voucherify.

