Points

If there is a Loyalty program managed by CRM CareCloud based on points collection to a customer account, the points transactions and records like points collection and points redemption can be managed by this resource.

Available methods

All available methods for resource points

HTTP method Endpoint Description
[badge-blue GET] /points Get information about all point records
[badge-blue GET] /points/{point_id} Get information about a specific point record

Available methods with sub-resources

All available methods for sub-resources of resource points.

HTTP method Endpoint Description
[badge-blue GET] /points/{point_id}/purchases List of all purchases tied to the point record

Actions

Action methods for resource points

HTTP method Endpoint Description
[badge-green POST] /points/actions/reduce-points Redemption of points. This POST creates a new point redemption record.
[badge-green POST] /points/actions/assign-points Collection of points. This POST creates a new point collection record.
[badge-green POST] /points/actions/transfer-points Procedural method transfer points from one customer to another.

Action methods are available only in Enterprise interface.


Get all point records

Get a list of all point transactions, point collections and redemptions
[badge-blue GET] /points

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
customer_id string The unique id of the customer No
point_type_id string The unique id of a point type No
create_point_time_from string Date and time from of the create point record (YYYY-MM-DD HH:MM:SS) No
create_point_time_to string Date and time to of the create point record (YYYY-MM-DD HH:MM:SS) No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
points Point[] List of the point records
total_items integer Count of all found point records

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/points?customer_id=87c2f95edf18a79b08e2367a6f&point_type_id=82de12eb8b138791e728fd11c3
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2UYmVlZDA2ZjBYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2w

Example response

HTTP/1.1 200 OK
Date: Tue, 29 Sep 2020 14:44:18 GMT
ing: chunked
Content-Type: application/json; charset=utf-8

{
  "data": {
    "points": [
      {
        "point_id": "8bcd4f6d0e14d32fc472t632ed",
        "customer_id": "87c2f95edf18a799b0r8e67a6f",
        "assigned_points": 2000,
        "available_points": 0,
        "point_type_id": "82de12eb8b1387t1e6r8fd11c3",
        "partner_id": "86e05affc7a7abefcd51ab4r00",
        "valid_to": "2012-10-26 23:59:59",
        "state": 1
      }
    ],
    "total_items": 1
  }
}


Get a point record

Get information about a specific point transaction
[badge-blue GET] /points/{point_id}

Path parameters

Parameter name Type Description
point_id string The unique id for the point record

Response

Status code: 200 OK
Output structure : Point

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/points/8bcd4f6d0e1432tfc472632e1d
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2w

Example response

HTTP/1.1 200 OK
Date: Tue, 29 Sep 2020 14:46:04 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "point_id": "8bcd4f6d0e14d32fc42632e1d",
    "customer_id": "87c2f95edf18a79b08e267a6f",
    "assigned_points": 2000,
    "available_points": 0,
    "point_type_id": "82de12eb8b18791e678fd11c3",
    "partner_id": "86e05affc7a7abefc513ab400",
    "valid_to": "2012-10-26 23:59:59",
    "state": 1
  }
}


Points redemption

New point redemption record is created.
[badge-green POST] /points/actions/reduce-points

Request

Parameter name Type Description Mandatory (Yes/No)
amount float Number of redeemed points. Yes
customer_id string The unique id of the customer. Yes
partner_id string The unique id of the partner. Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
point_id string The unique id of the redeemed point record

Example Request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/points/actions/reduce-points
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBmYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2wmYw==

{
  "amount" : "1000",
  "customer_id" : "87c2f95edf18a799b08e267a6f",
  "partner_id": "86e05affc7a7abefcd513ab400"
}

Example response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "data": {
    "point_id": "83ae1daade0ace34c2cd38"
  }
}


Assign of points

Creates a new point collection record with the corresponding value
[badge-green POST] /points/actions/assign-points

Request

Parameter name Type Description Mandatory (Yes/No)
amount float The number of collected points. Yes
customer_id string The unique id of the customer. Yes
partner_id string The unique id of the partner. Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
point_id string The unique id of the new point record

Example Request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/points/actions/assign-points
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBmYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2wmYw==

{
  "amount" : "1500",
  "customer_id" : "87c2f95edf18a799b08e267a6f",
  "partner_id": "86e05affc7a7abefcd513ab0"
}

Example response

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
  "data": {
    "point_id": "83ae1daade0ace34c2cd38"
  }
}


Transfer points

Transfers points from one customer to another
[badge-green POST] /points/actions/transfer-points

Request

Parameter name Type Description Mandatory (Yes/No)
original_customer_id string Id of the original points holder. Yes
new_customer_id string Id of the new points holder. Yes
amount float The number of transfered points. Yes
point_type_id string Type of the transfered points. No

Response

Status code: 204 No Content

Example request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/points/actions/transfer-points
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZV9pbnRlcmZhY2UTQxMGQzYjY3NmRlOWNjNjhjYjk1Mjc5YjdkZjEyOGYyNjgxMDE2MjM3OQ==

{
  "original_customer_id": "86ae806b9ae10r9c233bf2a5f5",
  "new_customer_id": "83aa5f5ba88er59c8b9a4e6ba3",
  "amount": "1",
  "point_type_id": "8acbd017407b60e201rf931e94"
}

Example response

HTTP/1.1 204 No Content
Date: Mon, 19 Apr 2021 17:11:13 GMT
Content-Type: application/json; charset=utf-8

<Response body is empty>