Get resource product by ID

GET /api/configuration/resource-products/{all}

Success: 200 OK

Overview

Returns one resource product, together with the weekly opening times resolved from the calendar attached to it.

A resource product is a bookable thing rather than a thing you sell over a counter — a badminton court, a studio, a lane, a piece of equipment. It is an ordinary product flagged as a resource, which is why it shares an id space with retail products. Use this endpoint when you have a resource product id and need its display name, the site group it belongs to and the days and hours it is open.

Two things about the response are worth knowing before you build against it.

A missing product returns 400, not 404. The endpoint answers an unknown id with a 400 whose body is the plain string Product not found. If your client treats 4xx other than 404 as "malformed request, do not retry, log an error", you will misclassify the ordinary case of a product that has been deleted.

The resource filter is bypassed when you supply an id. The endpoint matches on id alone and does not check that the product is a resource. Ask for the id of a retail product — a towel, a coffee — and you get a 200 with that product's details rather than the 400 you would expect, typically with an empty openingTimes. Do not use this endpoint to test whether an id is a bookable resource; get the set of genuine resources from Retrieves all resource products, which does apply the filter.

Endpoint

GET {base_url}/api/configuration/resource-products/{all}

{base_url} is the environment URL issued to your integration. See Authenticating with Gladstone APIs.

Path parameters

NameTypeRequiredDescription
productIdstringYesThe resource product to read, maximum 15 characters. Take it from id on Retrieves all resource products. Ids are uppercase — the endpoint uppercases what you send and what it returns, and auto-generated ids use the prefix RPROD — so send back exactly what you received. An empty value gives 400 with the body ProductId must be specified; an id with no matching product gives 400 with the body Product not found.

Sample request

cURL
curl -X GET '{base_url}/api/configuration/resource-products/{all}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'

Response fields

FieldTypeDescription
idstringThe product's identifier, maximum 15 characters, always returned uppercase regardless of the casing you sent. This is the value to use as productId on the update and delete calls, and as the product reference when booking against this resource.
descriptionstringThe operator's name for the resource — "Court 1", "Studio A" — maximum 255 characters. This is what to show a user; there is no separate display-name field.
siteGroupIdstringThe site group this resource belongs to, maximum 15 characters and always populated. A site group is a set of sites treated as one for configuration purposes, so this tells you which sites the resource is bookable at — resolve it with Get site group by ID to get the member sites. Use it to filter a resource list down to the site a user has chosen.
calendarIdstringThe identifier of the calendar that supplies openingTimes, maximum 15 characters and always populated. You do not normally need it: the opening times are already expanded into this response, and there is no public endpoint that takes a calendar id. It matters in one situation — calendars created by the platform for a single resource product carry the prefix $$ and are deleted with the product, whereas a calendar without that prefix is shared with other products, so changing this product's hours would change theirs too.
activebooleanWhether the resource is currently offered for booking. This is the inverse of the product's inactive flag, so it reads the way you would expect: true means bookable. A product with no value set is reported as true, meaning "never deactivated" and "explicitly activated" are indistinguishable here. Deactivating is the operator's alternative to deleting a resource that has booking history.
openingTimesarray of objectThe weekly opening pattern for this resource, one entry per configured day, resolved from the calendar named in calendarId. Always present — a resource with no calendar entries returns [], never null. Days on which the resource is closed are absent from the array rather than present with null times: unconfigured days belong to a shared "No Access" schedule that carries no times, and they are left out of this array. Treat a missing day as closed. There is no date dimension here — this is the recurring weekly pattern, not a bookable-slot feed, and it takes no account of holidays or one-off closures.
openingTimes[].daystringThe day of the week the entry applies to, as an English day name — Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday. Match on the string, not on position: the array is not guaranteed to start at Sunday or to be in day order. If the configured day is out of range, this field comes back null rather than raising an error.
openingTimes[].startTimestringThe time the resource opens on that day, formatted HH:mm in the site's local time — there is no date, offset or time zone in the value. Minutes are padded on the wrong side, so a minute value below ten and above zero is rendered as if it were a multiple of ten: five past nine comes back as 09:50, not 09:05. On-the-hour and half-hour times, which is what operators overwhelmingly configure, are unaffected. Parse defensively if you support arbitrary opening minutes.
openingTimes[].endTimestringThe time the resource closes on that day, in the same HH:mm local-time format and subject to the same minute-padding fault as startTime. Create and update reject an end time that is not later than the start time for a given day, so within a single entry you can rely on endTime being after startTime.

Sample response

200 OK
{
  "id": "string",
  "description": "string",
  "siteGroupId": "string",
  "calendarId": "string",
  "active": true,
  "openingTimes": [
    {
      "day": "string",
      "startTime": "string",
      "endTime": "string"
    }
  ]
}

Errors

StatusMeaningWhen
400Bad requestTwo distinct causes, both returning a plain-text body rather than a JSON error object. ProductId must be specified when the path segment is empty. Product not found when no product carries that id — this is the "does not exist" case, which this endpoint reports as 400 rather than 404.
500Internal server errorAn unexpected server-side failure while reading the product or expanding its calendar. The response has no body. A calendar entry with a start time but no end time fails here rather than being skipped.

This page as markdown · All pages · llms.txt