Introduction
The Webhook mission allows you to automate point attribution to a user based on a specific action they’ve completed (e.g., in-store purchase, item drop-off, etc.). The integration with a webhook ensures real-time information transfer and point attribution.
Mission setup
Basic settings
Mission title: Webhook Mission
Points to earn: 30 points (editable)
Description: Guides users through completing the mission
Number of possible validations:
By default: 1, 3, 5 or unlimited
Custom option available
2. Technical settings
Webhook and Data Sending
The webhook is based on an HTTP POST call to the following URL:🔗 Webhook Link (generated when the mission is created):
https://app.loyoly.io/api/api/webhook/challenge-creators/
Required headers
Loyoly-Challenge-Hash: 250954c32f708a03bceb7578e1ccb
(Security identifier for authentication)
Payload format (request body)
{ "challenge": 13555, "customer_id": "CUSTOMER_PRESTASHOP_ID", "points_value": 10 }
challenge: Unique mission identifier
customer_id: Customer ID (retrieved via Shopify or another platform)
points_value: Number of points awarded (if this value is not provided, the default points set for the mission will be awarded).
3. Response handling
The Webhook server returns different responses depending on the success or failure of the request:
✅ 200 – Success
📌 Points are successfully awarded and the "points_earned" email will be sent.
⚠️ Possible errors (4XX)
400: Incorrect payload (invalid format)
401: Incorrect authentication (issue with header)
429: Rate limiting (limit of 2 requests per second)
4. Display and targeting
Icon: Default icon (customization possible)
Mission explanation: Area to guide users on how to complete the mission
Targeting:
Open to all
Can be applied to a user list or a specific tier
5. Best practices
✅ Make sure the customer ID is correctly filled before sending the request
✅ Respect the limit of 2 requests per second to avoid blocking
✅ Use the correct Loyoly-Challenge-Hash for authentication
✅ Test the mission before activation to avoid any awarding errors