Adjust loyalty points

Add or deduct points on a loyalty customer's balance with a reason and a note.

POST https://cotlet.dev/api/v1/yotpo/loyalty-points/adjust

write Confirm

reward_customer and remove_earned_points change both the balance and total earned points, so they can move the customer's tier. The other reasons change the balance only. The call returns the balance, total earned and tier after the change. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: adjust_loyalty_points
NameTypeDescription
email string required string Customer email address, exactly as in Yotpo.
direction enum required enum add or deduct.
points integer required integer Number of points, a positive whole number.
reason enum required enum Add: reward_customer or refund_points_deducted. Deduct: redeem_points_for_discount, remove_earned_points or manually_expire_points.
note string required string Explanation shown in the customer's Rewards History.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/yotpo/loyalty-points/adjust \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"ana.lopez@example.com","direction":"add","points":150,"reason":"refund_points_deducted","note":"Points lost to a cancelled redemption, support ticket 4821"}'
Python
result = client.call("yotpo", "adjust_loyalty_points", {"email":"ana.lopez@example.com","direction":"add","points":150,"reason":"refund_points_deducted","note":"Points lost to a cancelled redemption, support ticket 4821"})
Node.js
const result = await cotlet.call('yotpo', 'adjust_loyalty_points', {"email":"ana.lopez@example.com","direction":"add","points":150,"reason":"refund_points_deducted","note":"Points lost to a cancelled redemption, support ticket 4821"});
CLI
cotlet call yotpo adjust_loyalty_points --data '{"email":"ana.lopez@example.com","direction":"add","points":150,"reason":"refund_points_deducted","note":"Points lost to a cancelled redemption, support ticket 4821"}'

Example response

JSON

{
  "email": "ana.lopez@example.com",
  "direction": "add",
  "points": 150,
  "reason": "refund_points_deducted",
  "points_balance": 240,
  "points_earned_total": 1020,
  "tier": "Silver"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.