Checkout Integration
Last updated
Last updated
This guide provides a detailed walkthrough of how to integrate Gameball’s loyalty and rewards features into your checkout process. The integration covers various scenarios to enhance your customers' shopping experience, including loyalty point accumulation, coupon usage, and the ability to preview earned rewards before completing a purchase.
The key scenarios addressed in this guide include:
Earning Loyalty Points: Automatically calculate and assign loyalty points based on a customer's order. Points can be awarded for the total order value, factoring in product prices, discounts, taxes, and shipping fees. This helps customers accumulate points with every purchase, promoting engagement and retention.
Previewing Points Before Completing an Order: Allow customers to view how many points they will earn based on the items in their cart before they proceed with checkout. This feature gives customers visibility into their rewards and can help drive purchases by highlighting loyalty benefits upfront.
Redeeming Loyalty Points During Checkout: Customers can redeem their loyalty points at checkout to reduce the total amount of their order. The system calculates the value of the redeemed points, applies the corresponding discount, and ensures the redemption complies with the configured rules for point usage.
Using Coupons in the Order: Customers can apply coupon codes during checkout to unlock specific discounts or benefits. The system validates the coupon, checks its eligibility criteria, and adjusts the order's total price accordingly.
Each scenario outlines a practical process that focuses on customer interactions, ensuring they can easily navigate loyalty rewards, coupons, and promotions as they make their purchase decisions. This guide will help you integrate these features smoothly into your checkout system, providing customers with a rewarding and seamless experience.
Start by placing an order. Tracking your customers' completed and paid orders allows you to evaluate key details and gain valuable insights. For example, you may have rewards campaigns configured to be achieved once specific products are purchased.
When the Order API is called, it automatically triggers a place_order
event, capturing all the order data as metadata.
One of the major advantages of using the Orders API is that you don't have to worry about sending two different requests for the order placement event and cashback reward. In fact, the Order API internally handles sending appropriate data to different modules depending on your Gameball program configurations.
Here we will explain how the data sent with the Orders API are translated into an event object. Understanding this will help you with linking rewards campaigns and messages with placing order events as needed.
Every order sent via Order API is mapped to a place_order
event. That’s why the place_order
event name is reserved and cannot be created via Gameball’s dashboard. The metadata sent along with the event is composed of the order data sent. This is in addition to key elements that can add value while designing your rewards campaign or message configuration.
The "i" in lineitems[i] denotes any given index in the lineitems array.
Take the example below, where your customer places an order for a "Hoxton Bag". Once the order is successfully placed and paid, the order details will be sent to Gameball via the Order API as follows:
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email or anything that uniquely identifies the customer.
orderId string
Unique identifier for the order on your system.
orderDate datetime
Timestamp of when the order was placed.
totalPaid float
The total cost of the order, including all item prices, shipping, taxes, and tips. This value does not account for any discounts or coupons applied and is not used for calculations in Gameball; it is solely saved as historical data linked to the order. Must be a positive value.
totalPrice float
The total cost of the order, including all item prices, shipping, taxes, and tips. This value does not account for any discounts or coupons applied and is not used for calculations in Gameball; it is solely saved as historical data linked to the order. Must be a positive value.
totalDiscount float
Total discount applied to the order.
totalShipping float
Total shipping cost associated with the order.
totalTax float
Total tax amount for the order.
lineItems array
An array containing details about each product in the order. If not provided, the calculation will only consider the total order values.
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email or anything that uniquely identifies the customer.
rewardedPoints number
The total number of points rewarded to the customer for making this order. These points are typically awarded based on your configured cashback rewards.
lineItems array
Details about each product or service in the order, including points rewarded.
Imagine a customer about to make a purchase, and you want to show them the exact points they’ll earn before they complete the order. This is where previewing points comes into play, giving both you and the customer full visibility of the potential rewards before hitting "place order."
Using the Calculate Cashback API , you can display a detailed preview of the points a customer will earn based on the products in their cart. This preview automatically accounts for active transaction campaigns—such as double or triple points—giving customers a clear picture of how their rewards will multiply. By showing the campaign’s start and end dates, you can also create a sense of urgency, encouraging customers to act fast and take advantage of the offer before it expires.
For example, if a customer buys items during a limited-time "triple points" campaign, they can immediately see the added value they’re getting. This not only enhances the customer experience but also motivates them to make the purchase sooner rather than later.
Additionally, this endpoint takes into account any custom cashback rules tied to different customer tiers. This means that customers in higher tiers may receive enhanced rewards, ensuring that each customer’s unique benefits are reflected in the points preview, driving engagement and loyalty.
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email or anything that uniquely identifies the customer.
If provided, the cashback calculation will consider the customer's tier. Special tier-based configurations, such as enhanced point accrual rates, may affect the points calculation.
totalPaid float
The actual amount paid by the customer for the order, accounting for any discounts or coupons applied. Unlike totalPrice
, which reflects the original cost of the order, totalPaid
represents the final amount the customer paid at checkout after all adjustments. This value is used for reward calculations in Gameball to determine the points or benefits earned from the order.
Example: A customer purchases items worth $120, including taxes and shipping. If a $20 coupon is applied, the totalPaid
becomes $100, reflecting the discounted amount the customer paid. This is the value used to calculate any points or rewards earned from the order.
totalPrice float
The total cost of the order, including all item prices, shipping, taxes, and tips. This value does not account for any discounts or coupons applied and is not used for calculations in Gameball; it is solely saved as historical data linked to the order. Must be a positive value.
Example: A customer purchases items worth $120, including taxes and shipping. Even if a $20 coupon is applied, the totalPrice remains $120 as it represents the original cost of the order before any discounts are applied.
totalDiscount float
Total discount applied to the order. Must be positive.
totalShipping float
Total shipping cost for the order.
lineItems array
An array containing details about each product in the order. If not provided, the calculation will only consider the total order values.
totalPoints number
Total points expected to be earned from the entire order.
totalScore number
Total score expected to be earned from the entire order.
lineItems array
An array of individual line items and their cashback calculation details.
You can use the response to encourage the customer to finalize their purchase faster by showcasing any active campaigns offering extra points compared to the usual rewards. Highlighting these limited-time benefits can create a sense of urgency and motivate the customer to complete their order promptly.
Imagine a customer excited to redeem their hard-earned points while placing an order but still wanting the freedom to browse and add more items to their cart before checking out. With Gameball’s redemption process, you can make this experience smooth and hassle-free by temporarily holding their points.
When the customer opts to redeem points, the Hold Points API allows you to hold those points, generating a unique hold reference ID. This ensures the points are securely reserved for their order, giving the customer peace of mind that their redemption is locked in. They can continue shopping at their own pace, confident that their points are ready to be applied when they're ready to checkout.
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.
transactionTime string
The time of the transaction in your system, indicating when the points were held for the customer.
pointsToHold integer
The number of points to be held from the customer’s points balance. This allows you to reserve a certain number of points for later use.
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email, or anything that uniquely identifies the customer.
number
The monetary value that has been held from the customer’s points balance. This value represents the amount reserved based on the customer’s available points.
number
The number of points that have been held from the customer’s points balance. These points are reserved for future use or specific transactions.
string
A unique identifier for the hold transaction. This reference is used to track and manage the held points for future actions, such as redeeming the held points or canceling the hold.
Once the customer finalizes their cart, simply use the hold reference "a2a199ad-86f3-45c4-8253-7aaee50e4798"
to link the redeemed points to the order API request. This seamless process ensures that their rewards are applied accurately and effortlessly, enhancing their shopping experience.
By providing this flexibility, you not only cater to your customers’ preferences but also build trust and satisfaction, ensuring they enjoy every moment of their loyalty rewards journey with you.
Holding points expire after 10 minutes if the checkout process was not completed for any reason.
In addition to the basic attributes outlined in the previous order scenario, such as customerId
, orderId
, orderDate
,totalPaid
, the hold reference will be added within the redemption object to seamlessly link the point redemption to the order the customer placed.
redemption object
Redemption details for the order, including points held for redemption.
In addition to the response provided in the previous order request, this response includes the redeemed amount, which specifies the exact number of points redeemed during the order.
redeemedPoints number
Number of points redeemed by the customer for this order.
Using coupon codes during checkout is an effective way to enhance the customer experience and boost sales. By validating and locking a coupon code, businesses can ensure that the discount is reserved exclusively for the customer, eliminating any risk of overuse or misuse. This approach provides a seamless checkout process, where the customer enjoys a personalized discount while the business maintains full control over coupon usage.
This feature is particularly valuable during high-demand campaigns or limited-time promotions, as locking the coupon creates urgency and encourages faster purchasing decisions. By tying the locked coupon to the order, businesses can guarantee accurate tracking of discounts applied and maximize the impact of their promotional efforts. When a customer is shopping and has a coupon code they wish to use, the Validate Coupon API with the lock
flag set to true
ensures the coupon is securely locked for their exclusive use. This allows the customer to continue shopping confidently, knowing their discount will be applied when they finalize the checkout. This seamless process prevents misuse, streamlines the shopping experience, and encourages quicker purchasing, all while ensuring the discount is properly tracked and applied.
customerId string
Unique identifier for the customer that you can reference across the customer’s whole lifetime. Could be a database ID, random string, email or anything that uniquely identifies the customer.
coupons array
A list of coupon codes the customer wants to use that needs to be validated and locked.
lock boolean
Indicates whether the request is intended to validate the coupon or to lock it for a future redemption.
You need to set here to True
so that the coupon will be locked, meaning that a hold reference will be returned. This hold reference must then be used when placing an order to redeem the coupon. Locking a coupon ensures that the coupon is reserved and cannot be used by others during the lock session.
The response indicates whether the provided coupon code is valid and if it can be used by the customer when completing their order. If the coupon is valid, it will be marked as eligible for use, allowing the customer to apply the discount during checkout. If invalid, the response will indicate the reason the coupon cannot be used.
valid boolean
Indicates whether the coupons are valid.
Example: true
if the coupon is eligible for use by the customer, and false
if the coupon cannot be applied to the customer's order.
coupons array
An array containing the details of the coupons that need to be locked or validated in the request.
lockReference string
The unique reference code associated with the coupon lock session. This reference ensures that the coupon is reserved exclusively for the current session and cannot be used elsewhere until the lock expires or is released. This lock reference is essential for linking the coupon to the order, and it must be included in the Order API request to apply the coupon to the customer's final order.
dateToExpire string
The exact date and time when the coupon lock will expire, after which the coupon will be available for others to use again or for another session.
Example: If the lock is set to expire on October 20, 2024, the dateToExpire
might be "2024-10-20T16:22:00.8249283Z"
, indicating the precise moment the lock is lifted.
To apply the coupon codes for the customer when completing the order, you will use the lockReference
returned in the coupon validation response. This ensures that the coupon is reserved for the customer during the checkout process.
In addition to the basic attributes outlined in the previous order scenario, such as customerId
, orderId
, orderDate
,totalPaid
,you will also include the couponsLockReference
within the redemption
object. This new attribute will link the locked coupon to the order, ensuring that the coupon is applied when the customer completes the checkout process.
redemption object
Redemption details for the order, including coupons that will be used in this order.
Order API attribute
Mapped to Event Object attribute
totalPaid
total_paid
totalDiscount
total_discount
lineItems[i].weight
weight
lineItems[i].vendor
vendor
lineItems[i].sku
sku
lineItems[i].title
title
lineItems[i].tag
tag
lineItems[i].category
category
lineItems[i].collection
collection
extra.key[0]:value
key[0]:value