Creating a new class adds only location to "absent_at_location_ids" array

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.

:waving_hand: 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:

Additional Documentation

Bookings API Concepts
Locations API
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.

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.

Is this in production or sandbox? Also whats your location_id. :slight_smile:

This is in both production and sandbox. location_id is LH1TAFGC58WYE

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.

What’s the ID of the class you created? :slight_smile:

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.

Hmm, what browser are you using? :slight_smile:

I’m using edge.
right now

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.

Firefox has a similar issue.

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

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

{
  "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:

{
  "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?

I’m testing the query on Square Developer using our production account.

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. If you’re looking to get created bookings, you should use ListBookings instead (which you can still filter by start time).

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

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.

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. :slight_smile:

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?