Skip to main content
PATCH/point-acquire-rule/:id/

Update point acquisition rule

You can update a specific point acquisition rule.

Attributes

Optional unless marked required

namestringrequired
A point acquire rule name.
product_eventinteger
A unique identifier for the product event type which is given by User
end_datedatetime
A DateTime when a point acquires rule to stop working.
earning_typeintegerrequired
A unique identifier for an earning type.
earning_valueintegerrequired
A point amount that the user receives if the rule requirements will be fulfilled.
max_points_dailyinteger
A daily maximum number of points that the user can get.
max_points_per_transactioninteger
A maximum number of points that user can get per transaction.
max_trigger_count_intervalinteger
A maximum number of interval days in between triggering this rule for a user.
max_trigger_count_valueinteger
A maximum number of times that rule triggers for this specific user
productsobject
A list of product segment ids which are given by User.
points_expiration_timestring
A datetime of how long the earned points are valid.
eventinteger
A unique identifier for the event which is given by User
point_campaignintegerrequired
A unique identifier for the point campaign which is given by User
user_attributestring
A standardized name for the user attribute (e.g. "My attribute" is standarized to "my_attribute"). An attribute has to be an integer type.
level_thresholdinteger
A unique identifier for the user's customer level which is given by User

Request​

curl -X PATCH "https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Points for a newsletter signup",
"point_campaign": 13,
"earning_type": 1,
"earning_value": 60
}'

Response examples​

{
"id": 3,
"name": "Points for a newsletter signup",
"points_expiration_relative_time": null,
"points_expiration_time": null,
"earning_type": 1,
"earning_value": "60.00",
"count_points_from": null,
"count_points_to": null,
"max_points_daily": null,
"max_points_per_transaction": null,
"max_trigger_count_interval": null,
"max_trigger_count_value": null,
"end_date": null,
"product_event": null,
"products": null,
"point_campaign": 12,
"user_attribute": null,
"event": null,
"event_attribute": null,
"product_attribute": null,
"level_thresholds": []
}

Response fields​

Fields returned in the 200 OK response body.

idinteger
ID of the point acquisition rule.
namestring
A point acquire rule name.
points_expiration_relative_timeintegernullable
Number of hours after which points earned through this rule expire; null if they don't.
points_expiration_timestringnullable
A datetime of how long the earned points are valid.
earning_typeinteger
A unique identifier for an earning type.
earning_valuestring
A point amount that the user receives if the rule requirements will be fulfilled.
count_points_fromintegernullable
Lowest price or order value that earns points with dynamic earning; null for no minimum.
count_points_tointegernullable
Highest price or order value that earns points with dynamic earning; null for no maximum.
max_points_dailyintegernullable
A daily maximum number of points that the user can get.
max_points_per_transactionintegernullable
A maximum number of points that user can get per transaction.
max_trigger_count_intervalintegernullable
A maximum number of interval days in between triggering this rule for a user.
max_trigger_count_valueintegernullable
A maximum number of times that rule triggers for this specific user
end_datedatetimenullable
A DateTime when a point acquires rule to stop working.
product_eventintegernullable
A unique identifier for the product event type which is given by User
productsobjectnullable
A list of product segment ids which are given by User.
point_campaigninteger
A unique identifier for the point campaign which is given by User
user_attributestringnullable
A standardized name for the user attribute (e.g. "My attribute" is standarized to "my_attribute"). An attribute has to be an integer type.
eventintegernullable
A unique identifier for the event which is given by User
event_attributeintegernullable
ID of the event attribute that holds the order value for dynamic earning; null if not used.
product_attributeintegernullable
ID of the product attribute that holds the price for dynamic earning; null if not used.
level_thresholdsarray of integer
IDs of the customer levels a contact needs to earn points from this rule; empty for everyone.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.