Calculate session pricing

POST /api/pricing/session

Success: 200 OK

Overview

Prices a selected session (one slot) for a member or a non-member, returning the member's own price and the price at each price level a guest can be booked at. Use it to show what a booking will cost before the member commits, for example after they pick a slot from List all available sessions.

It is step 3 of the Booking flow: take a slot reference from an availability response, price it here, then get a signed quote from Retrieve pricing information for different members, create a lease and confirm the booking. The response from this endpoint is not a pricing quote: it carries no signature or timestamp, so it cannot be passed to booking creation.

What you get back depends on memberId:

In both cases priceLevels lists only the levels a non-member may buy online, so it is the list to offer for guests. A level the member is on can therefore be missing from priceLevels while still appearing in memberPriceLevel.

Endpoint

POST {base_url}/api/pricing/session

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

Request body

FieldTypeRequiredDescription
memberIdinteger (int32)YesThe member the session is being priced for. Send 0 to price for a non-member; any value of 0 or below is treated as a non-member. A positive value must be a member that exists, or the request fails with 404 MemberID {memberId} does not exist.
slotReferencestringYesThe slot to price, taken verbatim from [].locations[].slots[].slotReferences.inCentre or .virtual on a sessions response such as List all available sessions. It is an opaque JSON document encoded as a string: pass it exactly as received, and do not build or edit one. A missing or empty value returns 400 with a validation problem document; a value that cannot be read returns 400 Invalid slotReference. See Errors for the other slot reference failures.

Sample request

cURL
curl -X POST '{base_url}/api/pricing/session' \
  -H 'Authorization: Bearer ***' \
  -H 'X-Use-SSO: true' \
  -H 'Content-Type: application/json' \
  -d '{
  "memberId": 12345,
  "slotReference": "string"
}'

Response fields

FieldTypeDescription
memberPriceLevelobjectThe price this member pays for the session. Null for a non-member, and also null for a member when no purchasable price exists for them at the slot's time.
memberPriceLevel.idstringThe price level applied to the member: their own level, or a cheaper one from a price level override on a membership valid on the slot's date. Null when the session is covered by a usage subscription.
memberPriceLevel.descriptionstringThe price level's name, for display. Null when the session is covered by a usage subscription.
memberPriceLevel.priceobjectThe price for one place. Which of the two fields below appear depends on how the activity is attended, not on which slot reference you sent.
memberPriceLevel.price.inCentrenumber (decimal)The price for attending in person, being the sum of the activity's priced products at this level for the slot's time band and date. Present unless the activity is virtual-only. 0 when a usage subscription covers the session.
memberPriceLevel.price.virtualnumber (decimal)The price for attending remotely, calculated the same way. Present unless the activity is in-centre only. For an activity that is both, inCentre and virtual carry the same amount. 0 when a usage subscription covers the session.
memberPriceLevel.translationsarray of objectTranslations of the price level, when the tenant has configured any. Null when the session is covered by a usage subscription.
memberPriceLevel.translations[].typestring
memberPriceLevel.translations[].culturestringThe culture the text belongs to, used to pick the variant matching your user's language.
memberPriceLevel.translations[].textstringThe translated text for this culture.
memberPriceLevel.maxLimitinteger (int32)The most people that may be booked at this price level, as configured by the tenant for activities or for classes. 0 means no limit is configured, and is always 0 when a usage subscription covers the session.
paidForbyUsageSubstringThe usage subscription that covers this session, when the member holds one with uses left for the activity. Null when there is none, and always null for a non-member.
usagesRemaininginteger (int32)Uses left on that subscription. 0 when no usage subscription applies, and always 0 for a non-member.
currencystringThe currency code configured for the activity's site, for example GBP or EUR. GBP when none is configured. All prices in the response are in this currency.
priceLevelsarray of objectEvery price level at which a non-member can book this session online: the levels to offer for guests. A level is listed only when every product that makes up the slot's price has a purchasable price at that level for the slot's time band. For a party activity, a level must also allow purchase by non-members. An empty array, with 200, means nothing is purchasable at the slot's time; it is not an error.
priceLevels[].idstringThe price level identifier.
priceLevels[].descriptionstringThe price level's name, for display.
priceLevels[].priceobjectThe price for one place at this level. Same shape and rules as memberPriceLevel.price.
priceLevels[].price.inCentrenumber (decimal)The in-person price at this level. Present unless the activity is virtual-only.
priceLevels[].price.virtualnumber (decimal)The remote price at this level. Present unless the activity is in-centre only.
priceLevels[].translationsarray of objectTranslations of the price level, when the tenant has configured any.
priceLevels[].translations[].typestring
priceLevels[].translations[].culturestringThe culture the text belongs to.
priceLevels[].translations[].textstringThe translated text for this culture.
priceLevels[].maxLimitinteger (int32)The most people that may be booked at this price level. 0 means no limit is configured.

Sample response

200 OK
{
  "memberPriceLevel": {
    "id": "string",
    "description": "string",
    "price": {
      "inCentre": 10.5,
      "virtual": 10.5
    },
    "translations": [
      {
        "type": "string",
        "culture": "string",
        "text": "string"
      }
    ],
    "maxLimit": 0
  },
  "paidForbyUsageSub": null,
  "usagesRemaining": 0,
  "currency": "GBP",
  "priceLevels": [
    {
      "id": "string",
      "description": "string",
      "price": {
        "inCentre": 10.5,
        "virtual": 10.5
      },
      "translations": [
        {
          "type": "string",
          "culture": "string",
          "text": "string"
        }
      ],
      "maxLimit": 0
    }
  ]
}

Errors

StatusMeaningWhen
400Bad requestslotReference is missing or empty: a validation problem document (application/problem+json) with an errors map keyed by field name.
400Bad requestslotReference is not a readable slot reference: Invalid slotReference.
400Bad requestThe slot reference names no booking and is missing a part it needs: ActivityId must be specified if no BookingId is provided, ResourceId must be specified if no BookingId is provided, or StartDateTime must be specified for the selected activity.
400Bad requestThe slot reference points at something that does not exist or cannot be booked: Invalid or missing ActivityId {activityId}, Invalid or missing ResourceId(s) {ids}, Invalid ResourceId(s) {ids}, must be a resource, or Invalid or missing BookingId {bookingId}.
400Bad requestThe slot has already started: StartDateTime cannot be in past. Where the tenant allows booking for a set period after a session starts, the slot is accepted until that period ends. Get a fresh slot reference from availability.
400Bad requestNo time band covers the slot's date and time, so the session cannot be bought then: This booking is not available to purchase at the selected time.
404Not foundmemberId is greater than 0 and no such member exists: MemberID {memberId} does not exist.
422Unprocessable entityThe activity has several pricing products on different calendars, which cannot be priced: Multiple pricing products with different calendars for activity "{activityId}" is not permitted. This is an activity configuration problem; retrying will not help.
500Internal server errorAn unexpected server-side failure. No body is returned.

Notes

This page as markdown · All pages · llms.txt