0

I'm trying to integrate with the public API for MindBody and I'm wondering how I pull the valid services for an Enrollment. If I request the /enrollment/enrollments I can get a list of enrollments.

 curl --location 'https://api.mindbodyonline.com/public/v6/enrollment/enrollments?limit=100&offset=0&startDate=19%2F7%2F2023&endDate=1%2F1%2F2024'

These have a program and a session type included. I can then request the /sale/service endpoint and I include the program id of the enrollment in this request I'll get a list of the services that are allowed for the program.

 curl --location 'https://api.mindbodyonline.com/public/v6/sale/services?limit=10&offset=0&programIds=10&sellOnline=true'

This includes the valid service for this enrollment but also some other services. I'm wondering how I just get the specific service for a specific enrollment. For instance for a class, I can just pass in the class id to the service endpoint and this only shows me the valid services for that class:

curl --location 'https://api.mindbodyonline.com/public/v6/sale/services? 
limit=10&offset=0&classId=19115&sellOnline=true' \

For the enrollments the closest I can get is passing in the program ID but this doesn't match what is in the branded app for the site I'm currently linked with. I'm a bit unsure what I'm missing here and any help would be appreciated.

I've stripped out the headers from the curl requests to safeguard API keys, etc, but I've been using the PostMan collection to grab these.

James Lendrem
  • 1,780
  • 2
  • 15
  • 23

1 Answers1

0

I contacted MindBody support about this and they got back to me so I'm going to post the answer here in my own words.

To get the Service assigned to the Enrollment. First, make a call to the GET Enrollments Endpoint and then in the response find the Id of the Enrollment you want to get the service for. Afterwards, make a call to the GET Services endpoint and pass the Id of the Enrollment but as the classScheduleId. This will return the service that has been assigned to that specific Enrollment.

I hope someone else finds this useful.

James Lendrem
  • 1,780
  • 2
  • 15
  • 23