Calculate reward points for orders and retrieve all associated transactions. These APIs provide cashback calculations and display reward, refund, and transaction details linked to specific orders.
This API calculates the cashback points to be rewarded for a specific order in Gameball, based on provided order details. It considers configured cashback rules and customer eligibility.
Security: Requires apiKey header
Channel Merging Available
If your system uses different customer IDs across multiple channels (e.g., online and offline), Gameball's channel merging feature helps unify customer profiles. By including the customer’s mobile number or email (based on your merging configuration) with each request, Gameball will combine activities into a single profile.For more information, head to the Channel Merging Guide.
This API calculates the expected cashback points but does not perform any actual reward or action for the customer.
Request
Body
application/json
customerIdstringOptional
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.
emailstringOptional
Customer's email address.
Note: This is required if your account uses email-based channel merging.
mobilestringOptional
Customer's mobile number.
Note: This is required if your account uses mobile-based channel merging.
totalPaidfloatRequired
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.
totalPricefloatOptional
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.
totalDiscountfloatRequired
Total discount applied to the order. Must be positive.
totalShippingfloatRequired
Total shipping cost for the order.
lineItemsarrayOptional
An array containing details about each product in the order. If not provided, the calculation will only consider the total order values.
lineItems object
productIdstringOptional
Unique identifier for the product or service being purchased.
quantityfloatOptional
Number of units purchased for this product or service.
pricefloatOptional
The original price of a single product before any tax or discount is applied. This reflects the cost of one unit of the item, not the total for multiple quantities in an order.
Example: If the original price of a product is $50 and a customer buys two units, the price for each item would still be recorded as $50, regardless of quantity.
skustringOptional
Stock Keeping Unit (SKU) for the product.
tagsarrayOptional
Tags associated with the product for categorization or promotional purposes.
categoryarrayOptional
Product category, such as fashion or electronics. It can include one or multiple categories.
Example: ["natural", "cosmetics"]
weightfloatOptional
Weight of the product.
vendorstringOptional
Vendor or manufacturer of the product.
collectionarrayOptional
Collection ID(s) to which the product belongs. It can include one or multiple collections.
Example: ["14313", "4343"]
titlestringOptional
Product title or name.
taxesfloatOptional
The total amount of taxes applied to the line item, expressed in the shop's currency. This amount must be positive and reflects the total taxes based on the quantity of the item.
discountfloatOptional
The total discount applied to this line item, expressed as a positive value. This amount should reflect the total discounts based on the quantity of the item.
extraobjectOptional
Key-value pairs containing any extra information about the product, such as size, color, or other custom attributes. The values must be of type string or number.
totalPointsnumber
Total points expected to be earned from the entire order.
totalScorenumber
Total score expected to be earned from the entire order.
lineItemsarray
An array of individual line items and their cashback calculation details.
lineItems object
campaignIdnumber
The unique identifier for the active transactional campaign that affects the cashback reward for purchasing this line item. If no campaign is applicable, this field will be null.
campaignNamestring
The name of the active transactional campaign that affects the cashback reward for purchasing this line item. If no campaign is applicable, this field will be null.
Example: If a store is running a "Double Points Weekend" campaign, the campaignName could be "Double Points Weekend."
campaignEndDatestring
The end date of the active campaign affecting the line item.This is the date when the campaign will no longer influence points or rewards.
campaignImpactWalletFactornumber
The multiplier applied by the campaign to the base points calculation. This factor adjusts the final points earned for the line item based on the campaign's impact. Present only if a campaign is applicable.
Example: If the campaign offers 3x points, the campaignImpactWalletFactor would be 3, multiplying the regular points earned by three.
campaignImpactPointsnumber
The total number of points given for this line item due to the campaign's impact. This value reflects the additional points earned from the campaign.
Example: If the base points for an item are 100 and the campaign offers 5x points, the campaignImpactPoints would be 400 (totaling 500 points with the base points included).
productIdstring
Unique identifier for the product.
quantitynumber
The quantity of the product purchased.
totalDecimalPointsnumber
The total decimal points earned for this line item,including any campaign impact.
totalPointsnumber
The total points earned for this line item, including any campaign impact.
Example: If the base points for a product are 50 and a campaign adds 150 points, the totalPoints would be 200.
totalScorenumber
The total score earned for this line item.This value is separate from point and is based on your cashback rewards configuration.
rewardWalletFactornumber
The multiplier applied to the product price to calculate the base points earned for this line item. This factor represents how many points are earned per unit of currency spent on the product.
Example: If the store rewards 10 points for every $1 spent, the rewardWalletFactor would be 10.
The first product (productId: 875511) is part of a collection affected by an active "5x Points Campaign," which multiplies the points earned for this product by a factor of 5.
The rewardWalletFactor for both products is 20, meaning the product price is multiplied by 20 to calculate the base points earned.
The campaignImpactPoints for the first product reflect the additional points awarded due to the active campaign.
This API retrieves the transactional details for a specified order in Gameball, identified by orderId. It includes information on rewards, refunds, and equivalent points, giving a detailed view of the financial activities associated with the order.
Security: Requires apikey and secretkey headers.
Request
Path Parameters
orderIdstringRequired
Unique identifier for the order. Used to reference and retrieve the order's transactions.
Response
application/json
transactionsarray
List of transactions associated with the order.
Example: If a customer places an order and redeems points, the transactions array will contain both the cashback reward transaction and the redemption transaction.
Transaction object
transactionDatedatetime
The date and time when the transaction occurred.
gameballTransactionIdnumber
Unique identifier for the transaction in the Gameball system.
transactionTypestring
Type of transaction. Possible values include:
AchievementReward: Captured when a customer reaches a VIP tier, participates in a reward campaign, or makes a referral.
PaymentReward: Recorded for rewarding a customer with points for every placed order.
Refund: Captured when points redeemed from a refunded order are returned to the customer.
Redemption: Recorded whenever a customer redeems their points for rewards.
Expiry: Captured when a customer's points expire, indicating a reduction in their total points.
Cancel: Recorded when a customer cancels an order, leading to the deduction of rewarded points.
Migration: Captured during updates or migrations of customer data via a CSV file, reflecting added or deducted points.
ManualAccumulation: Recorded for points that are manually added to a customer's balance.
DiscountCode: Captured when a customer creates a coupon code.
ManualDeduction: Recorded for points manually removed from a customer's balance.
ManualReward: Similar to AchievementReward, but specifically for manually awarding achievements to a customer.
amountnumber
The monetary value involved in the transaction.
transactionIdstring
A unique identifier for a transaction in your system (e.g., order number or invoice number). This ID can be used to reverse, cancel, or refund any reward or redemption transactions in Gameball.
equivalentPointsnumber
The points equivalent to the monetary value of the transaction.
countnumber
Total number of transactions associated with the order.