Skip to main content
POST/point-acquire-rule/

Create point acquisition rules

You can create a new point acquisition rule.

AttributesTypeRequiredDescription
namestringyesA point acquire rule name.
product_eventintegernoA unique identifier for the product event type which is given by User.com
end_datedatetimenoA DateTime when a point acquires rule to stop working.
earning_typeintegeryesA unique identifier for an earning type.
earning_valueintegeryesA point amount that the user receives if the rule requirements will be fulfilled.
max_points_dailyintegernoA daily maximum number of points that the user can get.
max_points_per_transactionintegernoA maximum number of points that user can get per transaction.
max_trigger_count_intervalintegernoA maximum number of interval days in between triggering this rule for a user.
max_trigger_count_valueintegernoA maximum number of times that rule triggers for this specific user
productsobjectnoA list of product segment ids which are given by User.com.
points_expiration_timestringnoA datetime of how long the earned points are valid.
eventintegernoA unique identifier for the event which is given by User.com
point_campaignintegeryesA unique identifier for the point campaign which is given by User.com
user_attributestringnoA standardized name for the user attribute (e.g. "My attribute" is standarized to "my_attribute"). An attribute has to be an integer type.
level_thresholdintegernoA unique identifier for the user's customer level which is given by User.com

Request​

curl --location --request POST 'https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token <your_64_char_api_key>' \
--header 'Accept: */*; version=2' \
--data-raw '{ "name": "string", "product_event": 1, "end_date": "2022-03-09T11:12:04.814Z", "earning_type": 0, "earning_value": 0, "max_points_daily": 0, "max_points_per_transaction": 0, "max_trigger_count_interval": 0, "max_trigger_count_value": 0, "products": {}, "points_expiration_time": "2022-03-09T11:12:04.814Z", "event": 0, "point_campaign": 0, "user_attribute": 0, "level_threshold": 0}'

Response​

{
"id": 2,
"name": "string",
"product_event": 1,
"end_date": "2022-03-09T11:12:04.814000Z",
"earning_type": 0,
"earning_value": 0,
"max_points_daily": 0,
"max_points_per_transaction": 0,
"max_trigger_count_interval": 0,
"max_trigger_count_value": 0,
"products": {},
"points_expiration_time": "2022-03-09T11:12:04.814000Z",
"event": 1,
"point_campaign": 1,
"user_attribute": 1,
"level_threshold": 1
}