PerfectGym Next API

  • Appointment, bookable appointment and slots operations
  • Class and slots operations
  • Cross studio operations
  • Get customers and contracts
  • Retrieve customer accounting details
  • Retrieve customer communication details
  • Get device information
  • Debt collection operations
  • Manage membership contracts
  • Get studio information
  • Get trial offers information
Download OpenAPI description
Languages
Servers
Mock server
https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/
Demo tenant
https://open-api-demo.open-api.perfectgym.com/

Appointments

Appointment, bookable appointment and slots operations

Operations

Classes

Class and slots operations

Operations

Get classes

Request

Required Scopes: CLASSES_READ

Returns classes with at least one scheduled appointment for the period of one day before to fourteen days ahead

Query
offsetstring

Offset from last request

Default "0"
sliceSizeinteger(int32)[ 10 .. 100 ]

Desired size of data chunk

Default 50
curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes?offset=0&sliceSize=50' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
resultArray of objects(Class)required

List of classes

result[].​idinteger(int64)required

Unique ID of the class

Example: 1001
result[].​titlestring

Title of the class

Example: "Mission Beach body"
result[].​typestring

Defines whether a class is held in the studio or virtually

Enum"STUDIO""STREAM"
Example: "STUDIO"
result[].​durationinteger(int32)

Duration of the class in minutes

Example: 45
result[].​categorystring

Category of the class

Example: "Fitness"
result[].​descriptionstring

Description of the class

Example: "Get your body ready for beaches"
result[].​imgUrlstring

Image URL assigned to display this class

result[].​bookablebooleanrequired

Whether this class can be booked

hasNextbooleanrequired

True if there exists next data slice

Example: true
offsetstringrequired

Offset for next query

Example: "100"
Response
application/json
{ "result": [ {} ], "hasNext": true, "offset": "100" }

Get class by id

Request

Required Scopes: CLASSES_READ

Returns a class for specified id

Path
classIdinteger(int64)required

Id of the class.

curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/{classId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
idinteger(int64)required

Unique ID of the class

Example: 1001
titlestring

Title of the class

Example: "Mission Beach body"
typestring

Defines whether a class is held in the studio or virtually

Enum"STUDIO""STREAM"
Example: "STUDIO"
durationinteger(int32)

Duration of the class in minutes

Example: 45
categorystring

Category of the class

Example: "Fitness"
descriptionstring

Description of the class

Example: "Get your body ready for beaches"
imgUrlstring

Image URL assigned to display this class

bookablebooleanrequired

Whether this class can be booked

Response
application/json
{ "id": 1001, "title": "Mission Beach body", "type": "STUDIO", "duration": 45, "category": "Fitness", "description": "Get your body ready for beaches", "imgUrl": "string", "bookable": true }

Get class slots

Request

Required Scopes: CLASSES_READ

Returns class slots for specified class id and the period of one day before to fourteen days ahead

Path
classIdinteger(int64)required

Id of the class.

Query
offsetany

Offset from last request

Default "0"
sliceSizeinteger(int32)[ 10 .. 100 ]

Desired size of data chunk

Default 50
curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/{classId}/slots?offset=0&sliceSize=50' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
resultArray of objects(ClassSlot)required

List of class slots

result[].​idinteger(int64)required

Unique ID of a class slot

Example: 1001
result[].​startDateTimestring(date-time)

Class slot start date and time with zone

Example: "2022-06-22T08:00:00.000+02:00[Europe/Berlin]"
result[].​endDateTimestring(date-time)

Class slot end date and time with zone

Example: "2022-06-22T09:00:00.000+02:00[Europe/Berlin]"
result[].​instructorsArray of objects(Instructor)

List of instructors

result[].​locationobject(Location)

Represents location data

result[].​earliestBookingDateTimestring(date-time)

Class slot earliest booking date and time with zone

Example: "2022-06-15T00:00:00.000+02:00[Europe/Berlin]"
result[].​latestBookingDateTimestring(date-time)

Class slot latest booking date and time with zone

Example: "2022-06-15T23:59:59.999+02:00[Europe/Berlin]"
result[].​maxParticipantsinteger(int32)

Maximum participants allowed for a class slot

Example: 25
result[].​maxWaitingListParticipantsinteger(int32)

Maximum number of waiting list participants allowed for a class slot

Example: 5
result[].​bookedParticipantsinteger(int32)

Current number of booked participants of a class slot

Example: 25
result[].​additionalParticipantsinteger(int32)required

Additional participants added by the operator

Example: 5
result[].​waitingListParticipantsinteger(int32)

Current number of waiting list participants of a class slot

Example: 2
hasNextbooleanrequired

True if there exists next data slice

Example: true
offsetstringrequired

Offset for next query

Example: "100"
Response
application/json
{ "result": [ {} ], "hasNext": true, "offset": "100" }

Get class slot by id

Request

Required Scopes: CLASSES_READ

Returns class slots for specified class slot id

Path
classIdinteger(int64)required

Id of the class.

classSlotIdinteger(int64)required

Unique ID of the class slot

curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/{classId}/slots/{classSlotId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
idinteger(int64)required

Unique ID of a class slot

Example: 1001
startDateTimestring(date-time)

Class slot start date and time with zone

Example: "2022-06-22T08:00:00.000+02:00[Europe/Berlin]"
endDateTimestring(date-time)

Class slot end date and time with zone

Example: "2022-06-22T09:00:00.000+02:00[Europe/Berlin]"
instructorsArray of objects(Instructor)

List of instructors

locationobject(Location)

Represents location data

earliestBookingDateTimestring(date-time)

Class slot earliest booking date and time with zone

Example: "2022-06-15T00:00:00.000+02:00[Europe/Berlin]"
latestBookingDateTimestring(date-time)

Class slot latest booking date and time with zone

Example: "2022-06-15T23:59:59.999+02:00[Europe/Berlin]"
maxParticipantsinteger(int32)

Maximum participants allowed for a class slot

Example: 25
maxWaitingListParticipantsinteger(int32)

Maximum number of waiting list participants allowed for a class slot

Example: 5
bookedParticipantsinteger(int32)

Current number of booked participants of a class slot

Example: 25
additionalParticipantsinteger(int32)required

Additional participants added by the operator

Example: 5
waitingListParticipantsinteger(int32)

Current number of waiting list participants of a class slot

Example: 2
Response
application/json
{ "id": 1001, "startDateTime": "2022-06-22T08:00:00.000+02:00[Europe/Berlin]", "endDateTime": "2022-06-22T09:00:00.000+02:00[Europe/Berlin]", "instructors": [ {} ], "location": { "id": 203, "name": "Room 1", "description": "Room located behind reception" }, "earliestBookingDateTime": "2022-06-15T00:00:00.000+02:00[Europe/Berlin]", "latestBookingDateTime": "2022-06-15T23:59:59.999+02:00[Europe/Berlin]", "maxParticipants": 25, "maxWaitingListParticipants": 5, "bookedParticipants": 25, "additionalParticipants": 5, "waitingListParticipants": 2 }

Book a class slot

Request

Required Scopes: CLASSES_WRITE

Book a class slot for given customer

Bodyapplication/jsonrequired
customerIdinteger(int64)required

Unique ID of the customer

Example: 203
classSlotIdinteger(int64)required

Unique ID of the class slot

Example: 20334
curl -i -X POST \
  https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/booking/book \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "customerId": 203,
    "classSlotId": 20334
  }'

Responses

OK

Bodyapplication/json
bookingIdinteger(int64)required

Unique ID of a class booking

Example: 2033
bookingStatusstringrequired

Status of the class slot booking

Enum ValueDescription
BOOKED

Customer is successfully booked

CANCELED

Customer booking is canceled

WAITING_LIST

Customer is assigned to waiting list

Example: "BOOKED"
classSlotIdinteger(int64)required

Unique ID of a class slot

Example: 14928
classIdinteger(int64)required

Unique ID of a class

Example: 14928
customerIdinteger(int64)required

Unique ID of a customer

Example: 14925548
classSlotStatusstringrequired

The status of a class slot

Enum ValueDescription
COMPLETED

The class slot is completed.

CANCELED

The class slot is canceled.

PLANNED

The class slot is planned.

Example: "COMPLETED"
participantStatusstringrequired

The status of a participant

Enum ValueDescription
PARTICIPATING

The customer is participating.

UNSET

The participation status is not set.

NOT_PARTICIPATING

The customer is not participating.

Example: "PARTICIPATING"
Response
application/json
{ "bookingId": 2033, "bookingStatus": "BOOKED", "classSlotId": 14928, "classId": 14928, "customerId": 14925548, "classSlotStatus": "COMPLETED", "participantStatus": "PARTICIPATING" }

Validate class slot is bookable

Request

Required Scopes: CLASSES_READ

Validate class slot is available to book for given customer

Bodyapplication/jsonrequired
customerIdinteger(int64)required

Unique ID of the customer

Example: 203
classSlotIdinteger(int64)required

Unique ID of the class slot

Example: 20334
curl -i -X POST \
  https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/booking/validate \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "customerId": 203,
    "classSlotId": 20334
  }'

Responses

OK

Bodyapplication/json
validationStatusstringrequired

Status of the booking validation

Enum ValueDescription
AVAILABLE

Booking is possible

NO_CONTINGENT

Customer doesn't have required contingent

BOOKING_LIMIT_REACHED

Waiting List/Max participant list exceeded

CUSTOMER_ALREADY_BOOKED

Customer already added to class slot

CUSTOMER_IDLE

Customer has an idle period during the time of the class slot

STUDIO_CLOSED

Studio is closed during period

CUSTOMER_IN_OTHER_BOOKING

Customer has other bookings in this period

DATE_TIME_BEFORE_EARLIEST_BOOKING_DATE_TIME

Date and time are before earliest possible booking date

NOT_AVAILABLE

Booking is not possible for other reasons

DISPLAY_ONLY

Class is display only

Example: "AVAILABLE"
Response
application/json
{ "validationStatus": "AVAILABLE" }

Get class booking by id

Request

Required Scopes: CLASSES_READ

Returns class booking for specified booking id

Path
bookingIdinteger(int64)required

Id of the booking

curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/booking/{bookingId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/json
bookingIdinteger(int64)required

Unique ID of a class booking

Example: 2033
bookingStatusstringrequired

Status of the class slot booking

Enum ValueDescription
BOOKED

Customer is successfully booked

CANCELED

Customer booking is canceled

WAITING_LIST

Customer is assigned to waiting list

Example: "BOOKED"
classSlotIdinteger(int64)required

Unique ID of a class slot

Example: 14928
classIdinteger(int64)required

Unique ID of a class

Example: 14928
customerIdinteger(int64)required

Unique ID of a customer

Example: 14925548
classSlotStatusstringrequired

The status of a class slot

Enum ValueDescription
COMPLETED

The class slot is completed.

CANCELED

The class slot is canceled.

PLANNED

The class slot is planned.

Example: "COMPLETED"
participantStatusstringrequired

The status of a participant

Enum ValueDescription
PARTICIPATING

The customer is participating.

UNSET

The participation status is not set.

NOT_PARTICIPATING

The customer is not participating.

Example: "PARTICIPATING"
Response
application/json
{ "bookingId": 2033, "bookingStatus": "BOOKED", "classSlotId": 14928, "classId": 14928, "customerId": 14925548, "classSlotStatus": "COMPLETED", "participantStatus": "PARTICIPATING" }

Cancel a class booking

Request

Required Scopes: CLASSES_WRITE

Cancel booking of a class slot for given bookingId

Path
bookingIdinteger(int64)required

Unique id of the booking to be cancelled

curl -i -X DELETE \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/booking/{bookingId}' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Booking was cancelled successfully

Response
No content

Get class bookings by customer id

Request

Required Scopes: CLASSES_READ

Returns class booking with a period starting and ending within a timeframe of +/- 2 weeks for a specific customer

Query
customerIdinteger(int64)required

Id of the customer

curl -i -X GET \
  'https://developer.sportalliance.com/_mock/apis/perfectgym/openapi/openapi/v1/classes/booking?customerId=0' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

OK

Bodyapplication/jsonArray [
bookingIdinteger(int64)required

Unique ID of a class booking

Example: 2033
bookingStatusstringrequired

Status of the class slot booking

Enum ValueDescription
BOOKED

Customer is successfully booked

CANCELED

Customer booking is canceled

WAITING_LIST

Customer is assigned to waiting list

Example: "BOOKED"
classSlotIdinteger(int64)required

Unique ID of a class slot

Example: 14928
classIdinteger(int64)required

Unique ID of a class

Example: 14928
customerIdinteger(int64)required

Unique ID of a customer

Example: 14925548
classSlotStatusstringrequired

The status of a class slot

Enum ValueDescription
COMPLETED

The class slot is completed.

CANCELED

The class slot is canceled.

PLANNED

The class slot is planned.

Example: "COMPLETED"
participantStatusstringrequired

The status of a participant

Enum ValueDescription
PARTICIPATING

The customer is participating.

UNSET

The participation status is not set.

NOT_PARTICIPATING

The customer is not participating.

Example: "PARTICIPATING"
]
Response
application/json
[ { "bookingId": 2033, "bookingStatus": "BOOKED", "classSlotId": 14928, "classId": 14928, "customerId": 14925548, "classSlotStatus": "COMPLETED", "participantStatus": "PARTICIPATING" } ]

Cross Studio

Cross studio operations

Operations

Customers

Get customers and contracts

Operations

Customers Account

Retrieve customer accounting details

Operations

Customers Communication

Retrieve customer communication details

Operations

Customers Self-service

Operations

Devices

Get device information

Operations

Finance

Debt collection operations

Operations

Membership Self-service

Manage membership contracts

Operations

Studios

Get studio information

Operations

Trial Offers

Get trial offers information

Operations