Product reservations

CRM CareCloud allows to reserve Products or Product sets and manages the reservation process. There is the possibility to create a particular group of Products that can be reserved - Reservable products. This resource can make the Reservation of a Product.

Available methods

All available methods for resource product-reservations.

HTTP method Endpoint Description
[badge-green POST] /product-reservations Create a product reservation
[badge-blue GET] /product-reservations Get a list of product reservations
[badge-blue GET] /product-reservations/{product_reservation_id} Detail of a product reservation

Actions

Action methods for resource product reservations

HTTP method Endpoint Description
[badge-green POST] /product-reservations/{product_reservation_id}/actions/cancel-reservation Cancel an existing product reservation.

Create a reservation

Create a new product reservation in CRM CareCloud
[badge-green POST] /product-reservations

Request

Parameter name Type Description Mandatory (Yes/No)
product_reservation ProductReservation ProductReservation structure Yes

Response

Status code: 201 Created
Output structure : object

Parameter name Type Description
product_reservation_id string The unique id for the product reservation

Example Request

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

{
  "product_reservation" : {
    "customer_id" : "8eae20da24332e84611849f5cd",
    "store_id" : "86e05affc7a7abefcd513ab400",
    "product_reservation_source_id" : "86e05affc7a7abefcd513ab400"
  }
}

Example response

HTTP/1.1 201 Created
Date: Tue, 29 Sep 2020 15:32:00 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "product_reservation_id": "84db37f94368932a56c439b5d6"
  }
}

Get all product reservations

Get a list of product reservations
[badge-blue GET] /product-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
reservation_code string Code of the reservation No
customer_id string The unique id for the customer No
store_id string Store, where customer can pick up the reservation No
reservation_state string Current state of the product reservation.
Possible values: 0 - Canceled / 1 - Entered / 2 - Accepted / 3 - Ready / 4 - Delivered / 5 - In progress / 6 - Not Picked up / 7 - Ordered / 8 - Being solved /
No

Response

Status code: 200 OK
Output structure : object

Parameter name Type Description
product_reservations ProductReservation[] List of the product reservations
total_items integer Count of all found product reservations

Example Request

GET https://<projectURL>/rest-api/enterprise-interface/v1.0/product-reservations?store_id=86e05affc7a7abefcd513ab400&customer_id=8eae20da24332e84611849f5cd&reservation_code=22&count=2
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBmYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2w

Example Response

HTTP/1.1 200 OK
Date: Tue, 29 Sep 2020 15:27:35 GMT
Content-Type: application/json; charset=utf-8

{
  "data": {
    "product_reservations": [
      {
        "product_reservation_id": "81d503b99cc748b3ca189383ad",
        "customer_id": "8eae20da24332e84611849f5cd",
        "store_id": "86e05affc7a7abefcd513ab400",
        "reservation_codes": [
          10
        ],
        "product_reservation_source_id": null,
        "pickup_date": null,
        "customers_note": "",
        "total_price": null,
        "currency_id": null,
        "product_reservation_items": [
          {
            "reservable_product_id": "85aee4e91a07d60626f7abcb21",
            "amount": 3,
            "unit_price": null,
            "vat_rate": null
          }
        ],
        "actual_state": 5,
        "states": [],
        "comments": [
          "test",
          "test"
        ],
        "last_change": "2020-04-20 11:23:35",
        "state": 1
      },
      {
        "product_reservation_id": "87d706e4864d02af7ce9201c58",
        "customer_id": "8eae20da24332e84611849f5cd",
        "store_id": "86e05affc7a7abefcd513ab400",
        "reservation_codes": [
          20
        ],
        "product_reservation_source_id": null,
        "pickup_date": null,
        "customers_note": null,
        "total_price": 69,
        "currency_id": "8bed991c68a470e7aaeffbf048",
        "product_reservation_items": [
          {
            "reservable_product_id": "85aee4e91a07d60626f7abcb21",
            "amount": 3,
            "unit_price": 23,
            "vat_rate": 5
          }
        ],
        "actual_state": 2,
        "states": [],
        "comments": [],
        "last_change": "2020-09-23 13:14:06",
        "state": 1
      }
    ],
    "total_items": 5
  }
}

Get a product-reservation

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

Path parameters

Parameter name Type Description
product_reservation_id string The unique id for a product reservation

Response

Status code: 200 OK
Output structure : ProductReservation

Example Request

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

Example response

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

{
  "data": {
    "product_reservation_id": "81d503b99cc748b3ca189383ad",
    "customer_id": "8eae20da24332e84611849f5cd",
    "store_id": "86e05affc7a7abefcd513ab400",
    "reservation_codes": [
      10
    ],
    "product_reservation_source_id": null,
    "pickup_date": null,
    "customers_note": "",
    "total_price": null,
    "currency_id": null,
    "product_reservation_items": [
      {
        "reservable_product_id": "85aee4e91a07d60626f7abcb21",
        "amount": 3,
        "unit_price": null,
        "vat_rate": null
      }
    ],
    "actual_state": 5,
    "states": [],
    "comments": [
      "test",
      "test"
    ],
    "last_change": "2020-04-20 11:23:35",
    "state": 1
  }
}


Cancel reservation

Cancel an existing reservation.
[badge-green POST] /product-reservations/{product_reservation_id}/actions/cancel-reservation

Path parameters

Parameter name Type Description Mandatory (Yes/No)
product_reservation_id string The unique id of the product reservation. Yes

Request

Parameter name Type Description Mandatory (Yes/No)
customer_id string The unique id for a logged in customer No

Response

Status code: 204 No Content

Example Request

POST https://<projectURL>/rest-api/enterprise-interface/v1.0/product-reservations/84db37f94368932a56c439b5d6/actions/cancel-reservation
Content-Type: application/json
Accept-Language: cs, en-gb;q=0.8
Authorization: Basic ZW50ZXJwcmlzZVcmZhY2U6YmVlZDA2ZjBmYhTEyUwOWIzNzk2ZjMODEEyZTIxNmVkMM5NDE5Zj2NzMwZmRj2w

{
  "product_reservation_id" : "84db37f94368932a56c439b5d6"
}

Example response

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