Loyalty
CalculateLoyaltyPoints
Calculates the points a purchase earns.
- If you are using the Orders API to manage orders, you provide order_id in the request. The endpoint calculates the points by reading the order.
- If you are not using the Orders API to manage orders, you provide the purchase amount in the request for the endpoint to calculate the points.
An application might call this endpoint to show the points that a buyer can earn with the specific purchase.
Note: The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs. For more information, see Availability of Square Loyalty.
post/v2/loyalty/programs/{program_id}/calculate
Path parameters
program_idstring required
The loyalty program ID, which defines the rules for accruing points.
Request body
Example request
{
"request_body": {
"order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
},
"request_params": "?program_id=d619f755-2d17-41f3-990d-c04ecedd64dd"
}Response
Success
Example response
{
"points": 6
}