Award an earning rule
Earning Rules
Award an earning rule
Award points to a customer for completing an earning rule.
POST
Award an earning rule
Award points to a customer for completing an earning rule action, using the rule’s configured points and any applicable VIP tier multiplier. OnlyDocumentation Index
Fetch the complete documentation index at: https://developers.mageloyalty.com/llms.txt
Use this file to discover all available pages before exploring further.
social and engagement category rules can be awarded via the API. Rules in other categories (e.g. purchase, birthday, anniversary) are managed automatically by the platform.
Each rule can only be awarded once per customer — duplicate requests return 409 Conflict.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
customer_identifier | string | Yes | Shopify customer ID or email address |
Validations
- Customer must exist and not be excluded from the loyalty program
- Earning rule must be active
- Earning rule category must be
socialorengagement - Customer must not have already been awarded points for this rule
Side effects
All non-blocking:- Creates a
CustomerEarningRulerecord with points awarded (or pending ifapproval_time > 0) - Logs the activity
- Syncs customer to Klaviyo, Omnisend, and Postscript
- Syncs Shopify metafields for the customer
Response
Returns201 Created:
When
approval_time > 0 is configured on the rule, status will be pending, points_given_at will be null, and points_due_at will reflect when the points will be approved.Errors
| Status | Scenario |
|---|---|
400 | customer_identifier missing or invalid JSON |
403 | Customer is excluded from the loyalty program |
404 | Customer or earning rule not found (or rule is inactive) |
409 | Customer has already been awarded points for this earning rule |
422 | Earning rule category cannot be awarded via the API |