CalculateLoyaltyPoints
Calculates the number of points a buyer can earn from a purchase. Applications might call this endpoint to display the points to the buyer.
-
If you are using the Orders API to manage orders, provide the order_id and (optional) loyalty_account_id. Square reads the order to compute the points earned from the base loyalty program and an associated loyalty promotion.
-
If you are not using the Orders API to manage orders, provide transaction_amount_money with the purchase amount. Square uses this amount to calculate the points earned from the base loyalty program, but not points earned from a loyalty promotion. For spend-based and visit-based programs, the tax_mode setting of the accrual rule indicates how taxes should be treated for loyalty points accrual. If the purchase qualifies for program points, call ListLoyaltyPromotions and perform a client-side computation to calculate whether the purchase also qualifies for promotion points. For more information, see Calculating promotion points.
Path parameters
The ID of the loyalty program, which defines the rules for accruing points.
Request body
Example request
{
"loyalty_account_id": "79b807d2-d786-46a9-933b-918028d7a8c5",
"order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
}Response
Success
Example response
{
"points": 6,
"promotion_points": 12
}