The earning rule object

This entity describes an earning rule object.

Attribute

Description

Example

id string

auto_xPTonXNMO2oqlv7XrNicwAY7

object string

A type of the object represented by JSON. The value is earning_rule.

validation_rule_id string

A unique validation rule identifier that is verified before points are added to balance

val_6o0qdvlbh1mt

created_at string, ISO 8601 date format

2016-11-16T14:14:31Z

loyalty

An object that defines how many points will be added to a loyalty card

"loyalty": {
    "points": 3
}

event string

It can be one of these options:

  • order.paid event
  • customer.segment.entered event
  • custom event name

order.paid

custom_event object

Required for the custom event option. Contains the ID of a custom event schema.

{
  "schema_id": "ces_C5Wv8nJSCy7W9OMw7shNxNk6"
}

segment object

Required for the customer.segment.entered option

{
   "id": "seg_f1r5Ts3gM3N7"
}

source object

Contains the configuration for a campaign this earning rule belongs to.

{
    "banner": "Yopu will get 3 points",
    "object_id": "camp_Zgj5HFIPcb70SWJ4IjBNta2F",
    "object_type": "campaign"
}
{
  "id": "auto_xPTonXNMO2oqlv7XrNicwAY7",
  "object": "earning_rule",
  "created_at": "2019-04-12T10:39:48.852Z",
  "validation_rule_id": "val_6o0qdvlbh1mt",
  "source": {
    "banner": "Yopu will get 3 points",
    "object_id": "camp_Zgj5HFIPcb70SWJ4IjBNta2F",
    "object_type": "campaign"
  },
  "loyalty": {
    "points": 3
  },
  "event": "order.paid"
}