I’m developing a small app using python to create bookings for our business, but am running into an issue. When creating a booking, the location field shows as empty in the booking, and in the calendar, despite the customer having the correct address as viewed when retrieving the customer by customer ID, and despite using “location_type”: “CUSTOMER_LOCATION”.
Oddly, when I open the booking with the empty location in the normal square dashboard and then click save, without changing anything at all, the booking in the calendar then shows the correct location.
What am I doing wrong here? How do I get the booking to have the correct location.
A code excerpt:
Data
service_variation_id, service_variation_version = self.service_mappings[self.service_list.selectedItems()[0].text()]
data = {
"booking": {
"start_at": utc_datetime_str,
"location_id": self.LOCATION_ID,
"customer_id": customer_id,
"seller_note": self.notes_edit.toPlainText(),
"appointment_segments": [
{
"service_variation_id": service_variation_id,
"service_variation_version": service_variation_version,
"team_member_id": self.tech_mappings[self.technician_name_dropdown.currentText()]
}
],
#"location_type": self.LOCATION_TYPE,
"location_type": "CUSTOMER_LOCATION"
}
}
# Send POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
Do you have an example of this? I’m not able to replicate.
Hi, thanks for responding.
Sure, for an example look at booking ID do73oca9h27asq. When running the above code it successfully creates the new booking. Except in the Square calendar there is no location, and clicking on the booking shows the ‘location’ field as empty.
And as I have that calendar exported to a google calendar, there is no location there either. However, if I click on the event in the Square calendar in the normal dashboard, click edit, then click save (literally changing nothing whatsoever before clicking save), suddenly the location field is immediately filled in, and then also gets filled in for the Google Calendar.
If you like I can send you the code for the entire app for you to test locally, but I have tested this multiple ways and this behaviour is very consistent.
When I use the api explorer and retrieve the booking and copy it to a file, then do this again after opening the booking with the ‘edit’ button in the dashboard, changing nothing, and clicking save, a diff between the two shows no differences (aside from the fact it was edited at a different time), but despite this the date now shows up in the Square calendar and the google calendar immediately upon clicking save.
It is 100% replicable each and every time.
Please let me know how to proceed to get the location field filled in properly. If you would like to examine the entire python script let me know and I can send it to you. I just created an event where as you can see the location field is empty. This is booking ID do73oca9h27asq.
Whats your application ID? Cause I don’t see the location in the Seller Dashboard when looking at the appointment.
The application ID is sq0idp-qqjoaKFDP2mN-J0tstGOFg
And yes, the fact there is no location in the Seller Dashboard when looking at the event is the issue I’m trying to fix. When creating an event through the Square dashboard, this populates just fine. When clicking ‘edit’ on an event created with my app, then immediately clicking ‘save’ in the seller dashboard, then the location is suddenly populated just fine. However, when actually creating the event with the api, it is left empty, despite the location_type field being sent.
Do you have a screenshot of the location not showing in the Dashboard? Every booking I create it shows the location when navigating the booking in the Dashboard.
Your question is confusing me a bit since you already admitted you looked at the booking ID I provided and can see the location is empty.
But sure. See the following screenshots. The first shows the appointment pop-up when clicking on the calendar event, and you can clearly see the empty location field. The second shows the correct address showing up in the editing screen upon clicking ‘edit’, despite the location field being empty (and if I click ‘save’ the address will suddenly show up in the location field). The third shows the exported google calendar event with an empty location, aside from a single comma, which is what always happens when these events are exported without the proper location, a single comma gets put in the Google Calendar event.
Please let me know what needs to happen to fix this. Thanks.
Here are the screenshots…
It seems this reply won’t post here for some reason with the screenshots included in it. Perhaps it only allows one at a time. I will post three messages, with one in each, and we’ll see what happens.
Here’s the 2nd screenshot.
Here’s the 3rd screenshot.
Thanks for providing all the information. I was able to replicate this and have escalated to the team.
Thanks very much! I look forward to seeing this get sorted out. I appreciate you helping me with this.
We have had the same issue. As a workaround, we send the address in the appointment notes.
That is not a bad idea. Much simpler than what I was thinking for a workaround. I was thinking I’d have a script read the details for the customer via the Square API, then plug in the address to the Google Calendar events (using the relevant team member, date and time to ensure the right event and calendar) using the Google Calendar API. An annoying workaround that I really don’t want to implement., so I hope they get this fixed soon.
The team is prioritizing a fix and I’ll be sure to reach out when we have an update.
I’m just wondering when this really annoying bug is going to get fixed. It’s been many months now and no word.
At this time there isn’t any updates on this feature. Nor do we have public roadmaps for when this will be prioritized.
Well, thanks for the reply, but that’s honestly disappointing and unhelpful. Remember, this isn’t a ‘feature’ that is being discussed, it’s a fix of a really annoying bug. And not having any kind of information on ‘when this is going to be prioritized’ comes across as as quite similar to ‘never’.
I would definitely appreciate more clarity on this bugfix.
Thanks.