# Creating a new class adds only location to "absent\_at\_location\_ids" array

**URL:** <https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909>\
**Category:** Questions\
**Tags:** booking-api\
**Created:** [September 8, 2025, 12:15am UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909 "2025-09-08T00:15:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 12:15am UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/1 "2025-09-08T00:15:26Z")

</div>

When I create a new class to use the bookings api, every location in my account (only 1) is added to the absent\_at\_locations\_id array. Thus I cannot query available bookings.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [September 8, 2025, 12:15am UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/2 "2025-09-08T00:15:42Z")

</div>

👋 I’m Square Dev AI, here to help answer your question!  
Based on the information you’ve provided, the following documentation will help answer your question:

> **[Create and Manage Bookings](https://developer.squareup.com/docs/bookings-api/use-the-api)**
>
> Learn how to call the Bookings API to create and manage bookings for a Square seller.

> **[Bookings API](https://developer.squareup.com/docs/bookings-api/what-it-is)**
>
> The Bookings API lets you create and manage bookings for Square sellers.

> **Additional Documentation**
>
> [Bookings API Concepts](https://developer.squareup.com/docs/bookings-api/get-ready-to-use-the-api)  
> [Locations API](https://developer.squareup.com/docs/locations-api/cookbook/get-locations)  
> [Locations API](https://developer.squareup.com/docs/locations-api)

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.  
Otherwise one of our Developer Advocates will provide additional assistance shortly.

---

<div class="post-metadata">

**Author:** ![Square-Dev-AI](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/square-dev-ai/32/2513_2.png) [@Square-Dev-AI](https://developer.squareup.com/forums/u/Square-Dev-AI)\
**Post date:** [September 8, 2025, 5:13pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/3 "2025-09-08T17:13:55Z")

</div>

When you encounter an issue where every location in your account is added to the `absent_at_locations_id` array, it typically means that the service or item variation you are trying to book is not available at any of your locations. This can happen if the service is not configured to be available at your specific location.

To resolve this issue, you should:

1. **Check Service Availability** : Ensure that the service you are trying to book is marked as available at your location. You can do this by verifying the `present_at_all_locations`, `present_at_location_ids`, and `absent_at_location_ids` attributes of the service in your catalog. The service should be listed in `present_at_location_ids` for your location.

2. **Update Service Configuration** : If the service is not available at your location, you may need to update the service configuration in the Square Dashboard or through the Catalog API to ensure it is available at the desired location.

3. **Verify Location Settings** : Make sure that your location is enabled for bookings. You can check this by calling the `ListLocationBookingProfiles` endpoint and verifying that the `online_booking_enabled` field is set to `true` for your location.

By ensuring that the service is correctly configured to be available at your location, you should be able to query available bookings without encountering the issue of locations being added to the `absent_at_locations_id` array.

_This answer was reviewed by @Bryan-Square._

---

<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:** [September 8, 2025, 5:14pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/4 "2025-09-08T17:14:42Z")

</div>

Is this in production or sandbox? Also whats your `location_id`. 🙂

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 6:11pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/5 "2025-09-08T18:11:22Z")

</div>

This is in both production and sandbox. location\_id is LH1TAFGC58WYE

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 6:24pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/6 "2025-09-08T18:24:07Z")

</div>

> [@Square-Dev-AI](#):
>
> ListLocationBookingProfiles

Response to the AI:

1. For me a class is inserted into square as a objectType: Item, productType: CLASS\_TICKET. Thus, I don’t think this is applicable.
2. Not applicable
3. Attribute is set to true.

---

<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:** [September 8, 2025, 9:18pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/7 "2025-09-08T21:18:56Z")

</div>

What’s the ID of the class you created? 🙂

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 9:45pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/8 "2025-09-08T21:45:07Z")

</div>

I sent you a message with a list of all the classes I created.

Unrelated but because I think your a developer. Using this is driving me crazy because I can’t see the text I write.

 ![Screenshot from 2025-09-08 15-44-29](https://global.discourse-cdn.com/square/original/2X/9/93494129b7bd9d7003d3a48147cfba537fee8b84.png)

---

<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:** [September 8, 2025, 10:11pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/9 "2025-09-08T22:11:11Z")

</div>

Hmm, what browser are you using? 🙂

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 10:20pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/10 "2025-09-08T22:20:15Z")

</div>

I’m using edge.  
right now

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 10:22pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/11 "2025-09-08T22:22:35Z")

</div>

The issue is .legal-disclosure max-width: 38% because the messaging popup is only a small section. I pulled this up on chrome and it’s showing correctly because the popup is the width of the screen.

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 8, 2025, 10:23pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/12 "2025-09-08T22:23:24Z")

</div>

Firefox has a similar issue.

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 10, 2025, 2:50pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/13 "2025-09-10T14:50:09Z")

</div>

Nvm we found a workaround. We’ll run an update everyday to ensure every class is available at all locations.

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 10, 2025, 3:19pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/14 "2025-09-10T15:19:12Z")

</div>

We still can’t retrieve any bookings though. I send this response in the explorer

```auto
{
  "query": {
    "filter": {
      "start_at_range": {
        "end_at": "2025-09-15T15:04:32.435Z",
        "start_at": "2025-09-10T15:04:33.234Z"
      },
      "location_id": "LH1TAFGC58WYE",
      "segment_filters": [
        {
          "service_variation_id": "R23P4BOGCVBXHHS33PTC3JI6"
        }
      ]
    }
  }
}

```

And get the following response:

```auto
{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "BAD_REQUEST",
      "detail": "Minimum booking duration is 1 minute.",
      "field": "query.filter.segment_filters"
    }
  ]
}

```

I created 25 bookings for the class Beginner Yoga with id “R23P4BOGCVBXHHS33PTC3JI6” on Sept 11 via the calendar. So, why is creating a booking via the calendar resulting in an error for the api?

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 10, 2025, 3:20pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/15 "2025-09-10T15:20:14Z")

</div>

I’m testing the query on [Square Developer](https://developer.squareup.com/explorer/square/bookings-api/search-availability) using our production account.

---

<div class="post-metadata">

**Author:** ![josh-square](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@josh-square](https://developer.squareup.com/forums/u/josh-square)\
**Post date:** [September 10, 2025, 10:14pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/16 "2025-09-10T22:14:11Z")

</div>

Hey @champquin! Do you mind clarifying for me whether you’re attempting to retrieve the bookings you created, or availabilities for a service?

It looks like the request you’re making is searching for [SearchAvailability](https://developer.squareup.com/reference/square/bookings-api/search-availability). If you’re looking to get created bookings, you should use [ListBookings](https://developer.squareup.com/reference/square/bookings-api/list-bookings) instead (which you can still filter by start time).

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 10, 2025, 10:28pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/17 "2025-09-10T22:28:53Z")

</div>

My understanding is that I need to search for availablity, once I find availability, then I can create a booking. Running a query for listBookings also doesn’t return anything. I just ran  
await client.bookings.list({  
locationId: “LH1TAFGC58WYE”,  
startAtMin: “2025-09-10T22:26:37.371Z”,  
});  
and it returned  
{  
“bookings”: ,  
“errors”:   
}

I manually created a booking for a class on Thu 09/11. We only have one location

 ![Screenshot from 2025-09-10 16-28-25](https://global.discourse-cdn.com/square/original/2X/8/889837763fdfb0b3e3bffc7bb00e391803a4ca3e.png)

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 10, 2025, 11:41pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/18 "2025-09-10T23:41:39Z")

</div>

To be clear, this is what I’m trying to do. We own a gym. I want employees of the gym to go to the calendar on the square dashboard to create a class for the gym (beginner yoga everyweek on Thursday at 8:00am). Then I want a customer to book a spot in the class from our app. I can currently fetch the classes using the catalog search catalog objects query, but I can’t book any of the slots we create for the class. First the issue was that every class we created had the location\_id in the absent\_at\_locations array. We can solve that by manually upserting the catalog object. Now the issue is that I can’t pull availability for the classes to get an id to create an appointment. The square explorer is giving me the error I posted previously.

---

<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:** [September 11, 2025, 4:29pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/19 "2025-09-11T16:29:25Z")

</div>

You can book a class with the Bookings API however adding members to a class isn’t currently available with the bookings API. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. 🙂

---

<div class="post-metadata">

**Author:** ![champquin](https://avatars.discourse-cdn.com/v4/letter/c/8dc957/32.png) [@champquin](https://developer.squareup.com/forums/u/champquin)\
**Post date:** [September 11, 2025, 6:29pm UTC](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909/20 "2025-09-11T18:29:11Z")

</div>

How can I find when a class will happen via the api? Currently there is no information of when a class starts or what day it is on via the catalog api. If I can’t tell which classes there are this week or how many people will be attending the class this week, then classes are unusable via the api. Thus are you saying that classes are not supported by your API?

[Next page](https://developer.squareup.com/forums/t/creating-a-new-class-adds-only-location-to-absent-at-location-ids-array/23909.md?page=2)
