Rewards

Different types of Rewards for Customers can be created and managed in CRM CareCloud. The Reward and its features is a pattern for creation of individual customer Vouchers that can be applied to the Customer purchases directly. It is defined by a set of parameters like Reward validity, prioroty or number of points, that will be spent by application and many other. You can create rewards and get the information about actual rewards processed in CRM CareCloud by this resource.

Available methods

All available methods for resource rewards.

HTTP method Endpoint Description
[badge-blue GET] /rewards List of all rewards
[badge-blue GET] /rewards/{reward_id} Detail of a specific reward

Available methods with sub-resources

All available methods for sub-resources of resource rewards.

HTTP method Endpoint Description
[badge-blue GET] /rewards/{reward_id}/vouchers List of all vouchers tied to a reward
[badge-blue GET] /rewards/{reward_id}/products List of all products tied to a reward
[badge-blue GET] /rewards/{reward_id}/product-groups List of all product groups tied to a reward
[badge-blue GET] /rewards/{reward_id}/product-brands List of all product brands tied to a reward
[badge-blue GET] /rewards/{reward_id}/stores List of all stores tied to a reward

Actions

Action methods for resource rewards

HTTP method Endpoint Description
[badge-green POST] /rewards/{reward_id}/actions/create-voucher Create a new individual voucher based on a reward features definition


Get all rewards

Get information about rewards as a list of all rewards
[badge-blue GET] /rewards

Query string

Parameter name Type Description Mandatory (Yes/No)
count integer The number of records to return.
Default value is 100.
No
offset integer The number of records from a collection to skip.
Default value is 0.
No
sort_field string One of the query string parameters for sorting.
Response is sorted by the specified field.
No
sort_direction string Direction of sorting the response list.
Possible values are: ASC / DESC
No
name string The name or a part of the name of the reward No
store_id string The unique id for the store where customer can apply the reward No
is_valid boolean Filter for valid rewards.
Possible values: true - all rewards valid in the moment / false - all rewards not valid in the moment / no value - all rewards
No
valid_from string Date from where is reward valid already. (YYYY-MM-DD) No
valid_to string Date to where is reward valid still. (YYYY-MM-DD) No
code string Code of the reward No
is_automated boolean Filter of the automated rewards
Possible values: true - returns all automated rewards / false - returns all non automated rewards / no value - all rewards(filter is not applied)
No
reward_group integer The unique id for the reward group
Possible values: 0 - cash desk reward (party time reward) / 1 - catalog reward / 2 - campaign reward
No
customer_type_id array Select by list of customer types from customer-types resource. Logic OR is used between values No
without_stores boolean If true, resource call returns rewards without list of stores. If false, or not set resource returns default strucutre. No

There is the logical AND between parameters is_valid, valid_from and valid to.

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
rewards Reward[] List of all rewards
total_items integer Count of all found rewards

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/rewards?store_id=86e05affc7a7abefcd513ab400&is_valid=true&reward_group=0&count=2
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2U6NDU3NDJhMDAxNmEyZjc1NDI3YWUwMM0NmMyOWQxNmE4NzI1MWZlzZmMzcwNmI2MDJmDfN2Q2Mw==

Example response

HTTP/1.1 200 OK
Date: Tue, 20 Oct 2020 14:12:56 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "rewards": [
      {
        "reward_id": "87cb1420907156ccf86bc3ec7b",
        "code": null,
        "name": "Dessert+Caffe",
        "note": "",
        "subtitle": null,
        "points_cost": 200,
        "valid_time_from": null,
        "valid_time_to": null,
        "reward_group": 0,
        "store_list": [
          {
            "store_id": "86e05affc7a7abefcd513ab400",
            "store_code": "",
            "name": "New restaurant",
            "store_address": {
              "address1": "Hlavní",
              "address2": "18",
              "address3": null,
              "address4": null,
              "address5": null,
              "address6": null,
              "address7": null,
              "zip": "19875",
              "city": "Borohrádek",
              "country_code": "cz"
            },
            "contact_email": "",
            "manager_name": "",
            "phone_number": "",
            "partner_id": "86e05affc7a7abefcd513ab400",
            "system_id": "2375303497",
            "gps_coordinates": {
              "gps_longitude": 0,
              "gps_latitude": 0
            },
            "url_address": "",
            "opening": [
              {
                "day_id": "MON",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "TUE",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "WED",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "THU",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "FRI",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SAT",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SUN",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              }
            ],
            "image_urls": [],
            "visibility_for_customer": 1,
            "description": "",
            "short_description": "fdsfdsfds",
            "registration_id": "123",
            "last_change": "2018-12-19 16:12:56",
            "state": 1
          },
          {
            "store_id": "83d1d11ea3884a5d33253fe214",
            "store_code": "",
            "name": "Old coffee spot",
            "store_address": {
              "address1": "Deza",
              "address2": "",
              "address3": null,
              "address4": null,
              "address5": null,
              "address6": null,
              "address7": null,
              "zip": "45678",
              "city": "Neiro",
              "country_code": "cz"
            },
            "contact_email": "great_service@oldcoffeespot.com",
            "manager_name": "The one",
            "phone_number": "4205989564",
            "partner_id": "86e05affc7a7abefcd513ab400",
            "system_id": "3630358671",
            "gps_coordinates": {
              "gps_longitude": 0,
              "gps_latitude": 0
            },
            "url_address": "",
            "opening": [
              {
                "day_id": "MON",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "TUE",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "WED",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "THU",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "FRI",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SAT",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SUN",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              }
            ],
            "image_urls": [],
            "visibility_for_customer": 0,
            "description": "",
            "short_description": "",
            "registration_id": "55555",
            "last_change": "2020-03-06 15:58:38",
            "state": 2
          }
        ],
        "additional_properties": [
          {
            "property_record_id": "count_items_bonus:87cb1420907156ccf86bc3ec7b",
            "property_id": "count_items_bonus",
            "property_name": "Bunus",
            "property_value": "",
            "last_change": null
          },
          {
            "property_record_id": "time_use_points:87cb1420907156ccf86bc3ec7b",
            "property_id": "time_use_points",
            "property_name": "Time",
            "property_value": [],
            "last_change": null
          }
        ],
        "priority": null,
        "image_urls": [],
        "has_product_condition": false,
        "has_group_condition": true,
        "has_brand_condition": false,
        "is_automated": false,
        "last_change": "2013-01-23 14:29:29.85381",
        "state": 1
      },
      {
        "reward_id": "8cce6d280f25df0e937ed986af",
        "code": null,
        "name": "2_cocktail",
        "note": "2 cocktaily  6 EUR + 500 points)",
        "subtitle": null,
        "points_cost": 500,
        "valid_time_from": null,
        "valid_time_to": null,
        "reward_group": 0,
        "store_list": [
          {
            "store_id": "86e05affc7a7abefcd513ab400",
            "store_code": "",
            "name": "New restaurant",
            "store_address": {
              "address1": "Hlavní",
              "address2": "18",
              "address3": null,
              "address4": null,
              "address5": null,
              "address6": null,
              "address7": null,
              "zip": "19875",
              "city": "Borohrádek",
              "country_code": "cz"
            },
            "contact_email": "",
            "manager_name": "",
            "phone_number": "",
            "partner_id": "86e05affc7a7abefcd513ab400",
            "system_id": "2375303497",
            "gps_coordinates": {
              "gps_longitude": 0,
              "gps_latitude": 0
            },
            "url_address": "",
            "opening": [
              {
                "day_id": "MON",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "TUE",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "WED",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "THU",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "FRI",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SAT",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SUN",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              }
            ],
            "image_urls": [],
            "visibility_for_customer": 1,
            "description": "",
            "short_description": "fdsfdsfds",
            "registration_id": "123",
            "last_change": "2018-12-19 16:12:56",
            "state": 1
          },
          {
            "store_id": "88d02503d2c20fb145bba2747e",
            "store_code": "",
            "name": "Top restaurant",
            "store_address": {
              "address1": "",
              "address2": "",
              "address3": null,
              "address4": null,
              "address5": null,
              "address6": null,
              "address7": null,
              "zip": "",
              "city": "",
              "country_code": "cz"
            },
            "contact_email": "",
            "manager_name": "",
            "phone_number": "",
            "partner_id": "86e05affc7a7abefcd513ab400",
            "system_id": "204553560",
            "gps_coordinates": {
              "gps_longitude": 0,
              "gps_latitude": 0
            },
            "url_address": "",
            "opening": [
              {
                "day_id": "MON",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "TUE",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "WED",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "THU",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "FRI",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SAT",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              },
              {
                "day_id": "SUN",
                "time_intervals": [
                  {
                    "from": null,
                    "to": null
                  },
                  {
                    "from": null,
                    "to": null
                  }
                ]
              }
            ],
            "image_urls": [],
            "visibility_for_customer": 1,
            "description": "",
            "short_description": "",
            "registration_id": null,
            "last_change": "2016-08-30 13:49:32",
            "state": 0
          }
        ],
        "additional_properties": [
          {
            "property_record_id": "count_items_bonus:8cce6d280f25df0e937ed986af",
            "property_id": "count_items_bonus",
            "property_name": "Bunus",
            "property_value": "",
            "last_change": null
          }
        ],
        "priority": null,
        "image_urls": [],
        "has_product_condition": false,
        "has_group_condition": true,
        "has_brand_condition": false,
        "is_automated": false,
        "last_change": "2013-01-24 14:04:07.702451",
        "state": 1
      }
    ],
    "total_items": 58
  }
}


Get a reward

Get information about a specific reward
[badge-blue GET] /rewards/{reward_id}

Path parameters

Parameter name Type Description Mandatory (Yes/No)
reward_id string The unique id for the reward Yes

Response

Status code: 200 OK
Output structure : Reward

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/rewards/87cb1420907156ccf86bc3ec7b
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2U6NDU3NDJhMDAxNmEyZjc1NDI3YWUwMTM0NmMyOWQxNmE4NzI1MWZlzZmMzcwNmI2MDJmDfN2Q2Mw==

Example response

HTTP/1.1 200 OK
Date: Tue, 20 Oct 2020 14:14:10 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "reward_id": "87cb1420907156ccf86bc3ec7b",
    "code": null,
    "name": "Dezert+Coffee",
    "note": "",
    "subtitle": null,
    "points_cost": 200,
    "valid_time_from": null,
    "valid_time_to": null,
    "reward_group": 0,
    "store_list": [
      {
        "store_id": "86e05affc7a7abefcd513ab400",
        "store_code": "",
        "name": "Small coffee spot",
        "store_address": {
          "address1": "Hlavní",
          "address2": "18",
          "address3": null,
          "address4": null,
          "address5": null,
          "address6": null,
          "address7": null,
          "zip": "19875",
          "city": "Borohrádek",
          "country_code": "cz"
        },
        "contact_email": "",
        "manager_name": "",
        "phone_number": "",
        "partner_id": "86e05affc7a7abefcd513ab400",
        "system_id": "2375303497",
        "gps_coordinates": {
          "gps_longitude": 0,
          "gps_latitude": 0
        },
        "url_address": "",
        "opening": [
          {
            "day_id": "MON",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "TUE",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "WED",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "THU",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "FRI",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "SAT",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "SUN",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          }
        ],
        "image_urls": [],
        "visibility_for_customer": 1,
        "description": "",
        "short_description": "fdsfdsfds",
        "registration_id": "123",
        "last_change": "2018-12-19 16:12:56",
        "state": 1
      },
      {
        "store_id": "83d1d11ea3884a5d33253fe214",
        "store_code": "",
        "name": "Cool coffee spot",
        "store_address": {
          "address1": "Deza",
          "address2": "",
          "address3": null,
          "address4": null,
          "address5": null,
          "address6": null,
          "address7": null,
          "zip": "45678",
          "city": "Neiro",
          "country_code": "cz"
        },
        "contact_email": "great_service@coolcoffeespot.cz",
        "manager_name": "Dežo",
        "phone_number": "42059889564",
        "partner_id": "86e05affc7a7abefcd513ab400",
        "system_id": "3630358671",
        "gps_coordinates": {
          "gps_longitude": 0,
          "gps_latitude": 0
        },
        "url_address": "",
        "opening": [
          {
            "day_id": "MON",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "TUE",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "WED",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "THU",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "FRI",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "SAT",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          },
          {
            "day_id": "SUN",
            "time_intervals": [
              {
                "from": null,
                "to": null
              },
              {
                "from": null,
                "to": null
              }
            ]
          }
        ],
        "image_urls": [],
        "visibility_for_customer": 0,
        "description": "",
        "short_description": "",
        "registration_id": "55555",
        "last_change": "2020-03-06 15:58:38",
        "state": 2
      }
    ],
    "additional_properties": [
      {
        "property_record_id": "count_items_bonus:87cb1420907156ccf86bc3ec7b",
        "property_id": "count_items_bonus",
        "property_name": "Bunus",
        "property_value": "",
        "last_change": null
      }
    ],
    "priority": null,
    "image_urls": [],
    "has_product_condition": false,
    "has_group_condition": true,
    "has_brand_condition": false,
    "is_automated": false,
    "last_change": "2013-01-23 14:29:29.85381",
    "state": 1
  }
}


Create a new voucher

Create a new voucher for a specific customer based on a reward features definition
[badge-green POST] /rewards/{reward_id}/actions/create-voucher

Path parameters

Parameter name Type Description Mandatory (Yes/No)
reward_id string The unique id for the reward Yes

Request

Parameter name Type Description Mandatory (Yes/No)
customer_id string The unique id for the customer Yes
code string voucher No

Response

Status code: 201 Created

Parameter name Type Description Mandatory (Yes/No)
voucher_id string The unique id for the voucher Yes

Example request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/rewards/88c35b274d4ac5e9e70f3ceb/actions/create-voucher
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2U6YA4Dk3ODFlMWU2YTE2YzU4YjMxYThlZGRiOTM5NTAwZTgxYjBkNTFkZTE2OWIwN2NhMg==

{
  "customer_id": "83aa5f5b2a88e59c8b94e6b3",
  "code": "w7TU7KfeE"
}

Example response

HTTP/1.1 201 Created
Date: Tue, 20 Apr 2021 17:21:12 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "voucher_id": "83bc0feb1a5006b0b0827a6f21"
  }
}