# Empty location when creating a booking with API using location\_type "CUSTOMER\_LOCATION"

**URL:** <https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385>\
**Category:** Questions\
**Tags:** booking-api\
**Created:** [August 21, 2023, 2:26am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385 "2023-08-21T02:26:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 21, 2023, 2:26am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/1 "2023-08-21T02:26:17Z")

</div>

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))

```

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 21, 2023, 9:11pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/2 "2023-08-21T21:11:31Z")

</div>

Do you have an example of this? I’m not able to replicate. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 21, 2023, 10:19pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/3 "2023-08-21T22:19:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2023, 1:06am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/4 "2023-08-22T01:06:11Z")

</div>

Whats your application ID? Cause I don’t see the location in the Seller Dashboard when looking at the appointment. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 22, 2023, 1:07am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/5 "2023-08-22T01:07:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2023, 4:04pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/6 "2023-08-22T16:04:45Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 22, 2023, 4:35pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/7 "2023-08-22T16:35:18Z")

</div>

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.

 ![Screenshot_2023-08-22_10-17-29](https://global.discourse-cdn.com/square/original/2X/1/1735a7f798bfb66b2493912301c581dc8b95d679.jpeg)

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 22, 2023, 4:36pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/8 "2023-08-22T16:36:24Z")

</div>

Here’s the 2nd screenshot.

 ![Screenshot_2023-08-22_10-18-21](https://global.discourse-cdn.com/square/original/2X/2/28aeecc4a36ffca1638ba05fe362eaa8ea1c4e97.jpeg)

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 22, 2023, 4:36pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/9 "2023-08-22T16:36:59Z")

</div>

Here’s the 3rd screenshot.

![Screenshot_2023-08-22_10-19-24](https://global.discourse-cdn.com/square/original/2X/2/292ee5176be711b46f09a37ad70c7a9719c1546b.jpeg)

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 22, 2023, 6:00pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/10 "2023-08-22T18:00:56Z")

</div>

Thanks for providing all the information. I was able to replicate this and have escalated to the team. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 22, 2023, 7:09pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/11 "2023-08-22T19:09:51Z")

</div>

Thanks very much! I look forward to seeing this get sorted out. I appreciate you helping me with this.

---

<div class="post-metadata">

**Author:** ![ashishm](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@ashishm](https://developer.squareup.com/forums/u/ashishm)\
**Post date:** [August 27, 2023, 3:22am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/12 "2023-08-27T03:22:28Z")

</div>

We have had the same issue. As a workaround, we send the address in the appointment notes.

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [August 27, 2023, 5:02am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/13 "2023-08-27T05:02:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [August 28, 2023, 4:43pm UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/14 "2023-08-28T16:43:17Z")

</div>

The team is prioritizing a fix and I’ll be sure to reach out when we have an update. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [January 3, 2024, 1:01am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/15 "2024-01-03T01:01:37Z")

</div>

I’m just wondering when this really annoying bug is going to get fixed. It’s been many months now and no word.

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [January 3, 2024, 1:04am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/16 "2024-01-03T01:04:04Z")

</div>

At this time there isn’t any updates on this feature. Nor do we have public roadmaps for when this will be prioritized. 🙂

---

<div class="post-metadata">

**Author:** ![dtklassy](https://avatars.discourse-cdn.com/v4/letter/d/f9ae1b/32.png) [@dtklassy](https://developer.squareup.com/forums/u/dtklassy)\
**Post date:** [January 3, 2024, 1:34am UTC](https://developer.squareup.com/forums/t/empty-location-when-creating-a-booking-with-api-using-location-type-customer-location/10385/17 "2024-01-03T01:34:39Z")

</div>

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.
