[#1199] Selected time not available when trying to create booking

Migrated from Redmine #1199 | Author: Guilherme Bueno
Status: New | Priority: High, I’m very impatient | Created: 2024-03-14


When trying to create a new booking for service 47, I’m receiving a error 400 with a message of : “Selected time not available when trying to create booking”.
When checking Simplybook for this provider’s availability I can see the slot for 2024-03-15 14:30:00 - 2024-03-15 14:45:00 is available. I double checked which providers are enabled for this specific service and I see that it is indeed the provider with id 9.

URL: ‘POST’, ‘https://user-api-v2.simplybook.plus/admin/bookings

Headers:


"headers" => [
    "X-Token" => "df925ee8083880142fdb7b77b6d18ed2ff3c70a902ca5346690d903e8332ae07"
    "X-Company-Login" => "santemedic1"
    "Content-type" => "application/json; charset=utf-8"
  ]

Body:


{
  "count": "1",
  "start_datetime": "2024-03-15 14:30:00",
  "end_datetime": "2024-03-15 14:45:00",
  "location_id": 2,
  "provider_id": "9",
  "service_id": "47",
  "client_id": 17314,
  "accept_payment": "true",
  "payment_processor": "Stripe",
  "additional_fields": [
    {
      "field": "473dd5d43a9146537758de98a4909a18",
      "value": "Pending"
    },
    {
      "field": "d5f910103c49904d8ac7b7a59be249b5",
      "value": "Customer agreed to pay $0 and for the tests: "
    },
    {
      "field": "45234aef3437bd78788fb92a71e41e41",
      "value": 0.2
    }
  ]
}

Response:


{
  "code": 400,
  "message": "",
  "data": {
    "start_datetime": [
      "Selected time not available"
    ]
  },
  "message_data": []
}

Redmine Admin wrote:

hi, you can always try to book the same service, provider, date and time via web interface. If web interface allows this but API not then we will investigate. Thank you

Guilherme Bueno wrote:

Redmine Admin wrote:

hi, you can always try to book the same service, provider, date and time via web interface. If web interface allows this but API not then we will investigate. Thank you

Yes, using the web interface works as you can see here: SM Privé Testing Center - STD, Covid and more

Redmine Admin wrote:

I see no slots here Santemedic | Scheduling and Booking Website

Guilherme Bueno wrote:

it seems it was a caching issue with the results we were getting with the calendar. It seems to be fine now, for some reason we were caching the calendar results and that was screwing. up the availability selection