GET/ point-acquire-rule/ :id/
Get specific point acquisition rule
You can return a specific point acquisition rule details.
Attributes
Optional unless marked required
- id
- A unique identifier for the point acquire rule which is given by User
Request
- cURL
- JavaScript
- PHP
- Python
curl -X GET "https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2"
const response = await fetch(
"https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/:id/",
{
method: "GET",
headers: {
Authorization: "Token <your_64_char_api_key>",
Accept: "*/*; version=2",
},
},
);
const data = await response.json();
console.log(data);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/:id/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Token <your_64_char_api_key>",
"Accept: */*; version=2",
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
response = requests.get(
"https://<your_app_subdomain>.user.com/api/public/point-acquire-rule/:id/",
headers={
"Authorization": "Token <your_64_char_api_key>",
"Accept": "*/*; version=2",
},
)
print(response.json())
Response examples
- 200 OK
- 404 Not Found
{"id": 3,"name": "Points for a newsletter signup","points_expiration_relative_time": null,"points_expiration_time": null,"earning_type": 1,"earning_value": "50.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": []}{
"detail": "No PointAcquireRule matches the given query."
}
Response fields
Fields returned in the 200 OK response body.
- id
- A unique identifier for the point acquire rule which is given by User
- name
- Name of the point acquisition rule.
- points_expiration_relative_time
- Number of hours after which points earned through this rule expire;
nullif they don't. - points_expiration_time
- When all points earned through this rule expire, ISO 8601;
nullif there's no such date. - earning_type
- How points are counted:
0static (earning_valuepoints per use) or1dynamic (earning_valuetimes the price or order value). - earning_value
- Points per use (static) or per unit of price (dynamic), as a decimal string.
- count_points_from
- Lowest price or order value that earns points with dynamic earning;
nullfor no minimum. - count_points_to
- Highest price or order value that earns points with dynamic earning;
nullfor no maximum. - max_points_daily
- Most points a contact can earn from this rule per day;
nullfor no limit. - max_points_per_transaction
- Most points a contact can earn from this rule in one transaction with dynamic earning;
nullfor no limit. - max_trigger_count_interval
- Number of days that
max_trigger_count_valuecounts over;nullmeans over the rule's whole life. - max_trigger_count_value
- Most times a contact can use this rule, within
max_trigger_count_intervaldays if set;nullfor no limit. - end_date
- When the rule stops working, ISO 8601;
nullif it doesn't. - product_event
- Product event type that earns points, for example
2(purchase);nullif the rule uses an event. - products
- A list of products' ids.
- point_campaign
- ID of the loyalty campaign the rule belongs to.
- user_attribute
name_stdof the contact attribute that stores the earned points.- event
- ID of the event that earns points;
nullif the rule uses a product event. - event_attribute
- ID of the event attribute that holds the order value for dynamic earning;
nullif not used. - product_attribute
- ID of the product attribute that holds the price for dynamic earning;
nullif not used. - level_thresholds
- 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.