Skip to main content
Estimates how many loyalty points a customer will earn for a given set of cart items. Customer is optional — guest checkouts are fully supported. POST /public/points/estimate

Authorizations

Authorization string header required Bearer authentication header of the form Bearer <token>, where <token> is your REST API token.

Request Body

customer object | null The customer placing the order. Optional — omit entirely for guest checkouts. Show child attributes customer.id string | null The platform customer ID. Used to look up the customer if email is not provided. Example: "cus_847362" customer.email string<email> | null The customer’s email address. Takes priority over id when both are provided. Example: "rahul.sharma@example.com" items object[] required The line items in the cart. Must contain at least one item. Show child attributes items[].product_id string required The platform product ID. Example: "prod_1001" items[].variant_id string required The platform variant/SKU ID. Example: "var_1001_red_m"

Response

200 - application/json data object Hide child attributes data.points_earned integer The estimated number of loyalty points the customer will earn after completing the purchase. Example: 120 data.message string A human-readable message to display to the customer. Example: "You will earn 120 points after completing this purchase"
curl --request POST \
  --url "https://api.yukoapp.com/api/v1/public/points/estimate" \
  --header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "customer": {
      "id": "cus_847362",
      "email": "rahul.sharma@example.com"
    },
    "items": [
      {
        "product_id": "prod_1001",
        "variant_id": "var_1001_red_m"
      },
      {
        "product_id": "prod_2044",
        "variant_id": "var_2044_black_42"
      }
    ]
  }'
{
  "data": {
    "points_earned": 120,
    "message": "You will earn 120 points after completing this purchase"
  }
}