Point reservation

If there is a Loyalty program managed by CRM CareCloud based on points collection to a customer account, the point reservations can be managed by this resource.

Available methods

All available methods for resource point-reservations

HTTP method Endpoint Description
[badge-blue GET] /point-reservations Get information about all point-reservations
[badge-blue GET] /point-reservations/{point_reservation_id} Get information about a specific point reservation

Actions

Action methods for resource point-reservations

HTTP method Endpoint Description
[badge-green POST] /point-reservations/actions/reserve-points Create point reservation. This POST creates a new reservation.
[badge-green POST] /point-reservations/actions/free-points Method release all reserved points in the reservation.


Get all point reservations

Get a list of all point reservations
[badge-blue GET] /point-reservations

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
external_id string The external id of the point reservation No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
point_reservations PointResrevation[] List of the point reservations
total_items integer Count of all found point reservations

Example Request

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

Example response

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

{
  "data": {
    "point_reservations": [
      {
        "point_reservation_id": "88c1e91444434b0243d94b40cd",
        "external_id": "123459",
        "quantity": 11,
        "customer_id": "8da9b5f32b636e5c0ca44f2a52",
        "partner_id": "0",
        "expiration": "2019-10-31 00:00:00",
        "state": 1
      }
    ],
    "total_items": 1
  }
}


Get a point reservation

Get information about a specific point reservation
[badge-blue GET] /point-reservations/{point_reservation_id}

Path parameters

Parameter name Type Description
point_reservation_id string The unique id of the point reservations

Response

Status code: 200 OK
Output structure : PointReservation

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/point-reservations/88c1e91444434b0243d94b40cd
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBmYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2wmYw==

Example response

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

{
  "data": {
    "point_reservation_id": "88c1e91444434b0243d94b40cd",
    "external_id": "123459",
    "quantity": 11,
    "customer_id": "8da9b5f32b636e5c0ca44f2a52",
    "partner_id": "0",
    "expiration": "2019-10-31 00:00:00",
    "state": 1
  }
}


Create point reservation

New point reservation is created.
[badge-green POST] /point-reservations/actions/reserve-points

Request

Parameter name Type Description Mandatory (Yes/No)
external_id string The external id of the point reservation. Yes
amount float Number of redeemed points. Yes
customer_id string The unique id of the customer. Yes
expiration_time string Date and time of the point reservation expiration (YYYY-MM-DD HH:MM:SS) No

Response

Status code: 204 No Content

Example Request

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

{
  "external_id" : "123455",
  "customer_id" : "8da9b5f32b636e5c0ca44f2a52",
  "amount" : "0"
}

Example response

HTTP/1.1 204 No Content
Date: Tue, 29 Sep 2020 14:59:44 GMT
Content-Type: application/json; charset=utf-8


Free points from reserevation

Release reserved points.
[badge-green POST] /point-reservations/actions/free-points

Request

Parameter name Type Description Mandatory (Yes/No)
external_id string The external id of the point reservation. Yes

Response

Status code: 204 No Content

Example Request

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

{
  "external_id" : "123455"
}

Example response

HTTP/1.1 204 No Content
Date: Tue, 29 Sep 2020 15:00:54 GMT
Content-Type: application/json; charset=utf-8