PUT

Update Loyalty Earning Rule


Updates an earning rule.

Supports partial updates.

Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes, the current revision must be passed when updating the earning rule.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage Loyalty
Learn more about app permissions.
Endpoint
PUT
https://www.wixapis.com/_api/loyalty-earning-rules/v1/earning-rules/{earningRule.id}

Path Params
earningRule.idstringRequired

Loyalty earning rule ID.

Body Params
earningRuleEarningRuleRequired

Earning rule to update.

Response Object
earningRuleEarningRule

The updated earning rule.

Update earning rule
Request
cURL
curl -X PUT \ 'https://www.wixapis.com/loyalty-earning-rules/v1/earning-rules/eeb9ff42-b24f-4a68-8491-21507508f3f5' \ -H 'Authorization: <AUTH>' \ -H 'Content-Type: application/json' \ -d '{ "earningRule": { "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "status": "ACTIVE", "conversionRate": { "configs": [ { "points": 20, "moneyAmount": 1 } ] }, "revision": 1 } }'
Response
JSON
{ "earningRule": { "id": "eeb9ff42-b24f-4a68-8491-21507508f3f5", "sourceAppId": "553c79f3-5625-4f38-b14b-ef7c0d1e87df", "triggerAppId": "1380b703-ce81-ff05-f115-39571d94dfcd", "triggerActivityType": "stores/OrderPaid", "title": "Purchase a product", "conversionRate": { "moneyAmount": 1, "points": 20, "configs": [ { "moneyAmount": 1, "points": 20 } ] }, "status": "ACTIVE", "revision": "2", "createdDate": "2024-09-16T12:12:16.833Z", "updatedDate": "2024-09-16T14:02:59.364Z", "metadata": { "canBeDeleted": true } } }
Did this help?