Skip to main content
GET
/
v1
/
loyalties
/
{campaignId}
/
earning-rules
/
{earningRuleId}
Get Earning Rule
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/earning-rules/{earningRuleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "id": "ern_abvbD0d7Wv4hgr3fTElLb38G",
  "created_at": "2022-02-07T08:19:41.810Z",
  "updated_at": null,
  "validation_rule_id": null,
  "loyalty": {
    "points": 2,
    "type": "FIXED"
  },
  "custom_event": {
    "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R"
  },
  "event": "saw_on_facebook",
  "source": {
    "banner": "Saw on Facebook Timeframe",
    "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3",
    "object_type": "campaign"
  },
  "active": true,
  "start_date": "2022-02-07T08:30:00.000Z",
  "validity_timeframe": {
    "duration": "PT1H",
    "interval": "P1D"
  },
  "object": "earning_rule",
  "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

Path Parameters

campaignId
string
required
Example:
earningRuleId
string
required
Example:

Response

200 - application/json
id
string
required
created_at
string<date-time>
required
loyalty
object
required
  • Define fixed amount of points
  • Order Amount
  • Order Total Amount
  • Order Metadata
  • Order Items Quantity
  • Order Items Amount
  • Order Items Subtotal Amount
  • Define amount of points proportional to customer metadata
  • Earning Rule Proportional Custom Event
source
object
required
object
enum<string>
default:earning_rule
required
Available options:
earning_rule
automation_id
string
required
metadata
object
required
validation_rule_id
string | null
required
updated_at
string<date-time> | null
required
active
boolean
required
event
string
Example:
custom_event
object
segment
object
loyalty_tier
object
pending_points
object
start_date
string
expiration_date
string
validity_timeframe
object
validity_day_of_week
enum<integer>[]
validity_hours
object
expiration_rules
object