REST APILoyalty API
Complete Earn Event
Marks a client-triggered earn event as completed for the authenticated customer, awarding points. This endpoint only works for earn events with clientTriggered: true. Backend-triggered events cannot be completed through this API.
Request Body
application/json
handle*string
The unique identifier (handle) of the earn event to complete.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://yourstore.myshopify.com/a/lantern/earn-events/complete" \ -H "Content-Type: application/json" \ -d '{ "handle": "follow-instagram" }'{
"success": true,
"earnEvent": {
"handle": "follow-instagram",
"title": "Follow us on Instagram",
"pointsAwarded": 50
},
"pointsBalance": 1550
}{
"error": "Missing required field",
"message": "handle is required"
}{
"error": "Invalid app proxy request"
}{
"error": "Cannot complete this earn event",
"message": "This earn event cannot be triggered by customers",
"handle": "order-placed"
}{
"error": "Earn event not found",
"handle": "invalid-handle",
"hint": "Check that the handle is correct and the earn event is active"
}