curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/earning-rules?per_page=20" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const params = new URLSearchParams({ per_page: 20 });
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/earning-rules?${params}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$query = http_build_query(["per_page" => 20]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/earning-rules?{$query}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Place an order",
"description": "Earn 5 points for every $1 spent.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "increment",
"earn_value": 5,
"earn_from_amount": 1
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
"name": "Sign up",
"description": "Earn 200 points when you create an account.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "fixed",
"earn_value": 200
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"has_more": false
}
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}
Earning Rules
List earning rules
Retrieves a paginated list of active earning rules (Ways to earn) for your organisation.
GET
/
public
/
earning-rules
curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/earning-rules?per_page=20" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const params = new URLSearchParams({ per_page: 20 });
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/earning-rules?${params}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$query = http_build_query(["per_page" => 20]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/earning-rules?{$query}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Place an order",
"description": "Earn 5 points for every $1 spent.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "increment",
"earn_value": 5,
"earn_from_amount": 1
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
"name": "Sign up",
"description": "Earn 200 points when you create an account.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "fixed",
"earn_value": 200
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"has_more": false
}
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}
Results are sorted by
created_at, newest first. Only active rules are returned.
Requires the
read:earning_rules scope. See Scopes.Query parameters
integer
default:20
The number of results per page. Values above
100 are treated as 100.integer
default:1
The page number to retrieve. See Classic pagination.
Response
object[]
The earning rules on this page.
Show earning rule properties
Show earning rule properties
string<uuid>
Unique UUID identifier for the earning rule.
string
The display name of the earning rule.
string | null
A short description shown to customers.
null
Currently always
null. The API doesn’t expose the earn rule’s trigger (purchase, signup and so on); use name and earning_rule to identify the rule.object | null
How points are calculated when the rule triggers. Keys vary by rule type. Common keys:
type: what the rule awards, for examplepoints.method:fixed(a set amount each time) orincrement(an amount per unit of spend, purchase rules only).earn_value: the points awarded.earn_from_amount: forincrement, the spend amount that earnsearn_valuepoints.is_expire_enabled,expire_after,expire_period: points expiry settings, if turned on.url: for social follow/like rules, the handle or page the customer is asked to visit.
array | null
Optional conditions that limit when the rule applies, such as product, collection or customer restrictions.
boolean
Whether this earning rule is currently active. Only active rules are returned, so this is always
true.null
Currently always
null.null
Currently always
null.string<date-time>
When the earning rule was created (ISO 8601).
object
Errors
| Status | Code | When |
|---|---|---|
401 | missing_token, invalid_token | The API key is missing, wrong or revoked. |
403 | insufficient_scope | The key doesn’t have read:earning_rules. |
429 | The key exceeded the rate limit. |
curl --request GET \
--url "https://api.yukoapp.com/api/v1/public/earning-rules?per_page=20" \
--header "Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
const params = new URLSearchParams({ per_page: 20 });
const response = await fetch(
`https://api.yukoapp.com/api/v1/public/earning-rules?${params}`,
{
method: "GET",
headers: {
Authorization: "Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
}
);
const data = await response.json();
$query = http_build_query(["per_page" => 20]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.yukoapp.com/api/v1/public/earning-rules?{$query}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer py_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Place an order",
"description": "Earn 5 points for every $1 spent.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "increment",
"earn_value": 5,
"earn_from_amount": 1
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f01234567890",
"name": "Sign up",
"description": "Earn 200 points when you create an account.",
"campaign_type": null,
"earning_rule": {
"type": "points",
"method": "fixed",
"earn_value": 200
},
"conditions": null,
"is_active": true,
"starts_at": null,
"ends_at": null,
"created_at": "2026-01-10T09:00:00+00:00"
}
],
"meta": {
"pagination": {
"current_page": 1,
"per_page": 20,
"total": 2,
"last_page": 1,
"has_more": false
}
}
}
{
"error": {
"code": "invalid_token",
"message": "Invalid or revoked API token"
}
}