Rewards

All rewards endpoints have path prefix /rewards-service.

Module

Activate Rewards Module

Activate rewards module for the participant. Takes JSON object containing module name rewards. Responds with list of participant's enabled modules. Current participant must be either System (can activate rewards for Partner, Manufacturer, Product 360, Expert or Retailer participants) or Partner with active rewards module (can active rewards for child Manufacturer, Product 360, Expert or Retailer participants).

POST /rewards-service/participants/:id/modules
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Participant identifier
module string e.g. "rewards"
Example Response
[
    "rewards",
    "other_module",
    "yet_another_module"
]

Deactivate Rewards Module

Deactivate rewards module for the participant. Required current participant permissions are the same as for activate module endpoint.

DELETE /rewards-service/participants/:id/modules/:module
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Participant identifier
module string e.g. "rewards"

Reminders

Reminder is a special campaign which using for sending push notifications for users. This types of campaigns available only for system participant.

Create Reminder Campaign

POST /rewards-service/reminder_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name body Required: Reminder name
run_options body Required: Reminder options
messages body Required: List of reminder messages
audience body Audience filter
status body Required: Reminder status (active/inactive)
run_options object
Name Description
start_date Required: Start date
start_time Required: Start time
frequency One of values (once is default):
"once",
"daily",
"weekly",
"monthly",
"yearly",
"working_days",
"weekends"
custom_days List of custom days (from 1 to 7)
Example Request
{
    "name": "Sample Reminder",
    "run_options": {
        "start_date": "2018-12-16",
        "start_time": "13:29:12",
        "frequency": "daily",
        "custom_days": [
            1,
            2,
            3
        ]
    },
    "audience": {
        "min_age": 20,
        "max_age": 35,
        "gender": "other",
        "languages": [
            "en"
        ],
        "user_levels": [
            "gold"
        ]
    },
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "status": "inactive",
    "messages": [
        {
            "text": "Some push text en",
            "language": "en"
        },
        {
            "text": "Some push text ru",
            "language": "ru"
        }
    ]
}

Example Response

{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold"
        ]
    },
    "id": "urn:authenticateit:reminder:263082888221005",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "messages": [
        {
            "language": "en",
            "text": "Some push text en"
        },
        {
            "language": "ru",
            "text": "Some push text ru"
        }
    ],
    "name": "Sample Reminder",
    "owner": "urn:authenticateit:participant:1",
    "run_options": {
        "custom_days": [
            1,
            2,
            3
        ],
        "frequency": "daily",
        "start_date": "2018-12-16",
        "start_time": "13:29:12"
    },
    "status": "inactive"
}

Update Reminder Campaign

PUT /rewards-service/reminder_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Reminder campaign identifier
Example Request
{
  "name": "Sample Reminder",
  "run_options": {
    "start_date": "2018-12-16",
    "start_time": "13:29:12",
    "frequency": "daily",
    "custom_days": [
      1,
      2,
      3
    ]
  },
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "basic"
    ]
  },
  "status": "inactive",
  "messages": [
    {
      "text": "Some push text en",
      "language": "en"
    },
    {
      "text": "Some push text ru",
      "language": "ru"
    }
  ]
}

Example Response

{
    "audience": {
        "countries": [
            "036"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "id": "urn:authenticateit:reminder:300261839642784",
    "messages": [
        {
            "language": "en",
            "text": "Some push text en"
        },
        {
            "language": "ru",
            "text": "Some push text ru"
        }
    ],
    "name": "Sample Reminder",
    "owner": "urn:authenticateit:participant:1",
    "run_options": {
        "custom_days": [
            1,
            2,
            3
        ],
        "frequency": "daily",
        "start_date": "2018-12-16",
        "start_time": "13:29:12"
    },
    "status": "inactive"
}

Delete Reminder Campaign

DELETE /rewards-service/reminder_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Reminder campaign identifier

Get Reminder Campaign

GET /rewards-service/reminder_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Reminder campaign identifier

Example Response

{
    "audience": {
        "countries": [
            "036"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "id": "urn:authenticateit:reminder:300261839642784",
    "messages": [
        {
            "language": "en",
            "text": "Some push text en"
        },
        {
            "language": "ru",
            "text": "Some push text ru"
        }
    ],
    "name": "Sample Reminder",
    "owner": "urn:authenticateit:participant:1",
    "run_options": {
        "custom_days": [
            1,
            2,
            3
        ],
        "frequency": "daily",
        "start_date": "2018-12-16",
        "start_time": "13:29:12"
    },
    "status": "inactive"
}

List Of Reminder Campaigns

List participant's own reminder campaigns. Responds with a list of reminder campaigns representations. The resulting list may be filtered by sending parameters in the request JSON body. All parameters are optional.

Campaigns can be filtered by audience (audience parameter (empty filter by default), see example request below), number of campaigns can be skipped from output (offset parameter (0 if unspecified)), and resulting list length can be limited (limit parameter (100 if unspecified)).

Campaigns can be filtered by status.

POST /rewards-service/reminder_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "audience": {
    "min_age": 18,
    "max_age": 60,
    "user_level": "basic",
    "country":  "036",
    "gender": "other",
    "language": "en"
  },
  "status":"active",
  "offset": 0,
  "limit": 3
}
Example Response
[
    {
        "audience": {
            "countries": [
                "036"
            ],
            "gender": "other",
            "languages": [
                "en"
            ],
            "max_age": 35,
            "min_age": 20,
            "user_levels": [
                "basic"
            ]
        },
        "id": "urn:authenticateit:reminder:912959360711414",
        "messages": [
            {
                "language": "en",
                "text": "Some push text en 1"
            },
            {
                "language": "ru",
                "text": "Some push text ru 1"
            }
        ],
        "name": "Sample Reminder 1",
        "owner": "urn:authenticateit:participant:1",
        "run_options": {
            "custom_days": [
                1,
                2,
                3
            ],
            "frequency": "daily",
            "start_date": "2018-12-16",
            "start_time": "13:29:12"
        },
        "status": "active"
    }
]

Boosts

Boost is a special campaign which activates a level for the user who has scanned attached gtin code. This types of campaigns available only for system participant. Also, boosts are available for special buddy_invite events (buddy_invite option is included). Only one active boost can contain key buddy_invite.

Create Boost Campaign

POST /rewards-service/boost_campaigns

end_date must be more than start_date and also stop_date must be more than start_date and also stop_date must be more than current timestamp (UTC+0).

Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name body Required: Boost name
start_date body Required: Start datetime
end_date body Required: End datetime
stop_date body Stop boost datetime
limit body Limit of number of users
level body Required for scans: Granted level
audience body Audience filter
locations body Locations filter
first_scan body First scan condition (true or false)
status body Required: Boost status (active or inactive)
period_min body Required for scans: Period for new level (in minutes)
products body List of gtins. May be skipped (all gtins option)
buddy_invite body Buddy invite options
buddy_invite object. All fields are required
Name Description
first Values: none or inc_level or level (bronze or silver etc.)
first_period Values: none or next_day_end
if_max_level Values: none or next_day_end
max_repeat Integer, from 1 to 100
repeat Values: inc_level or next_day_end or none
repeat_period Values: last_date or next_day_end or none
Example 1. buddy_invite boost settings

It means that:
1) When user first-time caught boost - his level will be upgraded (first:inc_level option) to the end of next day (first_period: next_day_end)
2) When user caught boost when the previous buddy boost is active - his level will be upgraded without changing date (repeat: inc_level and repeat_period: last_date)
3) When user catch max level (ambassador) - the end of boost will be increased to end of the next day (if_max_level: next_day_end)
4) Maximal of applying (max_repeat) the boost per user - 30

{
    "audience": {
        "min_age": 20,
        "max_age": 35,
        "gender": "other",
        "languages": [
            "en"
        ],
        "user_levels": [
            "basic"
        ]
    },
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "buddy_invite": {
        "first": "inc_level",
        "first_period": "next_day_end",
        "if_max_level": "next_day_end",
        "max_repeat": 30,
        "repeat": "inc_level",
        "repeat_period": "last_date"
    },
    "end_date": "2019-05-16T19:59:59Z",
    "name": "Buddies invite boost 1",
    "start_date": "2019-03-02T16:00:00Z",
    "status": "inactive",
    "type": "boost"
}
Example Request
{
    "audience": {
        "min_age": 20,
        "max_age": 35,
        "gender": "other",
        "languages": [
            "en"
        ],
        "user_levels": [
            "basic"
        ]
    },
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "buddy_invite": {
        "first": "inc_level",
        "first_period": "next_day_end",
        "if_max_level": "next_day_end",
        "max_repeat": 30,
        "repeat": "inc_level",
        "repeat_period": "last_date"
    },
    "end_date": "2019-05-16T19:59:59Z",
    "name": "Buddies invite boost 1",
    "start_date": "2019-03-02T16:00:00Z",
    "status": "inactive",
    "type": "boost"
}

Example Response

{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "buddy_invite": {
        "first": "inc_level",
        "first_period": "next_day_end",
        "if_max_level": "next_day_end",
        "max_repeat": 30,
        "repeat": "inc_level",
        "repeat_period": "last_date"
    },
    "end_date": "2019-05-16T19:59:59Z",
    "id": "urn:authenticateit:boost:369069035755767",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "name": "Buddies invite boost 1",
    "owner": "urn:authenticateit:participant:1",
    "start_date": "2019-03-02T16:00:00Z",
    "status": "inactive"
}
Example Request
{
  "name": "Sample Boost All Products And Stop Date",
  "start_date": "2018-10-09T00:00:01Z",
  "end_date": "2019-12-12T00:00:01Z",
  "level": "gold",
  "audience": {},
  "stop_date": "2018-12-14T12:00:00Z",
  "first_scan": true,
  "status": "active",
  "period_min": 100
}

Example Response

 {
    "audience": {},
    "end_date": "2019-12-12T00:00:01Z",
    "id": "urn:authenticateit:boost:045346796826981",
    "level": "gold",
    "name": "Sample Boost All Products And Stop Date",
    "owner": "urn:authenticateit:participant:1",
    "period_min": 100,
    "start_date": "2018-10-09T00:00:01Z",
    "first_scan": true,
    "status": "active",
    "stop_date": "2018-12-14T12:00:00Z"
}

Update Boost Campaign

PUT /rewards-service/boost_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Boost campaign identifier
Example Request
{
  "name": "Sample Boost Renamed",
  "start_date": "2018-10-09T00:00:01Z",
  "end_date": "2019-12-12T00:00:01Z",
  "limit": 2,
  "level": "silver",
  "first_scan": false,
  "products": [
    "02987376234230"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "basic"
    ]
  },
  "status": "inactive",
  "period_min": 1000
}

Example Response

{
    "audience": {
        "countries": [
            "036"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "end_date": "2019-12-12T00:00:01Z",
    "id": "urn:authenticateit:boost:555542010537598",
    "level": "silver",
    "limit": 2,
    "first_scan": false,
    "name": "Sample Boost Renamed",
    "owner": "urn:authenticateit:participant:1",
    "period_min": 1000,
    "products": [
        "02987376234230"
    ],
    "start_date": "2018-10-09T00:00:01Z",
    "status": "inactive"
}

Delete Boost Campaign

DELETE /rewards-service/boost_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Boost campaign identifier

Get Boost Campaign

GET /rewards-service/boost_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Boost campaign identifier

Example Response

{
    "audience": {
        "countries": [
            "036"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "end_date": "2019-12-12T00:00:01Z",
    "id": "urn:authenticateit:boost:569210120439034",
    "level": "silver",
    "limit": 2,
    "name": "Sample Boost",
    "owner": "urn:authenticateit:participant:1",
    "period_min": 1000,
    "products": [
        "02987376234230"
    ],
    "start_date": "2018-10-09T00:00:01Z",
    "status": "active"
}

List Boost Campaigns

List participant's own boost campaigns. Responds with a list of boost campaign representations. The resulting list may be filtered by sending parameters in the request JSON body. All parameters are optional.

Campaigns can be filtered by audience (audience parameter (empty filter by default), see example request below), number of campaigns can be skipped from output (offset parameter (0 if unspecified)), and resulting list length can be limited (limit parameter (100 if unspecified)).

Campaigns can be filtered by start and end dates range (start_date and end_date fields).

POST /rewards-service/boost_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "audience": {
    "min_age": 18,
    "max_age": 60,
    "user_level": "basic",
    "country":  "036",
    "gender": "other",
    "language": "en"
  },
  "start_date": "2018-05-08T00:00:01Z",
  "end_date": "2019-12-30T00:00:01Z",
  "status":"active",
  "offset": 0,
  "limit": 1
}
Example Response
[
    {
        "audience": {
            "countries": [
                "036"
            ],
            "gender": "other",
            "languages": [
                "en"
            ],
            "max_age": 35,
            "min_age": 20,
            "user_levels": [
                "basic"
            ]
        },
        "end_date": "2019-12-12T00:00:01Z",
        "id": "urn:authenticateit:boost:569210120439034",
        "level": "silver",
        "limit": 2,
        "name": "Sample Boost",
        "owner": "urn:authenticateit:participant:1",
        "period_min": 1000,
        "products": [
            "02987376234230"
        ],
        "start_date": "2018-10-09T00:00:01Z",
        "status": "active"
    }
]

Campaigns

Example responce

{
  "_id": "urn:authenticateit:campaign:1",
  "events": [
    {
      "scan": {
        "coins": 5000000
      }
    }
  ],
  "name": "System campaign",
  "owner": "urn:authenticateit:participant:1",
  "type": "rewards_campaign"
}

Adjustment of budgets and event

The sample of calculating adjustments of campaigns. For precalculating values before creating the campaign. The currency may be specified by the user. In the other case, the value will be extracted from country field of the participant. The participant determines the budget in conventional units, then the server sets the required currency and recalculates the budget values and events. adjustment.overall field is required.

POST /rewards-service/adjustment/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
adjustment body Required: Adjustment object
Example Request
{
  "adjustment":
  {
    "event":0.01,
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "usd",
    "event": "30000000000000000000"
}
Example Request
{
  "adjustment":
  {
      "day": 0.5,
      "week": 0.7,
    "month": 1,
    "overall": 3,
    "event":0.01,
    "country":"036",
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "aud",
    "day": "770000000000000000000",
    "event": "10000000000000000000",
    "month": "1540000000000000000000",
    "overall": "4620000000000000000000",
    "week": "1080000000000000000000"
}
Example Request
{
  "adjustment":
  {
      "day": 0.5,
      "week": 0.7,
    "month": 1,
    "overall": 3,
    "event":0.01,
    "currency":"aud",
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "aud",
    "day": "770000000000000000000",
    "event": "10000000000000000000",
    "month": "1540000000000000000000",
    "overall": "4620000000000000000000",
    "week": "1080000000000000000000"
}

Create Rewards Campaign

Create rewards campaign. Takes JSON object containing campaign name, start date, end date (optional, campaign is continuous if there is no end date), campaign budget, products filter (all participant products are eligible for campaign, if the filter is missing), audience filter and list of user action events. Responds with created rewards campaign representation.

Campaign must have overall budget (field budget.overall is required).

Currenct participant must be Product 360, Manufacturer, Retailer, Expert, System or Partner and must have rewards module activated.

all_products - the option which means that the campaign will be connected to all products. If all_products:true then products parameter must be empty.
partner_brand - the option which means that the campaign will be connected to partner brand's products.

events.<event>.condition - optional parameter. Possible values: once, daily, weekly, monthly, global_once events.<event>.count - optional parameter. The number of rewards for the period specified in the condition field

Supported events: view_popup, view_text, view_image, visit_link, watch_video, view_status, view_nutrition_info, view_certificates, follow_fb, scan, visit_social_networks_link, send_review, upload_receipt

upload_receipt event is available only for system.
upload_receipt event has additional campaign restrictions (all_receipts or recognized_receipts) and has additional receipts_rewards_options field.
all_receipts - reward all receipts
recognized_receipts - reward only recognized receipts
receipts_rewards_options should contains options for partner_brand_product, non_partner_brand_product and product_mapping

receipt_budget_restrictions option restrict budget of receipt campaign per user. This option should contains budget_per_user_per_day

Example of upload_receipt campaign:

{
   "id": "urn:authenticateit:campaign:063071786528766",
   "audience": {
   },
   "budget": {
       "day": "1000000000000000000000000000"
   },
   "events": [
       {
           "upload_receipt": {
               "coins": "11000000000000000000",
               "condition": "daily"
           }
       }
   ],
   "receipts_rewards_options": [
    {
      "id": "partner_brand_product",
      "adjustment": {
        "coins_step": "10000000000000000",
        "event": 0.01
      }
    },
    {
      "id": "non_partner_brand_product",
      "adjustment": {
        "coins_step": "10000000000000000",
        "event": 0.0001
      }
    },
    {
      "id": "product_mapping",
      "adjustment": {
        "coins_step": "1000000000000000",
        "event": 0.05
      }
    }
   ],
   "receipt_budget_restrictions": [
    {
      "id": "budget_per_user_per_day",
      "coins": "100000000000000000000",
      "adjustment": {
        "coins_step": "10000000000000000",
        "value": 5
      }
    }
   ],
   "name": "System Receipt",
   "owner": "urn:authenticateit:participant:1",
   "receipts_restrictions": {
       "all_receipts": true
   },
   "start_date": "2019-10-01T20:00:00Z",
   "status": "active",
   "type": "rewards_campaign"
}
POST /rewards-service/rewards_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "adjustment":
  {
    "event":0.01,
    "coins_step" : "10000000000000000000"
  },
  "name": "Some Campaign",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2016-12-24T00:00:00Z",
  "budget": {
    "day": "20000000000000000000",
    "week": "40000000000000000000",
    "month": "60000000000000000000"
  },
  "products": [],
  "all_products":false,
  "audience": {
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "gold"
    ]
  },
  "locations": [
      {
          "active": true,
          "country": "036",
          "states": [
              "VIC"
          ],
          "cities": [
              "Seddon"
          ],
          "postcodes": [
              "3030",
              "3011"
          ],
          "retailers": [
              "coles"
          ],
          "distance": 1000,
          "geodata": [
              {
                  "latitude": -70.0000,
                  "longitude": 43.000,
                  "distance": 0
              }
          ]
      }
  ],
  "status": "inactive",
  "partner_brand":true,
  "events": [
    {
      "view_text": {
        "coins": "10000000000000000000",
        "condition": "monthly",
        "count": 1
      }
    }
  ]
}

Example Response

{
    "adjustment": {
        "coins_step": "10000000000000000000",
        "currency": "aud",
        "event": 0.01
    },
    "all_products": false,
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold"
        ]
    },
    "budget": {
        "day": "20000000000000000000",
        "month": "60000000000000000000",
        "week": "40000000000000000000"
    },
    "end_date": "2016-12-24T00:00:00Z",
    "events": [
        {
            "view_text": {
                "coins": "30000000000000000000",
                "condition": "monthly",
                "count": 1
            }
        }
    ],
    "id": "urn:authenticateit:campaign:300272904407763",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "name": "Some Campaign",
    "owner": "urn:authenticateit:participant:1",
    "partner_brand": true,
    "products": [],
    "start_date": "2016-12-15T00:00:00Z",
    "status": "inactive"
}
{
  "name": "Test",
  "status": "active",
  "events": [
    {
      "send_review": {
        "coins": "22000000000000000000",
        "condition": "once"
      }
    }
  ],
  "social_networks_share": [
    {
      "id": "fb",
      "adjustment": {
        "coins_step": "10000000000000000",
        "event": 0.03
      }
    }
  ],
  "start_date": "2021-01-19T20:00:00Z",
  "products": [],
  "all_products": true,
  "audience": {},
  "budget": {
    "day": "1000000000000000000000000000"
  }
}

Example Response

{
    "all_products": true,
    "audience": {},
    "budget": {
        "day": "1000000000000000000000000000"
    },
    "events": [
        {
            "send_review": {
                "coins": "22000000000000000000",
                "condition": "once"
            }
        }
    ],
    "id": "urn:authenticateit:campaign:061908684754917",
    "name": "Test",
    "owner": "urn:authenticateit:participant:735879621218609",
    "products": [],
    "social_networks_share": [
        {
            "adjustment": {
                "coins_step": "10000000000000000",
                "currency": "aud",
                "event": 0.03
            },
            "coins": "853100000000000000000",
            "id": "fb"
        }
    ],
    "start_date": "2021-01-19T20:00:00Z",
    "status": "active"
}
{
  "name": "Test",
  "status": "active",
  "events": [
    {
      "send_review": {
        "coins": "22000000000000000000",
        "condition": "once"
      }
    }
  ],
  "social_networks_share": [
    {
      "id": "fb",
      "coins": "1832000000000000000000"
    }
  ],
  "start_date": "2021-01-19T20:00:00Z",
  "products": [],
  "all_products": true,
  "audience": {},
  "budget": {
    "day": "1000000000000000000000000000"
  }
}

Example Response

{
    "all_products": true,
    "audience": {},
    "budget": {
        "day": "1000000000000000000000000000"
    },
    "events": [
        {
            "send_review": {
                "coins": "22000000000000000000",
                "condition": "once"
            }
        }
    ],
    "id": "urn:authenticateit:campaign:061908684754917",
    "name": "Test",
    "owner": "urn:authenticateit:participant:735879621218609",
    "products": [],
    "social_networks_share": [
        {
            "coins": "1832000000000000000000",
            "id": "fb"
        }
    ],
    "start_date": "2021-01-19T20:00:00Z",
    "status": "active"
}
Example Request. Upload receipt campaign may contain options for rewards per recognized products. Example with adjustment
{
  "name": "Test",
  "status": "active",
  "receipts_restrictions": {
        "recognized_receipts": true
    },
  "events": [
    {
      "upload_receipt": {
        "coins": "22000000000000000000",
        "condition": "once"
      }
    }
  ],
    "receipts_rewards_options": [
    {
      "id": "partner_brand_product",
      "adjustment": {
        "coins_step": "10000000000000000",
        "event": 0.01
      }
    },
    {
      "id": "non_partner_brand_product",
      "adjustment": {
        "coins_step": "10000000000000000",
        "event": 0.001
      }
    }
  ],
  "start_date": "2021-01-19T20:00:00Z",
  "audience": {},
  "budget": {
    "day": "1000000000000000000000000000"
  }
}

Example Response

{
    "audience": {},
    "budget": {
        "day": "1000000000000000000000000000"
    },
    "events": [
        {
            "upload_receipt": {
                "coins": "22000000000000000000",
                "condition": "once"
            }
        }
    ],
    "id": "urn:authenticateit:campaign:259137172292695",
    "name": "Test",
    "owner": "urn:authenticateit:participant:1",
    "receipts_restrictions": {
        "recognized_receipts": true
    },
    "receipts_rewards_options": [
        {
            "adjustment": {
                "coins_step": "10000000000000000",
                "currency": "aud",
                "event": 0.01
            },
            "coins": "91880000000000000000",
            "id": "partner_brand_product"
        },
        {
            "adjustment": {
                "coins_step": "10000000000000000",
                "currency": "aud",
                "event": 0.001
            },
            "coins": "9180000000000000000",
            "id": "non_partner_brand_product"
        }
    ],
    "start_date": "2021-01-19T20:00:00Z",
    "status": "active"
}
Example Request. Upload receipt campaign may contain options for rewards per recognized products. Example without adjustment
{
  "name": "Test",
  "status": "active",
  "receipts_restrictions": {
        "recognized_receipts": true
    },
  "events": [
    {
      "upload_receipt": {
        "coins": "22000000000000000000",
        "condition": "once"
      }
    }
  ],
  "receipts_rewards_options": [
    {
      "id": "partner_brand_product",
      "coins": "1832000000000000000000"
    },
    {
      "id": "non_partner_brand_product",
      "coins": "1832000000000000000000"
    }
  ],
  "start_date": "2021-01-19T20:00:00Z",
  "audience": {},
  "budget": {
    "day": "1000000000000000000000000000"
  }
}

Example Response

{
    "audience": {},
    "budget": {
        "day": "1000000000000000000000000000"
    },
    "events": [
        {
            "upload_receipt": {
                "coins": "22000000000000000000",
                "condition": "once"
            }
        }
    ],
    "id": "urn:authenticateit:campaign:971508184725437",
    "name": "Test",
    "owner": "urn:authenticateit:participant:1",
    "receipts_restrictions": {
        "recognized_receipts": true
    },
    "receipts_rewards_options": [
        {
            "coins": "1832000000000000000000",
            "id": "partner_brand_product"
        },
        {
            "coins": "1832000000000000000000",
            "id": "non_partner_brand_product"
        }
    ],
    "start_date": "2021-01-19T20:00:00Z",
    "status": "active"
}

Update Rewards Campaign

Endpoint for owner participant to update it's rewards campaign. Takes JSON object containing rewards campaign (see endpoint for rewards campaign creation). Responds with updated rewards campaign representation.

Currenct participant must have rewards module activated and must be campaign owner.

PUT /rewards-service/rewards_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "name": "Renamed Campaign",
  "end_date": "2016-12-31T00:00:00Z",
  "budget": {
    "overall": 350000
  },
  "status": "inactive"
}

Example Response

{
  "id": "urn:authenticateit:campaign:12345678901245",
  "owner": "urn:epc:sgln:0614141.12345.1",
  "name": "Renamed Campaign",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2016-12-31T00:00:00Z",
  "budget": {
    "overall": 350000
  },
  "products": [
    "09780996791304"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "female",
    "languages": [
      "en"
    ]
  },
  "status": "inactive",
  "events": [
    {
      "view_text": {
        "coins": 1500000,
        "condition": "monthly"
      }
    },
    {
      "follow_fb": {
        "coins": 3500000,
        "condition": "once"
      }
    }
  ]
}

Delete Rewards campaign

Endpoint for participant to delete it's rewards campaign. Participant must have rewards module activated and must be campaign. owner.

DELETE /rewards-service/rewards_campaigns/{id}
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier

Change status of campaign

Endpoint for participant to change campaign status to pending.

PUT /rewards_campaigns/status/{id}
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Rewards campaign identifier
status string "active" or "inactive"

List Reward Campaigns

List participant's own reward campaigns. Responds with a list of reward campaign representations. The resulting list may be filtered by sending parameters in the request JSON body. All parameters are optional.

Campaigns can be filtered by audience (audience parameter (empty filter by default), see example request below), number of campaigns can be skipped from output (offset parameter (0 if unspecified)), and resulting list length can be limited (limit parameter (100 if unspecified)).

Campaigns can be filtered by events (events parameter (empty filter by default), see example request below), by start and end dates range (start_date and end_date fields).

Campaigns can be filtered by partner_brand option.

POST /rewards-service/rewards_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "audience": {
    "min_age": 21,
    "max_age": 25,
    "city": "Nagpur",
    "country": "356",
    "gender": "male",
    "language": "en",
    "state": "Maharashtra",
    "user_level": "bronze"
  },
  "events": {
    "type": "view_popup",
    "condition": "daily"
  },
  "start_date": "2016-05-05",
  "end_date": "2017-12-31",
  "offset": 5,
  "limit": 1
}
Example Response
[
  {
    "audience": {
      "countries": [
        "643", "356"
      ],
      "city": "Nagpur",
      "state": "Maharashtra",
      "gender": "male",
      "languages": [
        "ru",
        "en"
      ],
      "max_age": 24,
      "min_age": 22,
      "user_levels": [
        "platinum",
        "bronze"
      ]
    },
    "budget": {},
    "events": [
      {
        "view_popup": {
          "coins": 100000000,
          "condition": "daily",
          "unique_location": false
        }
      }
    ],
    "id": "urn:authenticateit:campaign:795220009246909",
    "name": "Test conditions campaign",
    "owner": "urn:authenticateit:participant:841535075581481",
    "products": [
      "00000026037431"
    ],
    "start_date": "2017-08-20",
    "status": "active"
  }
]
Example Request
{
  "partner_brand": true,
  "offset": 5,
  "limit": 1
}
Example Response
[
    {
        "all_products": false,
        "audience": {
            "user_levels": [
                "basic"
            ]
        },
        "budget": {
            "day": "1000000000000000000000000000"
        },
        "events": [
            {
                "scan": {
                    "coins": "12000000000000000000",
                    "condition": "once"
                }
            }
        ],
        "id": "urn:authenticateit:campaign:125266956013592",
        "name": "Test postcode",
        "owner": "urn:authenticateit:participant:1",
        "partner_brand": true,
        "start_date": "2021-01-27T20:00:00Z",
        "status": "inactive"
    }
]

Claim Reward Campaign Coins

API endpoint for user to claim reward campaign coins. Takes JSON object containing identifier of the corresponding scan and list of user action events. Responds with the number of pending coins. Created claim will be processed by the system in due time and either approved (user will be notified and pending coins will be transferred to the user account) or rejected.

POST /rewards-service/rewards_campaigns/:id/coin_claims
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "events": ["view_text", "follow_fb"],
  "scan_id": "763c0cf3-9949-4c2d-a0c8-700159f68b09"
}
Example Response
{
  "pending_coins": 50
}

Rewards Budget

Set Participant Budget

Endpoint for participant to set own rewards campaigns budget. Takes JSON object containing budget. Participant must have active rewards module.

PUT /rewards-service/rewards_campaigns/budget
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "budget": {
    "day": 10,
    "week": 70,
    "month": 300
  }
}

Set Participant Budget Limit

Endpoint for System or Partner to limit participant's rewards campaigns budget. Takes JSON object containing budget. Participant must have active rewards module. If current participant is Partner, it also must have active rewards module, participant must be child of Partner.

PUT /rewards-service/participants/:id/rewards_campaigns/budget_limit
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "budget": {
    "day": 20,
    "week": 140,
    "month": 600
  }
}

Rewards points

The system logged all income from the accrual points call internal methods

Set Participant points packet

POST /rewards-service/billing/packet
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
points number Points

Get available points

GET /rewards-service/billing/points
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket

Shoutouts

Create shoutout

POST /rewards-service/shoutouts_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name string Required: Shoutout name
copy string Required: Push message
products list Required: List of products
start_date string Start datetime
end_date string End datetime
delay integer Delay in minutes when message will be send
count integer Coun of mathing the campaign when message wil be send
audience object Audience object
locations list Rewards locations
status string "active" (default) or "inactive"
Audience object
Name Type Description
countries list List of countries
languages list List of languages
min_age integer Min user age
max_age integer Max user age
gender string User's gender
locations list List of locations
user_levels list User's levels list
advanced object Advanced object
Advanced object

May contain inverse flag - "inverse": true or false

Example Request
{
    "name": "Test 1",
    "start_date": "2016-12-15T00:00:00Z",
    "end_date": "2017-12-24T00:00:00Z",
    "products": [
        "00000026033419"
    ],
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "audience": {
        "min_age": 20,
        "max_age": 35,
        "gender": "other",
        "languages": [
            "en"
        ],
        "user_levels": [
            "gold",
            "bronze",
            "basic"
        ],
        "advanced": {
            "brand_scans": {
                "scans_from": 1,
                "scans_to": 3,
                "date_from": "2016-12-15T00:00:00Z",
                "date_to": "2017-12-15T00:00:00Z"
            },
            "weekly_scans": {
                "from": 1,
                "to": 3
            },
            "last_scan_date": {
                "date": "2017-12-15T00:00:00Z"
            },
            "countries": {
                "list": [
                    "036",
                    "643"
                ],
                "inverse": true
            }
        }
    },
    "copy": "Some push message",
    "delay": 4,
    "status": "active",
    "count": 1
}
Example Response
{
    "audience": {
        "advanced": {
            "brand_scans": {
                "date_from": "2016-12-15T00:00:00Z",
                "date_to": "2017-12-15T00:00:00Z",
                "scans_from": 1,
                "scans_to": 3
            },
            "countries": {
                "inverse": true,
                "list": [
                    "036",
                    "643"
                ]
            },
            "last_scan_date": {
                "date": "2017-12-15T00:00:00Z"
            },
            "weekly_scans": {
                "from": 1,
                "to": 3
            }
        },
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold",
            "bronze",
            "basic"
        ]
    },
    "copy": "Some push message",
    "count": 1,
    "delay": 4,
    "end_date": "2017-12-24T00:00:00Z",
    "id": "urn:authenticateit:shoutout:130970949432104",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "name": "Test 1",
    "owner": "urn:authenticateit:participant:1",
    "products": [
        "00000026033419"
    ],
    "start_date": "2016-12-15T00:00:00Z",
    "status": "active"
}

Read shoutout

GET /rewards-service/shoutouts_campaigns/{id}/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Response
{
"audience": {
"advanced": {
"brand_scans": {
"date_from": "2016-12-15T00:00:00Z",
"date_to": "2017-12-15T00:00:00Z",
"scans_from": 1,
"scans_to": 3
},
"countries": {
"inverse": true,
"list": [
  "036",
  "643"
],
},
"last_scan_date": {
"date": "2017-12-15T00:00:00Z"
},
"weekly_scans": {
"from": 1,
"to": 3
}
},
"countries": [
  "036"
],
"gender": "other",
"languages": [
  "en"
],
"locations": [
  "urn:authenticateit:location:1487249964787"
],
"max_age": 35,
"min_age": 20,
"user_levels": [
  "gold",
  "bronze",
  "basic"
],
},
"copy": "Some push message",
"count": 1,
"delay": 4,
"end_date": "2017-12-24T00:00:00Z",
"id": "urn:authenticateit:shoutout:013506706920330",
"name": "Test 1",
"owner": "urn:authenticateit:participant:841535075581481",
"products": [
  "00000026033419"
],
"start_date": "2016-12-15T00:00:00Z",
"status": "active"
}

Update shoutout

PUT /rewards-service/shoutouts_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier
Example Request
{
  "name": "Test 1",
  "start_date": "2016-12-15T00:00:00Z",
  "end_date": "2017-12-24T00:00:00Z",
  "products": [
    "00000026033419"
  ],
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "locations": [
      "urn:authenticateit:location:1487249964787"
    ],
    "user_levels": [
      "gold",
      "bronze",
      "basic"
    ],
    "advanced": {
      "brand_scans": {
        "scans_from": 1,
        "scans_to": 3,
        "date_from": "2016-12-15T00:00:00Z",
        "date_to": "2017-12-15T00:00:00Z"
      },
      "weekly_scans": {
        "from": 1,
        "to": 3
      },
      "last_scan_date": {
        "date": "2017-12-15T00:00:00Z"
      },
      "countries": {
        "list": [
          "036",
          "643"
        ],
        "inverse": true
      }
    }
  },
  "copy": "Some push message",
  "delay": 4,
  "status": "inactive",
  "count": 1
}
Example Response
{
"audience": {
"advanced": {
"brand_scans": {
"date_from": "2016-12-15T00:00:00Z",
"date_to": "2017-12-15T00:00:00Z",
"scans_from": 1,
"scans_to": 3
},
"countries": {
"inverse": true,
"list": [
  "036",
  "643"
],
},
"last_scan_date": {
"date": "2017-12-15T00:00:00Z"
},
"weekly_scans": {
"from": 1,
"to": 3
}
},
"countries": [
  "036"
],
"gender": "other",
"languages": [
  "en"
],
"locations": [
  "urn:authenticateit:location:1487249964787"
],
"max_age": 35,
"min_age": 20,
"user_levels": [
  "gold",
  "bronze",
  "basic"
],
},
"copy": "Some push message",
"count": 1,
"delay": 4,
"end_date": "2017-12-24T00:00:00Z",
"id": "urn:authenticateit:shoutout:013506706920330",
"name": "Test 1",
"owner": "urn:authenticateit:participant:841535075581481",
"products": [
  "00000026033419"
],
"start_date": "2016-12-15T00:00:00Z",
"status": "inactive"
}

Delete shoutout

DELETE /rewards-service/shoutouts_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Rewards campaign identifier

Read shoutouts

GET /rewards-service/shoutouts_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number Skip specified number of campaigns.
limit number Limit the number of returned campaigns.

Read and filter shoutouts

All parameters are optional.

POST /rewards-service/shoutouts_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
start_date string Datetime "0000-01-01T00:00:00Z"
end_date string Datetime "9999-12-31T00:00:00Z"
status string Shoutout status "active" or "inactive"
offset number Skip specified number of campaigns.
limit number Limit the number of returned campaigns.
audience object Audience filter
Audience filter
Name Type Description
country string or list "036" or ["036"], ["036", "643"]
language string or list "en" or ["en"], ["en", "ru"]
status string Shoutout status "active" or "inactive"
min_age integer Min age filter
max_age integer Max age filter
gender string "male" or "feamale" or "other"
user_level string or list "gold" or ["gold"], ["basic", "gold"]
locations string or list one or more location's id
Example Request
{
  "end_date": "9999-12-31T00:00:00Z",
  "start_date": "0000-01-01T00:00:00Z",
  "limit": 10,
  "ofset": 0,
  "audience": {
    "country": [
      "036"
    ],
    "user_level": [
      "basic"
    ],
    "language": [
      "en"
    ],
    "gender":"other"
  }
}
Example Response
[
  {
    "audience": {
      "advanced": {
        "brand_scans": {
          "date_from": "2016-12-15T00:00:00Z",
          "date_to": "2017-12-15T00:00:00Z",
          "scans_from": 1,
          "scans_to": 3
        },
        "countries": {
          "inverse": true,
          "list": [
            "036",
            "643"
          ]
        },
        "last_scan_date": {
          "date": "2017-12-15T00:00:00Z"
        },
        "weekly_scans": {
          "from": 1,
          "to": 3
        }
      },
      "countries": [
        "036"
      ],
      "gender": "other",
      "languages": [
        "en"
      ],
      "locations": [
        "urn:authenticateit:location:1487249964787"
      ],
      "max_age": 35,
      "min_age": 20,
      "user_levels": [
        "gold",
        "bronze",
        "basic"
      ]
    },
    "copy": "Some push message",
    "count": 1,
    "delay": 4,
    "end_date": "2017-12-24T00:00:00Z",
    "id": "urn:authenticateit:shoutout:013506706920330",
    "name": "Test 1",
    "owner": "urn:authenticateit:participant:841535075581481",
    "products": [
      "00000026033419"
    ],
    "start_date": "2016-12-15T00:00:00Z",
    "status": "inactive"
  }
]

Redemptions

List Available Rewards

List groups of rewards available for redemption. Query string parameter device_type (should be either android or ios) is used to filter out inappropriate (according to mobile device vendor) rewards. E.g., it may be used to filter out Google Play gift cards from the output on iOS devices. Response will contain a list of rewards. Each list item is either a product reward or a gift card reward.

GET /rewards-service/redemptions/rewards
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
device_type string Device type e.g. android
Example Response
[
  {
    "brand": "Sorny",
    "gtin": "11111111111113",
    "name": "Super Xyzzy 5000",
    "points_price": 800,
    "price": 400,
    "currency": "USD",
    "type": "product_reward"
  },
  {
    "brand": "Cyclon",
    "gtin": "33333333333339",
    "name": "Coupon 300F",
    "points_price": 200,
    "price": 150,
    "currency": "USD",
    "type": "product_reward"
  },
  {
    "card_type": "google",
    "not_device_types": [
      "ios"
    ],
    "points_price": 220,
    "price": 200,
    "currency": "USD",
    "type": "gift_card_reward"
  }
]

Redeem Reward

API to request reward redemption.

Either a product reward (parameters gtin and points must be provided in the request body) or a gift card reward (parameters card_type, price, currency and points must be provided) could be requested.

When a product reward is requested, user may pay less points than the points price of the reward. Brand related to the product will be notified about the request, and should contact the user directly to provide further instructions on how to pay the remaining amount (if less points were initially paid) and how to receive the reward. Created product redemption will be recorded in user's redemption history.

When a gift card reward is requested, provided points value must be exactly the points price of the gift card. User must have verified phone number in his account. Gift card number will be sent in a SMS message to phone number from user account. Created gift card redemption will be recorded in user's redemption history.

POST /rewards-service/redemptions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
  "gtin": "11111111111113",
  "points": 200
}

or

{
  "card_type": "google",
  "price": 200,
  "currency": "USD",
  "points": 220
}
Example Response
{
  "gtin": "11111111111113",
  "points": 200
}

Read Redemption History

Read user's history of reward redemptions. Response will contain the list of history entries. Each entry contains redemption timestamp, redeemed reward type and number of spent points.

GET /rewards-service/redemptions/history
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
  {
    "points": 220,
    "reward": {
      "card_type": "google",
      "not_device_types": [
        "ios"
      ],
      "points_price": 220,
      "price": 200,
      "currency": "USD",
      "type": "gift_card_reward"
    },
    "ts": "2017-03-30T19:49:24Z"
  },
  {
    "points": 200,
    "reward": {
      "brand": "Sorny",
      "gtin": "11111111111113",
      "name": "Super Xyzzy 5000",
      "points_price": 800,
      "price": 400,
      "currency": "USD",
      "type": "product_reward"
    },
    "ts": "2017-03-30T19:26:01Z"
  }
]

Bots

Create Bot

Create rewards bot. Takes JSON object containing bot name, start time (optional), end time (optional, bot is always active if there is no end date), list of GTINs (bot will be activated for these products), audience filter and list of text and media (image or video) widgets. Responds with created bot representation.

Bot audience is a JSON object with fields countries, min_age, max_age, gender, languages, last_scan_date (users with the last scan activity earlier than the specified date), weekly_scans (a JSON object with optional fields from and to, having integer values, the minimum and maximum number of scans during the last seven days), scan_countries (list of countries where a product was scanned), registration_methods (list of allowed registration methods, where method is either facebook or email). All fields are optional.

Currenct participant must have rewards module activated.

POST /rewards-service/bots
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Request
{
    "name": "Sample Bot",
    "status": "active",
    "start_time": "2017-01-01T13:00:00Z",
    "end_time": "2017-03-05T18:30:00Z",
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "audience": {
        "languages": [
            "en",
            "ru"
        ],
        "min_age": 25,
        "max_age": 30,
        "gender": "male",
        "registration_methods": [
            "email",
            "facebook"
        ],
        "last_scan_date": "2017-06-06",
        "weekly_scans": {
            "from": 15,
            "to": 30
        },
        "scan_countries": [
            "036",
            "643"
        ]
    },
    "products": [
        "00000000000000"
    ],
    "text_widgets": [
        {
            "text": {
                "title": "Nice Title!",
                "text": "The text includes some `markdown`.",
                "markdown": true
            }
        }
    ],
    "media_widgets": [
        {
            "image": [
                {
                    "url": "http://example.org/img1.png"
                },
                {
                    "url": "http://example.org/x.jpg"
                }
            ]
        },
        {
            "video": {
                "title": "Our Product",
                "url": "http://example.org/vid.mp4",
                "preview": "http://example.org/vid-small.jpg"
            }
        }
    ]
}
Example Response
{
    "audience": {
        "gender": "male",
        "languages": [
            "en",
            "ru"
        ],
        "last_scan_date": "2017-06-06",
        "max_age": 30,
        "min_age": 25,
        "registration_methods": [
            "email",
            "facebook"
        ],
        "scan_countries": [
            "036",
            "643"
        ],
        "weekly_scans": {
            "from": 15,
            "to": 30
        }
    },
    "end_time": "2017-03-05T18:30:00Z",
    "id": "urn:authenticateit:bot:036899386941983",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "media_widgets": [
        {
            "image": [
                {
                    "url": "http://example.org/img1.png"
                },
                {
                    "url": "http://example.org/x.jpg"
                }
            ]
        },
        {
            "video": {
                "preview": "http://example.org/vid-small.jpg",
                "title": "Our Product",
                "url": "http://example.org/vid.mp4"
            }
        }
    ],
    "name": "Sample Bot",
    "owner": "urn:authenticateit:participant:1",
    "products": [
        "00000000000000"
    ],
    "start_time": "2017-01-01T13:00:00Z",
    "status": "active",
    "text_widgets": [
        {
            "text": {
                "markdown": true,
                "text": "The text includes some `markdown`.",
                "title": "Nice Title!"
            }
        }
    ]
}

Update Bot

Endpoint for owner participant to update it's rewards bot. Takes JSON object containing bot (see endpoint for bot creation). Responds with updated bot representation.

Currenct participant must have rewards module activated and must be bot owner.

PUT /rewards-service/bots/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id
status string Bot status e.g. "inactive"
Example Response
{
  "audience": {
    "countries": [
      "036",
      "643"
    ],
    "gender": "male",
    "languages": [
      "en",
      "ru"
    ],
    "max_age": 30,
    "min_age": 25,
    "registration_methods": [
      "email",
      "facebook"
    ]
  },
  "end_time": "2017-03-05T18:30:00Z",
  "id": "urn:authenticateit:bot:808678240218235",
  "name": "Sample Bot",
  "owner": "urn:authenticateit:participant:1491563346054",
  "products": [],
  "start_time": "2017-01-01T13:00:00Z",
  "status": "inactive",
  "text_widgets": [
    {
      "text": {
        "markdown": true,
        "text": "The text includes some `markdown`.",
        "title": "Nice Title!"
      }
    }
  ],
  "media_widgets": [
    {
      "image": [
        {
          "url": "http://example.org/img1.png"
        },
        {
          "url": "http://example.org/x.jpg"
        }
      ]
    },
    {
      "video": {
        "preview": "http://example.org/vid-small.jpg",
        "title": "Our Product",
        "url": "http://example.org/vid.mp4"
      }
    }
  ]
}

Delete Bot

DELETE /rewards-service/bots/{id}
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id

List Bots

List participant's own reward bots. Accepts offset (skip specified number of bots; 0 by default) and limit (limit the number of returned bots; 100 by default) query parameters. Responds with a list of bot representations.

GET /rewards-service/bots
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number skip specified number of bots
limit number Limit the number of returned bots
Example Response
[
  {
    "id": "urn:authenticateit:bot:427622626238419",
    "name": "Sample Bot 2",
    "owner": "urn:authenticateit:participant:1491563346054",
    "text_widgets": [
      {
        "text": {
          "text": "B"
        }
      }
    ]
  },
  {
    "id": "urn:authenticateit:bot:749469863100815",
    "name": "Sample Bot 1",
    "owner": "urn:authenticateit:participant:1491563346054",
    "text_widgets": [
      {
        "text": {
          "text": "A"
        }
      }
    ]
  }
]

Report Bot Widgets as Viewed

API for user to explicitly report bot video widgets as viewed. Widgets from bots received on a product scan will include bot_id field. If client receives a video widget with bot_id, it should report widget view with this API. Bot wouldn't suggest the next video from it's list until previous one is viewed.

Request must include media_widgets array of video widgets, which were viewed by the user. Each widget must have url and that URL must match URL in one of the bot's widgets. Response will be empty.

POST /rewards-service/bots/{id}/widgets/viewed
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Bot id
Example Request
{
  "media_widgets": [
    {
      "video": {
        "url": "http://example.org/vid.mp4"
      }
    }
  ]
}

Campaign has options object with two boolean parameters: options.single_blast and options.even_distribution.
Only one option should be switched in true.
single_blast means that campaign will send product (products) to all matched users once. It is the default option.
even_distribution means that campaign will send product (products) to parts of users by each day between start_date and end_date.

Campaign has optional parameter hero_image_url. The value should be a link or null.

POST /rewards-service/featured_products_campaigns
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
name body Required: Campaign name
status body Required: Campaign status (active or inactive)
run_time body Required: Time when the campaign will be run
start_date body Required: Start datetime
end_date body Required: End datetime
products body Required: List of gtins
audience body Rewards audience
locations body Rewards locations
options body Featured Products Campaign options
hero_image_url body Hero image for Featured Product.
Example Request
{
    "name": "Test Featured Products Campaign",
    "products": [
        "00000000000369"
    ],
    "options": {
        "even_distribution": true
    },
    "start_date": "2019-08-01T01:01:01Z",
    "end_date": "2019-09-01T01:01:01Z",
    "run_time": "01:01:01",
    "status": "inactive",
    "hero_image_url": "https://dev-cdn.shping.com/2021/5/20/90218531-e697-4aac-a4ce-f1edfbbaaafc.jpeg",
    "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "distance": 1000,
            "geodata": [
                {
                    "latitude": -70.0000,
                    "longitude": 43.000,
                    "distance": 0
                }
            ]
        }
    ],
    "audience": {
        "min_age": 20,
        "max_age": 35,
        "gender": "other",
        "languages": [
            "en"
        ],
        "user_levels": [
            "gold"
        ]
    }
}

Example Response

{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold"
        ]
    },
    "end_date": "2019-09-01T01:01:01Z",
    "hero_image_url": "https://dev-cdn.shping.com/2021/5/20/90218531-e697-4aac-a4ce-f1edfbbaaafc.jpeg",
    "id": "urn:authenticateit:featured_products_campaigns:013625830806932",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "distance": 1000,
            "geodata": [
                {
                    "distance": 0,
                    "latitude": -70.0,
                    "longitude": 43.0
                }
            ],
            "postcodes": [
                "3030",
                "3011"
            ],
            "retailers": [
                "coles"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "name": "Test Featured Products Campaign",
    "options": {
        "even_distribution": true
    },
    "owner": "urn:authenticateit:participant:1",
    "products": [
        "00000000000369"
    ],
    "run_time": "01:01:01",
    "start_date": "2019-08-01T01:01:01Z",
    "status": "inactive"
}
PUT /rewards-service/featured_products_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Campaign identifier
name body Required: Campaign name
status body Required: Campaign status (active or inactive)
run_time body Required: Time when the campaign will be run
start_date body Required: Start datetime
end_date body Required: End datetime
products body Required: List of gtins
audience body Rewards audience
locations body Rewards locations
options body Featured Products Campaign options
hero_image_url body Hero image for Featured Product.
Example Request
{
  "name": "New Test Featured Products Campaign",
  "products": [
    "00000000000086"
  ],
  "start_date": "2019-08-01T01:01:01Z",
  "end_date": "2019-09-01T01:01:01Z",
  "run_time": "01:01:01",
  "status": "active",
  "hero_image_url": null,
  "audience": {
    "countries": [
      "036",
      "643"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "gold",
      "basic"
    ]
  }
}

Example Response

{
    "audience": {
        "countries": [
            "036",
            "643"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold",
            "basic"
        ]
    },
    "id": "urn:authenticateit:featured_products_campaigns:057191917446840",
    "name": "New Test Featured Products Campaign",
    "owner": "urn:authenticateit:participant:735879621218609",
    "hero_image_url": null,
    "products": [
        "00000000000086"
    ],
    "options": {
        "single_blast": true 
    },
    "start_date": "2019-08-01T01:01:01Z",
    "end_date": "2019-09-01T01:01:01Z",
    "run_time": "01:01:01",
    "status": "active"
}
DELETE /rewards-service/featured_products_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Campaign identifier
PUT /rewards-service/featured_products_campaigns/status/:id/:status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Campaign identifier
status string active or inactive

Example Response

{
    "audience": {
        "countries": [
            "036",
            "643"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold",
            "basic"
        ]
    },
    "options": {
        "single_blast": true 
    },
    "id": "urn:authenticateit:featured_products_campaigns:057191917446840",
    "name": "New Test Featured Products Campaign",
    "hero_image_url": null,
    "owner": "urn:authenticateit:participant:735879621218609",
    "products": [
        "00000000000086"
    ],
    "start_date": "2019-08-01T01:01:01Z",
    "end_date": "2019-09-01T01:01:01Z",
    "run_time": "01:01:01",
    "status": "inactive"
}
POST /rewards-service/featured_products_campaigns/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
audience string Audience filter
products list Products filter
offset non_neg_integer Offset
limit pos_integer Limit
Example Request
{
  "products": [
    "86"
  ]
}
Example Response
[
    {
        "audience": {
            "countries": [
                "036",
                "643"
            ],
            "gender": "other",
            "languages": [
                "en"
            ],
            "max_age": 35,
            "min_age": 20,
            "user_levels": [
                "gold",
                "basic"
            ]
        },
        "id": "urn:authenticateit:featured_products_campaigns:057191917446840",
        "name": "New Test Featured Products Campaign",
        "hero_image_url": null,
        "owner": "urn:authenticateit:participant:735879621218609",
        "products": [
            "00000000000086"
        ],
        "start_date": "2019-08-01T01:01:01Z",
        "end_date": "2019-09-01T01:01:01Z",
        "run_time": "01:01:01",
        "status": "active"
    }
]
GET /rewards-service/featured_products_campaigns/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Campaign identifier
Example Response
{
    "audience": {
        "countries": [
            "036",
            "643"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "gold",
            "basic"
        ]
    },
    "id": "urn:authenticateit:featured_products_campaigns:057191917446840",
    "name": "New Test Featured Products Campaign",
    "hero_image_url": null,
    "owner": "urn:authenticateit:participant:735879621218609",
    "products": [
        "00000000000086"
    ],
    "start_date": "2019-08-01T01:01:01Z",
    "end_date": "2019-09-01T01:01:01Z",
    "run_time": "01:01:01",
    "status": "active"
}

Competitions

Competition's coins adjustment

POST /rewards-service/competitions/adjustment/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
adjustment body Required: Adjustment object
Example Request
{
  "adjustment":
  {
      "result": 0.5,
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "usd",
    "result": "1700000000000000000000"
}
Example Request
{
  "adjustment":
  {
      "result": 0.5,
      "country":"036",
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "aud",
    "result": "770000000000000000000"
}
Example Request
{
  "adjustment":
  {
      "result": 0.5,
      "currency":"aud",
    "coins_step" : "10000000000000000000"
  }
}

Example Response

{
    "coins_step": "10000000000000000000",
    "currency": "aud",
    "result": "770000000000000000000"
}

Create Competition

POST /rewards-service/competitions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
start_date string Required: Start datetime
end_date string Required: End datetime
name string Required: Competition name
description string Required: Competition description
status string Required: active or inactive
card object Required: ToDo card object
t&c_link string Valid link to T&C of competition
all_products boolean All products options
purchased_products list Purchased products. List of gtins
products list List of selected products
coins string Reward for Competition card completion
audience object Audience filter
adjustment object Adjustment settings

Competition may contain coins field (reward in Shping Coins for the user for card completion).

card field takes JSON object containing card name, icon (predefined icon identifier or URL), description, non-empty list of steps.

Predefined icon identifiers are action, brand, contact, fb, support, verify and warning.

Each step is a JSON object containing step type, title (optional step title) and bunch of other fields depending on the type.

Step type may be text. In that case step must also include text field (textual description of the step).

Step type may be textbox. No other fields are defined for such step. User will be asked to provide some text to complete the step.

Step type may be rating. No other fields are defined for such step. User will be asked to provide a rating (integer number from 1 to 5) to complete the step.

Step type may be question. Fields question (question textual description) and answers (non-empty list of possible answers) must be present for such step. Each answer is a JSON object with fields answer (answer textual description) and optional correct (true if the answer must be accepted as correct).

Step type may be image. No other fields are defined for such step. User will be asked to upload an image to complete the step.

Example Request
{
  "start_date": "2019-08-20T22:42:25Z",
  "end_date": "2019-09-20T22:42:25Z",
  "name": "Competition example",
  "description": "Simple Competition",
  "status": "active",
  "all_products": true,
  "t&c_link" : "https://www.shping.com",
  "purchased_products": [
        "00000000000000"
  ],
  "coins": "1000000000000000000",
  "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "basic"
    ]
  },
  "card": {
    "name": "Sample Competition Card",
    "icon": "warning",
    "description": "Complete this survey to earn some coins.",
    "steps": [
      {
        "type": "text",
        "title": "Step 1 title",
        "text": "Review our Product"
      },
      {
        "type": "rating",
        "title": "Please rate this"
      },
      {
        "type": "question",
        "question": "A or B?",
        "answers": [
          {
            "answer": "Definitely A!"
          },
          {
            "answer": "B for sure!",
            "correct": true
          }
        ]
      },
      {
        "type": "image",
        "title": "Upload a photo, please"
      },
      {
        "type": "textbox",
        "title": "What's on your mind?"
      }
    ]
  }
}
Example Response
{
  "start_date": "2019-08-20T22:42:25Z",
  "end_date": "2019-09-20T22:42:25Z",
  "name": "Competition example",
  "description": "Simple Competition",
  "status": "active",
  "all_products": true,
  "purchased_products": [
        "00000000000000"
  ],
  "t&c_link" : "https://www.shping.com",
  "coins": "1000000000000000000",
    "audience": {
    "countries": [
      "036"
    ],
    "min_age": 20,
    "max_age": 35,
    "gender": "other",
    "languages": [
      "en"
    ],
    "user_levels": [
      "basic"
    ]
  },
  "card": {
    "name": "Sample Competition Card",
    "icon": "warning",
    "description": "Complete this survey to earn some coins.",
    "steps": [
      {
        "type": "text",
        "title": "Step 1 title",
        "text": "Review our Product"
      },
      {
        "type": "rating",
        "title": "Please rate this"
      },
      {
        "type": "question",
        "question": "A or B?",
        "answers": [
          {
            "answer": "Definitely A!"
          },
          {
            "answer": "B for sure!",
            "correct": true
          }
        ]
      },
      {
        "type": "image",
        "title": "Upload a photo, please"
      },
      {
        "type": "textbox",
        "title": "What's on your mind?"
      }
    ]
  },
  "id": "urn:authenticateit:competition:192822414174123",
  "owner": "urn:authenticateit:participant:1"
}
Example Request (adjustment)
{
  "start_date": "2019-08-20T22:42:25Z",
  "end_date": "2019-09-20T22:42:25Z",
  "name": "Competition example renamed",
  "description": "Simple Competition",
  "card": {
    "name": "Sample Competition Card",
    "icon": "warning",
    "description": "Complete this survey to earn some coins.",
    "steps": [
      {
        "type": "text",
        "title": "Step 1 title",
        "text": "Review our Product"
      }
    ]
  },
  "all_products": true,
  "status": "active",
  "adjustment": {
    "result": 0.1,
    "coins_step": "10000000000000000000"
  }
}
Example Response (adjustment)
{
    "adjustment": {
        "coins_step": "10000000000000000000",
        "currency": "aud",
        "result": 0.1
    },
    "all_products": true,
    "card": {
        "description": "Complete this survey to earn some coins.",
        "icon": "warning",
        "name": "Sample Competition Card",
        "steps": [
            {
                "text": "Review our Product",
                "title": "Step 1 title",
                "type": "text"
            }
        ]
    },
    "coins": "480000000000000000000",
    "description": "Simple Competition",
    "end_date": "2019-09-20T22:42:25Z",
    "id": "urn:authenticateit:competition:396083627591984",
    "name": "Competition example renamed",
    "owner": "urn:authenticateit:participant:735879621218609",
    "start_date": "2019-08-20T22:42:25Z",
    "status": "active"
}

Update Competition

Endpoint for owner participant to update a Competition.

Current participant must be Competition's owner.

PUT /rewards-service/competitions/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Competition id
Example Request
{
  "start_date": "2019-08-20T22:42:25Z",
  "end_date": "2019-09-20T22:42:25Z",
  "name": "Competition example renamed",
  "description": "Simple Competition",
  "status": "active",
  "all_products": true,
  "coins": "1000000000000000000",
  "card": {
    "name": "Sample Competition Card",
    "icon": "warning",
    "description": "Complete this survey to earn some coins.",
    "steps": [
      {
        "type": "text",
        "title": "Step 1 title",
        "text": "Review our Product"
      },
      {
        "type": "rating",
        "title": "Please rate this"
      },
      {
        "type": "question",
        "question": "A or B?",
        "answers": [
          {
            "answer": "Definitely A!"
          },
          {
            "answer": "B for sure!",
            "correct": true
          }
        ]
      },
      {
        "type": "image",
        "title": "Upload a photo, please"
      },
      {
        "type": "textbox",
        "title": "What's on your mind?"
      }
    ]
  }
}
Example Response
{
  "start_date": "2019-08-20T22:42:25Z",
  "end_date": "2019-09-20T22:42:25Z",
  "name": "Competition example renamed",
  "description": "Simple Competition",
  "status": "active",
  "all_products": true,
  "coins": "1000000000000000000",
  "card": {
    "name": "Sample Competition Card",
    "icon": "warning",
    "description": "Complete this survey to earn some coins.",
    "steps": [
      {
        "type": "text",
        "title": "Step 1 title",
        "text": "Review our Product"
      },
      {
        "type": "rating",
        "title": "Please rate this"
      },
      {
        "type": "question",
        "question": "A or B?",
        "answers": [
          {
            "answer": "Definitely A!"
          },
          {
            "answer": "B for sure!",
            "correct": true
          }
        ]
      },
      {
        "type": "image",
        "title": "Upload a photo, please"
      },
      {
        "type": "textbox",
        "title": "What's on your mind?"
      }
    ]
  },
  "id": "urn:authenticateit:competition:192822414174123",
  "owner": "urn:authenticateit:participant:1"
}

Delete Competition

Endpoint to delete existing Competition by id. Current participant must be Competition's owner.

DELETE /rewards-service/competitions/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Competition id

List Competitions

List participant's Competitions. Accepts offset (skip specified number of Competitions; 0 by default) and limit (limit the number of returned Competitions; 100 by default) query parameters. Responds with a list of Competition representations.

GET /rewards-service/competitions/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
type string Required: data or names
offset number Skip specified number of Competitions
limit number Limit the number of returned Competitions
Example Response with data type request
[
  {
    "all_products": true,
    "card": {
      "description": "Complete this survey to earn some coins.",
      "icon": "warning",
      "name": "Sample Competition Card",
      "steps": [
        {
          "title": "What's on your mind?",
          "type": "textbox"
        }
      ]
    },
    "coins": "1000000000000000000",
    "description": "Simple Competition",
    "end_date": "2019-09-20T22:42:25Z",
    "id": "urn:authenticateit:competition:888582780739927",
    "name": "Competition example",
    "owner": "urn:authenticateit:participant:1",
    "start_date": "2019-08-20T22:42:25Z",
    "status": "active"
  }
]
Example Response with names type request
[
    {
        "id": "urn:authenticateit:competition:167656099616488",
        "name": "Competition example name 1"
    },
    {
        "id": "urn:authenticateit:competition:394608992051372",
        "name": "Competition example name 2"
    }
]

List of filled Competitions cards

GET /rewards-service/competitions/considered/:status_filter
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
status_filter string Required: rejected or completed
competition_id string Filter by competition ID
offset number Skip specified number of Cards
limit number Limit the number of returned Cards
Example Response
{
    "count": 1,
    "documents": [
        {
            "campaign_type": "competition",
            "created": "2019-09-02T11:38:00Z",
            "delivery_id": "urn:authenticateit:competition:062633987276228",
            "description": "Complete this survey to earn some coins.",
            "icon": "warning",
            "id": "51a70232c1d535988527b1bcadf3a893ea8797943ff2b913b5a836397a6b27e531eaa66e11bd8802b712cb07a78d02a5",
            "name": "Sample Competition Cardv25",
            "owner": "urn:authenticateit:participant:735879621218609",
            "reason": "some_reason",
            "result": {
                "coins": "1000000000000000000"
            },
            "scan_id": "3d9bee37-e95e-43d6-b4a7-c3068a36c466",
            "status": "rejected",
            "steps": [
                {
                    "text": "Review our Product",
                    "title": "Step 1 title",
                    "type": "text"
                },
                {
                    "rating": 3,
                    "title": "Please rate this",
                    "type": "rating"
                },
                {
                    "answer_index": 0,
                    "answers": [
                        {
                            "answer": "Definitely A!"
                        },
                        {
                            "answer": "B for sure!",
                            "correct": true
                        }
                    ],
                    "question": "A or B?",
                    "type": "question"
                },
                {
                    "title": "Upload a photo, please",
                    "type": "image",
                    "url": "https://dev-cdn.shping.com/2019/9/2/58fce775-dcec-4b58-9224-ae6e13f987be"
                },
                {
                    "text": "5555",
                    "title": "What's on your mind?",
                    "type": "textbox"
                }
            ],
            "user": {
                "first_name": "user1",
                "last_name": "pwd1",
                "level": "basic",
                "photo": "https://dev-cdn.shping.com/2019/3/6/c5809b6f-3b0d-4d7c-8b43-14ff20edbffa",
                "reviews_karma": 1
            },
            "user_id": "urn:authenticateit:user:email:email@gmail.com"
        }
    ]
}

Ban user/ Mark Competition card as rejected

PUT /rewards-service/competitions/considered/:id/:status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Competition card Id
status string Required: rejected or ban
reason string Required: Reason of the reject (length > 4)
Example Request
{
  "reason": "Some text reason"
}

Create export task by competition id

POST /rewards-service/competitions/export
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Competition Id
Example Request
{
  "id" :"urn:authenticateit:competition:749078307488258"
}
Example Response
{
    "competition_id": "urn:authenticateit:competition:749078307488258",
    "competition_name": "Competition example",
    "id": "urn:authenticateit:competition:749078307488258@competition_export@b12661fd-806c-43f4-8d05-46d2293a9563",
    "started": "2019-09-03T18:13:14Z",
    "status": "in_progress"
}

Delete export task by id

DELETE /rewards-service/competitions/export/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Export task id

Get tasks

GET /rewards-service/competitions/export
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
    {
        "competition_id": "urn:authenticateit:competition:749078307488258",
        "competition_name": "Competition example",
        "id": "urn:authenticateit:competition:749078307488258@competition_export@b12661fd-806c-43f4-8d05-46d2293a9563",
        "started": "2019-09-03T18:13:14Z",
        "status": "in_progress"
    },
    {
        "competition_id": "urn:authenticateit:competition:749078307488258",
        "competition_name": "Competition example",
        "finished": "2019-09-03T17:38:01Z",
        "id": "urn:authenticateit:competition:749078307488258@competition_export@5a990276-0cf0-45de-87d2-2ee426bb84e2",
        "started": "2019-09-03T17:37:03Z",
        "status": "success",
        "link": "https://dev-cdn.shping.com/2019/9/2/csv_file.csv"
    }
    {
        "competition_id": "urn:authenticateit:competition:749078307488258",
        "competition_name": "Competition example",
        "finished": "2019-09-03T17:38:01Z",
        "id": "urn:authenticateit:competition:749078307488258@competition_export@5a990276-0cf0-45de-87d2-2ee426bb84e2",
        "started": "2019-09-03T17:37:03Z",
        "status": "failure"
    }
]

WebSocket endpoint

WebSocket endpoint for real time collecting scans and rewards coins.
WebSocket endpoint also supports JSON messages for getting total scans count and approved reviews count.

  • WebSocket endpoint supports only wss schema wss://.
  • WebSocket endpoint also works as echo. If you will send some data, if connection is established, you will receive back all data. Except predefined JSON messages.
  • Default timeout for connection without activity is 10 min. After that connection will be closed
  • coins parameter always in coins format (string or integer) 26000000000000000000 = 26 COINS, "26100000000000000000" = 26.1 COINS
  • latitude and longitude parameters is always in string integer format. For converting to correct values you need to divide value on 1000000. 56852863 / 1000000 = 56.852863
GET /rewards-service/websocket

Get total_scans count

Example Request
{
  "action": "total_scans"
}
Example Response
{
  "action": "total_scans",
  "count": 20016
}

Get total_reviews count

Example Request
{
  "action": "total_reviews"
}
Example Response
{
  "action": "total_reviews",
  "count": 531
}
Example message with type scan
{
  "accuracy": "50,3030014038086",
  "code": "00498765432233",
  "country": "643",
  "language": "ru",
  "latitude": "56853796",
  "longitude": "53298341",
  "product_image": "https://dev-cdn.shping.com/2018/12/12/13142d6f-20e8-491c-84d1-36f224fa5596.jpg",
  "product_name": "Test",
  "product_reviews_rate": 3.375,
  "ts": "2019-10-22T07:34:39Z",
  "type": "scan",
  "user": {
    "level": "platinum",
    "reviews_karma": 2
  }
}
Example message with type scan
{
  "accuracy": "57,6180000305176",
  "code": "09312828059513",
  "country": "643",
  "language": "ru",
  "latitude": "56853688",
  "longitude": "53298960",
  "product_image": "https://cdn.shping.com/2018/1/28/a759926f-0826-4d90-9d62-61aa4d202d56.png",
  "product_name": "Spirax A4 240 Pages 7mm No 595a",
  "product_reviews_rate": 0,
  "ts": "2019-10-29T07:07:54Z",
  "type": "scan",
  "user": {
    "level": "platinum",
    "reviews_karma": 2
  }
}
Example message with type coins_earned
{
  "accuracy": "57,6180000305176",
  "coins": 130000000000000000000,
  "country": "643",
  "language": "ru",
  "latitude": "56853688",
  "longitude": "53298960",
  "product_image": "https://cdn.shping.com/2018/1/28/a759926f-0826-4d90-9d62-61aa4d202d56.png",
  "product_name": "Spirax A4 240 Pages 7mm No 595a",
  "product_reviews_rate": 0,
  "ts": "2019-10-29T07:06:29Z",
  "type": "coins_earned",
  "user": {
    "level": "platinum",
    "reviews_karma": 2
  }
}

Coins for upload receipt

GET /rewards-service/upload_receipt/coins
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
latitude string Required: Latitude
longitude string Required: Longitude
accuracy string Required: Accuracy
country string Country code
Example Request
GET /rewards-service/upload_receipt/coins?latitude=0&longitude=0&accuracy=0
Example Response
{
    "coins": "7000000000000000000"
}

Read FP analytic

POST /rewards-service/featured_products_campaigns/analytic
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset integer Required: Timezone offset (in min)
group_fields list Can be list of owner,campaign,offset,date
campaigns list Filter. List of campaigns
owner string Filter. Owner id
date_from string Filter. Date from value
date_to string Filter. Date to value
Example Request
{
  "offset": 600,
  "group_fields":["owner", "campaign", "offset", "date"],
  "campaigns": ["urn:authenticateit:featured_products_campaigns:888180645516460"],
  "owner": "urn:authenticateit:participant:1",
  "date_from": "2020-10-01",
  "date_to": "2020-12-14"
}
Example Response
[
    {
        "campaign": "urn:authenticateit:featured_products_campaigns:888180645516460",
        "count": 299,
        "date": "2020-10-01",
        "offset": 600,
        "owner": "urn:authenticateit:participant:1"
    },
    {
        "campaign": "urn:authenticateit:featured_products_campaigns:888180645516460",
        "count": 30,
        "date": "2020-10-02",
        "offset": 600,
        "owner": "urn:authenticateit:participant:1"
    },
    {
        "campaign": "urn:authenticateit:featured_products_campaigns:888180645516460",
        "count": 9,
        "date": "2020-10-04",
        "offset": 600,
        "owner": "urn:authenticateit:participant:1"
    },
    {
        "campaign": "urn:authenticateit:featured_products_campaigns:888180645516460",
        "count": 2,
        "date": "2020-10-10",
        "offset": 600,
        "owner": "urn:authenticateit:participant:1"
    }
]

Cashbacks

Create Cashback

POST /rewards-service/cashbacks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
start_date string Required: Start datetime
end_date string Required: End datetime
name string Required: Name
options object Required: Options
status string Required: active or inactive
card object Required: ToDo card object
all_products boolean All products options
purchased_products list Purchased products. List of gtins
products list List of selected products
audience object Audience filter
locations list Rewards locations
budget object Cashback budget in coins/currency
messages list Cashback messages
validation list Cashback validation rules
t&c string Text (URL) with T&C
cashback_per_x_product_receipt_level boolean cashback_per_x_product flag (described below)

cashback_per_x_product_receipt_level flag shows which cashback_per_x_product option should be used.
cashback_per_x_product_receipt_level.true - will be used options.cashback_per_x_product if value exsist. In other case (options.cashback_per_x_product not exsist) the behaviour same as cashback_per_x_product_receipt_level.false.
cashback_per_x_product_receipt_level.false - by default. Will be used purchased_products.cashback_per_x_product if value exsist.

card field takes JSON object containing card name, icon (predefined icon identifier or URL), description, non-empty list of steps.

Also card may include the promo_image (URL) and promo_image_mission (URL).

Predefined icon identifiers are action, brand, contact, fb, support, verify and warning.

Each step is a JSON object containing step type, title (optional step title) and bunch of other fields depending on the type.

Step type may be phone_verification. In that case step must also may include title field.

Step type may be text. In that case step must also include text field (textual description of the step).

Step type may be textbox. No other fields are defined for such step. User will be asked to provide some text to complete the step.

Step type may be rating. No other fields are defined for such step. User will be asked to provide a rating (integer number from 1 to 5) to complete the step.

Step type may be question. Fields question (question textual description) and answers (non-empty list of possible answers) must be present for such step. Each answer is a JSON object with fields answer (answer textual description) and optional correct (true if the answer must be accepted as correct).

Step type may be image. No other fields are defined for such step. User will be asked to upload an image to complete the step.

Steps should contains elements with type receipt and cashout_account.

Cashback should contain options field with followed params:
options.auto_approve - boolean flag shows that card will accepted automatically
options.retailers - list of acceptable retailers
options.currency - currency options.cashback - could be as percents/value/coins
options.currency - cashback result currency
options.claims_per_gtin - cashback claims per gtin
options.claims_per_user - cashback claims per user
options.receipt_postcode - list of valid postcodes for receipt
options.max_claims - allowed claims per cashback
options.receipt_date_from - receipt datetime validation rule
options.receipt_date_to - receipt datetime validation rule
options.receipt_date_to - receipt datetime validation rule
options.cashback_per_x_product - cashbacks per X products. Global settings (pos_integer)
options.cap_in_receipt - total cap per receipt (pos_integer)

messages list contains notifications for user.
messages.type - is type of message REJECT\ACCPET\MANUAL_REJECT\PENDING
messages.message - timeline notification
messages.push - optional push notification

purchased_products.gtin - valid gtin
purchased_products.max_price - max price per product
purchased_products.min_qty - min quantity per product
purchased_products.max_qty - max quantity per product
purchased_products.required - gtin should be presented in list
purchased_products.cashback_per_x_product - cashbacks per X product

Example Request
{
   "all_products": true,
   "locations": [
        {
            "active": true,
            "country": "036",
            "states": [
                "VIC"
            ],
            "cities": [
                "Seddon"
            ],
            "postcodes": [
                "3030",
                "3011"
            ]
        }
    ],
   "audience": {
       "gender": "other",
       "languages": [
           "en"
       ],
       "max_age": 35,
       "min_age": 20,
       "user_levels": [
           "basic"
       ]
   }, 
   "budget": {
       "value": 100
   },
   "card": {
       "description": "Complete this survey to earn some coins.",
       "icon": "https://dev-cdn.shping.com/2021/11/23/a8c1f969-aaed-444a-bd4f-d47a6cf16eee.png",
       "promo_image": "https://dev-cdn.shping.com/2021/12/2/9aff4203-3e89-4af2-b014-26d9a734d5fe.png",
       "promo_image_mission": "https://dev-cdn.shping.com/2021/12/2/9aff4203-3e89-4af2-b014-26d9a734d5fe.png",
       "name": "Sample Cashback Card",
       "steps": [
           {
               "text": "Please follow TC URL",
               "title": "Step 1 title",
               "type": "text"
           },
           {
             "title": "Verify phone if req",
             "type": "phone_verification"
           },
           {
               "title": "Please rate this",
               "type": "rating"
           },
           {
               "answers": [
                   {
                       "answer": "Definitely A!"
                   },
                   {
                       "answer": "B for sure!",
                       "correct": true
                   }
               ],
               "question": "A or B?",
               "type": "question"
           },
           {
               "title": "Add receipt",
               "type": "receipt"
           },
           {
               "title": "Add account id",
               "type": "cashout_account"
           }
       ]
   },
   "end_date": "2021-12-29T22:42:25Z",
   "messages": [
       {
           "message": "Test message",
           "push": "Test message",
           "type": "REJECT"
       },
       {
           "message": "Test message",
           "type": "ACCPET"
       },
       {
           "message": "Test message",
           "push": "Test message",
           "type": "MANUAL_REJECT"
       },
       {
           "message": "Test message",
           "push": "Test message",
           "type": "PENDING"
       }
   ],
   "name": "Cashback example 1",
   "options": {
       "cashback_per_x_product": 2,
       "cap_in_receipt": 3,
       "receipt_date_from": "2021-01-29T00:00:00Z",
       "receipt_date_to": "2021-09-29T00:00:00Z",
       "auto_approve": true,
       "cashback": {
           "percents": 20
       },
       "claims_per_gtin": 1,
       "claims_per_user": 5,
       "max_claims": 1000,
       "currency": "aud",
       "receipt_postcode": [
           "3003"
       ],
       "retailers": [
           "coles"
       ]
   },
   "purchased_products": [
       {
           "gtin": "00000000000000",
           "cashback_per_x_product": 2,
           "max_price": 4.5,
           "min_qty": 2,
           "max_qty": 3,
           "required": true
       }
   ],
   "start_date": "2020-01-20T22:42:25Z",
   "status": "active",
   "type": "cashback_campaign",
   "validation": [
       "profile:phone"
   ],
   "t&c": "Please follow https://en.wikipedia.org/wiki/Main_Page"
}
Example Response
{
    "all_products": true,
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "branch_io_link": "https://shping-click.app.link/v4sPM8SeYrb",
    "budget": {
        "value": 100
    },
    "card": {
        "description": "Complete this survey to earn some coins.",
        "icon": "https://dev-cdn.shping.com/2021/11/23/a8c1f969-aaed-444a-bd4f-d47a6cf16eee.png",
        "name": "Sample Cashback Card",
        "promo_image": "https://dev-cdn.shping.com/2021/12/2/9aff4203-3e89-4af2-b014-26d9a734d5fe.png",
        "promo_image_mission": "https://dev-cdn.shping.com/2021/12/2/9aff4203-3e89-4af2-b014-26d9a734d5fe.png",
        "steps": [
            {
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "title": "Verify phone if req",
                "type": "phone_verification"
            },
            {
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "type": "question"
            },
            {
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "title": "Add account id",
                "type": "cashout_account"
            }
        ]
    },
    "end_date": "2021-12-29T22:42:25Z",
    "id": "urn:authenticateit:cashback:237821382641810",
    "locations": [
        {
            "active": true,
            "cities": [
                "Seddon"
            ],
            "country": "036",
            "postcodes": [
                "3030",
                "3011"
            ],
            "states": [
                "VIC"
            ]
        }
    ],
    "messages": [
        {
            "message": "Test message",
            "push": "Test message",
            "type": "REJECT"
        },
        {
            "message": "Test message",
            "type": "ACCPET"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "MANUAL_REJECT"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "PENDING"
        }
    ],
    "name": "Cashback example 1",
    "options": {
        "auto_approve": true,
        "cap_in_receipt": 3,
        "cashback": {
            "percents": 20
        },
        "cashback_per_x_product": 2,
        "claims_per_gtin": 1,
        "claims_per_user": 5,
        "currency": "aud",
        "max_claims": 1000,
        "receipt_date_from": "2021-01-29T00:00:00Z",
        "receipt_date_to": "2021-09-29T00:00:00Z",
        "receipt_postcode": [
            "3003"
        ],
        "retailers": [
            "coles"
        ]
    },
    "purchased_products": [
        {
            "cashback_per_x_product": 2,
            "gtin": "00000000000000",
            "gtin_name": "Champion Fresh Seal Smooth Blue Duo Pouch 40g X 5 X 30",
            "max_price": 4.5,
            "max_qty": 3,
            "min_qty": 2,
            "required": true
        }
    ],
    "spendings": {
        "budget_value": 100,
        "cashback_total": 0,
        "remaining_balance": 100
    },
    "start_date": "2020-01-20T22:42:25Z",
    "status": "active",
    "t&c": "Please follow https://en.wikipedia.org/wiki/Main_Page",
    "validation": [
        "profile:phone"
    ]
}

Mark cashback as published

After publication owner will no access to update all cashback fields and delete cashback

PUT /rewards-service/cashbacks/published/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Cashback id
Example Request


Example Response
{
    "all_products": true,
    "spendings": {
      "budget_value": 100,
      "cashback_total": 0,
      "remaining_balance": 100
    },
    "audience": {
        "countries": [
            "036",
            "643"
        ],
        "languages": [
            "en"
        ],
        "postcode": [
            "00000"
        ],
        "user_levels": [
            "basic"
        ]
    },
    "branch_io_link": "https://shping-click.app.link/M8Xo0pLrolb",
    "budget": {
        "value": 100
    },
    "card": {
        "description": "Complete this survey to earn some coins.",
        "icon": "warning",
        "name": "Cashback example v1",
        "steps": [
            {
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "type": "question"
            },
            {
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "type": "phone_verification"
            },
            {
                "title": "Add account id",
                "type": "cashout_account"
            }
        ]
    },
    "end_date": "2021-12-29T22:42:25Z",
    "id": "urn:authenticateit:cashback:603210973107806",
    "messages": [
        {
            "message": "Test message1111111",
            "push": "Test message",
            "type": "REJECT"
        },
        {
            "message": "Test message",
            "type": "ACCPET"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "MANUAL_REJECT"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "PENDING"
        }
    ],
    "name": "Cashback example v1",
    "options": {
        "auto_approve": true,
        "cashback": {
            "percents": 20
        },
        "claims_per_gtin": 1,
        "claims_per_user": 5,
        "currency": "aud",
        "max_claims": 1000,
        "receipt_postcode": [
            "3003"
        ],
        "retailers": [
            "coles"
        ]
    },
    "published_at": "2021-10-19T22:42:25Z",
    "purchased_products": [
        {
            "gtin": "00000000000000",
            "gtin_name": "Champion Fresh Seal Smooth Blue Duo Pouch 40g X 5 X 30",
            "max_price": 4.5,
            "max_qty": 3,
            "min_qty": 2,
            "required": true
        }
    ],
    "start_date": "2021-10-20T22:42:25Z",
    "status": "active",
    "validation": [
        "profile:phone"
    ]
}

Update cashback

Endpoint for owner participant to update a cashback.

Current participant must be cashback's owner. Only name,status and messages fields can be updated if the cashback has been already published.

PUT /rewards-service/cashbacks/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Cashback id
Example Request
{
  "status": "inactive",
  "name": "New name",
  "messages": [
    {
      "type": "REJECT",
      "message": "Test message",
      "push": "Test message"
    },
    {
      "type": "ACCPET",
      "message": "Test message"
    },
    {
      "type": "MANUAL_REJECT",
      "message": "Test message",
      "push": "Test message"
    },
    {
      "type": "PENDING",
      "message": "Test message",
      "push": "Test message"
    }
  ]
}
Example Response
{
    "all_products": true,
    "spendings": {
      "budget_value": 100,
      "cashback_total": 0,
      "remaining_balance": 100
    },
    "audience": {
        "city": [
            "c1",
            "c2"
        ],
        "countries": [
            "036"
        ],
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "postcode": [
            "01",
            "02"
        ],
        "user_levels": [
            "basic"
        ]
    },
    "branch_io_link": "https://test-shping.app.link/g4mmzEKISkb",
    "budget": {
        "value": 100
    },
    "card": {
        "description": "Complete this survey to earn some coins.",
        "icon": "warning",
        "name": "Sample Competition Card",
        "steps": [
            {
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "type": "question"
            },
            {
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "title": "Add account id",
                "type": "cashout_account"
            }
        ]
    },
    "end_date": "2021-12-20T22:42:25Z",
    "id": "urn:authenticateit:cashback:702640393170547",
    "messages": [
        {
            "message": "Test message",
            "push": "Test message",
            "type": "REJECT"
        },
        {
            "message": "Test message",
            "type": "ACCPET"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "MANUAL_REJECT"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "PENDING"
        }
    ],
    "name": "New name",
    "options": {
        "auto_approve": true,
        "cashback": {
            "percents": 20
        },
        "claims_per_gtin": 1,
        "claims_per_user": 2,
        "currency": "aud",
        "receipt_postcode": [
            "3003"
        ],
        "retailers": [
            "coles"
        ]
    },
    "purchased_products": [
        {
            "gtin": "00000000000000",
            "gtin_name": "Champion Fresh Seal Smooth Blue Duo Pouch 40g X 5 X 30",
            "max_price": 4.5,
            "max_qty": 3,
            "min_qty": 2,
            "required": true
        }
    ],
    "start_date": "2021-10-20T22:42:25Z",
    "status": "inactive",
    "validation": [
        "profile:phone"
    ]
}

Delete cashback

Endpoint to delete existing cashback by id. Current participant must be cashback's owner. Cashback should not be published

DELETE /rewards-service/cashbacks/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Cashback id

List cashbacks

List participant's cashbacks. Accepts offset (skip specified number of cashbacks; 0 by default) and limit (limit the number of returned cashbacks; 100 by default) query parameters.

GET /rewards-service/cashbacks/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number Skip specified number of cashbacks
limit number Limit the number of returned cashbacks
sort_by string One of start_date, end_date, status, published_at
sort_type string asc or desc
status string One of active, completed, draft, all

status.all - do not filter.
status.active - published_at IS NOT NULL end_date > NOW().
status.completed - published_at IS NOT NULL end_data < NOW().
status.draft - published_at IS NULL.

Example Response
{
    "count": 11,
    "data": [
        {
            "spendings": {
                "budget_value": 15,
                "cashback_total": 0,
                "remaining_balance": 15
              },
            "all_products": true,
            "audience": {
                "city": [
                    "c1",
                    "c2"
                ],
                "countries": [
                    "036"
                ],
                "gender": "other",
                "languages": [
                    "en"
                ],
                "max_age": 35,
                "min_age": 20,
                "postcode": [
                    "01",
                    "02"
                ],
                "user_levels": [
                    "basic"
                ]
            },
            "branch_io_link": "https://test-shping.app.link/j8ba8LUA1kb",
            "budget": {
                "value": 15
            },
            "card": {
                "description": "Complete this survey to earn some coins.",
                "icon": "warning",
                "name": "Sample Competition Card",
                "steps": [
                    {
                        "text": "Please follow TC URL",
                        "title": "Step 1 title",
                        "type": "text"
                    },
                    {
                        "title": "Please rate this",
                        "type": "rating"
                    },
                    {
                        "answers": [
                            {
                                "answer": "Definitely A!"
                            },
                            {
                                "answer": "B for sure!",
                                "correct": true
                            }
                        ],
                        "question": "A or B?",
                        "type": "question"
                    },
                    {
                        "title": "Add receipt",
                        "type": "receipt"
                    },
                    {
                        "title": "Add account id",
                        "type": "cashout_account"
                    }
                ]
            },
            "end_date": "2021-10-29T22:42:25Z",
            "id": "urn:authenticateit:cashback:059131414534263",
            "messages": [
                {
                    "message": "Test message",
                    "push": "Test message",
                    "type": "REJECT"
                },
                {
                    "message": "Test message",
                    "type": "ACCPET"
                },
                {
                    "message": "Test message",
                    "push": "Test message",
                    "type": "MANUAL_REJECT"
                },
                {
                    "message": "Test message",
                    "push": "Test message",
                    "type": "PENDING"
                }
            ],
            "name": "Cashback example 1",
            "options": {
                "auto_approve": true,
                "cashback": {
                    "percents": 20
                },
                "claims_per_gtin": 1,
                "claims_per_user": 5,
                "currency": "aud",
                "max_claims": 1000,
                "receipt_postcode": [
                    "3003"
                ],
                "retailers": [
                    "coles"
                ]
            },
            "purchased_products": [
              {
                  "gtin": "00000000000000",
                  "gtin_name": "Champion Fresh Seal Smooth Blue Duo Pouch 40g X 5 X 30",
                  "max_price": 4.5,
                  "max_qty": 3,
                  "min_qty": 2,
                  "required": true
              }
            ],
            "start_date": "2020-01-20T22:42:25Z",
            "status": "active",
            "validation": [
                "profile:phone"
            ]
        }
    ]
}

Read cashback

GET /rewards-service/cashbacks/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Cashback id
Example Response
{
    "spendings": {
        "budget_value": 1000,
        "cashback_total": 105.01,
        "remaining_balance": 894.99
    },
    "all_products": true,
    "audience": {},
    "branch_io_link": "https://shping-click.app.link/LX3lyGhlhlb",
    "budget": {
        "value": 1000
    },
    "card": {
        "description": "Complete this survey to earn some coins.",
        "icon": "warning",
        "name": "Sample Competition Card",
        "steps": [
            {
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "type": "question"
            },
            {
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "title": "Add account id",
                "type": "cashout_account"
            }
        ]
    },
    "end_date": "2021-10-29T22:42:25Z",
    "id": "urn:authenticateit:cashback:627147240157780",
    "messages": [
        {
            "message": "Test message1111111",
            "push": "Test message",
            "type": "REJECT"
        },
        {
            "message": "Test message",
            "type": "ACCPET"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "MANUAL_REJECT"
        },
        {
            "message": "Test message",
            "push": "Test message",
            "type": "PENDING"
        }
    ],
    "name": "Cashback example 1",
    "options": {
        "auto_approve": true,
        "cashback": {
            "percents": 20
        },
        "claims_per_gtin": 1,
        "claims_per_user": 5,
        "currency": "aud",
        "max_claims": 1000,
        "receipt_postcode": [
            "3003"
        ],
        "retailers": [
            "coles"
        ]
    },
    "purchased_products": [
        {
            "gtin": "00000000000000",
            "gtin_name": "Champion Fresh Seal Smooth Blue Duo Pouch 40g X 5 X 30",
            "max_price": 4.5,
            "max_qty": 3,
            "min_qty": 2,
            "required": true
        }
    ],
    "start_date": "2020-01-20T22:42:25Z",
    "status": "inactive",
    "validation": [
        "profile:phone"
    ]
}

Sync build considered card

GET /rewards-service/cashbacks/considered/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id url Required: Cahsback id.
Example Response
{
  "campaign_type": "cashback",
  "created": "2021-11-03T10:55:54Z",
  "delivery_id": "urn:authenticateit:cashback:710565617279618",
  "description": "Complete this survey to earn some coins.",
  "icon": "warning",
  "id": "dae798f9f9d8accb3b130515b6c66c52be3b0b81b83340fccd282b3d23c531e74bc10b1669bbbd1a00a58d6bbdb94d2d",
  "name": "Sample Competition Card",
  "owner": "urn:authenticateit:participant:735879621218609",
  "result": null,
  "scan_id": null,
  "status": null,
  "validation": [
     "profile:phone"
  ],
  "steps": [
    {
      "text": "Please follow TC URL",
      "title": "Step 1 title",
      "type": "text"
    },
    {
      "title": "Verify phone if req",
      "type": "phone_verification"
    },
    {
      "title": "Please rate this",
      "type": "rating"
    },
    {
      "answers": [
        {
          "answer": "Definitely A!"
        },
        {
          "answer": "B for sure!",
          "correct": true
        }
      ],
      "question": "A or B?",
      "type": "question"
    },
    {
      "title": "Add receipt",
      "type": "receipt"
    },
    {
      "title": "Add account id",
      "type": "cashout_account"
    }
  ],
  "type": "considered_todo_card",
  "user_id": "urn:authenticateit:user:email:test@gmail.com"
}

List of cashback submissions

POST /rewards-service/cashbacks/submissions/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
status list Status filter
delivery_id list Cashbacks filter
order_by string Order rule
order_type string Order type rule
offset non_neg_integer Offset (default 0)
limit pos_integer Limit (default 0)

status should be a list of folowed values ["filled", "under_review", "completed", "failure"]
delivery_id should be a list of cashback ids
order_by should be one of values ["id", "considered_id", "submission_id", "user_id", "user_phone", "delivery_id", "created_ts", "status", "error_id", "cashback_value"]
order_type should be one of values ["asc", "desc"]

Example Request
{
    "status": [
        "under_review"
    ],
    "delivery_id": [
        "urn:authenticateit:cashback:398109165616647"
    ],
    "limit": 1,
    "offset": 0,
    "order_by": "created_ts",
    "order_type": "asc"
}
Example Response
{
    "count": 3,
    "data": [
        {
            "analyzed_receipt": {
                "accuracy_rate": 0.7300000190734863,
                "data": {
                    "expanded_prices": [
                        {
                            "hash": "f3444c5b185759fb036522a2b810d7e599bd463d",
                            "id": "d712e62c-69b0-4c96-b0c6-bd317977bfee",
                            "name": "COLES LITE MILK 2LITRE",
                            "value": "2.39"
                        },
                        {
                            "hash": "1eb33ebaac98b12dc60e9f5f82c74f6ebad5d297",
                            "id": "23c6b761-76ec-4f29-8da0-36e228b4d164",
                            "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                            "value": "6.20"
                        },
                        {
                            "hash": "f1b0b19779050deada97fcc8a8502d3746a4e20c",
                            "id": "9bd2d6d3-82f2-4a03-9bca-c46315b2bad8",
                            "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                            "value": "3.50"
                        },
                        {
                            "hash": "a8de6907f48304ac73585f00bc8d0b34f82d61a5",
                            "id": "5482d906-a94c-4662-9584-b36d9e0ecf5c",
                            "name": "PREPACK CARROTS 1EACH",
                            "value": "1.00"
                        }
                    ],
                    "links": [
                        [
                            "https://cdn.shping.com/2019/10/25/0770b942-9c81-45ed-8909-6ebb52ca935e"
                        ]
                    ],
                    "prices": [
                        {
                            "name": "COLES LITE MILK 2LITRE",
                            "value": "2.39"
                        },
                        {
                            "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                            "value": "6.20"
                        },
                        {
                            "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                            "value": "3.50"
                        },
                        {
                            "name": "PREPACK CARROTS 1EACH",
                            "value": "1.00"
                        }
                    ],
                    "store": "coles",
                    "total": "13.09",
                    "ts": "2021-11-24T08:32:03.037Z"
                },
                "id": "urn:authenticateit:user:email:email@gmail.com@analyzed_receipts@28a8403a-a0c3-4ceb-9829-1a23a953693a",
                "ocr_hash": "792bfd379c26d1ad01ebe04a92142d7f6c93a29d",
                "receipt_date": "25/10/2019",
                "receipt_id": "28a8403a-a0c3-4ceb-9829-1a23a953693a",
                "receipt_time": "Date:",
                "retailer": "coles",
                "retailer_store_id": "697",
                "source": "cashback",
                "status": "completed",
                "ts": "2021-11-24T08:34:15Z",
                "type": "analyzed_receipts",
                "user_id": "urn:authenticateit:user:email:email@gmail.com",
                "words_count": 146
            },
            "cashback_value": null,
            "considered_id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788",
            "created_ts": "2021-11-24T08:29:37Z",
            "delivery_id": "urn:authenticateit:cashback:398109165616647",
            "error_id": null,
            "error_reason": null,
            "id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788@5e3af683-60ae-48e6-9c2c-66135ad72e91",
            "status": "under_review",
            "submission_id": "5e3af683-60ae-48e6-9c2c-66135ad72e91",
            "transaction_request": null,
            "user_first_name": "user1",
            "user_id": "urn:authenticateit:user:email:email@gmail.com",
            "user_last_name": "pwd1",
            "user_livel": "basic",
            "user_phone": "+7111111111",
            "user_photo": "https://dev-cdn.shping.com/2019/3/6/c5809b6f-3b0d-4d7c-8b43-14ff20edbffa"
        }
    ]
}

Fields description:
"analyzed_receipt" - data from receipt after OCR (could be a empty object if receipt OCR is not available).
"cashback_value" - cashback value if status is "completed".
"considered_id" - considered card id.
"created_ts" - submission timestamp.
"delivery_id" - cashback campaign id.
"id" - submission complex id.
"error_id" - error id if status is "failure".
"error_reason" - error text if status is "failure".
"status" - current submission status ("completed"/"failure"/"filled"/"under_review").
"submission_id" - submission id.
"transaction_request" - transaction request id if status is "completed".
"user_first_name" - User's first name.
"user_id" - User's id.
"user_last_name" - User's last name.
"user_livel" - User's level.
"user_phone" - User's phone.
"user_photo" - User's profile photo.

Get submission data by id

POST /rewards-service/cashbacks/submissions/get
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Submission complex id
Example Request
{
    "id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788@5e3af683-60ae-48e6-9c2c-66135ad72e91"
}
Example Response
{
    "analyzed_receipt": {
        "accuracy_rate": 0.7300000190734863,
        "data": {
            "expanded_prices": [
                {
                    "hash": "f3444c5b185759fb036522a2b810d7e599bd463d",
                    "id": "d712e62c-69b0-4c96-b0c6-bd317977bfee",
                    "name": "COLES LITE MILK 2LITRE",
                    "value": "2.39"
                },
                {
                    "hash": "1eb33ebaac98b12dc60e9f5f82c74f6ebad5d297",
                    "id": "23c6b761-76ec-4f29-8da0-36e228b4d164",
                    "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                    "value": "6.20"
                },
                {
                    "hash": "f1b0b19779050deada97fcc8a8502d3746a4e20c",
                    "id": "9bd2d6d3-82f2-4a03-9bca-c46315b2bad8",
                    "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                    "value": "3.50"
                },
                {
                    "hash": "a8de6907f48304ac73585f00bc8d0b34f82d61a5",
                    "id": "5482d906-a94c-4662-9584-b36d9e0ecf5c",
                    "name": "PREPACK CARROTS 1EACH",
                    "value": "1.00"
                }
            ],
            "links": [
                [
                    "https://cdn.shping.com/2019/10/25/0770b942-9c81-45ed-8909-6ebb52ca935e"
                ]
            ],
            "prices": [
                {
                    "name": "COLES LITE MILK 2LITRE",
                    "value": "2.39"
                },
                {
                    "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                    "value": "6.20"
                },
                {
                    "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                    "value": "3.50"
                },
                {
                    "name": "PREPACK CARROTS 1EACH",
                    "value": "1.00"
                }
            ],
            "store": "coles",
            "total": "13.09",
            "ts": "2021-11-24T08:32:03.037Z"
        },
        "id": "urn:authenticateit:user:email:email@gmail.com@analyzed_receipts@28a8403a-a0c3-4ceb-9829-1a23a953693a",
        "ocr_hash": "792bfd379c26d1ad01ebe04a92142d7f6c93a29d",
        "receipt_date": "25/10/2019",
        "receipt_id": "28a8403a-a0c3-4ceb-9829-1a23a953693a",
        "receipt_time": "Date:",
        "retailer": "coles",
        "retailer_store_id": "697",
        "source": "cashback",
        "status": "completed",
        "ts": "2021-11-24T08:34:15Z",
        "type": "analyzed_receipts",
        "user_id": "urn:authenticateit:user:email:email@gmail.com",
        "words_count": 146
    },
    "considered_card": {
        "campaign_type": "cashback",
        "created": "2021-11-24T07:14:30Z",
        "delivery_id": "urn:authenticateit:cashback:398109165616647",
        "description": "Complete this survey to earn some coins.",
        "icon": "https://dev-cdn.shping.com/2021/11/23/a8c1f969-aaed-444a-bd4f-d47a6cf16eee.png",
        "id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788",
        "name": "Sample Cashback Card review",
        "owner": "urn:authenticateit:participant:735879621218609",
        "result": null,
        "scan_id": null,
        "status": null,
        "steps": [
            {
                "is_default": true,
                "text": "Please follow https://en.wikipedia.org/wiki/Main_Page",
                "title": "Terms and Conditions",
                "type": "text"
            },
            {
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "title": "Verify phone if req",
                "type": "phone_verification"
            },
            {
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "type": "question"
            },
            {
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "title": "Add account id",
                "type": "cashout_account"
            }
        ],
        "type": "considered_todo_card",
        "user_id": "urn:authenticateit:user:email:email@gmail.com",
        "validation": [
            "profile:phone"
        ]
    },
    "submission": {
        "id": "5e3af683-60ae-48e6-9c2c-66135ad72e91",
        "phone": "+79199101840",
        "status": "under_review",
        "steps": [
            {
                "is_default": true,
                "step_id": "be47f381-543f-424d-97f1-f704bcc5c432",
                "text": "Please follow https://en.wikipedia.org/wiki/Main_Page",
                "title": "Terms and Conditions",
                "type": "text"
            },
            {
                "step_id": "fd60173b-dbaa-47df-bb5d-3df4bf2d6dc4",
                "text": "Please follow TC URL",
                "title": "Step 1 title",
                "type": "text"
            },
            {
                "step_id": "e7e98d98-8f1b-4abf-a243-fa37b7574b41",
                "title": "Verify phone if req",
                "type": "phone_verification"
            },
            {
                "rating": 4,
                "step_id": "3ba453c4-26e7-42a3-acb3-6ee63c9135f7",
                "title": "Please rate this",
                "type": "rating"
            },
            {
                "answer_index": 1,
                "answers": [
                    {
                        "answer": "Definitely A!"
                    },
                    {
                        "answer": "B for sure!",
                        "correct": true
                    }
                ],
                "question": "A or B?",
                "step_id": "7831f61a-1037-4c30-8699-2bb9211404b5",
                "type": "question"
            },
            {
                "image": [
                    {
                        "url": "https://cdn.shping.com/2019/10/25/0770b942-9c81-45ed-8909-6ebb52ca935e"
                    }
                ],
                "step_id": "28a8403a-a0c3-4ceb-9829-1a23a953693a",
                "title": "Add receipt",
                "type": "receipt"
            },
            {
                "account": {
                    "account": "67774555",
                    "bank": "gjkkklllo",
                    "bsb": "355896",
                    "country": "036",
                    "description": "gjkkklllo",
                    "id": "ab97eff9-1ef5-4612-95ea-b557d9b106fe",
                    "name": "754fffhu",
                    "postcode": "6646"
                },
                "id": "ab97eff9-1ef5-4612-95ea-b557d9b106fe",
                "step_id": "652248d3-3519-46c5-8438-a97fc3634e99",
                "title": "Add account id",
                "type": "cashout_account"
            }
        ],
        "ts": "2021-11-24T08:29:37Z"
    },
    "user": {
        "first_name": "user1",
        "id": "urn:authenticateit:user:email:email@gmail.com",
        "last_name": "pwd1",
        "level": "basic",
        "photo": "https://dev-cdn.shping.com/2019/3/6/c5809b6f-3b0d-4d7c-8b43-14ff20edbffa"
    }
}

Fields description:
"considered_card" - cashback card, that user received.
"submission" - user's submission by this considered card (completed card by user).
"user" - data about user.
"analyzed_receipt" - data from receipt after OCR (could be a empty object if receipt OCR is not available).

Reject submission data

Applicable only for submissions with under_review status.

POST /rewards-service/cashbacks/submissions/status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Submission complex id
status string Required: failure
reason string Required: Text error reason
Example Request
{
    "id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788@5e3af683-60ae-48e6-9c2c-66135ad72e91",
    "status": "failure",
    "reason": "Some text reason"
}

Accept submission data

Applicable only for submissions with under_review status.

POST /rewards-service/cashbacks/submissions/status
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Submission complex id
status string Required: completed
cashback_value number Required: Cashback value

cashback_value the value must be greater than 0.01 and lower or equal than total value of receipt if exist (analyzed_receipt.data.total).

Example Request
{
  "id": "d1276d659f666853a9ece436ce8077a5fcfc0de09b2c355e3e656f79c851b5a983324f5dd2d836dede4eba09c8c42c32@a86081b3-9acd-44c4-97e2-8a2b784bfc93",
  "status": "completed",
  "cashback_value": 0.1
}

Edit submission data

Applicable only for submissions with under_review status.

PUT /rewards-service/cashbacks/submissions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Submission complex id
cashback_value number Number value greater than 0.01
total number/string Receipt total value (number/number string)
retailer string Receipt retailer
expanded_prices list List of objects with prices

expanded_prices.name - is required (string).
expanded_prices.quantity - is required (integer greater than 0).
expanded_prices.value - is required (number/string).
expanded_prices.gtin - valid gtin. Optional.

Example Request
{
    "id": "d1276d659f666853a9ece436ce8077a5fcfc0de09b2c355e3e656f79c851b5a983324f5dd2d836dede4eba09c8c42c32@7bb4554d-06b5-45fb-afe8-d1a69657fbb2",
    "cashback_value": 0.01,
    "total": "999.01",
    "retailer": "iga",
    "expanded_prices": [
        {
            "name": "N1",
            "quantity": 2,
            "gtin": "00000000000000",
            "value": 9.01
        },
        {
            "name": "P2",
            "quantity": 1,
            "value": 0.01
        }
    ]
}

Edit submission receipt items by id

Applicable only for submissions with under_review status.

PUT /rewards-service/cashbacks/submissions/receipt/items
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Submission complex id
expanded_prices list Required: List of objects

expanded_prices.id - is required (string). expanded_prices.name - is not required (string).
expanded_prices.quantity - is not required (integer greater than 0).
expanded_prices.value - is not required (number/string).
expanded_prices.gtin - valid gtin. Optional.

Example Request
{
  "id": "a6b7bfe5d6c9796a99fe0120bd7247ee8cd34fd18b56cdb8020402399b770ee313687b3e607340b099b0a07233da2788@a0045133-12e7-48f6-a5ef-a88c0e9165ad",
  "expanded_prices": [
    {
      "id": "26f266a6-3dd3-4dcb-a6fa-c4accc7bdea4",
      "name": "COLES CHANGED",
      "value": 2.22,
      "gtin": "00000000000000",
      "quantity": 3
    },
    {
      "id": "8fbebd56-125d-4a7e-aab1-2e416ab8d302",
      "value": 3.5
    }
  ]
}
Example Response
{
    "analyzed_receipt": {
        "accuracy_rate": 0.7300000190734863,
        "data": {
            "expanded_prices": [
                {
                    "gtin": "00000000000000",
                    "hash": "a72d55ea869f3c4c3ad41299723176eab0856d67",
                    "id": "26f266a6-3dd3-4dcb-a6fa-c4accc7bdea4",
                    "name": "COLES CHANGED",
                    "quantity": 3,
                    "value": 2.22
                },
                {
                    "hash": "1eb33ebaac98b12dc60e9f5f82c74f6ebad5d297",
                    "id": "4d6fd754-70c2-407d-b36e-5ac32d20afca",
                    "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                    "value": "6.20"
                },
                {
                    "hash": "f1b0b19779050deada97fcc8a8502d3746a4e20c",
                    "id": "8fbebd56-125d-4a7e-aab1-2e416ab8d302",
                    "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                    "value": 3.5
                },
                {
                    "hash": "a8de6907f48304ac73585f00bc8d0b34f82d61a5",
                    "id": "5af6c516-fa41-49ef-9e89-189b51e30598",
                    "name": "PREPACK CARROTS 1EACH",
                    "value": "1.00"
                }
            ],
            "links": [
                [
                    "https://cdn.shping.com/2019/10/25/0770b942-9c81-45ed-8909-6ebb52ca935e"
                ]
            ],
            "prices": [
                {
                    "name": "COLES LITE MILK 2LITRE",
                    "value": "2.39"
                },
                {
                    "name": "* FREEDOM MUESLI 500 G 500GRAM 2 @ $3.10 EACH",
                    "value": "6.20"
                },
                {
                    "name": "* VEGEMITÉ CHEESYBITE 270GRAM",
                    "value": "3.50"
                },
                {
                    "name": "PREPACK CARROTS 1EACH",
                    "value": "1.00"
                }
            ],
            "store": "coles",
            "total": "13.09",
            "ts": "2021-11-24T08:52:03.258Z"
        },
        "id": "urn:authenticateit:user:email:email@gmail.com@analyzed_receipts@61037aae-2efc-45e7-b10b-7eaded72eafc",
        "ocr_hash": "792bfd379c26d1ad01ebe04a92142d7f6c93a29d",
        "receipt_date": "25/10/2019",
        "receipt_id": "61037aae-2efc-45e7-b10b-7eaded72eafc",
        "receipt_time": "Date:",
        "retailer": "coles",
        "retailer_store_id": "697",
        "source": "cashback",
        "status": "completed",
        "ts": "2021-11-24T08:54:15Z",
        "type": "analyzed_receipts",
        "user_id": "urn:authenticateit:user:email:email@gmail.com",
        "words_count": 146
    }
}

Cashout boosters

Create cashout booster

POST /rewards-service/boosters
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
start_date string Required: Start date
end_date string Required: End date
name string Required: Name
product string Required: Gtin
status string Required: active or inactive
percents integer Required: Booster percents
rrp number Required: RRP AUD price (from 0.01 to 1000000)
audience object Rewards audience
locations list Rewards locations
Example Request
{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "locations": [
        {
            "active": true,
            "country": "036"
        }
    ],
    "name": "Booster name",
    "product": "00000000000024",
    "percents": 50,
    "rrp": 1.11,
    "start_date": "2022-04-08",
    "end_date": "2022-08-30",
    "status": "inactive"
}
Example Response
{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "rrp": 1.11,
    "created": "2022-05-19T04:19:23Z",
    "end_date": "2022-08-30",
    "id": "urn:authenticateit:booster:211266519442224",
    "locations": [
        {
            "active": true,
            "country": "036"
        }
    ],
    "name": "Booster name",
    "percents": 50,
    "product": "00000000000024",
    "start_date": "2022-04-08",
    "status": "inactive"
}

Mark cashout booster as published

After publication owner will no access to update some booster fields and delete booster

PUT /rewards-service/boosters/published/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Booster id
Example Request


Example Response
{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "created": "2022-05-19T04:21:52Z",
    "end_date": "2022-09-30",
    "rrp": 1.11,
    "id": "urn:authenticateit:booster:182132400536253",
    "locations": [
        {
            "active": true,
            "country": "036"
        }
    ],
    "name": "Booster name",
    "percents": 50,
    "product": "00000000000024",
    "published_at": "2022-05-19T04:22:02Z",
    "start_date": "2022-08-08",
    "status": "inactive"
}

Update cashout booster

Endpoint for owner participant to update a cashout booster. Current participant must be booster's owner. Only name, rrp and status fields can be updated if the booster has been already published.

PUT /rewards-service/boosters/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Booster id
Example Request
{
   "name": "Booster renamed",
   "status": "inactive",
   "rrp": 5.11
}
Example Response
{
    "audience": {
        "gender": "other",
        "languages": [
            "en"
        ],
        "max_age": 35,
        "min_age": 20,
        "user_levels": [
            "basic"
        ]
    },
    "rrp": 5.11,
    "created": "2022-05-19T04:21:52Z",
    "end_date": "2022-09-30",
    "id": "urn:authenticateit:booster:182132400536253",
    "locations": [
        {
            "active": true,
            "country": "036"
        }
    ],
    "name": "Booster renamed",
    "percents": 50,
    "product": "00000000000024",
    "published_at": "2022-05-19T04:22:02Z",
    "start_date": "2022-08-08",
    "status": "inactive"
}

Delete cashout booster

Endpoint to delete existing booster by id. Current participant must be booster's owner. Booster should not be published

DELETE /rewards-service/boosters/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Booster id

List cashout boosters

List participant's boosters. Accepts offset (skip specified number of boosters; 0 by default) and limit (limit the number of returned boosters; 100 by default) query parameters.

GET /rewards-service/boosters/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
offset number Skip specified number of boosters
limit number Limit the number of returned boosters
sort_by string One of start_date, end_date, status, published_at, rrp
sort_type string asc or desc
status string One of active, completed, draft, all
product string Gtin filter

status.all - do not filter.
status.active - published_at IS NOT NULL end_date >= CUR_DATE().
status.completed - published_at IS NOT NULL end_date < CUR_DATE().
status.draft - published_at IS NULL.

Example Response
{
    "count": 3,
    "data": [
        {
            "audience": {},
            "created": "2022-05-19T02:24:58Z",
            "end_date": "2022-04-30",
            "id": "urn:authenticateit:booster:152640607008239",
            "locations": [
                {
                    "active": true,
                    "country": "036"
                }
            ],
            "name": "Booster 1",
            "percents": 50,
            "rrp": 22.0,
            "product": "00000000000024",
            "published_at": "2022-05-19T02:25:35Z",
            "start_date": "2022-04-08",
            "status": "active"
        }
    ]
}

Read cashout booster

GET /rewards-service/boosters/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Booster id
Example Response
{
    "audience": {},
    "created": "2022-05-19T02:24:58Z",
    "end_date": "2022-04-30",
    "id": "urn:authenticateit:booster:152640607008239",
    "locations": [
        {
            "active": true,
            "country": "036"
        }
    ],
    "name": "Booster 1",
    "percents": 50,
    "rrp": 22.0,
    "product": "00000000000024",
    "published_at": "2022-05-19T02:25:35Z",
    "start_date": "2022-04-08",
    "status": "active"
}

Read active booster products

GET /rewards-service/boosters/products/preview
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
{
    "list": [
        {
            "booster_id": "urn:authenticateit:booster:694502125143220",
            "event_ts": "2022-05-20T03:19:46Z",
            "image": "https://dev-cdn.shping.com/2021/10/28/0cef3746-6c06-4204-8b4f-66a914342b52",
            "partner_brand": false,
            "percents": 50,
            "product_id": "00000000000918",
            "product_name": "Crystallised Ginger Loose",
            "product_type": "gtin",
            "scan_id": "b5db7f18-0eaf-46b1-a90d-592958646b19",
            "end_date": "2029-01-30",
            "start_date": "2018-08-08"
        }
    ]
}

results matching ""

    No results matching ""