NAV Navbar

Mindbody Public API V6.0

Welcome to the new format and content for the Public API V6.0 documentation. Public API V6.0 is the latest STABLE RELEASE.

Getting Started

To develop and integrate an application using the Mindbody Public APIs, you’ll need to do the following:

  1. Create a Mindbody developer account.
  2. Write your application, using the Mindbody sandbox for development and testing.
  3. Request approval from Mindbody to take your application live.
  4. Request a site-specific activation code or an activation link for a specific business owner’s Mindbody account so that your application can access the owner’s business data.
  5. Send the activation code or the activation link to the business owner to activate.

You’ll need to follow these processes in the order given.

Creating a Mindbody Developer Account

Before you can log in to the developer portal, you must create a Mindbody developer account.

To create a Mindbody developer account

  1. Fill out the form for a developer account.
    It is important to note that Mindbody takes the business name that you enter on this form and makes it the SourceName parameter used for Public API calls. This name cannot be changed once you have submitted this form.
  2. Click Submit.
    You can then log in to your developer account from https://developers.mindbodyonline.com/Home/LogIn

Using the Sandbox

The sandbox has a permanent subscriber owner account that you can log into if you need to change the settings of the sample business to match the settings used by the business for which you are developing your application.
Optionally, you can also create a mock client account in the sandbox, and log into that account to emulate the behavior of the business owner’s clients. You can use this account to act as a client who makes and cancels appointments, buys products from the sample online store in the sandbox, and so on.

To log in to the sandbox as a subscriber owner

  1. Go to Mindbody developer’s portal.
  2. On the upper right corner, click Log In.
  3. Enter your username and password, and click Log In.
  4. On the upper right, click Public API.
  5. On the left side bar, under TOOLS, click Sandbox.
  6. Log in using the following credentials:
    Username: Siteowner
    Password: apitest1234
  7. Click Log in.

To create a client account to test application behavior

  1. Go to Mindbody developer’s portal.
  2. On the upper right corner, click Log In.
  3. Use your username and password to log into your developer account.
  4. On the upper right, click Public API.
  5. On the left side bar, under TOOLS, click Sandbox.
  6. In the Create an Account box, enter an email address and then click Next.
    Note that entering an email address is optional, but if you plan to test email behavior, you need to add a real email address here.
  7. Fill in the Contact Information fields and the Account Information fields.
  8. Check the checkbox to agree with the terms and then click Create Account.

Private Sandbox Sites

You may purchase a private sandbox site if the free public sandbox site is not meeting your testing needs. For more information, please reach out to Contact API Support.

Taking Your Application Live

Note that when you request to go live, you’ll need to have the Site ID of the business with which you are initially integrating.

To request approval to make your application go live

  1. Log into your developer account.
  2. On the upper right, click Dashboard.
  3. On the bottom of the page, click Request Live Access.
  4. Fill out the application with the required information.
  5. Mindbody reviews your application. Once the issues, if any, are resolved, we update your account status and email you to let you know that your application is ready to go live.
  6. Then, enter your billing information to complete your account setup.

There is only one more step needed to complete the process.

Accessing Business Data From Mindbody

To access live data from the business with which you are integrating, you’ll need to retrieve a site-specific activation code from Mindbody. You must then provide the code to the owner of the business for which you are developing your application. Once the owner activates the connection, you can access live data from the owner’s business.

Note that you’ll also need the Site ID of the business for this process.

To get an owner’s permission to access the owner’s live Mindbody business data

  1. Go to Mindbody developer’s portal.
  2. On the upper right corner, click Log In.
  3. Enter your username and password and click Log in.
  4. On the top right, click Account.
  5. On the left sidebar, click Site activation.
  6. Enter the Site ID of the business with which you are integrating.
  7. Mindbody then generates and returns a site-specific activation code and an activation link.
    If you want to automate steps 5-7, you can generate the code and link within your application by calling the GetActivationCode endpoint.
  8. There are two ways that the owner can activate your access to site data:
    • You can email the activation link to the business owner. Ask the owner to click the link, then log in to his or her Mindbody site using the owner account. If successful, the owner sees a page titled Integrating with Mindbody’s API that has a green checkmark on the right side.
    • Alternatively, you can email the activation code to the owner and ask them to enter the code on the API Integration page of his or her site. This page is located under Manager Tools > Mindbody Add Ons > API Integrations.
    • You can also refer the owner to the Mindbody support article that covers the owner’s part of this process.

Contacting API Support

If you have questions regarding the Mindbody API or need to update your developer billing information, send a request to Contact API Support.

Developer Resources

This section includes resources for developers to use when building integrations with Mindbody.

Swagger

Check out the Mindbody Public API V6.0 Swagger documentation where you can explore V6.0 API calls in your browser.

Postman

Check out the Mindbody Public API V6.0 Postman Customer Collection. This includes support for common workflows, all V6.0 endpoints, and more.

Run in Postman

Frequently Asked Questions

This section provides answers to questions that we hear frequently from developers and the business owners whose businesses they integrate with.

What is the Mindbody Public Application Programming Interface?

The Mindbody Public Application Programming Interface (Public API) is comprised of resources that third-party developers can use to pull data from a business using the Mindbody software. The Public API can be used to output the data from a business to the main website of the business. Security and access are ensured through access-control measures, and accountability is tracked using an auditing system.

The Mindbody Public API works with any language that has an HTTP library. Requests use standard HTTP verbs such as GET, POST, and DELETE. JSON is returned and accepted by all endpoints. The Public API uses the JSON data types defined by W3Schools. REST-like endpoints provide access to Mindbody business databases. You can use our Public API to retrieve JSON data. For example, if you want to get class visits, you can call an endpoint in the Public API called GetClassVisits that returns the requested visits in JSON. Since the data is returned in a standardized format, you can then integrate it directly into a business website or a third-party application. The Mindbody Public APIs gives you the ability to customize business data exactly as a business owner desires.

The Public API’s main goal is to allow easy bi-directional integration with third-party developer applications. Our Public API strives to allow the broadest possible compatibility with the least amount of development time.

The Public API resource documentation describes requests and responses in detail for each endpoint.

How does Mindbody charge developer accounts for using the Public API?

Testing in our sandbox test site is always free. However, when you integrate with a live site or sites, there is a fee of $11 per integration, per location that entitles you to make 1,000 Public API calls per day, per location. Every call over 1,000 costs an additional 1/3 cent each.

For integrations that aggregate and/or sell services sourced from multiple Mindbody subscribers, there is an additional charge of $1.20 per booking fee for class bookings, and $2.40 per appointment booking. These fees are not associated with most accounts.

When a business owner activates the integration of an active developer account with clients, the completion of the activation process results in a charge to the developer of $11 per integration, per location for the month in which the owner activates the integration. This occurs because clicking the activation link in the process triggers a GetActivationCode API call, which counts as a call to the SiteId and causes the charge. For more information about the activation process, see the process detailed in Getting Started or refer to the customer support article Setting up an API integration.

To be charged, a developer account must be connected to a business as well as make at least one API call within the billing period. If a business makes no API calls to an integration during a month, then there is no charge to the developer account for that business for that month.

For example, if a business owner with two locations activates an integration in May, but no other API calls are made, then the developer account is charged $22 ($11 per integration, per location) for the month of May. If neither of the locations make any API calls to the integration during June, the developer account is not charged any fee for that client for the month of June.

Who can use the Public APIs?

As of January 1, 2018, the Mindbody Public API is available to developers who are partnering with Mindbody business owners (subscribers) on all subscription levels.

How can subscribers customize Mindbody sites to look like their business websites?

Subscribers (business owners) need to have each application developer sign up for a developer account in our developer’s portal. Once the developer has joined the program and the subscriber has authorized the developer to access the site data using an activation link or code, the developer can use the Public API to write a custom application that can output live data from your Mindbody site to the main business website.

Some third-party developers may try different ways to get Mindbody data onto business websites, such as hacking the style sheet in our pages, which we don’t officially support, or using iFrames, which are not related to Apple and are no longer supported by Mindbody. The only correct way to integrate with our data is to sign up for a developer account and use our Public API.

See Getting Started for the details of the process.

What can a developer do with the Mindbody Public API?

A developer can use the Public API to write custom software that integrates with a business website using data from a Mindbody account. A third-party application can perform a variety of activities using site data, including the following:

  • Display a class or appointment schedule
  • Add clients into any of the services
  • Access client information
  • Manage client data
  • Complete sales for services and retail products
  • Add and retrieve staff profile information and permissions
  • Allow clients to purchase contracts and autopays with credit cards

For example, if you want an application to get a class schedule, a developer can call the Mindbody GetClasses endpoint to return all the class schedule information for the business. The developer can then customize the business data as desired and output the live data from the subscriber’s Mindbody software to the subscriber’s main website.

How can a developer start to use the Mindbody Public API?

See Getting Started for step-by-step information about what a developer needs to do.

How can I test against the Public API without affecting live data?

Our Public API Sandbox can be used to test Public API requests against test data. The login credentials for the test subscriber owner acccount that is already set up in the sandbox are as follows:

  • Studio ID: -99
  • Username: Siteowner
  • Password: apitest1234

Note that the sandbox site is refreshed nightly to clear any changes that developers have made while testing.
All Public API users also have access to the Test parameter within all calls. This parameter can be set to true or false.

  • When set to true, the request ensures that its parameters are valid without affecting the business database.
  • When set to false, the request performs as intended and may affect live client data.

For example, when you use the AddOrUpdateClients parameter, if you include the Test parameter and set it to true, client information is not updated when the request is executed, even though the response returns the updated information. If you set the Test parameter to false, then the request updates the business database with the intended changes.

Can I process credit cards through the Public API?

The Mindbody Public API can process credit cards, but this requires that the site ID specified in the request have an active merchant account with Mindbody. TSYS, Bluefin, Elavon, Paysafe, Adyen, and Ezidebit are the only merchant processors that the Public API supports currently, meaning that access is currently limited to clients in the United States, Canada (except Moneris clients), United Kingdom, European Union, Australia, New Zealand, and Hong Kong.
You can use the CheckoutShoppingCart request to handle credit card processing.

Which version of the Public API should I use?

We recommend that you use the latest stable version of the Public API, V6.0.

Where can I submit feedback and feature requests for the Public API?

All suggestions and feature requests regarding the Public API should be requested to Contact API Support.

How do I contact Public API support?

You may contact the Public API support team by submitting a ticket on Contact API Support

If you are currently logged in to your developer account, at the top right, click Support to bring up the form to submit a ticket. If you are not currently logged into your developer account, log in and then click the Support link.

Phone support is not currently available.

If you need help correcting, accessing, and/or transferring your personal data, or if you would like to execute your right to be forgotten, send a request to Contact API Support.

API Release Notes

Check out the API Release Notes regularly for updates on all our APIs.

Authentication

HTTPS

All calls to the Public API must use HTTPS connections, using TLS v1.2 or higher. Any connections made using an older version of TLS are not guaranteed to work correctly.

API Keys

Example request passing Api-Key, SiteId, and Authorization headers:

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/class/classes' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'authorization: {staffUserToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classes");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "{staffUserToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/classes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'authorization' => '{staffUserToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'authorization': "{staffUserToken}"
    }

conn.request("GET", "/public/v6/class/classes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/classes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["authorization"] = '{staffUserToken}'

response = http.request(request)
puts response.read_body

The Mindbody Public API and Webhooks API support self-service API key management. When using the Public API, you must pass a SiteId header and an Api-Key header in your request to authenticate your integration. The Public API V6.0 does not support the use of SourceCredentials nodes.

You can create up to ten unique API keys for use with the Public API and Webhooks API.

We strongly recommend that, for security and ease of management, you:

  • use a different API key for each integration (application).
  • store and use API keys only in intermediary server-side applications, not in client-facing applications.

To create an API key

  1. Log in to your Mindbody developer account.
  2. On the upper right menu, click Account.
  3. On the left sidebar, click API credentials.
  4. On the Credentials page, at the bottom under API Keys, click Create new API Key.
  5. In the App Name box that appears, change the default name to a name that describes this application. If you plan to use multiple API keys, we recommend that you use descriptive names so that you can easily distinguish between your API keys.

    If you do not type in a name, the API uses the default name of SourceName-Key-Number, where Key-Number is the current count of keys plus one.

    Note that you can change the name of an API key after you create it by editing the name in the table and then clicking Save. If you want the key to be active immediately, leave the Active? checkbox checked and then click Create. If you want to create the API key now but activate it sometime in the future, uncheck the Active? check box and then click Create. The API key’s status is Inactive until you activate it.

Once you create an API key, an entry appears in the table. For example:

Issued App Name (click to edit) Key Status Actions
July 8 2018 12:05 My Test Key Active

Using API keys

When using an Api-Key header, you must also provide a SiteId header. Note that only one SiteId may be passed with the Api-Key header in each request.

Note the following when using API keys:

  • Clicking Activate immediately activates an API key.
  • Clicking Deactivate makes an API key immediately inactive; all requests using this API key fail while it is inactive.
  • Clicking Show displays the API key; clicking Hide hides the API key.
  • To create a new API key after you have already created ten API keys, you must deactivate and then delete at least one API key. Inactive API keys count toward your total number of API keys; deleted API keys do not.

The example in the right pane shows how you would use an API key in your application. Note the Api-Key and SiteId headers.

User Tokens

Example request to the Issue endpoint for user tokens:

curl -X POST \
  https://api.mindbodyonline.com/public/v6/usertoken/issue \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "Username": "{staffUserName}",
    "Password": "{staffPassword}"
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/usertoken/issue");
var request = new RestRequest(Method.POST);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n\t\"Username\": \"{staffUserName}\",\r\n\t\"Password\": \"{staffPassword}\"\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/usertoken/issue');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "Username": "{staffUserName}",
    "Password": "{staffPassword}"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n\t\"Username\": \"{staffUserName}\",\r\n\t\"Password\": \"{staffPassword}\"\r\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("POST", "/public/v6/usertoken/issue", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/usertoken/issue")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request.body = "{\r\n\t\"Username\": \"{staffUserName}\",\r\n\t\"Password\": \"{staffPassword}\"\r\n}"

response = http.request(request)
puts response.read_body

Example response body:

{
    "TokenType": "Bearer",
    "AccessToken": "e10ce5f8701041ad97efeddhjfbn3288246831e84c52c429f8bd56e6f4bd89a1d",
    "User": {
        "Id": 3,
        "FirstName": "John",
        "LastName": "Smith",
        "Type": "Staff"
    }
}

https://api.mindbodyonline.com/public/v6/usertoken/issue

When users interact with your Public API integration as staff members, they need to get a staff user token for authentication. You can use the issue endpoint to get a staff user token, then pass the token in the headers for all of your requests. Note the following:

  • An unused token expires after seven days.
  • A token can only be used with the API key that created it.
  • For all endpoints, staff permissions may alter the returned data based on the passed token.

The user token is the equivalent of credentials for a staff member with basic staff permissions. To retrieve a valid user token, you can either pass actual staff credentials or your user credentials in the user token request (see below).

Please note: User credentials are automatically created for you whenever you integrate with a SiteID. They are the same as your source credentials, with the exception that you will use an underscore (_) in front of your source name when using it as the user name. The source password remains the same. This simulates a staff member performing the action in place of a consumer, since a consumer would not be able to perform the action online.

To get the authorization token for a live site, you can run the user token request and pass your user credentials as follows.

curl -X POST \
  https://api.mindbodyonline.com/public/v6/usertoken/issue \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "Username": "_SourceName",
    "Password": "SourcePassword"
}'

For the sandbox site
To get the Authorization token, you can use the issue endpoint to pass the User Credentials of the sandbox test site as follows.

curl -X POST \
  https://api.mindbodyonline.com/public/v6/usertoken/issue \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: -99' \
  -d '{
    "Username": "Siteowner",
    "Password": "apitest1234"
}'

Request Body

Name Type Description
Username string The staff member’s username.
Password string The staff member’s password.

Response

Name Type Description
AccessToken string The authentication token value.
TokenType string Bearer.
User object Contains information about the user represented by the access token.
User.Id number The user’s ID at the business. This is always 0 for Admin and Owner type users.
User.FirstName string The user’s first name.
User.LastName string The user’s last name.
User.Type string The user’s type. Possible values are:
  • Staff
  • Owner
  • Admin

OAuth

OAuth is another way to authorize endpoints by obtaining access token. The OAuth 2.0 authorization is a framework that allows user to grant a third party website or application access to the user’s protected resources, without necessarily revealing their credentials or even identity.

In OAuth, the client request access to resources controlled by the resource owner and hosted by the resource server and is issued a different set of credentials than those of the resource owner. Instead of using the resource owner’s credentials to access protected resources, the partner obtains an access token i.e. a string denoting a specific scope, lifetime and other attributes.

Access tokens are issued to the third party clients by an authorization server with the approval of the resource owner, then the client uses the access token to access the protected resources. Access tokens are in Json Web Token (JWT) format. The permissions represented by the access token in OAuth terms are known as scopes.

For OAuth client creation, please Contact API Support. OAuth 2.0 uses below two endpoints to get bearer access token to call Public API.

Authorize

curl -X GET \
  'https://signin.mindbodyonline.com/connect/authorize?response_mode=form_post&response_type=code%20id_token&client_id={yourClientId}&redirect_uri={yourRedirectUri}&scope=email profile openid offline_access Mindbody.Api.Public.v6&subscriberId={subscriberId}&nonce={nonce}'
var client = new RestClient("https://signin.mindbodyonline.com/connect/authorize?response_mode=form_post&response_type=code%20id_token&client_id={yourClientId}&redirect_uri={yourRedirectUri}&scope=email profile openid offline_access Mindbody.Api.Public.v6&subscriberId={subscriberId}&nonce={nonce}");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://signin.mindbodyonline.com/connect/authorize?response_mode=form_post&response_type=code%20id_token&client_id={yourClientId}&redirect_uri={yourRedirectUri}&scope=email profile openid offline_access Mindbody.Api.Public.v6&subscriberId={subscriberId}&nonce={nonce}');
$request->setMethod(METHOD_GET);

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

import http.client

conn = http.client.HTTPSConnection("signin.mindbodyonline.com")
payload = ''
headers = {}
conn.request("GET", "/connect/authorize?response_mode=form_post&response_type=code%20id_token&client_id={yourClientId}&redirect_uri={yourRedirectUri}&scope=email profile openid offline_access Mindbody.Api.Public.v6&subscriberId={subscriberId}&nonce={nonce}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "net/http"

url = URI("https://signin.mindbodyonline.com/connect/authorize?response_mode=form_post&response_type=code%20id_token&client_id={yourClientId}&redirect_uri={yourRedirectUri}&scope=email profile openid offline_access Mindbody.Api.Public.v6&subscriberId={subscriberId}&nonce={nonce}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)

response = https.request(request)
puts response.read_body

https://signin.mindbodyonline.com/connect/authorize

This endpoint initiates a sign in workflow. An OAuth Client will need to be provisioned for your account in order to use this endpoint.

Query Parameters

Name Type Description
response_mode string Use the value form_post.
response_type string Determines the authorization processing flow to be used. Clients created as type web will be assigned the OpenID Connect hybrid flow and should use code id_token. Clients created as type native or SPA will use OpenID Connect code flow with PKCE and should use code.
client_id string Your OAuth Client ID.
redirect_uri string Redirection URI to which the response will be sent.
scope string Use the value email profile openid offline_access Mindbody.Api.Public.v6. Your OAuth Client would need to have been provisioned with this scope. offline_access scope is mandatory to pass if you want refresh token back in response.
nonce string Value used to associate a Client session with an ID Token.
subscriberId string The Subscriber ID.

Response

After a consumer navigates to the authorize endpoint, they will be redirected to a sign in page to complete the workflow. This is where they will enter their username and password.

Status Code Description
200 Redirect to OAuth provider

Token

curl -X POST \
  'https://signin.mindbodyonline.com/connect/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=authorization_code&client_id={yourClientId}&client_secret={yourClientSecret}&code={authorizationCode}&redirect_uri={yourRedirectUri}&subscriberId={subscriberId}&scope=email profile openid offline_access Mindbody.Api.Public.v6'
var client = new RestClient("https://signin.mindbodyonline.com/connect/token");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "grant_type=authorization_code&client_id={yourClientId}&client_secret={yourClientSecret}&code={authorizationCode}&redirect_uri={yourRedirectUri}&subscriberId={subscriberId}&scope=email profile openid offline_access Mindbody.Api.Public.v6", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://signin.mindbodyonline.com/connect/token');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/x-www-form-urlencoded'
));

$request->setBody('grant_type=authorization_code&client_id={yourClientId}&client_secret={yourClientSecret}&code={authorizationCode}&redirect_uri={yourRedirectUri}&subscriberId={subscriberId}&scope=email profile openid offline_access Mindbody.Api.Public.v6');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("signin.mindbodyonline.com")

payload = "grant_type=authorization_code&client_id={yourClientId}&client_secret={yourClientSecret}&code={authorizationCode}&redirect_uri={yourRedirectUri}&subscriberId={subscriberId}&scope=email profile openid offline_access Mindbody.Api.Public.v6"

headers = {
    'Content-Type': "application/x-www-form-urlencoded"
    }

conn.request("POST", "/connect/token", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://signin.mindbodyonline.com/connect/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "grant_type=authorization_code&client_id={yourClientId}&client_secret={yourClientSecret}&code={authorizationCode}&redirect_uri={yourRedirectUri}&subscriberId={subscriberId}&scope=email profile openid offline_access Mindbody.Api.Public.v6"

response = http.request(request)
puts response.read_body

https://signin.mindbodyonline.com/connect/token

This endpoint is used to request an access token in exchange for an authorization code or a refresh token. An OAuth Client will need to be provisioned for your account in order to use this endpoint.

Form Data

Name Type Description
grant_type string Specifies the workflow that the client application is using to authenticate and authorize a user against the token server. Possible values are authorization_code and refresh_token.
client_id string Your OAuth Client ID.
client_secret string Your OAuth Client Secret.
code string Required when grant_type is authorization_code
redirect_uri string Required when grant_type is authorization_code
refresh_token string Required when grant_type is refresh_token
scope string Use the value email profile openid offline_access Mindbody.Api.Public.v6. Your OAuth Client would need to have been provisioned with this scope. offline_access scope is mandatory to pass if you want refresh token back in response.
nonce
Optional
string Value used to associate a Client session with an ID Token.
subscriberId string The Subscriber ID.

Response

Example Response

{
    "id_token": "id_token",
    "access_token": "access_token",
    "refresh_token": "refresh_token",
    "token_type": "Bearer",
    "expires_in": 3600,
}
Name Type Description
id_token string The ID Token is a security token that contains Claims about the Authentication of an End-User by an authorization server.
access_token string A JSON Web Token, used for authorization, that contains information about the token provider, client application, target API resource, etc.
refresh_token string Present when the scope parameter includes offline_access. A token that can be used to obtain a new set of tokens from the token server.
token_type string Type of the token is set to “Bearer”.
expires_in number The lifetime in seconds of the access token.

Allowlist

The Public API Allowlist is an optional feature for all supported versions to protect your services from unauthorized usage. When IPv4 addresses or address ranges are registered via our allowlisting web tool, only those addresses or ranges will have access to the Public API. Usage of address ranges are optional and specified in CIDR notation.

  • To activate the allowlist feature, allow at least one IP address.
  • The allowlist is disabled when the allowlist is empty.
  • A single IP address allowed will be converted to an IP range of 1 via a CIDR subnet mask of /32.
  • The Public API allowlist has a limit of 32 IP ranges per account.

To access the Allowlist tool:

  1. Log in to your Mindbody developer account.
  2. In the upper right, click Account.
  3. In the left side bar, click Allowlist.

Base URL

The base URL for the Public API is:

https://api.mindbodyonline.com/public/v6/

Pagination

Example request using pagination parameters to skip the first 20 results and returning the next 10:

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/class/classes?limit=10&offset=20' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'authorization: {staffUserToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classes?limit=10&offset=20");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "{staffUserToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/classes');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'limit' => '10',
  'offset' => '20'
));

$request->setHeaders(array(
  'authorization' => '{staffUserToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'authorization': "{staffUserToken}"
    }

conn.request("GET", "/public/v6/class/classes?limit=10&offset=20", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/classes?limit=10&offset=20")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["authorization"] = '{staffUserToken}'

response = http.request(request)
puts response.read_body

Example pagination information returned in the response body:

{
    "PaginationResponse": {
        "RequestedLimit": 10,
        "RequestedOffset": 20,
        "PageSize": 10,
        "TotalResults": 128
    },
    "Classes": [
        . . .
    ]
}

Most of the Public API GET endpoints support paging to handle larger amounts of data. If you do not explicitly set a limit, your requests default to 100 results and no offset. The query parameters and response associated with pagination are described in the next two tables.

Query Parameters

Name Type Description
Limit number The number of results to include.
Default: 100
Maximum: 200
Offset number Specifies the number of records that you want the call to skip. The list of results is offset by this amount.
Default: 0

Response

Name Type Description
RequestedLimit number The requested pagination limit used in this response.
RequestedOffset number The number of records skipped over to reach the results returned in the response.
PageSize number The number of results returned in this response.
TotalResults number The total number of results in the dataset.

Handling Dates and Times

To represent points in time, the Public API accepts time stamp strings. Because JSON doesn’t have a built-in format for expressing dates and times, the Public API returns dates and times as strings. All date and time pairs are returned in the format YYYY-MM-DDTHH:mm:ss. When you send or receive dates and times using the Public API, the data is always passed in the business owner’s local time. We consider it a best practice to pass in times without using a UTC designation.

To ensure that you don’t have problems rendering dates and times, we recommend that you pass dates and times in the ISO 8601 format as defined by the RFC 339 specification. If you enter dates and times in a nonstandard format, you may encounter errors.

Handling Errors

To help with troubleshooting your integration, the Public API returns error codes in response to invalid requests. When an invalid API request is made, you can use the errors to help to identify and resolve issues such as invalid parameters or conflicting site settings.

Mindbody has introduced error code 429, Too Many Requests, to the Public API. If you receive this error, the rate limit has been reached. Reduce the number of Requests Per Minute (RPM) to resolve this error. We recommend that you keep your requests to 2000 RPM or lower for optimal performance. If you feel this limit should be revised for your integration, contact Contact API Support with your request. Note that Mindbody does not currently charge you for calls that result in a 429 error code response.

Errors have the following properties.

Name Type Description
Message string The text of the message. Each message is specific to the error that caused it. For example, if the the error type is InvalidFileFormat, the message could say “The photo you attempted to upload is not a supported file type.”
Code string The type of error that occurred, for example, ClientNotFound or InvalidClassId.

If you get an internal server error, you should first try the request again. If the problem persists, send request to Contact API Support.

In addition to HTTP codes, the API returns a JSON error response object, as shown in the following example:

{
    "Error": {
        "Message": "Client 11123123874 does not exist.",
        "Code": "ClientNotFound"
    }
}

A general description of each type of error is provided below. The actual description that returns for an error is even more specific to the problem in the request.

Error Code Description
ClassRequiresPayment A client must pay at the time of sign up, and no payment was passed in the request.
ClassScheduleNotFound No schedule with that ID exists.
ClassSignUpsFull The class is full. No more clients can be added to the class roster.
ClientCustomFieldNotFound The custom field used in the request does not exist.
ClientIndexNotFound The client index used in the request does not exist.
ClientIndexValueNotFound The client index value used in the request does not exist.
ClientIsAlreadyBooked The client in the request is already booked for a class, appointment, service, or event.
ClientIsAlreadyOnWaitlist The client in the request is already on the requested waiting list.
ClientIsSuspended The client in the request is suspended from scheduling, so the action cannot be carried out.
ClientNotFound The client in the request does not exist.
CrossRegionalNotSupported The cross regional feature in the request is not supported.
DeniedAccess Access is denied.
EnrollmentSignUpsFull The enrollment is full. No more clients can be added to the enrollment.
EnrollmentWaitlistFull The waiting list for the requested enrollment is full. No more clients can be added to the waiting list.
FormulaNoteNotFound The requested formula note does not exist.
InvalidBookingTime The time requested is not a valid booking time. For example, the time may be after the close of business, or on a holiday when the business is closed.
InvalidClassId The class ID used in the request is not valid.
InvalidClientCreation Client creation cannot result in duplicate client records.
InvalidClientUpdate Client update cannot result in duplicate client records or client has linked Mindbody account and sensitive fields cannot be edited.
InvalidCountry The country used in the request is not valid.
InvalidFileFormat The file format used in the request is not valid.
InvalidItem There is a problem with an item used in the request.
InvalidLocation A location used in the request is not valid.
InvalidLoginCredentials The login credentials used in the request are not valid.
InvalidParameter A parameter used in the request is not valid.
InvalidPaymentInfo The payment information used in the request is not valid.
InvalidPermissionConfiguration The staff permissions used in the request are not a valid configuration.
InvalidPrerequisite The client in the request does not meet the prerequisite requirement for the class in the request.
InvalidPromotionCode A promotion code used in the request is not valid.
InvalidResource A resource used in the request is not valid.
InvalidSaleReturn The return of an item or service that is used in the request is not valid.
InvalidSalesRepId A sales representative ID used in the request is not valid.
InvalidSettingConfiguration A setting in the business is configured in such a way as to make the request invalid.
InvalidSiteId The site ID used in the request is not valid.
InvalidSourceCredentials The source credentials used in the request are not valid.
InvalidStaffAndProviderId The staff and provider IDs used in the request are not valid.
InvalidStaffCredentials The staff credentials used in the request are not valid.
InvalidUserAccessLevel The user access level used in the request is not valid.
InvalidUserCredentials The user credentials used in the request are not valid.
ItemNotFound An item used in the request does not exist.
LeaderFollowerFull The role that the client is booking, either leader or follower, is not available. That role is full.
MissingRequiredFields One or more fields that are required in this request are missing.
PaymentRequired The payment needed to complete this request is missing.
RelatedClientNotFound The requested related client does not exist.
ResourceDoesNotExist The requested resource does not exist.
SaleIdNotFound The sale ID used in this request does not exist.
SchedulingRestrictionsViolated This request violates one or more of the scheduling restrictions.
SchedulingWindowViolated This request violates a scheduling window.
ServiceDoesNotPayForAppointment The pricing option used in this request cannot be used to pay for the appointment in the request.
ServiceDoesNotPayForVisit The pricing option used in this request cannot be used to pay for the visit in the request.
SessionTypeNotFound The session type used in the request does not exist.
StaffCannotTakeTips The tip included in the request cannot be applied.
StaffIsInactive The staff member used in the request is not an active staff member.
StaffIsNotATrainer The staff member used in the request does not teach classes or enrollments.
StaffMemberNotFound The staff member used in the request does not exist.
TooManyRequests The rate limit has been reached. Reduce the Requests Per Minute to resolve this error.
Unknown The cause of this error is not known.
ValidationFailed The validation of the request itself failed.
VisitMustBeAClass The visit used in the request must be a class.
SQLDBMaintenance Please try again as db backup is in progress.

Testing Your Integration

Example AddClientToClass request using the Test parameter:

curl -X POST \
  https://api.mindbodyonline.com/public/v6/class/addclienttoclass \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'authorization: {staffUserToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId": "{someClientId}",
    "ClassId": {someClassId},
    "Test": true
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/addclienttoclass");
var request = new RestRequest(Method.POST);
request.AddHeader("authorization", "{staffUserToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"ClientId\": \"{someClientId}\",\n\t\"ClassId\": {someClassId},\n\t\"Test\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/addclienttoclass');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'authorization' => '{staffUserToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId": "{someClientId}",
    "ClassId": {someClassId},
    "Test": true
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"ClientId\": \"{someClientId}\",\n\t\"ClassId\": {someClassId},\n\t\"Test\": true\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'authorization': "{staffUserToken}"
    }

conn.request("POST", "/public/v6/class/addclienttoclass", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/addclienttoclass")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["authorization"] = '{staffUserToken}'
request.body = "{\n\t\"ClientId\": \"{someClientId}\",\n\t\"ClassId\": {someClassId},\n\t\"Test\": true\n}"

response = http.request(request)
puts response.read_body

Before you implement your integration with your client’s live data, it is a good idea to test it in our sandbox. The data in the sandbox is fictitious, but structured in exactly the same way as it would be in an actual business. Your source name can access this account as soon as it is created; you do not need to complete the activation process to access this site.

To log in to the Public API Sandbox, use the following credentials:

Name Value
Studio ID -99
Username Siteowner
Password apitest1234

Note the following:

  • This site is refreshed nightly to clear any changes that were made during the day.
  • You cannot use it to test a live credit card sale.

Test Parameter

You can also use the test parameter to test any calls that update site data. This parameter can be set to true or false.

  • If set to true, you can ensure that the request is valid without affecting the business database.
  • If set to false, the request performs as intended and does affect live business data.

For example, if you use the AddClientToClass endpoint and include the test parameter set to true, then the client information is not added when the request is executed, even though the response returns the information as if it was added. If you use the AddClientToClass endpoint and include the test parameter set to false, then the request does add the client to the business database.

Branding Requirements

You should be familiar with and follow the Mindbody Branding Requirements.

An approved Mindbody logo must be displayed on any web page that displays data generated by an integration with the Mindbody Public API.

Logos should be smaller than the logo of the business the data refers to, and smaller than your logo if it is also visible on the page. Approved Mindbody logos can be found on the Branding Requirements page, accessible through your dashboard. Logos can be resized, but should otherwise be unedited.

SCA Regulatory Support

Strong Customer Authentication (SCA) is a new European regulatory requirement to reduce fraud and make online payments more secure. To accept payments and meet SCA requirements, CheckoutShoppingCart, PurchaseContract, and PurchaseGiftCard endpoints were updated to facilitate an SCA challenge. This only impacts EU customers who use the Public API to conduct consumer transactions using Stripe.

CheckoutShoppingCart endpoint

New optional request fields had been added:
ConsumerPresent
PaymentAuthenticationCallbackUrl
TransactionIDs

If any of the credit card payments are indicating an SCA challenge, then a second call into CheckoutShoppingCart is required where these challenged or pre-authorized credit card transactions will be needed to complete the process and capture the funds. These will be provided in the response from the first call to CheckoutShoppingCart along with AuthenticationUrls for any card authorizations that have an SCA challenge indicated. Note that if no SCA challenge is required, these will not be provided in the response and no second call into CheckoutShoppingCart is needed. Also note that this list may only contain 1 integer depending on whether your integration allows for multiple payments which is supported by the CheckoutShoppingCart endpoint.

New element Transactions has been added to the response object:
TransactionID
AuthenticationUrl

If no SCA challenge is indicated, none of this information is needed and it will not be returned, and no second call into CheckoutShoppingCart is needed. If provided at least one of the indicated transactions will have an AuthenticationUrl where the consumer will need to accept or decline the transaction, and upon doing so will be redirected to the PaymentAuthenticationCallbackUrl indicated in the request.

If your integration supports multiple credit card payments, there is a chance that more than one of them will have an SCA challenge indicated. It is up to your application to maintain this awareness and only make the second call into CheckoutShoppingCart when all the challenges have been addressed. Your integration will need to provide all these TransactionIDs in the second call back into CheckoutShoppingCart. Any TransactionResponse indicating only a TransactionID with no AuthenticationUrl, simply means that transaction has been preauthorized and has no SCA challenge indicated.

PurchaseContract / PurchaseGiftCard endpoints

New optional request fields had been added:
ConsumerPresent
PaymentAuthenticationCallbackUrl

New element PaymentProcessingFailures has been added to the response object:
Type
Message
AuthenticationRedirectUrl

Details below are for PurchaseContract endpoint, updates to the PurchaseGiftCard endpoint are similar.

If no SCA challenge is indicated, PurchaseContract.Status = Success, none of this information is needed and it will not be returned, and no second call into PurchaseContract is needed. If provided at least one of the indicated PaymentProcessingFailures, will have an AuthenticationRedirectUrl where the consumer will need to accept or decline the transaction, and upon doing so will be redirected to the PaymentAuthenticationCallbackUrl indicated in the request.

Because PurchaseContract leverages a shopping cart via the Mindbody Marketplace, no additional information needs to be passed back in the second call into PurchaseContract to finalize the order. Note: The cart will only remain valid for 15 minutes, after which time the cart is abandoned and any authorized credit card transactions will be voided.

Tutorials

Add a New Client

Step 2: Get required client fields request

curl -X GET \
  https://api.mindbodyonline.com/public/v6/client/requiredclientfields \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/requiredclientfields");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/requiredclientfields');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{SiteId}",
    }

conn.request("GET", "/public/v6/client/requiredclientfields", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/requiredclientfields")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Get required client fields response

{
    "RequiredClientFields": [
        "AddressLine1",
        "City",
        "State",
        "PostalCode",
        "BirthDate"
    ]
}

Step 3: Add client request:

curl -X POST \
  https://api.mindbodyonline.com/public/v6/client/addclient \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "FirstName": "John",
    "LastName": "Smith",
    "AddressLine1": "123 ABC Ct",
    "City": "San Luis Obispo",
    "State": "CA",
    "PostalCode": "93401",
    "BirthDate": "1990-01-01"
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/addclient");
var request = new RestRequest(Method.POST);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"FirstName\": \"John\",\n\t\"LastName\": \"Smith\",\n    \"AddressLine1\": \"123 ABC Ct\",\n    \"City\": \"San Luis Obispo\",\n    \"State\": \"CA\",\n    \"PostalCode\": \"93401\",\n    \"BirthDate\": \"1990-01-01\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/addclient');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "FirstName": "John",
    "LastName": "Smith",
    "AddressLine1": "123 ABC Ct",
    "City": "San Luis Obispo",
    "State": "CA",
    "PostalCode": "93401",
    "BirthDate": "1990-01-01"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"FirstName\": \"John\",\n\t\"LastName\": \"Smith\",\n    \"AddressLine1\": \"123 ABC Ct\",\n    \"City\": \"San Luis Obispo\",\n    \"State\": \"CA\",\n    \"PostalCode\": \"93401\",\n    \"BirthDate\": \"1990-01-01\"\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("POST", "/public/v6/client/addclient", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/addclient")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request.body = "{\n\t\"FirstName\": \"John\",\n\t\"LastName\": \"Smith\",\n    \"AddressLine1\": \"123 ABC Ct\",\n    \"City\": \"San Luis Obispo\",\n    \"State\": \"CA\",\n    \"PostalCode\": \"93401\",\n    \"BirthDate\": \"1990-01-01\"\n}"

response = http.request(request)
puts response.read_body

See the AddClient endpoint documentation for an example response.

Summary

Starting the week of May 11th, 2020 all versions of the Public API will no longer allow duplicate clients to be created. This applies to both adding a client and updating a client record. A duplicate client is created when two profiles have the same first name, last name and email.

If you have purchased an Ultimate tier then AddClient and UpdateClient endpoint will automatically start showing new opportunity on Sales Pipeline if lead criteria match.

This tutorial demonstrates how a staff member can add a new client to the business.

Workflow

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For examples and a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Client required fields determine the information that new clients need to provide so that a staff member can create a client account for a new client at a business. For example, the business owner may want to collect the client’s first and last names, email address, and phone number. Call the GetRequiredClientFields endpoint to retrieve the required fields.

    If GetRequiredClientFields returns EmergContact in the list of required fields, then all emergency contact parameters are required, which includes: EmergencyContactInfoEmail, EmergencyContactInfoName, EmergencyContactInfoPhone, and EmergencyContactInfoRelationship. If EmergContact is not in the list of required fielids, then none of the emergency contact parameters are required in this request.

  3. Call the AddClient endpoint to add the client, using the required fields that you obtained in Step 1.

    Setting Test to true allows you to test the request without affecting the database.

    A staff member with the Add client staff permission can bypass the required fields and add a new client using only first and last names.

  4. After the client has been added, you can call the SendPasswordResetEmail endpoint to set up a client’s account by passing in their email, first name, and last name. An email is then sent to the client with a link to create a password.

Book a Client into a Class

Step 3: Get today’s classes:

curl -X GET \
  https://api.mindbodyonline.com/public/v6/class/classes \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classes");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/classes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "/public/v6/class/classes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/classes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

See the GetClasses endpoint documentation for an example response.

Step 4: Add client to a class

curl -X POST \
  https://api.mindbodyonline.com/public/v6/class/addclienttoclass \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId": "{clientId}",
    "ClassId": {classId}
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/addclienttoclass");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"ClientId\": \"{clientId}\",\n\t\"ClassId\": {classId}\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/addclienttoclass');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId": "{clientId}",
    "ClassId": {classId}
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"ClientId\": \"{clientId}\",\n\t\"ClassId\": {classId}\n}"

headers = {endpoint documentation for an example response
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "/public/v6/class/addclienttoclass", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/addclienttoclass")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n\t\"ClientId\": \"{clientId}\",\n\t\"ClassId\": {classId}\n}"

response = http.request(request)
puts response.read_body

See the AddClientToClass endpoint documentation for an example response.

Summary

This tutorial demonstrates how a staff member can book a client into a class.

Workflow

  1. Get a user authentication token for the staff member by passing their login credentials to the authentication endpoint. For a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. If the client exists and you have their ID, continue to the next step.

    If the client does not exist, add the client, then store and use the returned Id property in Step 4.

  3. If you know which class the client wants to book, continue to the next step.

    If the client has not yet chosen a class, call the GetClasses endpoint and store the Id property of the class the client wants to book.

  4. Call the AddClientToClass endpoint and pass the stored client and class IDs. Note that all payment and booking restrictions are overridden because the booking is made by a staff member. Setting Test to true allows you to test the request without affecting the database.

Note: Virtual billings are tracked via the “ContentFormats” property, found in the program shared resource. Any class that is booked that contains values “Livestream:Mindbody” or “Livestream:Other”, will count as a virtual booking. Any bookings class that is booked under “InPerson” will count as an in-person booking. Please note that booking fees are incurred based on these settings. To help businesses correctly mark their classes as virtual or in-person, please reference the support article titled “Live stream: Setup, scheduling, and
pricing, ”
under the second section-“Setting up live stream classes.”

Remove a Client from a Class

Step 2: Get the client’s visits

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000203&endDate=2018-10-15T00:00:00' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000203&endDate=2018-10-15T00:00:00");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientvisits');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '100000203',
  'endDate' => '2018-10-15T00:00:00'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000203&endDate=2018-10-15T00:00:00")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "public/v6/client/clientvisits", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

See the GetClientVisits endpoint documentation for an example response.

Step 3: Remove the client from the class

curl -X POST \
  https://api.mindbodyonline.com/public/v6/class/removeclientfromclass \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId":"100000203",
    "ClassId":"7715",
    "Test":"true",
    "SendEmail":"false",
    "LateCancel":"false"
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/removeclientfromclass");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"ClientId\":\"100000203\",\n\t\"ClassId\":\"7715\",\n\t\"Test\":\"true\",\n\t\"SendEmail\":\"false\",\n\t\"LateCancel\":\"false\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/removeclientfromclass');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId":"100000203",
    "ClassId":"7715",
    "Test":"true",
    "SendEmail":"false",
    "LateCancel":"false"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"ClientId\":\"100000203\",\n\t\"ClassId\":\"7715\",\n\t\"Test\":\"true\",\n\t\"SendEmail\":\"false\",\n\t\"LateCancel\":\"false\"\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "public/v6/class/removeclientfromclass", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/removeclientfromclass")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n\t\"ClientId\":\"100000203\",\n\t\"ClassId\":\"7715\",\n\t\"Test\":\"true\",\n\t\"SendEmail\":\"false\",\n\t\"LateCancel\":\"false\"\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can remove a client from a class.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For examples and a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Use the GetClientVisits endpoint to retrieve the client’s schedule, including the classes and appointments in which the client is enrolled. In the request to this endpoint, pass the client ID from your application and an end date to filter the results. Note that the visit object in the response contains both a class ID and an appointment ID. The one that contains a non-zero number indicates which type of visit this is. That is, if the class ID is non-zero, then this is a class. If the appointment ID is non-zero, then this is an appointment. Make sure that the visit that is returned is a class.
  3. Use the RemoveClientFromClass endpoint to remove the client from the class with the class ID from step 2.

    Note that removing the client from the class can fail if staff members try to cancel outside the cancellation window. For example, a business may require that appointments be cancelled at least 24 hours before the scheduled time. If staff members try to cancel 12 hours in advance, they are not able to cancel. Instead, they have to use a late cancel. To late cancel, set LateCancel to true in the request.

Book an Appointment

Step 2: Get the locations

curl -X GET \
  https://api.mindbodyonline.com/public/v6/site/locations \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/site/locations");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/site/locations');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/site/locations", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/site/locations")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 3: Get the session types

curl -X GET \
  https://api.mindbodyonline.com/public/v6/site/sessiontypes \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/site/sessiontypes");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/site/sessiontypes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/site/sessiontypes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/site/sessiontypes")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 4: Get the bookable items

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/appointment/bookableitems?sessionTypeIds=2&locationIds=1' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/bookableitems?sessionTypeIds=2&locationIds=1");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/bookableitems');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'sessionTypeIds' => '2',
  'locationIds' => '1'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "public/v6/appointment/bookableitems", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/appointment/bookableitems?sessionTypeIds=2&locationIds=1")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 5: Get the client services

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=100000527&sessionTypeIds=2' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=100000527&sessionTypeIds=2");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientservices');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '100000527',
  'sessionTypeIds' => '2'
));

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/client/clientservices", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=100000527&sessionTypeIds=2")

http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 6: Add the appointment

curl -X POST \
  https://api.mindbodyonline.com/public/v6/appointment/addappointment \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "StartDateTime": "2018-10-16T15:00:00",
    "LocationId": 1,
    "StaffId": 22,
    "ClientId": "100000934",
    "SessionTypeId": 2,
    "ClientServiceId": 86602,
    "ApplyPayment": true,
    "IgnoreDefaultSessionLength": false,
    "SendEmail": false,
    "Test": false
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/addappointment");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n\t\"StartDateTime\": \"2018-10-16T15:00:00\",\r\n\t\"LocationId\": 1,\r\n\t\"StaffId\": 22,\r\n\t\"ClientId\": \"100000934\",\r\n\t\"SessionTypeId\": 2,\r\n\t\"ClientServiceId\": 86602,\r\n\t\"ApplyPayment\": true,\r\n\t\"IgnoreDefaultSessionLength\": false,\r\n\t\"SendEmail\": false,\r\n\t\"Test\": false\r\n}\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/addappointment');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "StartDateTime": "2018-10-16T15:00:00",
    "LocationId": 1,
    "StaffId": 22,
    "ClientId": "100000934",
    "SessionTypeId": 2,
    "ClientServiceId": 86602,
    "ApplyPayment": true,
    "IgnoreDefaultSessionLength": false,
    "SendEmail": false,
    "Test": false
}
');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n\t\"StartDateTime\": \"2018-10-16T15:00:00\",\r\n\t\"LocationId\": 1,\r\n\t\"StaffId\": 22,\r\n\t\"ClientId\": \"100000934\",\r\n\t\"SessionTypeId\": 2,\r\n\t\"ClientServiceId\": 86602,\r\n\t\"ApplyPayment\": true,\r\n\t\"IgnoreDefaultSessionLength\": false,\r\n\t\"SendEmail\": false,\r\n\t\"Test\": false\r\n}\r\n"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "public/v6/appointment/addappointment", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/appointment/addappointment")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\r\n\t\"StartDateTime\": \"2018-10-16T15:00:00\",\r\n\t\"LocationId\": 1,\r\n\t\"StaffId\": 22,\r\n\t\"ClientId\": \"100000934\",\r\n\t\"SessionTypeId\": 2,\r\n\t\"ClientServiceId\": 86602,\r\n\t\"ApplyPayment\": true,\r\n\t\"IgnoreDefaultSessionLength\": false,\r\n\t\"SendEmail\": false,\r\n\t\"Test\": false\r\n}\r\n"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can book an appointment for a client.

To book an appointment, follow these steps:

  • Get a user authentication token for the staff member.
  • Get a location ID.
  • Get a session type ID.
  • Retrieve bookable items that contain the information needed to book the appointment.
  • Optionally, you can get the client service ID.
  • Book the appointment.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing their login credentials to the authentication endpoint. For a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. The GetLocations endpoint allows you to retrieve business locations. Each location object that returns has a location ID. At this point, the staff member may choose a location for the appointment. See the GetLocations endpoint for an example response.
  3. Use the GetSessionTypes endpoint to retrieve session types. Each SessionType object that returns has an ID. You need the session type ID for the appointment that the client wants to book. For additional information and to customize your results, see the GetSessionTypes endpoint.
  4. Before you can book an appointment, you need to get the bookable items. In this case, the bookable items are the staff and appointment availability information. Use the GetBookableItems endpoint to retrieve this information.

    Use the session type IDs from Step 3 and a location ID from Step 2 as the parameters for the request. Each Availability object that returns contains a Staff object, a SessionType object, a start date and time, and a Location object. See the GetBookableItems endpoint for an example response.
  5. Optionally, you can use GetClientServices endpoint to obtain services that can pay for the class by specifying the session type ID from Step 4 and the client ID from your application.
  6. Use the information gathered in the previous steps to book the appointment with the AddAppointment endpoint. See the AddAppointment endpoint for an example response. Setting Test to true allows you to test the request without affecting the database.

Note: Virtual billings are tracked via the “ContentFormats” property, found in the program shared resource. Any class that is booked that contains values “Livestream:Mindbody” or “Livestream:Other”, will count as a virtual booking. Any bookings class that is booked under “InPerson” will count as an in-person booking. Please note that booking fees are incurred based on these settings. To help businesses correctly mark their classes as virtual or in-person, please reference the support article titled “Live stream: Setup, scheduling, and
pricing, ”
under the second section-“Setting up live stream classes.”

Cancel an Appointment

Step 2: Get a client’s visits

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000062&endDate=2018-10-17' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000062&endDate=2018-10-17");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientvisits');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '100000062',
  'endDate' => '2018-10-17'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "/public/v6/client/clientvisits?clientId=100000062&endDate=2018-10-17", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=100000062&endDate=2018-10-17")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 3: Cancel a booked appointment

curl -X POST \
  https://api.mindbodyonline.com/public/v6/appointment/updateappointment \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
  -d '{
    "AppointmentId": 45587,
    "Execute": "cancel"
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/updateappointment");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"AppointmentId\": 45587,\n\t\"Execute\": \"cancel\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/updateappointment');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "AppointmentId": 45587,
    "Execute": "cancel"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"AppointmentId\": 45587,\n\t\"Execute\": \"cancel\"\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "/public/v6/appointment/updateappointment", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/appointment/updateappointment")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n\t\"AppointmentId\": 45587,\n\t\"Execute\": \"cancel\"\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can cancel an appointment for a client.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the staff member’s login credentials to the authentication endpoint. For a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Use the GetClientVisits endpoint to retrieve the client’s schedule, including the appointments and classes in which the client is enrolled. In the request to this endpoint, pass the client ID from your application and an end date to filter the results. Note that the visit object in the response contains both a class ID and an appointment ID. The one that contains a non-zero number indicates which type of visit this is. That is, if the class ID is non-zero, then this is a class. If the appointment ID is non-zero, then this is a appointment. Make sure that the visit that is returned is an appointment.
  3. Use the UpdateAppointment endpoint to cancel the appointment with the appointment ID from step 2. Set Execute to cancel in the request.

    Note that the cancellation may fail if the staff member tries to cancel the appointment outside the cancellation window. For example, a business may require appointments to be cancelled at least 24 hours before the scheduled time. If staff members try to cancel 12 hours in advance, they are not able to cancel. Instead, they have to use a late cancel. For a late cancel, set Execute to latecancel instead of cancel in the request.

Purchase a Class Pass

Step 2: Get today’s classes

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/class/classes' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classes");
var request = new RestRequest(Method.GET);
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Authorization", "{staffAuthToken}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/classes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Api-Key' => '{yourApiKey}',
  'SiteId' => '{yourSiteId}',
  'Authorization' => '{staffAuthToken}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Authorization': "{staffAuthToken}",
    'SiteId': "{yourSiteId}",
    'Api-Key': "{yourApiKey}"
    }

conn.request("GET", "/public/v6/class/classes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/classes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = '{staffAuthToken}'
request["SiteId"] = '{yourSiteId}'
request["Api-Key"] = '{yourApiKey}'

response = http.request(request)
puts response.read_body

Step 3: Find services that pay for the selected class

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/sale/services?classId=929' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}'
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/services?classId=929");
var request = new RestRequest(Method.GET);
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Authorization", "{staffAuthToken}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/services');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'classId' => '929'
));

$request->setHeaders(array(
  'Api-Key' => '{yourApiKey}',
  'SiteId' => '{yourSiteId}',
  'Authorization' => '{staffAuthToken}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Authorization': "{staffAuthToken}",
    'SiteId': "{yourSiteId}",
    'Api-Key': "{yourApiKey}"
    }

conn.request("GET", "/public/v6/sale/services?classId=929", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/services?classId=929")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Authorization"] = '{staffAuthToken}'
request["SiteId"] = '{yourSiteId}'
request["Api-Key"] = '{yourApiKey}'

response = http.request(request)
puts response.read_body

Step 4: Purchase the service

curl -X POST \
  'https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart' \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId" : "100000556",
    "Test" : false,
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "Comp",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId" : "100000556",
    "Test" : false,
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "Comp",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "/public/v6/sale/checkoutshoppingcart", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can purchase a class pass for a client. Note that the client must be able to pay with a stored credit card, account balance, or gift card.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the staff member’s login credentials to the authentication endpoint. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.

    For a description of the user authentication process, see User Tokens.

  2. Use the GetClasses endpoint to retrieve today’s classes. Each class object that returns contains a class ID.

  3. Pass the chosen class ID to the GetServices endpoint to retrieve all services that can pay for that class. Each service object that returns contains a service ID.

  4. Pass the client ID and service ID to the CheckoutShoppingCart endpoint to purchase the service. Use the client ID from your own application and the service ID from step 3. You can set Test to true to test the request without affecting the database.

Purchase an Appointment Pass

Step 2: Get locations

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/site/locations' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/site/locations");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/site/locations');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "/public/v6/site/locations", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/site/locations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 3: Get session types

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/site/sessiontypes' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/site/sessiontypes");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/site/sessiontypes');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "/public/v6/site/sessiontypes", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/site/sessiontypes")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 4: Get services for a specific session type

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/sale/services?sessionTypeId=34' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/services?sessionTypeId=34");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/services');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'sessionTypeId' => '34'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "/public/v6/sale/services?sessionTypeId=34", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/services?sessionTypeId=34")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 5: Purchase a service that will pay for a session type

curl -X POST \
  'https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart' \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId" : "100000556",
    "Test" : false,
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "Comp",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId" : "100000556",
    "Test" : false,
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "Comp",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Iey': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "/public/v6/sale/checkoutshoppingcart", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\r\n\t\"ClientId\" : \"100000556\",\r\n\t\"Test\" : false,\r\n\t\"LocationId\" : 1,\r\n\t\"Items\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Item\":{\r\n\t\t\t\t\"Type\": \"Service\",\r\n\t\t\t\t\"Metadata\":{\r\n\t\t\t\t\t\"Id\": 10114\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t\"DiscountAmount\" : 0,\r\n\t\t\t\"Quantity\" : 1\r\n\t\t}\r\n\t],\r\n\t\"Payments\" : \r\n\t[\r\n\t\t{\r\n\t\t\t\"Type\": \"Comp\",\r\n\t\t\t\"Metadata\":{\r\n\t\t\t\t\"Amount\" : 75\r\n\t\t\t}\r\n\t\t}\r\n\t]\r\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can purchase an appointment pass for a client. The client must be able to pay with a stored credit card, account balance, or gift card.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the staff member’s login credentials to the authentication endpoint. For a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Use the GetLocations endpoint to retrieve business locations. Each location object that returns has a location ID.
  3. Use the GetSessionTypes endpoint to retrieve session types. Each session type object that returns has an ID. You need the session type ID of the appointment that the client wants to purchase a pass for.
  4. Use the GetServices endpoint, which lists services based on the session type, to get a service ID. Use the session type ID from Step 3 to find services that pay for that session type.
  5. Use the CheckoutShoppingCart endpoint to check out and purchase the service. You need to provide the service ID from Step 4 and the client ID from your own application. You can set Test to true to test the request without affecting the database.

    The Amount under PaymentInfo must match the shopping cart total for the payment to go through. We do not recommend calculating the total amount yourself. Instead, obtain the total for the entire cart first, and then use that as the total amount. For more information, see the Get Shopping Cart Total tutorial.

Purchase a Product Online

Step 2: Get the products

curl -X GET \
  https://api.mindbodyonline.com/public/v6/sale/products \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/products");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/products');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/sale/products", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/products")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 3: Purchase the product using CheckoutShoppingCart

curl -X POST \
  https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
  "ClientId": "100000701",
  "Test": false,
  "Items": [
    {
      "Item": {
        "Type": "Product",
        "Metadata": {
          "Id" : "3"
        }
      },
      "Quantity": 1
    }
  ],
  "InStore": true,
  "CalculateTax": true,
  "Payments": [
    {
      "Type": "CreditCard",
      "Metadata": {
        "Amount":10,
        "CreditCardNumber":"4111111111111111",
        "ExpMonth": 12,
        "ExpYear" : 2021,
        "Cvv": "323",
        "BillingName":"John Doe",
        "BillingAddress": "1234 Brad Street",
        "BillingCity" : "San Luis Obispo",
        "BillingState" : "CA",
        "BillingPostalCode": "93405",
        "SaveInfo": true
      }
    }
  ],
  "SendEmail": true,
  "LocationId": 1
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n  \"ClientId\": \"100000701\",\r\n  \"Test\": false,\r\n  \"Items\": [\r\n    {\r\n      \"Item\": {\r\n        \"Type\": \"Product\",\r\n        \"Metadata\": {\r\n          \"Id\" : \"3\"\r\n        }\r\n      },\r\n      \"Quantity\": 1\r\n    }\r\n  ],\r\n  \"InStore\": true,\r\n  \"Payments\": [\r\n    {\r\n      \"Type\": \"CreditCard\",\r\n      \"Metadata\": {\r\n      \t\"Amount\":10,\r\n      \t\"CreditCardNumber\":\"4111111111111111\",\r\n      \t\"ExpMonth\": 12,\r\n      \t\"ExpYear\" : 2021,\r\n      \t\"Cvv\": \"323\",\r\n      \t\"BillingName\":\"John Doe\",\r\n      \t\"BillingAddress\": \"1234 Brad Street\",\r\n      \t\"BillingCity\" : \"San Luis Obispo\",\r\n      \t\"BillingState\" : \"CA\",\r\n      \t\"BillingPostalCode\": \"93405\",\r\n      \t\"SaveInfo\": true\r\n      }\r\n    }\r\n  ],\r\n  \"SendEmail\": true,\r\n  \"LocationId\": 1\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
  "ClientId": "100000701",
  "Test": false,
  "Items": [
    {
      "Item": {
        "Type": "Product",
        "Metadata": {
          "Id" : "3"
        }
      },
      "Quantity": 1
    }
  ],
  "InStore": true,
  "Payments": [
    {
      "Type": "CreditCard",
      "Metadata": {
        "Amount":10,
        "CreditCardNumber":"4111111111111111",
        "ExpMonth": 12,
        "ExpYear" : 2021,
        "Cvv": "323",
        "BillingName":"John Doe",
        "BillingAddress": "1234 Brad Street",
        "BillingCity" : "San Luis Obispo",
        "BillingState" : "CA",
        "BillingPostalCode": "93405",
        "SaveInfo": true
      }
    }
  ],
  "SendEmail": true,
  "LocationId": 1
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n  \"ClientId\": \"100000701\",\r\n  \"Test\": false,\r\n  \"Items\": [\r\n    {\r\n      \"Item\": {\r\n        \"Type\": \"Product\",\r\n        \"Metadata\": {\r\n          \"Id\" : \"3\"\r\n        }\r\n      },\r\n      \"Quantity\": 1\r\n    }\r\n  ],\r\n  \"InStore\": true,\r\n  \"Payments\": [\r\n    {\r\n      \"Type\": \"CreditCard\",\r\n      \"Metadata\": {\r\n      \t\"Amount\":10,\r\n      \t\"CreditCardNumber\":\"4111111111111111\",\r\n      \t\"ExpMonth\": 12,\r\n      \t\"ExpYear\" : 2021,\r\n      \t\"Cvv\": \"323\",\r\n      \t\"BillingName\":\"John Doe\",\r\n      \t\"BillingAddress\": \"1234 Brad Street\",\r\n      \t\"BillingCity\" : \"San Luis Obispo\",\r\n      \t\"BillingState\" : \"CA\",\r\n      \t\"BillingPostalCode\": \"93405\",\r\n      \t\"SaveInfo\": true\r\n      }\r\n    }\r\n  ],\r\n  \"SendEmail\": true,\r\n  \"LocationId\": 1\r\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "public/v6/sale/checkoutshoppingcart", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\r\n  \"ClientId\": \"100000701\",\r\n  \"Test\": false,\r\n  \"Items\": [\r\n    {\r\n      \"Item\": {\r\n        \"Type\": \"Product\",\r\n        \"Metadata\": {\r\n          \"Id\" : \"3\"\r\n        }\r\n      },\r\n      \"Quantity\": 1\r\n    }\r\n  ],\r\n  \"InStore\": true,\r\n  \"Payments\": [\r\n    {\r\n      \"Type\": \"CreditCard\",\r\n      \"Metadata\": {\r\n      \t\"Amount\":10,\r\n      \t\"CreditCardNumber\":\"4111111111111111\",\r\n      \t\"ExpMonth\": 12,\r\n      \t\"ExpYear\" : 2021,\r\n      \t\"Cvv\": \"323\",\r\n      \t\"BillingName\":\"John Doe\",\r\n      \t\"BillingAddress\": \"1234 Brad Street\",\r\n      \t\"BillingCity\" : \"San Luis Obispo\",\r\n      \t\"BillingState\" : \"CA\",\r\n      \t\"BillingPostalCode\": \"93405\",\r\n      \t\"SaveInfo\": true\r\n      }\r\n    }\r\n  ],\r\n  \"SendEmail\": true,\r\n  \"LocationId\": 1\r\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can purchase a product for a client.

Workflow

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For examples and a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Use the GetProducts endpoint to retrieve the list of products. Each product object that returns contains an ID.
  3. Use CheckoutShoppingCart to check out. Use the client ID from your own application and the product IDs from Step 2. The Amount under PaymentInfo must match the shopping cart total for the payment to go through. We do not recommend calculating the total amount yourself. Instead, obtain the total for the entire cart first, and then use that as the total amount. Setting Test to true allows you to test the request without affecting the database.

    For more information, see the Get Shopping Cart Total tutorial.

Get Shopping Cart Total

Step 3: CheckoutShoppingCart example request with multiple items

curl -X POST \
  https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
  "ClientId": "100000123",
  "Test": true,
  "LocationId": 1,
  "InStore": true,
  "CalculateTax": true,
  "Items": [
     {
      "Item": {
        "Type": "Product",
        "Metadata": {
          "Id": "5104"
        }
      },
      "DiscountAmount": 0,
      "Quantity": 1
    },
    {
      "Item": {
        "Type": "Service",
        "Metadata": {
          "Id": 5101
        }
      },
      "DiscountAmount": 0,
      "Quantity": 1
    }
  ],
  "Payments": [
    {
      "Type": "CreditCard",
      "Metadata": {
        "Amount": 10,
        "CreditCardNumber":"4111111111111111",
        "ExpMonth": 12,
        "ExpYear" : 2021,
        "Cvv": "323",
        "BillingName":"Bob Jones",
        "BillingAddress": "4051 Broad Street",
        "BillingCity" : "San Luis Obispo",
        "BillingState" : "CA",
        "BillingPostalCode": "93405",
        "SaveInfo": true
      }
    }
  ]
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n  \"ClientId\": \"100000123\",\n  \"Test\": true,\n  \"LocationId\": 1,\n  \"InStore\": true,\n  \"Items\": [\n     {\n      \"Item\": {\n        \"Type\": \"Product\",\n        \"Metadata\": {\n          \"Id\": \"5104\"\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    },\n    {\n      \"Item\": {\n        \"Type\": \"Service\",\n        \"Metadata\": {\n          \"Id\": 5101\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    }\n  ],\n  \"Payments\": [\n    {\n      \"Type\": \"CreditCard\",\n      \"Metadata\": {\n      \t\"Amount\": 10,\n      \t\"CreditCardNumber\":\"4111111111111111\",\n      \t\"ExpMonth\": 12,\n      \t\"ExpYear\" : 2021,\n      \t\"Cvv\": \"323\",\n      \t\"BillingName\":\"Bob Jones\",\n      \t\"BillingAddress\": \"4051 Broad Street\",\n      \t\"BillingCity\" : \"San Luis Obispo\",\n      \t\"BillingState\" : \"CA\",\n      \t\"BillingPostalCode\": \"93405\",\n      \t\"SaveInfo\": true\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}',
  'Content-Type' => 'application/json'
));

$request->setBody('{
  "ClientId": "100000123",
  "Test": true,
  "LocationId": 1,
  "InStore": true,
  "Items": [
     {
      "Item": {
        "Type": "Product",
        "Metadata": {
          "Id": "5104"
        }
      },
      "DiscountAmount": 0,
      "Quantity": 1
    },
    {
      "Item": {
        "Type": "Service",
        "Metadata": {
          "Id": 5101
        }
      },
      "DiscountAmount": 0,
      "Quantity": 1
    }
  ],
  "Payments": [
    {
      "Type": "CreditCard",
      "Metadata": {
        "Amount": 10,
        "CreditCardNumber":"4111111111111111",
        "ExpMonth": 12,
        "ExpYear" : 2021,
        "Cvv": "323",
        "BillingName":"Bob Jones",
        "BillingAddress": "4051 Broad Street",
        "BillingCity" : "San Luis Obispo",
        "BillingState" : "CA",
        "BillingPostalCode": "93405",
        "SaveInfo": true
      }
    }
  ]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n  \"ClientId\": \"100000123\",\n  \"Test\": true,\n  \"LocationId\": 1,\n  \"InStore\": true,\n  \"Items\": [\n     {\n      \"Item\": {\n        \"Type\": \"Product\",\n        \"Metadata\": {\n          \"Id\": \"5104\"\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    },\n    {\n      \"Item\": {\n        \"Type\": \"Service\",\n        \"Metadata\": {\n          \"Id\": 5101\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    }\n  ],\n  \"Payments\": [\n    {\n      \"Type\": \"CreditCard\",\n      \"Metadata\": {\n      \t\"Amount\": 10,\n      \t\"CreditCardNumber\":\"4111111111111111\",\n      \t\"ExpMonth\": 12,\n      \t\"ExpYear\" : 2021,\n      \t\"Cvv\": \"323\",\n      \t\"BillingName\":\"Bob Jones\",\n      \t\"BillingAddress\": \"4051 Broad Street\",\n      \t\"BillingCity\" : \"San Luis Obispo\",\n      \t\"BillingState\" : \"CA\",\n      \t\"BillingPostalCode\": \"93405\",\n      \t\"SaveInfo\": true\n      }\n    }\n  ]\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "public/v6/sale/checkoutshoppingcart", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n  \"ClientId\": \"100000123\",\n  \"Test\": true,\n  \"LocationId\": 1,\n  \"InStore\": true,\n  \"Items\": [\n     {\n      \"Item\": {\n        \"Type\": \"Product\",\n        \"Metadata\": {\n          \"Id\": \"5104\"\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    },\n    {\n      \"Item\": {\n        \"Type\": \"Service\",\n        \"Metadata\": {\n          \"Id\": 5101\n        }\n      },\n      \"DiscountAmount\": 0,\n      \"Quantity\": 1\n    }\n  ],\n  \"Payments\": [\n    {\n      \"Type\": \"CreditCard\",\n      \"Metadata\": {\n      \t\"Amount\": 10,\n      \t\"CreditCardNumber\":\"4111111111111111\",\n      \t\"ExpMonth\": 12,\n      \t\"ExpYear\" : 2021,\n      \t\"Cvv\": \"323\",\n      \t\"BillingName\":\"Bob Jones\",\n      \t\"BillingAddress\": \"4051 Broad Street\",\n      \t\"BillingCity\" : \"San Luis Obispo\",\n      \t\"BillingState\" : \"CA\",\n      \t\"BillingPostalCode\": \"93405\",\n      \t\"SaveInfo\": true\n      }\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body

Step 4: CheckoutShoppingCart example response with the calculated cart total

{
    "ShoppingCart": {
        "Id": "1ba90250-5b7d-4af8-86d6-4d4fc30359c0",
        "CartItems": [
            {
                "Item": {
                    "Id": "3046",
                    "GroupId": 5104,
                    "Name": "Water Bottle",
                    "OnlinePrice": 5,
                    "ShortDesc": "Small water bottle",
                    "LongDesc": "",
                    "Size": {
                        "Id": 1,
                        "Name": "Small"
                    },
                    "Price": 5,
                    "TaxIncluded": 0,
                    "TaxRate": 0
                },
                "DiscountAmount": 0,
                "VisitIds": [],
                "AppointmentIds": [],
                "Appointments": [],
                "Id": 1,
                "Quantity": 1
            },
            {
                "Item": {
                    "Id": null,
                    "Name": "Yoga Pass",
                    "Count": 1,
                    "OnlinePrice": 5,
                    "Price": 5,
                    "TaxRate": 0,
                    "ProductId": "5101",
                    "ProgramId": 41,
                    "TaxIncluded": 0
                },
                "DiscountAmount": 0,
                "VisitIds": [],
                "AppointmentIds": [],
                "Appointments": [],
                "Id": 2,
                "Quantity": 1
            }
        ],
        "SubTotal": 10,
        "DiscountTotal": 0,
        "TaxTotal": 0,
        "GrandTotal": 10
    },
    "Classes": [],
    "Appointments": [],
    "Enrollments": []
}

Summary

This tutorial demonstrates how a staff member can get the total for a shopping cart.

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For examples and a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. Find the product IDs that you need by using a combination of calls to the following endpoints to obtain the items that the client wants to purchase:
  3. Pass the checkout request you have constructed to the CheckoutShoppingCart endpoint using that information. See the tutorial example request on the right to see how to construct a cart that contains each of the item types that you need.
  4. Once you have constructed the cart, make a test call using the POST CheckoutShoppingCart endpoint by setting both InStore and Test to true. The response shows the cart total that Mindbody has calculated.

Purchase a Contract

Step 2: Get the client’s existing contract

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientcontracts?clientId=100000527' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' 
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientcontracts?clientId=100000527");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientcontracts');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '100000527'
));

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/client/clientcontracts", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientcontracts?clientId=100000527")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 3: Get the locations

curl -X GET \
  https://api.mindbodyonline.com/public/v6/site/locations \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/site/locations");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/site/locations');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/site/locations", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/site/locations")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

Step 4: Get the contracts

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/sale/contracts?contractIds=3' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' 
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/contracts?contractIds=3");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/contracts');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'contractIds' => '3'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "public/v6/sale/contracts", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/contracts?contractIds=3")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 5: Purchase the contract

curl -X POST \
  https://api.mindbodyonline.com/public/v6/sale/purchasecontract \
  -H 'Content-Type: application/json' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "Test": false,
    "LocationId": 1,
    "ClientId": "100000527",
    "ContractID": "3",
    "FirstPaymentOccurs": "Instant",
    "CreditCardInfo":{
        "CreditCardNumber": "4111111111111111",
        "ExpMonth": "12",
        "ExpYear": "2019",
        "BillingName": "John Doe",
        "BillingAddress": "123 Lake Dr",
        "BillingCity": "San Luis Obispo",
        "BillingState": "CA",
        "BillingPostalCode": "93405"
    }
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/purchasecontract");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"Test\": false,\n\t\"LocationId\": 1,\n\t\"ClientId\": \"100000527\",\n\t\"ContractID\": \"3\",\n\t\"FirstPaymentOccurs\": \"Instant\",\n\t\"CreditCardInfo\":{\n\t\t\"CreditCardNumber\": \"4111111111111111\",\n\t\t\"ExpMonth\": \"12\",\n\t\t\"ExpYear\": \"2019\",\n\t\t\"BillingName\": \"John Doe\",\n\t\t\"BillingAddress\": \"123 Lake Dr\",\n\t\t\"BillingCity\": \"San Luis Obispo\",\n\t\t\"BillingState\": \"CA\",\n\t\t\"BillingPostalCode\": \"93405\"\n\t}\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/purchasecontract');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "Test": false,
    "LocationId": 1,
    "ClientId": "100000527",
    "ContractID": "3",
    "FirstPaymentOccurs": "Instant",
    "CreditCardInfo":{
        "CreditCardNumber": "4111111111111111",
        "ExpMonth": "12",
        "ExpYear": "2019",
        "BillingName": "John Doe",
        "BillingAddress": "123 Lake Dr",
        "BillingCity": "San Luis Obispo",
        "BillingState": "CA",
        "BillingPostalCode": "93405"
    }
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"Test\": false,\n\t\"LocationId\": 1,\n\t\"ClientId\": \"100000527\",\n\t\"ContractID\": \"3\",\n\t\"FirstPaymentOccurs\": \"Instant\",\n\t\"CreditCardInfo\":{\n\t\t\"CreditCardNumber\": \"4111111111111111\",\n\t\t\"ExpMonth\": \"12\",\n\t\t\"ExpYear\": \"2019\",\n\t\t\"BillingName\": \"John Doe\",\n\t\t\"BillingAddress\": \"123 Lake Dr\",\n\t\t\"BillingCity\": \"San Luis Obispo\",\n\t\t\"BillingState\": \"CA\",\n\t\t\"BillingPostalCode\": \"93405\"\n\t}\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("POST", "public/v6/sale/purchasecontract", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/purchasecontract")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n\t\"Test\": false,\n\t\"LocationId\": 1,\n\t\"ClientId\": \"100000527\",\n\t\"ContractID\": \"3\",\n\t\"FirstPaymentOccurs\": \"Instant\",\n\t\"CreditCardInfo\":{\n\t\t\"CreditCardNumber\": \"4111111111111111\",\n\t\t\"ExpMonth\": \"12\",\n\t\t\"ExpYear\": \"2019\",\n\t\t\"BillingName\": \"John Doe\",\n\t\t\"BillingAddress\": \"123 Lake Dr\",\n\t\t\"BillingCity\": \"San Luis Obispo\",\n\t\t\"BillingState\": \"CA\",\n\t\t\"BillingPostalCode\": \"93405\"\n\t}\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how a staff member can purchase a contract for a client.

Workflow

To perform this workflow:

  • The business must have created the contract.
  • You must know the location ID, client ID, and contract ID that you want to use.
  • The client must be able to pay with either a new credit card or stored credit card.

Note that you need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.

    For a description of the user authentication process, see User Tokens.

  2. Use the GetClientContracts endpoint to get the client’s existing contract information.
  3. Use the GetLocations endpoint to get the location ID.
  4. Use the GetContracts endpoint to get the contract ID the client would like to purchase.
  5. Use the PurchaseContract endpoint to purchase the contract using the information above.

Cross-Regional Class Bookings

Step 2: GET CrossRegionalClientAssociations

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/crossregionalclientassociations?clientId=123' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' 
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/crossregionalclientassociations?clientId=123");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/crossregionalclientassociations');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
    'clientId' => '123'
));

$request->setHeaders(array(
    'SiteId' => '{yourSiteId}',
    'Api-Key' => '{yourApiKey}',
    'Authorization' => '{staffAuthToken}',
    'Content-Type' => 'application/json'
));

try {
    $response = $request->send();

    echo $response->getBody();
} catch (HttpException $ex) {
    echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = ""

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'Authorization': "{stafAuthToken}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/client/crossregionalclientAssociations", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/crossregionalclientassociations?clientId=123")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 4: GET ClientServices

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=123&crossRegionalLookup=true' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' 
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=123&crossRegionalLookup=true");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientservices');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '123',
  'crossRegionalLookup' => 'true'
));

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}',
  'Authorization' => '{staffAuthToken}',
  'Content-Type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = ""

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'Authorization': "{staffAuthToken}",
    'SiteId': "{yourSiteId}"
    }

conn.request("GET", "public/v6/client/clientservices", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientservices?clientId=123&crossRegionalLookup=true")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Step 5: AddClientToClass

curl -X POST \
  https://api.mindbodyonline.com/public/v6/class/addclienttoclass \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId": "123",
    "ClassId": 1206,
    "ClientServiceId": 4456,
    "CrossRegionalBooking": true,
    "CrossRegionalBookingClientServiceSiteId": 1234
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/addclienttoclass");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\n\t\"ClientId\": \"123\",\n\t\"ClassId\": 1206,\n\t\"ClientServiceId\": 4456,\n\t\"CrossRegionalBooking\": true,\n\t\"CrossRegionalBookingClientServiceSiteId\": 1234\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/class/addclienttoclass');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Authorization' => '{staffAuthToken}',
  'Api-Key' => '{yourApiKey}'
));

$request->setBody('{
    "ClientId": "123",
    "ClassId": 1206,
    "ClientServiceId": 4456,
    "CrossRegionalBooking": true,
    "CrossRegionalBookingClientServiceSiteId": 1234
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n\t\"ClientId\": \"123\",\n\t\"ClassId\": 1206,\n\t\"ClientServiceId\": 4456,\n\t\"CrossRegionalBooking\": true,\n\t\"CrossRegionalBookingClientServiceSiteId\": 1234\n}"

headers = {
    'Api-Key': "{yourApiKey}",
    'Authorization': "{staffAuthToken}",
    'SiteId': "{yourSiteId}"
    }

conn.request("POST", "public/v6/class/addclienttoclass", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/class/addclienttoclass")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request.body = "{\n\t\"ClientId\": \"123\",\n\t\"ClassId\": 1206,\n\t\"ClientServiceId\": 4456,\n\t\"CrossRegionalBooking\": true,\n\t\"CrossRegionalBookingClientServiceSiteId\": 1234\n}"

response = http.request(request)
puts response.read_body

Step 6: GET ClientVisits

curl -X GET \
  'https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=123&crossRegionalLookup=true' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' 
var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=123&crossRegionalLookup=true");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/client/clientvisits');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'clientId' => '123',
  'crossRegionalLookup' => 'true'
));

$request->setHeaders(array(
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}',
  'Content-Type' => 'application/json'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = ""

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}"
    }

conn.request("GET", "public/v6/client/clientvisits", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/client/clientvisits?clientId=123&crossRegionalLookup=true")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'

response = http.request(request)
puts response.read_body

Example GET ClientVisits response

{
    "PaginationResponse": {
        "RequestedLimit": 100,
        "RequestedOffset": 0,
        "PageSize": 22,
        "TotalResults": 22
    },
    "Visits": [
        {
            "AppointmentId": 0,
            "AppointmentGenderPreference": "None",
            "AppointmentStatus": "None",
            "ClassId": 1206,
            "ClientId": "123",
            "StartDateTime": "2019-04-26T07:00:00",
            "EndDateTime": "2019-04-26T08:00:00",
            "Id": 90982,
            "LastModifiedDateTime": "0001-01-01T00:00:00Z",
            "LateCancelled": false,
            "LocationId": 1,
            "MakeUp": false,
            "Name": "Cross Region Visit",
            "ServiceId": 4456,
            "SignedIn": true,
            "StaffId": 1467,
            "WebSignup": false,
            "Action": "None"
        }
    ]
}

Summary

This tutorial demonstrates how a client can book a class at one site using a client pricing option from another site. Both sites must belong to the same organization.

Workflow

You need to determine the client ID from your own application, as the Mindbody Public API does not validate client logins.

Note that all Cross-Regional functionality in the Mindbody Public API returns only the first ten sites. If a user belongs to more than ten sites, you can use the ClientAssociatedSitesOffset parameter to scan through additional sites.

  1. Get a user authentication token for the staff member by passing the login credentials to the authentication endpoint. For examples and a description of the user authentication process, see User Tokens. For all following steps, put the token that you receive into the Authorization header formatted as Bearer {authToken}.

  2. Clients may belong to multiple sites where they may have pricing options that they could use for the booking. Use the GET CrossRegionalClientAssociations endpoint, specifying the ClientId (RSSID) of the client who wants to book the class, to obtain the site IDs of the client’s cross regional associations. See GET CrossRegionalClientAssociations for an example response.
  3. If the client does not have an existing pricing option from a site in a region different from the class, then you can look at the Purchase a Class Pass tutorial to see how to purchase a new pricing option using CheckoutShoppingCart. Otherwise, proceed to the next step.
  4. Optionally, you can call the GET ClientServices endpoint and set CrossRegionalLookup to true to obtain the Id of the pricing option to be used to pay for the class. If the user belongs to more than ten sites, you can make multiple calls to ClientAssociatedSitesOffset, using a different value for each call, to scan through all the sites. See GET ClientServices for an example response.
  5. Call the AddClientToClass endpoint, setting CrossRegionalBooking to true, and setting CrossRegionalBookingClientServiceSiteId to the site ID that you obtained in Step 2. Note that you must supply a CrossRegionalBookingClientServiceSiteId when CrossRegionalBooking is set to true. You can optionally supply the ClientServiceId, which is the Id that you obtained in Step 4, to specify the pricing option to use. If no ClientServiceId is provided, an applicable pricing option from the cross-regional site is used. See AddClientToClass for an example response.
  6. You can retrieve a client’s visits across multiple sites using GET ClientVisits with CrossRegionalLookup set to true.

How to Set Up Direct Debit and Check Out

Step 5: Purchase contract using direct debit

curl -X POST \
  https://api.mindbodyonline.com/public/v6/sale/purchasecontract \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
  "LocationId": 1,
  "ClientId": "100000025",
  "ContractId": 241,
  "FirstPaymentOccurs": "Instant",
  "UseDirectDebit": true
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/purchasecontract");
var request = new RestRequest(Method.POST);
request.AddHeader("User-Agent", "{yourAppName}");
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddParameter("application/json", "{\r\n  \"LocationId\": 1,\r\n  \"ClientId\": \"100000025\",\r\n  \"ContractId\": 241,\r\n  \"FirstPaymentOccurs\": \"Instant\",\r\n  \"UseDirectDebit\": true\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/purchasecontract');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'User-Agent' => '{yourAppName}',
  'Authorization' => '{staffAuthToken}',
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}',
  'Content-Type' => 'application/json'
));

$request->setBody('{
  "LocationId": 1,
  "ClientId": "100000025",
  "ContractId": 241,
  "FirstPaymentOccurs": "Instant",
  "UseDirectDebit": true
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\r\n  \"LocationId\": 1,\r\n  \"ClientId\": \"100000025\",\r\n  \"ContractId\": 241,\r\n  \"FirstPaymentOccurs\": \"Instant\",\r\n  \"UseDirectDebit\": true\r\n}"

headers = {
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    'Authorization': "{staffAuthToken}",
    'User-Agent': "{yourAppName}"
    }

conn.request("POST", "public/v6/sale/purchasecontract", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/purchasecontract")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'
request["Authorization"] = '{staffAuthToken}'
request["User-Agent"] = '{yourAppName'
request.body = "{\r\n  \"LocationId\": 1,\r\n  \"ClientId\": \"100000025\",\r\n  \"ContractId\": 241,\r\n  \"FirstPaymentOccurs\": \"Instant\",\r\n  \"UseDirectDebit\": true\r\n}"

response = http.request(request)
puts response.read_body

Step 5: Use direct debit in POST CheckoutShoppingCart

curl -X POST \
  https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart \
  -H 'Api-Key: {yourApiKey}' \
  -H 'Authorization: {staffAuthToken}' \
  -H 'Content-Type: application/json' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}' \
  -d '{
    "ClientId" : "100000025",
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "DirectDebit",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart");
var request = new RestRequest(Method.POST);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Authorization", "{staffAuthToken}");
request.AddHeader("Api-Key", "{yourApiKey}");
request.AddHeader("User-Agent", "{yourAppName}");
request.AddParameter("application/json", "{\n    \"ClientId\" : \"100000025\",\n    \"LocationId\" : 1,\n    \"Items\" : \n    [\n        {\n            \"Item\":{\n                \"Type\": \"Service\",\n                \"Metadata\":{\n                    \"Id\": 10114\n                }\n            },\n            \"DiscountAmount\" : 0,\n            \"Quantity\" : 1\n        }\n    ],\n    \"Payments\" : \n    [\n        {\n            \"Type\": \"DirectDebit\",\n            \"Metadata\":{\n                \"Amount\" : 75\n            }\n        }\n    ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Authorization' => '{staffAuthToken}',
  'Api-Key' => '{yourApiKey}',
  'Content-Type' => 'application/json',
  'User-Agent' => '{yourAppName}'
));

$request->setBody('{
    "ClientId" : "100000025",
    "LocationId" : 1,
    "Items" : 
    [
        {
            "Item":{
                "Type": "Service",
                "Metadata":{
                    "Id": 10114
                }
            },
            "DiscountAmount" : 0,
            "Quantity" : 1
        }
    ],
    "Payments" : 
    [
        {
            "Type": "DirectDebit",
            "Metadata":{
                "Amount" : 75
            }
        }
    ]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

payload = "{\n    \"ClientId\" : \"100000025\",\n    \"LocationId\" : 1,\n    \"Items\" : \n    [\n        {\n            \"Item\":{\n                \"Type\": \"Service\",\n                \"Metadata\":{\n                    \"Id\": 10114\n                }\n            },\n            \"DiscountAmount\" : 0,\n            \"Quantity\" : 1\n        }\n    ],\n    \"Payments\" : \n    [\n        {\n            \"Type\": \"DirectDebit\",\n            \"Metadata\":{\n                \"Amount\" : 75\n            }\n        }\n    ]\n}"

headers = {
    'User-Agent': "{yourAppName}",
    'Content-Type': "application/json",
    'Api-Key': "{yourApiKey}",
    'Authorization': "{staffAuthToken}",
    'SiteId': "{yourSiteId}"
    }

conn.request("POST", "public/v6/sale/checkoutshoppingcart", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/sale/checkoutshoppingcart")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["User-Agent"] = '{yourAppName}'
request["Content-Type"] = 'application/json'
request["Api-Key"] = '{yourApiKey}'
request["Authorization"] = '{staffAuthToken}'
request["SiteId"] = '{yourSiteId}'
request.body = "{\n    \"ClientId\" : \"100000025\",\n    \"LocationId\" : 1,\n    \"Items\" : \n    [\n        {\n            \"Item\":{\n                \"Type\": \"Service\",\n                \"Metadata\":{\n                    \"Id\": 10114\n                }\n            },\n            \"DiscountAmount\" : 0,\n            \"Quantity\" : 1\n        }\n    ],\n    \"Payments\" : \n    [\n        {\n            \"Type\": \"DirectDebit\",\n            \"Metadata\":{\n                \"Amount\" : 75\n            }\n        }\n    ]\n}"

response = http.request(request)
puts response.read_body

Summary

This tutorial demonstrates how to use direct debit information to make purchases for a client.

Workflow

  1. Get a user authentication token for the staff member by passing their login credentials to the authentication endpoint. For a description of the user authentication process, see User Tokens. For all following steps, put the token you receive into the Authorization header formatted as Bearer {authToken}.
  2. If the client exists and you have their ID, continue to the next step.

    If the client does not exist, add the client, then store and use the returned Id for the rest of these steps.

  3. Get the client’s direct debit info to ensure they have usable information. If they have direct debit info, skip the next step and proceed to Step 5.
  4. Add direct debit info for the client, then continue to the next step.
  5. See the example requests on the right to see how to use direct debit info in both POST CheckoutShoppingCart and POST PurchaseContract.

Endpoints

Appointment

GET ActiveSessionTimes

curl -X GET \
  https://api.mindbodyonline.com/public/v6/appointment/activesessiontimes?SessionTypeIds=5 \
  -H 'Api-Key: {yourApiKey}' \
  -H 'SiteId: {yourSiteId}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/activesessiontimes?SessionTypeIds=5");
var request = new RestRequest(Method.GET);
request.AddHeader("SiteId", "{yourSiteId}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/activesessiontimes');
$request->setMethod(HTTP_METH_GET);

$request->setQueryData(array(
  'SessionTypeIds' => '5'
));

$request->setHeaders(array(
  'SiteId' => '{yourSiteId}',
  'Api-Key' => '{yourApiKey}'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
import http.client

conn = http.client.HTTPSConnection("api.mindbodyonline.com")

headers = {
    'Api-Key': "{yourApiKey}",
    'SiteId': "{yourSiteId}",
    }

conn.request("GET", "/public/v6/appointment/activesessiontimes?SessionTypeIds=5", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
require 'uri'
require 'net/http'

url = URI("https://api.mindbodyonline.com/public/v6/appointment/activesessiontimes?SessionTypeIds=5")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["Api-Key"] = '{yourApiKey}'
request["SiteId"] = '{yourSiteId}'

response = http.request(request)
puts response.read_body

https://api.mindbodyonline.com/public/v6/appointment/activesessiontimes

Returns a list of the times that can be booked for a given program schedule type. ActiveSessionTimes represent the scheduling increments that can be booked during the active business hours for services.

Query Parameters

This endpoint supports pagination. See Pagination for a description of the Pagination information.

Name Type Description
ScheduleType
Optional
string Filters on the provided the schedule type. Either SessionTypeIds or ScheduleType must be provided. Possible values are:
  • All
  • Class
  • Enrollment
  • Appointment
  • Resource
  • Media
  • Arrival
    SessionTypeIds
    Optional
    list of numbers Filters on the provided session type IDs. Either SessionTypeIds or ScheduleType must be provided.
    StartTime
    Optional
    string Filters results to times that start on or after this time on the current date. Any date provided is ignored.
    Default: 00:00:00
    EndTime
    Optional
    string Filters results to times that end on or before this time on the current date. Any date provided is ignored..
    Default: 23:59:59

    Response

    Example Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 12,
            "TotalResults": 12
        },
        "ActiveSessionTimes": [
            "07:00:00",
            "07:30:00",
            "08:00:00",
            "08:30:00",
            . . .
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination used. See Pagination for a description of the Pagination information.
    ActiveSessionTimes list of strings List of available start times for active sessions. Note the following:
    • The times returned represent possibilities for scheduling a session, not necessarily currently scheduled sessions.
    • The response includes either all schedule types or those filtered by supplying ScheduleTypeor SessionTypeIds.
    • Each session has an associated schedule type, but when you supply SessionTypeIds, they may map to one or more of the schedule types.

    GET AppointmentAddOns

    curl -L -X GET 'https://api.mindbodyonline.com/public/v6/appointment/addons?StaffId=someStaffId' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/addons?StaffId=someStaffId");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    IRestResponse response = client.Execute(request);
    
    <?php
    require_once 'HTTP/Request2.php';
    $request = new HTTP_Request2();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/addons?StaffId=someStaffId');
    $request->setMethod(HTTP_Request2::METHOD_GET);
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}'
    ));
    try {
      $response = $request->send();
      if ($response->getStatus() == 200) {
        echo $response->getBody();
      }
      else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
        $response->getReasonPhrase();
      }
    }
    catch(HTTP_Request2_Exception $e) {
      echo 'Error: ' . $e->getMessage();
    }
    
    import http.client
    import mimetypes
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    payload = ''
    headers = {
      'Api-Key': '{yourApiKey}',
      'SiteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': "{yourAppName}"
    }
    conn.request("GET", "/public/v6/appointment/addons?StaffId=someStaffId", payload, headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/addons?StaffId=someStaffId")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Api-Key"] = "{yourApiKey}"
    request["SiteId"] = "{yourSiteId}"
    request["Authorization"] = "{staffAuthToken}"
    request["User-Agent"] = "{yourAppName}"
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/addons

    Get active appointment add-ons.

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    StaffId
    Optional
    number Filter to add-ons only performed by this staff member.

    Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 5,
            "TotalResults": 5
        },
        "AddOns": [
            {
                "Id": 10285,
                "Name": "Hot Stones",
                "NumDeducted": 1,
                "CategoryId": 12,
                "Category": "Massage Enhancements"
            },
            . . .
            ]
    }
    
    Name Type Description
    AddOns list of objects A list of available add-ons.
    AddOns[].Name string The name of this add-on.
    AddOns[].Id number The ID of this add-on.
    AddOns[].NumDeducted number The number of sessions that this add-on deducts from the pricing option used to pay for this add-on.
    AddOns[].Category string The name of this add-on’s category.
    AddOns[].CategoryId string This ID of this add-on’s category.

    GET AppointmentAvailableDates

    curl -L -X GET 'https://api.mindbodyonline.com/public/v6/appointment/availabledates?SessionTypeId=someSessionTypeId&StaffId=someStaffId&StartDate=someStartDate&EndDate=someEndDate' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'siteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/availabledates?SessionTypeId=someSessionTypeId&StaffId=someStaffId&StartDate=someStartDate&EndDate=someEndDate");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("siteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    require_once 'HTTP/Request2.php';
    $request = new HTTP_Request2();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/availabledates?SessionTypeId=someSessionTypeId&StaffId=someStaffId&StartDate=someStartDate&EndDate=someEndDate');
    $request->setMethod(HTTP_Request2::METHOD_GET);
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'siteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}'
    ));
    try {
      $response = $request->send();
      if ($response->getStatus() == 200) {
        echo $response->getBody();
      }
      else {
        echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
        $response->getReasonPhrase();
      }
    }
    catch(HTTP_Request2_Exception $e) {
      echo 'Error: ' . $e->getMessage();
    }
    
    import http.client
    import mimetypes
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    payload = ''
    headers = {
      'Api-Key': '{yourApiKey}',
      'siteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': "{yourAppName}"
    }
    conn.request("GET", "/public/v6/appointment/availabledates?SessionTypeId=someSessionTypeId&StaffId=someStaffId&StartDate=someStartDate&EndDate=someEndDate", payload, headers)
    res = conn.getresponse()
    data = res.read()
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/availabledates?SessionTypeId=someSessionTypeId&StaffId=someStaffId&StartDate=someStartDate&EndDate=someEndDate")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Api-Key"] = "{yourApiKey}"
    request["siteId"] = "{yourSiteId}"
    request["Authorization"] = "{staffAuthToken}"
    request["User-Agent"] = "{yourAppName}"
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/availabledates

    Returns a list of dates to narrow down staff availability when booking. Dates are those which staff are scheduled to work and do not guarantee booking availabilities. After this call is made, use GET BookableItems to retrieve availabilities for specific dates before booking.

    Query Parameters

    Name Type Description
    SessionTypeId number The requested session type ID.
    LocationId
    Optional
    number The requested location ID.
    StaffId
    Optional
    number The requested staff ID.
    StartDate
    Optional
    string The start date of the requested date range. If omitted, the default is used.
    Default: today’s date
    EndDate
    Optional
    string The end date of the requested date range.
    Default: StartDate

    Response

    {
        "AvailableDates": [
            "2020-09-25T00:00:00",
            "2020-09-29T00:00:00",
            "2020-10-01T00:00:00",
            "2020-10-03T00:00:00",
            "2020-10-07T00:00:00",
            "2020-10-08T00:00:00",
            "2020-10-10T00:00:00",
            "2020-10-13T00:00:00"
        ]
    }
    
    Name Type Description
    AvailableDates list of strings A list of dates for which there is a staff scheduled to work for the requested session type.

    GET AppointmentOptions

    curl -X GET \
    'https://api.mindbodyonline.com/public/v6/appointment/appointmentoptions' \
    -H 'SiteId: {yourSiteId}' \
    -H 'Api-Key: {yourApiKey}'\
    -H 'Authorization: {staffAuthToken}'\
    -H 'Content-Type: application/json'\
    -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/appointmentoptions");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/appointmentoptions');
    
    $request->setMethod(HTTP_METH_GET);
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    payload = ''
    
    headers = {
      'Content-Type': "application/json",
      'SiteId': "{yourSiteId}",
      'Api-Key': "{yourApiKey}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/appointment/appointmentoptions", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/appointmentoptions")
    
    http = Net::HTTP.new(url.host, url.port);
    request = Net::HTTP::Get.new(url)
    request["SiteId"] = '{yourSiteId}'
    request["Api-Key"] = '{yourApiKey}'
    request["Content-Type"] = 'application/json'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/appointmentoptions

    This endpoint has no query parameters.

    Response

    Example Response

    {
        "Options": [
            {
                "DisplayName": "Track Confirmations",
                "Name": "UseApptConfirm",
                "Value": "True",
                "Type": "bool"
            },
            {
                "DisplayName": "Track Arrivals",
                "Name": "UseApptConfirm2",
                "Value": "False",
                "Type": "bool"
            },
            {
                "DisplayName": "Use Gender Preferences",
                "Name": "UseGenderPreferences",
                "Value": "False",
                "Type": "bool"
            },
            {
                "DisplayName": "Default Require Resource for Booking",
                "Name": "RequireApptResource",
                "Value": "False",
                "Type": "bool"
            },
            {
                "DisplayName": "Travel Sheets",
                "Name": "EnableApptTravelSheets",
                "Value": "False",
                "Type": "bool"
            },
            {
                "DisplayName": "Activate Formula notes",
                "Name": "EnableApptFormulaTracking",
                "Value": "False",
                "Type": "bool"
            },
            {
                "DisplayName": "Allow Client Booked Appointments",
                "Name": "ConsumerBookingsAllowed",
                "Value": "False",
                "Type": "bool"
            }
        ]
    }
    
    Name Type Description
    Options list of objects Contains information about the appointment options.
    Options[].DisplayName string The name displayed for this appointment option.
    Options[].Name string The name given to this option.
    Options[].Value string The value of the option.
    Options[].Type string The data type of the option value.

    GET BookableItems

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/appointment/bookableitems?SessionTypeIds={someSessionTypeId}&StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/bookableitems?SessionTypeIds={someSessionTypeId}&StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/bookableitems');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'SessionTypeIds' => '{someSessionTypeId}',
      'StaffIds' => '{someStaffId}',
      'StartDate' => '{someStartDate}',
      'EndDate' => '{someEndDate}'
    ));
    
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': '{yourApiKey}',
      'SiteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/appointment/bookableitems?SessionTypeIds={someSessionTypeId}&StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/bookableitems?SessionTypeIds={someSessionTypeId}&StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/bookableitems

    Returns a list of availabilities with the information needed to book appointments. Availabilities include information such as the location and its amenities, staff members, programs, and session types.

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    SessionTypeIds list of numbers A list of the requested session type IDs.
    LocationIds
    Optional
    list of numbers A list of the requested location IDs.
    StaffIds
    Optional
    list of numbers A list of the requested staff IDs.
    StartDate
    Optional
    string The start date of the requested date range.
    Default: today’s date
    EndDate
    Optional
    string The end date of the requested date range.
    Default: StartDate
    AppointmentId
    Optional
    number If provided, filters out the appointment with this ID.

    Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 1,
            "TotalResults": 1
        },
        "Availabilities": [
            {
                "Id": 11647,
                "Staff": {
                    "Address": null,
                    "AppointmentInstructor": true,
                    "AlwaysAllowDoubleBooking": false,
                    "Bio": "",
                    "City": null,
                    "Country": "US",
                    "Email": null,
                    "FirstName": "Facelicia",
                    "HomePhone": null,
                    "Id": 4,
                    "IndependentContractor": false,
                    "IsMale": false,
                    "LastName": "Facerton",
                    "MobilePhone": null,
                    "Name": null,
                    "PostalCode": null,
                    "ClassTeacher": false,
                    "SortOrder": 0,
                    "State": "0",
                    "WorkPhone": null,
                    "ImageUrl": null,
                    "ClassAssistant": false,
                    "ClassAssistant2": false,
                    "EmploymentStart": null,
                    "EmploymentEnd": null,
                    "ProviderIDs": null,
                    "Appointments": [],
                    "Unavailabilities": [],
                    "Availabilities": []
                },
                "SessionType": {
                    "Type": "All",
                    "DefaultTimeLength": 60,
                    "Id": 5,
                    "Name": "Massage Sports 60 min",
                    "NumDeducted": 1,
                    "ProgramId": 2
                },
                "Programs": null,
                "StartDateTime": "2021-02-08T13:00:00+05:30",
                "EndDateTime": "2021-02-08T23:00:00+05:30",
                "BookableEndDateTime": "2021-02-08T22:00:00+05:30",
                "Location": {
                    "AdditionalImageURLs": [],
                    "Address": "4051 Broad Street",
                    "Address2": "San Luis Obispo CA 93401",
                    "Amenities": null,
                    "BusinessDescription": null,
                    "City": "San Luis Obispo",
                    "Description": null,
                    "HasClasses": true,
                    "Id": 1,
                    "Latitude": 35.2471373,
                    "Longitude": -120.6432148,
                    "Name": "Postman Automation Rest API",
                    "Phone": "2067196749",
                    "PhoneExtension": null,
                    "PostalCode": "93401",
                    "SiteID": null,
                    "StateProvCode": "CA",
                    "Tax1": 0.07,
                    "Tax2": 0.08,
                    "Tax3": 0.1,
                    "Tax4": 0.05,
                    "Tax5": 0.02,
                    "TotalNumberOfRatings": 0,
                    "AverageRating": 0.0,
                    "TotalNumberOfDeals": 0
                },
                "PrepTime": null,
                "FinishTime": null
            }
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use. See Pagination for a description of the Pagination information.
    Availabilities list of objects Contains information about the availabilities for booking. See Availability for descriptions of the Availability information.

    GET ScheduleItems

    https://api.mindbodyonline.com/public/v6/appointment/scheduleitems

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/appointment/scheduleitems?staffIds={someStaffId}&startDate={someStartDate}&endDate={someEndDate}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/scheduleitems?staffIds={someStaffId}&startDate={someStartDate}&endDate={someEndDate}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/scheduleitems');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'staffIds' => '{someStaffId}',
      'startDate' => '{someStartDate}',
      'endDate' => '{someEndDate}'
    ));
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': "{yourApiKey}",
      'SiteId': "{yourSiteId}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/appointment/scheduleitems?StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/scheduleitems?StaffIds={someStaffId}&StartDate={someStartDate}&EndDate={someEndDate}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    Returns a list of schedule items, including appointments, availabilities, and unavailabilities. Unavailabilities are the times at which appointments cannot be booked, for example, on holidays or after hours when the business is closed.

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    LocationIds
    Optional
    list of numbers A list of requested location IDs.
    StaffIds
    Optional
    list of numbers A list of requested staff IDs.
    StartDate
    Optional
    string The start date of the requested date range.
    Default: today’s date
    EndDate
    Optional
    string The end date of the requested date range.
    Default: today’s date
    IgnorePrepFinishTimes
    Optional
    boolean When true, appointment preparation and finish unavailabilities are not returned.
    Default: false

    Response

    Example Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 24,
            "TotalResults": 24
        },
         "StaffMembers": [
            {
                "Address": null,
                "AppointmentInstructor": true,
                "AlwaysAllowDoubleBooking": false,
                "Bio": "",
                "City": null,
                "Country": "US",
                "Email": null,
                "FirstName": "Jennifer",
                "HomePhone": null,
                "Id": 2,
                "IndependentContractor": false,
                "IsMale": false,
                "LastName": "Jazzy",
                "MobilePhone": null,
                "Name": null,
                "PostalCode": null,
                "ClassTeacher": true,
                "SortOrder": 0,
                "State": "0",
                "WorkPhone": null,
                "ImageUrl": null,
                "ClassAssistant": false,
                "ClassAssistant2": false,
                "EmploymentStart": null,
                "EmploymentEnd": null,
                "ProviderIDs": null,
                "Appointments": [],
                "Unavailabilities": [],
                "Availabilities": [
                    {
                        "Id": 4,
                        "Staff": {
                            "Address": null,
                            "AppointmentInstructor": true,
                            "AlwaysAllowDoubleBooking": false,
                            "Bio": "",
                            "City": null,
                            "Country": "US",
                            "Email": null,
                            "FirstName": "Jennifer",
                            "HomePhone": null,
                            "Id": 2,
                            "IndependentContractor": false,
                            "IsMale": false,
                            "LastName": "Jazzy",
                            "MobilePhone": null,
                            "Name": null,
                            "PostalCode": null,
                            "ClassTeacher": true,
                            "SortOrder": 0,
                            "State": "0",
                            "WorkPhone": null,
                            "ImageUrl": null,
                            "ClassAssistant": false,
                            "ClassAssistant2": false,
                            "EmploymentStart": null,
                            "EmploymentEnd": null,
                            "ProviderIDs": null,
                            "Appointments": [],
                            "Unavailabilities": [],
                            "Availabilities": []
                        },
                        "SessionType": null,
                        "Programs": [
                            {
                                "Id": 2,
                                "Name": "Ballet Appointments",
                                "ScheduleType": "Appointment",
                                "CancelOffset": 0,
                                "ContentFormats": [
                                    "InPerson"
                                ]
                            },
                            {
                                "Id": 3,
                                "Name": "Hip Hop Appointments",
                                "ScheduleType": "Appointment",
                                "CancelOffset": 0,
                                "ContentFormats": [
                                    "InPerson"
                                ]
                            },
                            {
                                "Id": 5,
                                "Name": "Multiple Capacity Appts",
                                "ScheduleType": "Appointment",
                                "CancelOffset": 0,
                                "ContentFormats": [
                                    "InPerson"
                                ]
                            }
                        ],
                        "StartDateTime": "2020-12-30T08:00:00",
                        "EndDateTime": "2020-12-30T20:00:00",
                        "BookableEndDateTime": "0001-01-01T00:00:00",
                        "Location": {
                            "AdditionalImageURLs": [],
                            "Address": "2006 Chorro Street",
                            "Address2": "San Luis Obispo CA 93401",
                            "Amenities": null,
                            "BusinessDescription": null,
                            "City": "San Luis Obispo",
                            "Description": "These are the directions",
                            "HasClasses": true,
                            "Id": 1,
                            "Latitude": 35.254587,
                            "Longitude": -120.67359,
                            "Name": "LL Dev Demo Site B",
                            "Phone": "5678566765",
                            "PhoneExtension": null,
                            "PostalCode": "93401",
                            "SiteID": null,
                            "StateProvCode": "CA",
                            "Tax1": 0.0013,
                            "Tax2": 0.0023,
                            "Tax3": 0.002,
                            "Tax4": 0.0725,
                            "Tax5": 0.0,
                            "TotalNumberOfRatings": 0,
                            "AverageRating": 0.0,
                            "TotalNumberOfDeals": 0
                        },
                        "PrepTime": null,
                        "FinishTime": null
                    }
                ]
            }                
         ]
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use. See Pagination for a description of the Pagination information.
    StaffMembers list of objects Contains information about staff members with schedule items. See Staff for a description of the Staff information.

    GET StaffAppointments

    https://api.mindbodyonline.com/public/v6/appointment/staffappointments

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/appointment/staffappointments?startDate={someStartDate}&endDate={someEndDate}'\
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}''
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/staffappointments?startDate={someStartDate}&endDate={someEndDate}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/staffappointments');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
       'startDate' => '{someStartDate}',
      'endDate' => '{someEndDate}'
    ));
    
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': "{yourApiKey}",
      'SiteId': "{yourSiteId}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/appointment/staffappointments?StartDate={someStartDate}&EndDate={someEndDate}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/staffappointments?StartDate={someStartDate}&EndDate={someEndDate}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    Returns a list of appointments by staff member.

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    AppointmentIds
    Optional
    list of numbers A list of the requested appointment IDs.
    LocationIds
    Optional
    list of numbers A list of the requested location IDs.
    StartDate
    Optional
    string The start date of the requested date range. If omitted, the default is used.
    Default: today’s date
    EndDate
    Optional
    string The end date of the requested date range.
    Default: StartDate
    StaffIds
    Optional
    list of numbers List of staff IDs to be returned. Use a value of zero to return all staff appointments.
    ClientId
    Optional
    string The client ID to be returned.

    Response

    Example Response

    {
        PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 1,
            "TotalResults": 1
        },
        "Appointments": [
            {
                "GenderPreference": "None",
                "Duration": 65,
                "ProviderId": "0",
                "Id": 30328,
                "Status": "NoShow",
                "StartDateTime": "2021-01-07T16:00:00",
                "EndDateTime": "2021-01-07T17:05:00",
                "Notes": "Notes",
                "StaffRequested": false,
                "ProgramId": 3,
                "SessionTypeId": 10014,
                "LocationId": 1,
                "StaffId": 100000007,
                "ClientId": "FridayTest",
                "FirstAppointment": false,
                "ClientServiceId": "ClientServiceId",
                "Resources": [],
                "AddOns":"AddOns"
            }
        ]
    }
    
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use. See Pagination for a description of the Pagination information.
    Appointments list of objects Contains information about appointments and their details. See Appointment for a description of the Appointment information.

    POST AddAppointment

    https://api.mindbodyonline.com/public/v6/appointment/addappointment

    curl -X POST \
      'https://api.mindbodyonline.com/public/v6/appointment/addappointment'\
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'\
      -d '{
          "ApplyPayment": "{ApplyPayment}",
          "ClientId": "{ClientId}",
          "LocationId": {LocationId},
          "SessionTypeId": {SessionTypeId},
          "StaffId": {StaffId},
          "StaffRequested": {StaffRequested},
          "StartDateTime": "{StartDateTime}",
          "Test": {Test}
          }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/addappointment");
    var request = new RestRequest(Method.POST);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\r\n    \"ApplyPayment\": \"{ApplyPayment}\",\r\n    \"ClientId\": \"{ClientId}\",\r\n     \"LocationId\": {LocationId},\r\n    \"SessionTypeId\": {SessionTypeId},\r\n     \"StaffId\": {StaffId},\r\n      \"StaffRequested\": {StaffRequested},\r\n       \"StartDateTime\":\"{StartDateTime}\" , \r\n      \"Test\": {Test}, \r\n }",  ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/addappointment');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setQueryData(array(
        'startDate' => '{someStartDate}',
        'endDate'   => '{someEndDate}'
    ));
    
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    
    $request->setBody('{
       "ApplyPayment"=> "{ApplyPayment}",
       "ClientId" => "{ClientId}",
       "LocationId" => {LocationId},
       "SessionTypeId" => {SessionTypeId},
       "StaffId" => {StaffId},
       "StaffRequested"=> {StaffRequested},
       "StartDateTime"=> "{StartDateTime}",
       "Test"=> {Test}}'
    );
    
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': "{yourApiKey}",
      'SiteId': "{yourSiteId}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    payload = "{\r\n  \"ApplyPayment\": \"{ApplyPayment}\",\r\n    \"ClientId\": \"{ClientId}\",\r\n   \"LocationId\": {LocationId},\r\n   \"SessionTypeId\": {SessionTypeId} ,\r\n   \"StaffRequested\": {StaffRequested} ,\r\n   \"StartDateTime\": \"{StartDateTime}\",\r\n \"test\": {test},\r\n}"
    
    conn.request("POST", "/public/v6/appointment/addappointment", payload , headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/addappointment")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    request.body="{\r\n  \"ApplyPayment\": \"{ApplyPayment}\",\r\n    \"ClientId\": \"{ClientId}\",\r\n   \"LocationId\": {LocationId},\r\n   \"SessionTypeId\": {SessionTypeId} ,\r\n   \"StaffRequested\": {StaffRequested} ,\r\n   \"StartDateTime\": \"{StartDateTime}\",\r\n \"test\": {test},\r\n}"
    response = https.request(request)
    puts response.read_body
    

    To book an appointment, you must use a location ID, staff ID, client ID, session type ID, and the StartDateTime of the appointment. You can get most of this information using GET BookableItems.

    Request Body

    Name Type Description
    ApplyPayment
    Optional
    boolean When true, indicates that a payment should be applied to the appointment.
    Default: true
    ClientId string The RSSID of the client for whom the new appointment is being made.
    Duration
    Optional
    number The duration of the appointment. This parameter is used to change the default duration of an appointment.
    Execute
    Optional
    string The action taken to add this appointment.
    EndDateTime
    Optional
    string The end date and time of the new appointment.
    Default: StartDateTime, offset by the staff member’s default appointment duration.
    GenderPreference
    Optional
    string The client’s service provider gender preference. Possible values are:
    • None
    • Female
    • Male
    LocationId number The ID of the location where the new appointment is to take place.
    Notes string Any general notes about this appointment.
    ProviderId string If a user has Complementary and Alternative Medicine features enabled, this parameter assigns a provider ID to the appointment.
    ResourceIds
    Optional
    list of numbers A list of resource IDs to associate with the new appointment.
    SendEmail
    Optional
    boolean Whether to send client an email for cancellations. An email is sent only if the client has an email address and automatic emails have been set up.
    Default: false
    SessionTypeId number The session type associated with the new appointment.
    StaffId number The ID of the staff member who is adding the new appointment.
    StaffRequested
    Optional
    boolean When true, indicates that the staff member was requested specifically by the client.
    StartDateTime string The start date and time of the new appointment.
    Test
    Optional
    boolean When true, indicates that the method is to be validated, but no new appointment data is added.
    Default: false

    Response

    Example Response

          "Appointment": {
            "GenderPreference": "None",
            "Duration": 0,
            "ProviderId": "0",
            "Id": 0,
            "Status": "Booked",
            "StartDateTime": "0001-01-01T00:00:00",
            "EndDateTime": "0001-01-01T00:00:00",
            "Notes": "Notes",
            "StaffRequested": false,
            "ProgramId": 0,
            "SessionTypeId": 0,
            "LocationId": 0,
            "StaffId": 0,
            "ClientId": "100000791",
            "FirstAppointment": false,
            "ClientServiceId": "ClientServiceId",
            "Resources": "Resources",
            "AddOns": "AddOns"
          }
    
    
    Name Type Description
    Appointment object Contains information about the appointment. See Appointment for a description of the Appointment information.

    POST AddAppointmentAddOn

    https://api.mindbodyonline.com/public/v6/appointment/addappointmentaddon

    curl -X POST \
      'https://api.mindbodyonline.com/public/v6/appointment/addappointmentaddon'\
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'\
      -d '{
        "AppointmentId": {AppointmentId},
        "SessionTypeId": {SessionTypeId},
        "ApplyPayment": {ApplyPayment},
        "StaffId": {StaffId},
        "Test": {Test}
       }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/addappointmentaddon");
    var request = new RestRequest(Method.POST);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\r\n    \"AppointmentId\": {AppointmentId},\r\n    \"SessionTypeId\": {SessionTypeId},\r\n     \"ApplyPayment\": {ApplyPayment},\r\n    \"StaffId\": {StaffId},\r\n     \"test\": {test},\r\n }",  ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/addappointmentaddon');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setQueryData(array(
        'startDate' => '{someStartDate}',
        'endDate'   => '{someEndDate}'
    ));
    
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
      "AppointmentId" => {AppointmentId},
      "SessionTypeId" => {SessionTypeId},
      "ApplyPayment" => {ApplyPayment},
      "StaffId" => {StaffId},
      "Test" => {Test}}'
    );
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': "{yourApiKey}",
      'SiteId': "{yourSiteId}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    payload = "test{\r\n  \"AppointmentId\": {AppointmentId},\r\n    \"SessionTypeId\": {SessionTypeId},\r\n   \"ApplyPayment\": {ApplyPayment},\r\n   \"StaffId\": {StaffId},\r\n \"test\": {test},\r\n}"
    
    conn.request("POST", "/public/v6/appointment/addappointmentaddon", payload , headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/addappointmentaddon")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    request.body = "{\r\n  \"AppointmentId\": {AppointmentId},\r\n    \"SessionTypeId\": {SessionTypeId},\r\n   \"ApplyPayment\": {ApplyPayment},\r\n   \"StaffId\": {StaffId},\r\n \"test\": {test},\r\n}"
    response = https.request(request)
    puts response.read_body
    

    This endpoint books an add-on on top of an existing, regular appointment. To book an add-on, you must use an existing appointment ID and session type ID. You can get a session type ID using GET AppointmentAddOns.

    Request Body

    Name Type Description
    AppointmentId number The appointment ID the add-on is getting added to.
    ApplyPayment
    Optional
    boolean When true, indicates that a payment should be applied to the appointment. Currently only ApplyPayment=false is implemented.
    Default: true
    SessionTypeId number The session type associated with the new appointment add-on.
    StaffId number The ID of the staff member who is adding the new appointment add-on.
    Default: staff member performing the appointment.
    Test
    Optional
    boolean When true, indicates that the method is to be validated, but no new appointment add-on data is added.
    Default: false

    Response

    Example Response

    {
        "AppointmentId": 100046507,
        "AddOnAppointmentId": 100046508
    }    
    
    
    Name Type Description
    AppointmentId number The unique ID of the appointment.
    AddOnAppointmentId number The unique ID of the appointment add-on.

    POST UpdateAppointment

    curl -X POST \
      https://api.mindbodyonline.com/public/v6/appointment/updateappointment \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \  
      -A '{yourAppName}' \
      -d '{
      "AppointmentId": {someAppointmendId},
      "ProviderId": "{someProviderId}",
      "Notes": "{someNotes}",
      "StartDateTime": "{someStartDateTime}"
    }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/updateappointment");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddParameter("application/json", "{\r\n \"AppointmentId\": {someAppointmendId},\r\n \"ProviderId\": \"{someProviderId}\",\r\n \"Notes\": \"{someNotes}\",\r\n \"StartDateTime\": \"{someStartDateTime}\"\r\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/updateappointment');
    
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Authorization' => '{staffAuthToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
      "AppointmentId": {someAppointmendId},
      "ProviderId": "{someProviderId}",
      "Notes": "{someNotes}",
      "StartDateTime": "{someStartDateTime}"
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    payload = "{\r\n \"AppointmentId\": {someAppointmendId},\r\n \"ProviderId\": \"{someProviderId}\",\r\n \"Notes\": \"{someNotes}\",\r\n \"StartDateTime\": \"{someStartDateTime}\"\r\n}"
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{staffAuthToken}"
        }
    
    conn.request("POST", "public/v6/appointment/updateappointment", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/updateappointment")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request.body = "{\r\n \"AppointmentId\": {someAppointmendId},\r\n \"ProviderId\": \"{someProviderId}\",\r\n \"Notes\": \"{someNotes}\",\r\n \"StartDateTime\": \"{someStartDateTime}\"\r\n}"
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/updateappointment

    To update the information for a specific appointment, you must have a staff user token with the proper permissions. Note that you can only update the appointment’s StartDateTime, EndDateTime, StaffId, Notes, and SessionTypeId.

    Request Body

    Name Type Description
    AppointmentId number A unique ID for the appointment.
    EndDateTime
    Optional
    string The end date and time of the new appointment.
    Default: StartDateTime, offset by the staff member’s default appointment duration.
    Execute
    Optional
    string The action taken to add this appointment.
    GenderPreference
    Optional
    string The client’s service provider gender preference. Possible values are:
    • None
    • Female
    • Male
    Notes string Any general notes about this appointment.
    ProviderId string If a user has Complementary and Alternative Medicine features enabled, this parameter assigns a provider ID to the appointment.
    ResourceIds
    Optional
    list of numbers A list of resource IDs to associate with the new appointment.
    SendEmail
    Optional
    boolean Whether to send client an email for cancellations. An email is sent only if the client has an email address and automatic emails have been set up.
    Default: false
    SessionTypeId number The session type associated with the new appointment.
    StaffId number The ID of the staff member who is adding the new appointment.
    StartDateTime string The start date and time of the new appointment.
    Test
    Optional
    boolean When true, indicates that the method is to be validated, but no new appointment data is added.
    Default: false

    Response

    {
        "Appointment": {
            "GenderPreference": "Female",
            "Duration": 30,
            "ProviderId": "4567891230",
            "Id": 10458,
            "Status": "Booked",
            "StartDateTime": "2019-10-30T18:30:00",
            "EndDateTime": "2029-10-06T06:30:00",
            "Notes": "",
            "StaffRequested": false,
            "ProgramId": 1,
            "SessionTypeId": 34,
            "LocationId": 1,
            "StaffId": 100000055,
            "ClientId": "100019049",
            "FirstAppointment": true,
            "ClientServiceId": null,
            "Resources": [],
            "AddOns": null
        }
    }
    
    Name Type Description
    Appointment object Contains information about the appointment. See Appointment for a description of the Appointment information.

    DELETE AppointmentAddOn

    curl -X DELETE \
      'https://api.mindbodyonline.com/public/v6/appointment/deleteappointmentaddon?Id={yourAddOnId}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/appointment/deleteappointmentaddon?Id={yourAddOnId}");
    var request = new RestRequest(Method.DELETE);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/appointment/deleteappointmentaddon');
    $request->setMethod(HTTP_METH_DELETE);
    
    $request->setQueryData(array(
      'Id' => '{yourAddOnId}'
    ));
    
    $request->setHeaders(array(
      'User-Agent' => '{yourAppName}',
      'Authorization' => '{staffAuthToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{staffAuthToken}",
        'User-Agent': "{yourAppName}"
        }
    
    conn.request("DELETE", "public/v6/appointment/deleteappointmentaddon?Id={yourAddOnId}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/appointment/deleteappointmentaddon?Id={yourAddOnId}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Delete.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/appointment/deleteappointmentaddon

    This endpoint can be used to early-cancel a booked appointment add-on.

    Query Parameters

    Name Type Description
    Id number ID of the appointment add-on to be deleted.

    This endpoint does not return a response. If a call to this endpoint results in a 204 No Content HTTP status code, then the call was successful.

    Class

    GET Classes

    https://api.mindbodyonline.com/public/v6/class/classes

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    curl -X GET \
      https://api.mindbodyonline.com/public/v6/class/classes?LocationIds={LocationId}&ClassIds={ClassId1}&ClassIds={ClassId2} \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classes?LocationIds={LocationId}&ClassIds={ClassId1}&ClassIds={ClassId2}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl(https://api.mindbodyonline.com/public/v6/class/classes');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'LocationIds' => '={LocationId}',
      'ClassIds' => '={ClassId1}',
      'ClassIds' => '={ClassId2}'
    ));
    
    $request->setHeaders(array(
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
        'Api-Key': "{yourApiKey}",
        'SiteId': "{siteID}"
        }
    
    conn.request("GET", "/public/v6/class/classes?LocationIds={LocationId}&ClassIds={ClassId1}&ClassIds={ClassId2}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/classes?LocationIds={LocationId}&ClassIds={ClassId1}&ClassIds={ClassId2}")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    
    response = http.request(request)
    puts response.read_body
    
    Name Type Description
    ClassDescriptionIds
    Optional
    list of numbers The requested class description IDs.
    ClassIds
    Optional
    list of numbers The requested class IDs.
    StaffIds
    Optional
    list of numbers The requested IDs of the teaching staff members.
    StartDateTime
    Optional
    string The requested start date for filtering.
    Default: today’s date
    EndDateTime
    Optional
    string The requested end date for filtering.
    Default: today’s date
    ClientId
    Optional
    string The client ID of the client who is viewing this class list. The client ID is not required however if the client ID is passed, its permissions will be honored and only the information that the client has access to will be returned. Based on identity, the client may be able to see additional information, such as membership specials.
    ProgramIds
    Optional
    list of numbers A list of program IDs on which to base the search.
    SessionTypeIds
    Optional
    list of numbers A list of session type IDs on which to base the search.
    LocationIds
    Optional
    list of numbers A list of location IDs on which to base the search.
    SemesterIds
    Optional
    list of numbers A list of semester IDs on which to base the search.
    HideCanceledClasses
    Optional
    boolean When true, canceled classes are removed from the response.
    When false, canceled classes are included in the response.
    Default: false
    SchedulingWindow
    Optional
    boolean When true,(and when omitting the Auth Token) classes outside scheduling window are removed from the response.
    When false, classes are included in the response, regardless of the scheduling window.
    Default: false
    LastModifiedDate
    Optional
    string When included in the request, only records modified on or after the LastModifiedDate specified are included in the response.

    Response

    Example Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 2,
            "TotalResults": 2
        },
        "Classes": [
            {
                "ClassScheduleId": 6,
                "Visits": null,
                "Clients": [],
                "Location": {
                    "AdditionalImageURLs": [],
                    "Address": "123 Alphabet Street",
                    "Address2": "Paisely Park, MN 55404",
                    "Amenities": [
                        {
                            "Id": 1,
                            "Name": "Showers"
                        },
                        {
                            "Id": 2,
                            "Name": "Rentals"
                        }
                    ],
                    "BusinessDescription": "Yoga 4 U",
                    "City": "Paisely Park",
                    "Description": "Yoga 2 the dawn.",
                    "HasClasses": true,
                    "Id": 7,
                    "Latitude": 35.2795603,
                    "Longitude": -120.6626051,
                    "Name": "Yoga 4 U",
                    "Phone": "800 555-1212",
                    "PhoneExtension": "123",
                    "PostalCode": "55404",
                    "SiteId": 999,
                    "StateProvCode": "MN",
                    "Tax1": 0.7,
                    "Tax2": 0,
                    "Tax3": 0,
                    "Tax4": 0,
                    "Tax5": 0,
                    "TotalNumberOfRatings": 1,
                    "AverageRating": 5,
                    "TotalNumberOfDeals": 4
                },
                "Resource": null,
                "MaxCapacity": 2,
                "WebCapacity": 2,
                "TotalBooked": 0,
                "TotalBookedWaitlist": 0,
                "WebBooked": 0,
                "SemesterId": null,
                "IsCanceled": false,
                "Substitute": false,
                "Active": true,
                "IsWaitlistAvailable": false,
                "IsEnrolled": null,
                "HideCancel": false,
                "Id": 1464,
                "IsAvailable": true,
                "StartDateTime": "2019-01-11T18:00:00",
                "EndDateTime": "2019-01-11T19:00:00",
                "LastModifiedDateTime": "0001-01-01T00:00:00",
                "ClassDescription": {
                    "Active": true,
                    "Description": "<div style=\"text-align:center;\">\r\n<ul>\r\n<li><span style=\"color:#ff0000;\"><em><strong>This is the Description for your Yoga Class.</strong></em></span></li>\r\n</ul>\r\n</div>",
                    "Id": 1,
                    "ImageURL": "https://clients.mindbodyonline.com/studios/ACMEYoga/reservations/1.jpg?osv=637136734414821811",
                    "LastUpdated": "2016-04-18T10:48:08.933",
                    "Level": {
                        "ID": 1,
                        "Name": "Level 1",
                        "Description": null
                    },
                    "Name": "Yoga 4 U Beginners Class",
                    "Notes": "<div>This is a place for class notes.</div>",
                    "Prereq": "<div><strong>This is a a place for Pre Requisite Notes</strong></div>",
                    "Program": {
                        "Id": 22,
                        "Name": "Yoga Class 22",
                        "ScheduleType": "Class",
                        "CancelOffset": 0,
                        "ContentFormats": [
                            "InPerson"
                        ]
                    },
                    "SessionType": {
                        "Type": "All",
                        "DefaultTimeLength": null,
                        "Id": 5,
                        "Name": "Yoga Class",
                        "NumDeducted": 1,
                        "ProgramId": 22,
                        "CrossRegionalBookingPerformed": false,
                        "SiteId": null
                    },
                    "Category": "Personal training",
                    "CategoryId": 138,
                    "Subcategory": "General",
                    "SubcategoryId": 145
                },
                "Staff": {
                    "Address": "456 Alfred Road",
                    "AppointmentInstructor": false,
                    "AlwaysAllowDoubleBooking": false,
                    "Bio": "<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ac lacinia lacus. Donec mollis eros ut consectetur molestie. Praesent rutrum quis sem pharetra hendrerit. In hac habitasse platea dictumst. Morbi vitae venenatis nisi. Aenean vulputate ut ligula eu vulputate. Integer auctor dignissim leo, a commodo massa vehicula sed. Fusce aliquet iaculis nisl ut efficitur.</div>",
                    "City": "Minneapolis",
                    "Country": "US",
                    "Email": "[email protected]",
                    "FirstName": "Cloreen",
                    "HomePhone": "8005551212",
                    "Id": 3,
                    "IndependentContractor": false,
                    "IsMale": false,
                    "LastName": "Baconskin",
                    "MobilePhone": "8005552323",
                    "Name": "Chilling",
                    "PostalCode": "55404",
                    "ClassTeacher": false,
                    "SortOrder": 0,
                    "State": "MN",
                    "WorkPhone": "8005553434",
                    "ImageUrl": null,
                    "Appointments": [],
                    "Unavailabilities": [],
                    "Availabilities": []
                },
                "BookingWindow": {
                    "StartDateTime": "2019-01-11T00:00:00",
                    "EndDateTime": "2019-01-11T18:00:00",
                    "DailyStartTime": null,
                    "DailyEndTime": null
                },
                "BookingStatus": "Free",
                "VirtualStreamLink": "https://video.mindbody.io/studios/12345/live-streams/dd5f1esss4a5d2e1f55"
            },
            {
                "ClassScheduleId": 13,
                "Visits": null,
                "Clients": [],
                "Location": {
                    "AdditionalImageURLs": [],
                    "Address": "123 Eastside Lane",
                    "Address2": "South Park, CO",
                    "Amenities": [
                        {
                            "Id": 1,
                            "Name": "Ample parking everywhere"
                        },
                        {
                            "Id": 2,
                            "Name": "Locker Room"
                        }
                    ],
                    "BusinessDescription": "Bust that gut. Guaranteed.",
                    "City": "South Park",
                    "Description": "Got gut?",
                    "HasClasses": true,
                    "Id": 1,
                    "Latitude": 35.246934,
                    "Longitude": -120.643445,
                    "Name": "Gut Busters",
                    "Phone": "8051234567",
                    "PhoneExtension": "1111",
                    "PostalCode": "81611",
                    "SiteId": 999,
                    "StateProvCode": "CO",
                    "Tax1": 0.09,
                    "Tax2": 0,
                    "Tax3": 0,
                    "Tax4": 0,
                    "Tax5": 0,
                    "TotalNumberOfRatings": 3,
                    "AverageRating": 3.33,
                    "TotalNumberOfDeals": 4
                },
                "Resource": null,
                "MaxCapacity": 2,
                "WebCapacity": 2,
                "TotalBooked": 0,
                "TotalBookedWaitlist": 0,
                "WebBooked": 0,
                "SemesterId": null,
                "IsCanceled": false,
                "Substitute": false,
                "Active": true,
                "IsWaitlistAvailable": false,
                "IsEnrolled": null,
                "HideCancel": false,
                "Id": 3291,
                "IsAvailable": true,
                "StartDateTime": "2019-01-11T19:00:00",
                "EndDateTime": "2019-01-11T20:00:00",
                "LastModifiedDateTime": "0001-01-01T00:00:00",
                "ClassDescription": {
                    "Active": true,
                    "Description": "",
                    "Id": 2,
                    "ImageURL": null,
                    "LastUpdated": "2016-04-18T13:11:16.437",
                    "Level": null,
                    "Name": "Cancelled Yoga Class",
                    "Notes": "",
                    "Prereq": "",
                    "Program": {
                        "Id": 22,
                        "Name": "Yoga Class 22",
                        "ScheduleType": "Class",
                        "CancelOffset": 0,
                        "ContentFormats": [
                            "Livestream:Other"
                        ]
                    },
                    "SessionType": {
                        "Type": "All",
                        "DefaultTimeLength": null,
                        "Id": 5,
                        "Name": "Yoga Class",
                        "NumDeducted": 1,
                        "ProgramId": 22,
                        "CrossRegionalBookingPerformed": false,
                        "SiteId": null
                    },
                    "Category": "Naturopathic medicine",
                    "CategoryId": 284,
                    "Subcategory": "Aromatherapy",
                    "SubcategoryId": 287
                },
                "Staff": {
                    "Address": "789 Cartman Boulevard",
                    "AppointmentInstructor": false,
                    "AlwaysAllowDoubleBooking": false,
                    "Bio": "<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ac lacinia lacus. Donec mollis eros ut consectetur molestie. Praesent rutrum quis sem pharetra hendrerit. In hac habitasse platea dictumst. Morbi vitae venenatis nisi. Aenean vulputate ut ligula eu vulputate. Integer auctor dignissim leo, a commodo massa vehicula sed. Fusce aliquet iaculis nisl ut efficitur.</div>",
                    "City": "South Park",
                    "Country": "US",
                    "Email": "[email protected]",
                    "FirstName": "Wendy",
                    "HomePhone": "8005554545",
                    "Id": 3,
                    "IndependentContractor": false,
                    "IsMale": false,
                    "LastName": "Testaburger",
                    "MobilePhone": "1234567894",
                    "Name": "Chilling",
                    "PostalCode": "81611",
                    "ClassTeacher": false,
                    "SortOrder": 0,
                    "State": "CO",
                    "WorkPhone": "8005555656",
                    "ImageUrl": null,
                    "Appointments": [],
                    "Unavailabilities": [],
                    "Availabilities": []
                },
                "BookingWindow": {
                    "StartDateTime": "2019-01-11T00:00:00",
                    "EndDateTime": "2019-01-11T19:00:00",
                    "DailyStartTime": null,
                    "DailyEndTime": null
                },
                "BookingStatus": "BookAndPayLater",
                "VirtualStreamLink": "https://video.mindbody.io/studios/12345/live-streams/dd5f1esss4a5d2e1f55"
            }
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use in the response. See Pagination for a description of the Pagination information.
    Classes list of objects A list of the requested classes. See Class for a description of the Class information.

    GET ClassDescriptions

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/class/classdescriptions?ProgramIds={someProgramId}&StaffId={someStaffId}&StartClassDateTime={someStartDate}&EndClassDateTime={someEndDate}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classdescriptions?ProgramIds={someProgramId}&StaffId={someStaffId}&StartClassDateTime={someStartDate}&EndClassDateTime={someEndDate}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/classdescriptions');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'ProgramIds' => '{someProgramId}',
      'StaffId' => '{someStaffId}',
      'StartClassDateTime' => '{someStartDate}',
      'EndClassDateTime' => '{someEndDate}'
    ));
    
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': '{yourApiKey}',
      'SiteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/class/classdescriptions?ProgramIds={someProgramId}&StaffId={someStaffId}&StartClassDateTime={someStartDate}&EndClassDateTime={someEndDate}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/classdescriptions?ProgramIds={someProgramId}&StaffId={someStaffId}&StartClassDateTime={someStartDate}&EndClassDateTime={someEndDate}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/classdescriptions

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of Pagination information.

    Name Type Description
    ClassDescriptionId number The ID of the requested client.
    ProgramIds list of numbers A list of requested program IDs.
    StartClassDateTime string The date and time that the class starts.
    EndClassDateTime string The date and time that the class ends.
    StaffId number The ID of the requested staff member.
    LocationId number The ID of the requested location.

    Response

    {
        "PaginationResponse": {
            "RequestedLimit": 100,
            "RequestedOffset": 0,
            "PageSize": 1,
            "TotalResults": 1
        },
        "ClassDescriptions": [
            {
                "Active": true,
                "Description": "<div gid=\"11\">geafewaf</div>\r\n<div gid=\"12\">woof</div>",
                "Id": 2,
                "ImageURL": null,
                "LastUpdated": "2016-06-03T08:02:29",
                "Level": {
                    "Id": 1,
                    "Name": "Beg",
                    "Description": null
                },
                "Name": "Beginner Hip Hop",
                "Notes": "<div gid=\"11\">&nbsp;</div>",
                "Prereq": "<div gid=\"11\">&nbsp;</div>",
                "Program": {
                    "Id": 23,
                    "Name": "Hip Hop Classes(Prog23)",
                    "ScheduleType": "Class",
                    "CancelOffset": 0,
                    "ContentFormats": [
                        "InPerson"
                    ]
                },
                "SessionType": {
                    "Type": "All",
                    "DefaultTimeLength": null,
                    "Id": 6,
                    "Name": "Hip Hop Classes",
                    "NumDeducted": 1,
                    "ProgramId": 23
                },
                "Category": "Med spa",
                "CategoryId": 374,
                "Subcategory": "Dermaplaning",
                "SubcategoryId": 381
            }
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use. See Pagination for a description of the Pagination information.
    ClassDescriptions list of objects Contains information about the class. See ClassDescription for a description of the ClassDescription information.

    GET ClassSchedules

    curl -X GET \
    'https://api.mindbodyonline.com/public/v6/class/classschedules?limit={someLimit}&offset={someOffest}&classScheduleIds={someClassScheduleId}&startDate={someStartDate}&endDate={someEndDate}&locationIds={someLocationId}&programIds={someProgramId}&sessionTypeIds={someSessionTylpeId}&staffIds={someStaffid}' \
    -H 'SiteId: {yourSiteId}' \
    -H 'Api-Key: {yourApiKey}'\
    -H 'Authorization: {staffAuthToken}'\
    -H 'Content-Type: application/json'\
    -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classschedules?limit={someLimit}&offset={someOffset}&classScheduleIds={someClassScheduleId}&startDate={someStartDate}&endDate={someEndDate}&locationIds={someLocationId}&programIds={someProgramId}&sessionTypeIds={someSessionTylpeId}&staffIds={someStaffid}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/classschedules');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'limit' => '{someLimit}',
      'offset' => '{someOffset}',
      'classScheduleIds' => '{someClassScheduleId}',
      'locationIds'  => '{SomeLocationId}',
      'programIds' => '{SomeProgramId}',
      'SessionTypeIds' => '{someSessionTypeId}',
      'StaffIds' => '{someStaffId}',
      'StartDate' => '{someStartDate}',
      'EndDate' => '{someEndDate}'
    ));
    
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': '{yourApiKey}',
      'SiteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': "{yourAppName}"
    }
    
    conn.request("GET", "/public/v6/class/classschedules?limit={someLimit}&offset={SomeOffset}&classScheduleIds={someClassScheduleId}&startDate={someStartDate}&endDate={someEndDate}&locationIds={someLocationId}&programIds={someProgramId}&sessionTypeIds={someSessionTylpeId}&staffIds={someStaffid}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/classschedules?limit={someLimit}&offset={someOffset}&classScheduleIds={someClassScheduleId}&startDate={someStartDate}&endDate={someEndDate}&locationIds={someLocationId}&programIds={someProgramId}&sessionTypeIds={someSessionTylpeId}&staffIds={someStaffid}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/classschedules

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    ClassScheduleIds
    Optional
    list of numbers The class schedule IDs.
    Default: all
    EndDate
    Optional
    string The end date of the range. Return any active enrollments that occur on or before this day.
    Default: StartDate
    LocationIds
    Optional
    list of numbers The location IDs.
    Default: all
    ProgramIds
    Optional
    list of numbers The program IDs.
    Default: all
    SessionTypeIds
    Optional
    list of numbers The session type IDs.
    Default: all
    StaffIds
    Optional
    list of numbers The staff IDs.
    Default: all
    StartDate
    Optional
    string The start date of the range. Return any active enrollments that occur on or after this day.
    Default: today’s date

    Response

    {
        "PaginationResponse": {
            "RequestedLimit": 2,
            "RequestedOffset": 0,
            "PageSize": 2,
            "TotalResults": 28
        },
        "ClassSchedules": [
            {
                "Classes": [],
                "Clients": [],
                "Course": CourseObj,
                "SemesterId": 0,
                "IsAvailable": false,
                "Id": 2255,
                "ClassDescription": {
                    "Active": true,s                
                    "Id": 69,
                    "ImageURL": "https://clients-content.mindbodyonline.com/studios/DemoAPISandboxRestore/reservations/69.jpg?osv=637392261918898713",
                    "LastUpdated": "2017-04-11T06:17:11",
                    "Level": {
                        "Id": 7,
                        "Name": "Beginner",
                        "Description": "Description"
                    },
                    "Name": "Power Yoga",
                    "Notes": "Notes",
                    "Prereq": "Prereq",
                    "Program": {
                        "Id": 26,
                        "Name": "Classes",
                        "ScheduleType": "Class",
                        "CancelOffset": 0,
                        "ContentFormats": [
                            "Livestream:Other"
                        ]
                    },
                    "SessionType": {
                        "Type": "All",
                        "DefaultTimeLength": 0,
                        "Id": 68,
                        "Name": "Yoga ",
                        "NumDeducted": 1,
                        "ProgramId": 26
                    },
                    "Category": CategoryObj,
                    "CategoryId": 0,
                    "Subcategory": "Subcategory",
                    "SubcategoryId": 0
                },
                "DaySunday": false,
                "DayMonday": true,
                "DayTuesday": true,
                "DayWednesday": true,
                "DayThursday": false,
                "DayFriday": true,
                "DaySaturday": true,
                "AllowOpenEnrollment": false,
                "AllowDateForwardEnrollment": false,
                "StartTime": "1899-12-30T16:30:00",
                "EndTime": "1899-12-30T17:45:00",
                "StartDate": "2021-03-01T00:00:00",
                "EndDate": "2022-03-01T00:00:00",
                "Staff": {
                    "Address": "Address",
                    "AppointmentInstructor": true,
                    "AlwaysAllowDoubleBooking": false,
                    "Bio": "Bio",
                    "City": "City",
                    "Country": "Country",
                    "Email": "Email",
                    "FirstName": "Ashley",
                    "HomePhone": 099876,
                    "Id": 100000279,
                    "IndependentContractor": false,
                    "IsMale": false,
                    "LastName": "Knight",
                    "MobilePhone": 09765,
                    "Name": "Name",
                    "PostalCode": 897109,
                    "ClassTeacher": true,
                    "SortOrder": 0,
                    "State": "CA",
                    "WorkPhone": 0009651,
                    "ImageUrl": "https://clients-content.mindbodyonline.com/studios/DemoAPISandboxRestore/staff/100000279_large.jpg?osv=635578631684385500",
                    "ClassAssistant": false,
                    "ClassAssistant2": false,
                    "EmploymentStart":  "2021-03-01T00:00:00",
                    "EmploymentEnd":  "2022-03-01T00:00:00",
                    "ProviderIDs": [],
                    "Rep": false,
                    "Rep2": false,
                    "Rep3": false,
                    "Rep4": false,
                    "Rep5": false,
                    "Rep6": false,
                    "Appointments": [],
                    "Unavailabilities": [],
                    "Availabilities": []
                },
                "Location": {
                    "AdditionalImageURLs": [],
                    "Address": "\"4051 S Broad St",
                    "Address2": "\"San Luis Obispo, CA 93401",
                    "Amenities": "Aminities",
                    "BusinessDescription": "\"The MINDBODY Health Club Demo is awesome.\"\r\n - Anonymous (but probably someone cool and smart)",
                    "City": "San Luis Obispo",
                    "Description": "Description",
                    "HasClasses": true,
                    "Id": 1,
                    "Latitude": 35.2470788,
                    "Longitude": -120.6426145,
                    "Name": "Clubville",
                    "Phone": "8777554279",
                    "PhoneExtension": "",
                    "PostalCode": "93401",
                    "SiteID": -99,
                    "StateProvCode": "CA",
                    "Tax1": 0.08,
                    "Tax2": 0.05,
                    "Tax3": 0.05,
                    "Tax4": 0.0,
                    "Tax5": 0.0,
                    "TotalNumberOfRatings": 0,
                    "AverageRating": 0.0,
                    "TotalNumberOfDeals": 0
                }    
            }
        ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination to use. See Pagination for a description of the Pagination information.
    ClassSchedules object Contains information about the class schedules. See ClassSchedule for a description of the ClassSchedule information.

    GET ClassVisits

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/class/classvisits?classId={classId}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/classvisits?classId={classId}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    IRestResponse response = client.Execute(request);
    
    <?php
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/classvisits');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'classId' => '={classId}'
    ));
    
    $request->setHeaders(array(
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
        'Api-Key': "{yourApiKey}",
        'SiteId': "{siteID}"
        }
    
    conn.request("GET", "/public/v6/class/classvisits?classId={classId}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/classvisits?classid={classId}")
    
    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    
    request = Net::HTTP::Get.new(url)
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/classvisits

    Returns a list of visits that contain information for a specified class. On success, this request returns the class object in the response with a list of visits.

    Query Parameters

    GET ClassVisits contains information about specific class visits.

    Name Type Description
    ClassID number The class ID.
    LastModifiedDate string When included in the request, only records modified on or after the LastModifiedDate specified are included in the response.

    Response

    Example Response

    {
        "Class": {
            "ClassScheduleId": 171,
            "Visits": [
                {
                    "AppointmentId": 0,
                    "AppointmentGenderPreference": "None",
                    "AppointmentStatus": "None",
                    "ClassId": 54407,
                    "Client": {
                        . . .
                    },
                    "StartDateTime": "2018-06-28T07:00:00",
                    "EndDateTime": "2018-06-28T08:00:00",
                    "Id": 255027,
                    "LastModifiedDateTime": "2018-09-25T23:17:47.9Z",
                    "LateCancelled": false,
                    "Location": {
                        . . .
                    },
                    "MakeUp": false,
                    "Name": "Yoga Class",
                    "Service": {
                        . . .
                    },
                    "SignedIn": true,
                    "Staff": {
                        . . .
                    },
                    "WebSignup": false,
                    "Action": "None"
                }
            ],
            . . .
        }
    }
    
    
    Name Type Description
    Class object See Class for descriptions of the Class information.

    GET WaitListEntries

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/class/waitlistentries?ClientIds={someClientId}' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/waitlistentries?ClientIds={someClientId}");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/waitlistentries');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'ClientIds' => '{someClientId}'
    ));
    
    $request->setConfig(array(
      'follow_redirects' => TRUE
    ));
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': '{yourApiKey}',
      'SiteId': '{yourSiteId}',
      'Authorization': '{staffAuthToken}',
      'User-Agent': '{yourAppName}'
    }
    
    conn.request("GET", "/public/v6/class/waitlistentries?ClientIds={someClientId}", headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/waitlistentries?ClientIds={someClientId}")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    
    response = https.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/waitlistentries

    Returns a list of waiting list entries for a specified class schedule or class. The request requires staff credentials and either a class schedule ID or class ID.

    Query Parameters

    This endpoint supports pagination. See Pagination for a description of the Pagination information.

    Name Type Description
    ClassIds
    Optional
    list of numbers The requested class IDs. If a class ID is present, the request automatically disregards any class schedule IDs in the request.
    Either ClassScheduleIds, ClientIds, WaitlistEntryIds, or ClassIds is required; the others become optional.
    Default: all ClassIds
    ClassScheduleIds
    Optional
    list of numbers The requested class schedule IDs. If a class ID is present, the request automatically disregards any class schedule IDs in the request.
    Either ClassScheduleIds, ClientIds, WaitlistEntryIds, or ClassIds is required; the others become optional.
    Default: all ClassScheduleIds
    ClientIds
    Optional
    list of strings The requested client IDs.
    Either ClassScheduleIds, ClientIds, WaitlistEntryIds, or ClassIds is required; the others become optional.
    Default: all ClientIds
    HidePastEntries
    Optional
    boolean When true, indicates that past waiting list entries are hidden from clients.
    When false, indicates that past entries are not hidden from clients.
    Default: false
    WaitlistEntryIds
    Optional
    list of numbers The requested waiting list entry IDs.
    Either ClassScheduleIds, ClientIds, WaitlistEntryIds, or ClassIds is required; the others become optional.

    Response

    {
      "PaginationResponse": {
        "RequestedLimit": 100,
        "RequestedOffset": 0,
        "PageSize": 1,
        "TotalResults": 1
      },
      "WaitlistEntries": [
        {
          "ClassDate": "2030-10-08T00:00:00",
          "ClassId": 64050,
          "ClassSchedule": {
            "Classes": [],
            "Clients": [],
            "Course": CourseObj,
            "SemesterId": 0,
            "IsAvailable": false,
            "Id": 270,
            "ClassDescription": {
              "Active": true,
              "Description": "",
              "Id": 3,
              "ImageURL": "https://clients-content.mindbodyonline.com/studios/DemoAPISandboxRestore/reservations/69.jpg?osv=637392261918898713",
              "LastUpdated": "2017-04-11T06:17:11",
              "Level": {
                 "Id": 7,
                 "Name": "Beginner",
                 "Description": "Description"
              },
              "Name": "Free Yoga Class",
              "Notes": "",
              "Prereq": "",
              "Program": {
                "Id": 22,
                "Name": "Yoga Class 22",
                "ScheduleType": "Class",
                "CancelOffset": 0,
                "ContentFormats": [
                  "InPerson"
                ]
              },
              "SessionType": {
                "Type": "All",
                "DefaultTimeLength": 0,
                "Id": 5,
                "Name": "Yoga Class",
                "NumDeducted": 1,
                "ProgramId": 22
              },
               "Category": CategoryObj,
               "CategoryId": 0,
               "Subcategory": "Subcategory",
               "SubcategoryId": 0
            },
            "DaySunday": false,
            "DayMonday": false,
            "DayTuesday": true,
            "DayWednesday": false,
            "DayThursday": false,
            "DayFriday": false,
            "DaySaturday": false,
            "AllowOpenEnrollment": false,
            "AllowDateForwardEnrollment": false,
            "StartTime": "1899-12-30T07:00:00",
            "EndTime": "1899-12-30T16:00:00",
            "StartDate": "2030-01-01T00:00:00",
            "EndDate": "2031-01-01T00:00:00",
            "Staff": {
              "Address": "123 Main",
              "AppointmentInstructor": true,
              "AlwaysAllowDoubleBooking": true,
              "Bio": "<div>Public biography (staff profile)</div>",
              "City": "San Luis Obispo, CA",
              "Country": "US",
              "Email": "[email protected]",
              "FirstName": "SOAP API",
              "HomePhone": "8051234567",
              "Id": 100000008,
              "IndependentContractor": true,
              "IsMale": false,
              "LastName": "Teacher",
              "MobilePhone": "8054417030",
              "Name": "Name",
              "PostalCode": "93401",
              "ClassTeacher": true,
              "SortOrder": 0,
              "State": "CA",
              "WorkPhone": "8051234567",
              "ImageUrl": "https://clients-content-aws.mbodev.me/studios/SOAPAPIAUTOMATEDINTEGRATIONTESTSITE/staff/100000008_large.jpg?osv=636008655925132533",
              "ClassAssistant": false,
              "ClassAssistant2": false,
              "EmploymentStart":  "2021-03-01T00:00:00",
              "EmploymentEnd":  "2022-03-01T00:00:00",
              "ProviderIDs": [],
              "Appointments": [],
              "Unavailabilities": [],
              "Availabilities": []
            },
            "Location": {
              "AdditionalImageURLs": [],
              "Address": "4051 Broad Street Line2",
              "Address2": "San Luis Obispo CA 93401",
              "Amenities": null,
              "BusinessDescription": "Business Description (Location & App Listings)",
              "City": "San Luis Obispo",
              "Description": "Location Description (Location & App Listings)",
              "HasClasses": true,
              "Id": 1,
              "Latitude": 35.246934,
              "Longitude": -120.643445,
              "Name": "Location 1 Bluefin/PayConexTest",
              "Phone": "8051234567",
              "PhoneExtension": "1111",
              "PostalCode": "93401",
              "SiteID": -99,
              "StateProvCode": "CA",
              "Tax1": 0.1,
              "Tax2": 0.1,
              "Tax3": 0.13,
              "Tax4": 0.045,
              "Tax5": 0.1,
              "TotalNumberOfRatings": 0,
              "AverageRating": 0.0,
              "TotalNumberOfDeals": 0
            }
          },
          "Client": {
            "AppointmentGenderPreference": "None",
            "BirthDate": "2005-08-16T00:00:00",
            "Country": "US",
            "CreationDate": "2018-08-14T15:13:49.173",
            "CustomClientFields": [
              {
                "Value": "12",
                "Id": 2,
                "DataType": "Double",
                "Name": "Favorite Number"
              }
            ],
            "ClientCreditCard": null,
            "ClientIndexes": null,
            "ClientRelationships": null,
            "FirstAppointmentDate": null,
            "FirstName": "Volpi",
            "Id": "100000934",
            "IsCompany": false,
            "IsProspect": false,
            "LastName": "Test2",
            "Liability": {
              "AgreementDate": null,
              "IsReleased": false,
              "ReleasedBy": null
            },
            "LiabilityRelease": false,
            "MembershipIcon": 0,
            "MobileProvider": null,
            "Notes": " ",
            "State": "CA",
            "UniqueId": 100000934,
            "LastModifiedDateTime": "0001-01-01T00:00:00",
            "RedAlert": null,
            "YellowAlert": null,
            "MiddleName": null,
            "ProspectStage": null,
            "Email": null,
            "MobilePhone": null,
            "HomePhone": null,
            "WorkPhone": null,
            "AccountBalance": 0.0,
            "AddressLine1": null,
            "AddressLine2": null,
            "City": null,
            "PostalCode": null,
            "WorkExtension": null,
            "ReferredBy": null,
            "PhotoUrl": null,
            "EmergencyContactInfoName": null,
            "EmergencyContactInfoEmail": null,
            "EmergencyContactInfoPhone": null,
            "EmergencyContactInfoRelationship": null,
            "Gender": null,
            "LastFormulaNotes": null,
            "Active": false,
            "SalesReps": null,
            "Status": null,
            "Action": "None",
            "SendAccountEmails": true,
            "SendAccountTexts": false,
            "SendPromotionalEmails": true,
            "SendPromotionalTexts": false,
            "SendScheduleEmails": true,
            "SendScheduleTexts": false
          },
          "EnrollmentDateForward": "0001-01-01T00:00:00",
          "Id": 28587,
          "RequestDateTime": "2019-10-14T11:23:16",
          "VisitRefNo": 0,
          "Web": false
        }
      ]
    }
    
    Name Type Description
    PaginationResponse object Contains information about the pagination properties to use. See Pagination for a description of the Pagination information.
    WaitlistEntries list of objects Contains information about the waiting list entries.
    WaitlistEntries[].ClassDate string The date of the class or enrollment.
    WaitlistEntries[].ClassId number The ID of the class or enrollment.
    WaitlistEntries[].ClassSchedule object Contains information about the class schedule for this waiting list entry. See ClassSchedule for a description of the ClassSchedule information.
    WaitlistEntries[].Client object Contains information about the requested client who is on the waiting list. See Client for a description of the Client information.
    WaitlistEntries[].EnrollmentDateForward string If the waiting list entry was created for an enrollment, this is the date on or after which the client can be added to the enrollment from the waitlist.
    WaitlistEntries[].Id number The ID of the waiting list entry.
    WaitlistEntries[].RequestDateTime string The date and time that the request to be on the waiting list was made.
    WaitlistEntries[].VisitRefNo number The visit that is associated with the waiting list entry.
    WaitlistEntries[].Web boolean If true, the entry on the waiting list was requested online. If false, the entry on the waiting list was requested offline, for example in person or by phone.

    POST AddClientToClass

    curl -X POST \
      https://api.mindbodyonline.com/public/v6/class/addclienttoclass \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {yourUserToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}' \
      -d '{
      "ClientId": "{ClientId}",
      "ClassId": {ClassId},
      "RequirePayment": {RequirePayment},
      "Waitlist": {Waitlist},
      "SendEmail": {SendEmail}
    }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/addclienttoclass");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "{yourUserToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddParameter("application/json", "{\r\n  \"ClientId\": \"{ClientId}\",\r\n  \"ClassId\": {ClassId},\r\n  \"RequirePayment\": {RequirePayment},\r\n  \"Waitlist\": {Waitlist},\r\n  \"SendEmail\": {SendEmail}\r\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/addclienttoclass');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Authorization' => '{yourUserToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
      "ClientId": "{ClientId}",
      "ClassId": {ClassId},
      "RequirePayment": {RequirePayment},
      "Waitlist": {Waitlist},
      "SendEmail": {SendEmail}
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    payload = "{\r\n  \"ClientId\": \"{ClientId}\",\r\n  \"ClassId\": {ClassId},\r\n  \"RequirePayment\": {RequirePayment},\r\n  \"Waitlist\": {Waitlist},\r\n  \"SendEmail\": {SendEmail}\r\n}"
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{yourUserToken}"
        }
    
    conn.request("POST", "/public/v6/class/addclienttoclass", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/addclienttoclass")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{yourUserToken}'
    request.body = "{\r\n  \"ClientId\": \"{ClientId}\",\r\n  \"ClassId\": {ClassId},\r\n  \"RequirePayment\": {RequirePayment},\r\n  \"Waitlist\": {Waitlist},\r\n  \"SendEmail\": {SendEmail}\r\n}"
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/addclienttoclass

    This endpoint adds a client to a class or to a class waiting list. It is helpful to use this endpoint in the following situations:

    • Use after calling GET Clients and GET Classes so that you are sure which client to book in which class.
    • If adding a client to a class from a waiting list, use this call after you call GET WaitlistEntries and determine the ID of the waiting list from which you are moving the client.
    • If adding a client to a class and using a pricing option that the client has already purchased, use this call after you call GET ClientServices to determine the ID of the pricing option that the client wants to use.

    If you add a client to a class and the client purchases a new pricing option, use GET Services, GET Classes, and then POST CheckoutShoppingCart in place of this call.

    This endpoint also supports cross-regional class bookings. If you want to perform a cross-regional class booking, set CrossRegionalBooking to true. This endpoint also supports adding a user to a waiting list using a cross-regional client pricing option (service). Cross-regional booking workflows do not support client service scheduling restrictions.

    When performing a cross-regional class booking, this endpoint loops through the sites that the client is associated with, looks for client pricing options at each of those sites, and then uses the oldest client pricing option found. If you know that a client has a client service at another site, you can specify that site using the CrossRegionalBookingClientServiceSiteId query parameter.

    If you perform a cross-regional booking, two additional fields are included in the SessionType object of the response:

    • SiteID, which specifies where the client service is coming from
    • CrossRegionalBookingPerformed, a Boolean field that is set to true

    As a prerequisite to using this endpoint, your SourceName must have been granted access to the organization to which the site belongs.

    Request Body

    Name Type Description
    ClientId string The ID of the client who is being booked into the class.
    ClassId number The ID of the class into which the client is being booked.
    Test boolean When true, indicates that input information is validated, but not committed.
    When false, the information is committed and the database is affected.
    Default: false
    RequirePayment boolean When true, the client must have an active, usable pricing option on their account. When false or omitted, an active pricing option is not required to complete the client’s booking.
    Waitlist boolean When true, indicates that the client should be added to a specific class waiting list. When false, the client should not be added to the waiting list.
    SendEmail boolean When true, the subscriber’s configured Booking Confirmation automatic email is sent to the client. Note that an email is sent only if the client has an email address and automatic emails have been set up. When false, indicates that the client does not receive emails.
    Default: false
    WaitlistEntryId number The ID of the waiting list entry from which you are moving a client into a class.
    ClientServiceID number The ID of the pricing option on the client’s account that you want to use to pay for this booking, if payment is required at the time of the update.
    CrossRegionalBooking boolean When true, cross regional series are checked and used if applicable.
    CrossRegionalBookingClientServiceSiteId number If the request is cross regional, use a purchased pricing option from this specified site. If omitted, an attempt is made to use an applicable pricing option from the local site.

    Response

    {
        "Visit": {
            "AppointmentId": 0,
            "AppointmentGenderPreference": "None",
            "AppointmentStatus": "None",
            "ClassId": 2544,
            "ClientId": "100000186",
            "StartDateTime": "2019-11-01T06:00:00",
            "EndDateTime": "2019-11-01T07:00:00",
            "Id": 12186,
            "LastModifiedDateTime": "2019-11-05T16:55:49.66Z",
            "LateCancelled": false,
            "LocationId": 1,
            "MakeUp": false,
            "Name": "Intro to Hot Yoga",
            "ServiceId": 1154,
            "ServiceName": "Hot Yoga - Drop In",
            "ProductId": 4266,
            "SignedIn": true,
            "StaffId": 100000122,
            "WebSignup": false,
            "Action": "Added",
            "CrossRegionalBookingPerformed": false,
            "SiteId": null,
            "WaitlistEntryId": null
        }
    }     
    
    Name Type Description
    AppointmentId number The appointment’s ID.
    AppointmentGenderPreference string The gender of staff member with whom the client prefers to book appointments. Possible values are:
    • Female - Indicates that the client prefers to book appointments with female staff members.
    • Male - Indicates that the client prefers to book appointments with male staff members.
    • None - Indicates that the client does not have a staff member gender preference.
    AppointmentStatus string The status of the appointment. Possible values are:
  • None
  • Requested
  • Booked
  • Completed
  • Confirmed
  • Arrived
  • NoShow
  • Cancelled
  • LateCancelled
  • ClassId number The class ID that was used to retrieve the visits.
    ClientId string The ID of the client associated with the visit.
    StartDateTime string The time this class is scheduled to start.
    EndDateTime string The time this class is scheduled to end.
    Id number The ID of the class visit.
    LastModifiedDateTime string When included in the request, only records modified on or after the specified LastModifiedDate are included in the response. The Public API returns UTC dates and times. For example, a class that occurs on June 25th, 2018 at 2:15PM (EST) appears as “2018-06-25T19:15:00Z” because EST is five hours behind UTC. Date time pairs always return in the format YYYY-MM-DDTHH:mm:ssZ.
    LateCancelled boolean When true, indicates that the class has been LateCancelled.
    When false, indicates that the class has not been LateCancelled.
    LocationId number The ID of the location where the visit took place or is to take place.
    MakeUp boolean When true, the client can make up this session and a session is not deducted from the pricing option that was used to sign the client into the enrollment. When the client has the make-up session, a session is automatically removed from a pricing option that matches the service category of the enrollment and is within the same date range of the missed session.
    When false, the client cannot make up this session.
    See Enrollments: Make-ups for more information.
    Name string The name of the class.
    ServiceId number The unique ID assigned to this pricing option when it was purchased by the client.
    ServiceName string The name of the pricing option at the site where it was purchased.
    ProductId number The ID of the pricing option at the site where it was purchased.
    SignedIn boolean When true, indicates that the client has been signed in.
    When false, indicates that the client has not been signed in.
    StaffId number The ID of the staff member who is teaching the class.
    WebSignup boolean When true, indicates that the client signed up online.
    When false, indicates that the client was signed up by a staff member.
    Action string The action taken. Possible values are:
    • None
    • Added
    • Updated
    • Failed
    • Removed
    CrossRegionalBookingPerformed boolean When true, indicates that the client is paying for the visit using a pricing option from one of their associated cross-regional profiles.
    SiteId number The ID of the business from which cross-regional payment is applied.
    WaitlistEntryId number When this value is not null, it indicates that the client is on the waiting list for the requested class. The only additional fields that are populated when this is not null are:
    • ClassId
    • ClientId
    You can call GET WaitlistEntries using WaitlistEntryId to obtain more data about this waiting list entry.

    POST RemoveClientFromClass

    curl -X POST \
      https://api.mindbodyonline.com/public/v6/class/removeclientfromclass \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}' \
      -d '{
        "ClientId": "{ClientId}",
        "ClassId": {ClassId},
        "Test": {Test},
        "SendEmail": {SendEmail},
        "LateCancel": {LateCancel}
    }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/removeclientfromclass");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddParameter("application/json", "{\n\t\"ClientId\": \"{ClientId}\",\n\t\"ClassId\": {ClassId},\n\t\"Test\": {Test},\n\t\"SendEmail\": {SendEmail},\n\t\"LateCancel\": {LateCancel}\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/removeclientfromclass');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'Authorization' => '{staffAuthToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
        "ClientId": "{ClientId}",
        "ClassId": {ClassId},
        "Test": {Test},
        "SendEmail": {SendEmail},
        "LateCancel": {LateCancel}
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    payload = "{\n\t\"ClientId\": \"{ClientId}\",\n\t\"ClassId\": {ClassId},\n\t\"Test\": {Test},\n\t\"SendEmail\": {SendEmail},\n\t\"LateCancel\": {LateCancel}\n}"
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{staffAuthToken}"
        }
    
    conn.request("POST", "public/v6/class/removeclientfromclass", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/removeclientfromclass")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request.body ="{\n\t\"ClientId\": \"{ClientId}\",\n\t\"ClassId\": {ClassId},\n\t\"Test\": {Test},\n\t\"SendEmail\": {SendEmail},\n\t\"LateCancel\": {LateCancel}\n}"
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/removeclientfromclass

    Request Body

    Name Type Description
    ClientId string The RSSID of the client to remove from the specified class.
    ClassId number The ID of the class that you want to remove the client from.
    Test
    Optional
    boolean When true, the request ensures that its parameters are valid without affecting real data.
    When false, the request performs as intended and may affect live client data.
    Default: false
    SendEmail
    Optional
    boolean When true, indicates that the client should be sent an email. Depending on the site and client settings, an email may or may not be sent.
    Default: false
    LateCancel
    Optional
    boolean When true, indicates that the client is to be late cancelled from the class. When false, indicates that the client is to be early cancelled from the class.
    Default: false

    Response

    Example Response

    {
        "Class": {
            "ClassScheduleId": 372,
            "Visits": [],
            "Clients": [
                {
                    "AppointmentGenderPreference": "None",
                    "BirthDate": "1989-12-17T00:00:00",
                    "Country": "US",
                    "CreationDate": "2018-06-20T13:42:14.587",
                    "ClientCreditCard": null,
                    "ClientIndexes": null,
                    "ClientRelationships": null,
                    "FirstAppointmentDate": null,
                    "FirstName": "John",
                    "Id": "100000123",
                    "IsCompany": false,
                    "IsProspect": false,
                    "LastName": "Smith",
                    ...
                }
            ],
            "Location": {
                "AdditionalImageURLs": [],
                "Address": "123 Main Street",
                "Address2": null,
                "Amenities": null,
                "BusinessDescription": null,
                "City": "San Luis Obispo",
                "Description": "Yoga studio",
                "HasClasses": true,
                "Id": 1,
                "Latitude": 35.246934,
                "Longitude": -120.643445,
                "Name": "Location 1",
                ...
            },
            "Resource": null,
            "MaxCapacity": 10000,
            "WebCapacity": 10000,
            "TotalBooked": 26,
            "TotalBookedWaitlist": 0,
            "WebBooked": 5,
            "SemesterId": null,
            "IsCanceled": false,
            "Substitute": true,
            "Active": true,
            "IsWaitlistAvailable": false,
            "IsEnrolled": null,
            "HideCancel": false,
            "Id": 23455,
            "IsAvailable": true,
            "StartDateTime": "2029-12-31T05:00:00",
            "EndDateTime": "2029-12-31T09:45:00",
            "LastModifiedDateTime": "0001-01-01T00:00:00",
            ...
        }
    }
    
    Name Type Description
    Class object Contains information about the class. See Class for a description of Class information.

    POST RemoveFromWaitlist

    curl -X POST \
      https://api.mindbodyonline.com/public/v6/class/removefromwaitlist \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}' \
      -d '{
        "WaitlistEntryIds": [{SomeWaitListEntryId1},{SomeWaitListEntryId2}]
    }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/removefromwaitlist");
    var request = new RestRequest(Method.POST);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddParameter("application/json", "{\n\t\"WaitlistEntryIds\": [{SomeWaitListEntryId1},{SomeWaitListEntryId2}]\n\t}" , ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/removefromwaitlist');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setHeaders(array(
      'User-Agent' => '{yourAppName}',
      'Authorization' => '{staffAuthToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
        "WaitlistEntryIds": [{SomeWaitListEntryId1},{SomeWaitListEntryId2}]
    }');
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    payload = "{\n\t\"WaitlistEntryIds\": [{SomeWaitListEntryId1},{SomeWaitListEntryId2}]\n}"
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{staffAuthToken}",
        'User-Agent': "{yourAppName}"
        }
    
    conn.request("POST", "public/v6/class/removefromwaitlist", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/removefromwaitlist")
    
    http = Net::HTTP.new(url.host, url.port)
    
    request = Net::HTTP::Post.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    request.body = "{\n\t\"WaitlistEntryIds\": [{SomeWaitListEntryId1},{SomeWaitListEntryId2}]\n}"
    
    response = http.request(request)
    puts response.read_body
    

    https://api.mindbodyonline.com/public/v6/class/removefromwaitlist

    Request Body

    Name Type Description
    WaitlistEntryIds list of numbers A list of WaitlistEntryIds to remove from the waiting list.

    This endpoint does not return a response. If a call to this endpoint results in a 200 OK HTTP status code, then the call was successful.

    POST SubstituteClassTeacher

    https://api.mindbodyonline.com/public/v6/class/substituteclassteacher

    curl -X POST \
      'https://api.mindbodyonline.com/public/v6/class/substituteclassteacher'\
      -H 'Api-Key: {yourApiKey}' \
      -H 'SiteId: {yourSiteId}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -A '{yourAppName}'\
      -d '{
          "ClassId": {ClassId},
          "StaffId": {StaffId},
          "OverrideConflicts": {OverrideConflicts},
          "SendClientEmail": {SendClientEmail},
          "SendOriginalTeacherEmail": {SendOriginalTeacherEmail},
          "SendSubstituteTeacherEmail": {SendSubstituteTeacherEmail}
       }'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/class/substituteclassteacher");
    var request = new RestRequest(Method.POST);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\r\n    \"ClassId\": {ClassId},\r\n    \"StaffId\": {StaffId},\r\n     \"OverrideConflicts\": {OverrideConflicts},\r\n    \"SendOriginalTeacherEmail\": {SendOriginalTeacherEmail},\r\n    \"SendClientEmail\": {SendClientEmail}, \r\n     \"SendSubstituteTeacherEmail\": {SendSubstituteTeacherEmail}, \r\n }",  ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HTTP_Request();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/class/substituteclassteacher');
    $request->setMethod(HTTP_METH_POST);
    
    $request->setQueryData(array(
        'startDate' => '{someStartDate}',
        'endDate'   => '{someEndDate}'
    ));
    
    
    $request->setHeader(array(
      'User-Agent' => '{yourAppName}',
      'Api-Key' => '{yourApiKey}',
      'SiteId' => '{yourSiteId}',
      'Authorization' => '{staffAuthToken}',
      'Content-Type' => 'application/json'
    ));
    
    $request->setBody('{
       "ClassId"=> {ClassId},
       "StaffId" => {StaffId},
       "OverrideConflicts" => {OverrideConflicts},
       "SendClientEmail" => {SendClientEmail},
       "SendOriginalTeacherEmail" => {SendOriginalTeacherEmail},
       "SendSubstituteTeacherEmail"=> {SendSubstituteTeacherEmail},
      }');
    
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    import mimetypes
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
      'Content-Type': "application/json",
      'Api-Key': "{yourApiKey}",
      'SiteId': "{yourSiteId}",
      'Authorization': "{staffAuthToken}",
      'User-Agent': "{yourAppName}"
    }
    
    payload = "{\r\n   \"ClassId\": {ClassId},\r\n    \"StaffId\": {StaffId},\r\n     \"OverrideConflicts\": {OverrideConflicts},\r\n    \"SendOriginalTeacherEmail\": {SendOriginalTeacherEmail},\r\n    \"SendClientEmail \": {SendClientEmail}, \r\n   \"SendSubstituteTeacherEmail\": {SendSubstituteTeacherEmail}, \r\n }"
    
    conn.request("POST", "/public/v6/class/substituteclassteacher", payload , headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require "uri"
    require "net/http"
    
    url = URI("https://api.mindbodyonline.com/public/v6/class/substituteclassteacher")
    
    https = Net::HTTP.new(url.host, url.port);
    https.use_ssl = true
    
    request = Net::HTTP::Get.new(url)
    request["Content-Type"] = 'application/json'
    request["Api-Key"] = '{yourApiKey}'
    request["SiteId"] = '{yourSiteId}'
    request["Authorization"] = '{staffAuthToken}'
    request["User-Agent"] = '{yourAppName}'
    request.body="{\r\n   \"ClassId\": {ClassId},\r\n    \"StaffId\": {StaffId},\r\n     \"OverrideConflicts\": {OverrideConflicts},\r\n    \"SendOriginalTeacherEmail\": {SendOriginalTeacherEmail},\r\n    \"SendClientEmail \": {SendClientEmail}, \r\n   \"SendSubstituteTeacherEmail\": {SendSubstituteTeacherEmail}, \r\n }"
    response = https.request(request)
    puts response.read_body
    

    Request Body

    Name Type Description
    ClassId number The ID of the class to which a substitute teacher needs to be assigned.
    StaffId number The staff ID of the teacher to substitute.
    OverrideConflicts boolean When true, overrides any conflicts in the schedule.
    SendClientEmail boolean When true, sends the client an automatic email about the substitution, if the client has opted to receive email.
    SendOriginalTeacherEmail boolean When true, sends the originally scheduled teacher an automatic email about the substitution.
    SendSubstituteTeacherEmail boolean When true, sends the substituted teacher an automatic email about the substitution.

    Response

    Name Type Description
    Class object Contains information about the class that is being assigned a substitute teacher. This class object differs from other references to Class and is only used by this endpoint.
    Class.ClassScheduleId number The class schedule ID of the requested class.
    Class.Location list of objects Contains information about the location where the class is taking place. See Location for a description of Location information.
    Class.MaxCapacity number The total number of bookings allowed in the class.
    Class.WebCapacity number The total number of online bookings allowed in the class.
    Class.TotalBooked number The total number of clients who are booked into the class prior to this call being made.
    Class.TotalBookedWaitlist number The total number of booked clients who are on the waiting list for the class prior to this call being made.
    Class.WebBooked number The total number of bookings in the class made by online users, prior to this call being made. This property is the current number of bookings counted toward the WebCapacity limit.
    Class.SemesterId number Identifies the semester assigned to this class.
    Class.IsCanceled boolean When true, indicates that the class has been canceled. When false, indicates that the class has not been canceled and may still be bookable.
    Class.Substitute boolean When true, indicates that the class is being taught by a substitute teacher.
    Class.Active boolean When true, indicates that the class is being shown to clients in consumer mode.
    Class.IsWaitlistAvailable boolean When true, indicates that the class has a waiting list and there is space available on the waiting list for another client. When false, indicates either that the class does not have a waiting list or there is no space available on the class waiting list.
    Class.HideCancel boolean When true, indicates that this class is hidden when cancelled. This property can be ignored when the IsCancelled property is false.
    When IsCancelled is true, the following logic should be used for this class:
    When true, indicates that this cancelled class should not be shown to clients.
    When false, indicates that this cancelled class should be shown on all schedules and have a visual indicator that the class has been cancelled.
    Class.Id number The unique identifier of the class.
    Class.IsAvailable boolean When true, indicates that the class can be booked. When false, that the class cannot be booked at this time.
    Class.StartDateTime string The date and time that this class is scheduled to start.
    Class.EndDateTime string The date and time when this class is scheduled to end.
    Class.LastModifiedDateTime string The last time the class was modified.
    Class.ClassDescription object Contains information about this class. See ClassDescription for a description of the ClassDescription information.
    Class.Staff object Contains information about the teacher of the class. See Staff for a description of the Staff information.
    Class.VirtualStreamLink string The link to the Mindbody-hosted live stream for the class. This is null when no live stream is configured for the class.

    Response

    Example Response

    
        "Class": {
        "ClassScheduleId": 372,
            "Location": {
              "AdditionalImageURLs": [],
              "Address": "4051 Broad Street Line2",
              "Address2": "San Luis Obispo CA 93401",
              "Amenities": null,
              "BusinessDescription": null,
              "City": "San Luis Obispo",
              "Description": "Location Description (Location & App Listings)",
              "HasClasses": true,
              "Id": 1,
              "Latitude": 35.246934,
              "Longitude": -120.643445,
              "Name": "Location 1 Bluefin/PayConexTest",
              "Phone": "8051234567",
              "PhoneExtension": "1111",
              "PostalCode": "93401",
              "SiteID": null,
              "StateProvCode": "CA",
              "Tax1": 0.1,
              "Tax2": 0.1,
              "Tax3": 0.13,
              "Tax4": 0.045,
              "Tax5": 0.1,
              "TotalNumberOfRatings": 0,
              "AverageRating": 0.0,
              "TotalNumberOfDeals": 0
            },
        "MaxCapacity": 10000,
        "WebCapacity": 10000,
        "TotalBooked": 5556,
        "TotalBookedWaitlist": 0,
        "WebBooked": 400,
        "SemesterId": null,
        "IsCanceled": false,
        "Substitute": true,
        "Active": true,
        "IsWaitlistAvailable": false,
        "HideCancel": false,
        "Id": 88966,
        "IsAvailable": true,
        "StartDateTime": "2029-12-31T05:00:00",
        "EndDateTime": "2029-12-31T09:45:00",
        "LastModifiedDateTime": "0001-01-01T00:00:00",
        "ClassDescription": {
          "Active": true,
          "Description": "<div style=\"text-align:center;\">\r\n<ul>\r\n<li><span style=\"color:#ff0000;\"><em><strong>This is the Description for for Yoga Class.</strong></em></span></li>\r\n</ul>\r\n</div>",
          "Id": 1,
          "ImageURL": "https://clients-content-aws.mbodev.me/studios/SOAPAPIAUTOMATEDINTEGRATIONTESTSITE/reservations/1.jpg?osv=636658943728737252",
          "LastUpdated": "2016-04-18T10:48:08.933",
          "Level": {
            "Id": 1,
            "Name": "Level 1",
            "Description": null
          },
          "Name": "Yoga Class",
          "Notes": "<div>This is a place for class notes.</div>",
          "Prereq": "<div><strong>This is a a place for Pre Requisite Notes</strong></div>",
          "Program": {
            "Id": 22,
            "Name": "Yoga Class 22",
            "ScheduleType": "Class",
            "CancelOffset": 0,
            "ContentFormats": [
              "InPerson"
            ]
          },
          "SessionType": {
            "Type": "All",
            "DefaultTimeLength": null,
            "Id": 5,
            "Name": "Yoga Class",
            "NumDeducted": 1,
            "ProgramId": 22
          },
          "Category": null,
          "CategoryId": null,
          "Subcategory": null,
          "SubcategoryId": null
        },
        "Staff": {
          "Address": null,
          "AppointmentInstructor": true,
          "AlwaysAllowDoubleBooking": false,
          "Bio": "",
          "City": null,
          "Country": "US",
          "Email": "[email protected]",
          "FirstName": "Manager",
          "HomePhone": null,
          "Id": 100000027,
          "IndependentContractor": false,
          "IsMale": true,
          "LastName": "Manager",
          "MobilePhone": null,
          "Name": null,
          "PostalCode": null,
          "ClassTeacher": true,
          "SortOrder": 0,
          "State": "0",
          "WorkPhone": null,
          "ImageUrl": "https://clients-content-aws.mbodev.me/studios/SOAPAPIAUTOMATEDINTEGRATIONTESTSITE/staff/100000027_large.jpg?osv=636462750307993663",
          "ClassAssistant": false,
          "ClassAssistant2": false,
          "EmploymentStart": null,
          "EmploymentEnd": null,
          "ProviderIDs": null,
          "Appointments": [],
          "Unavailabilities": [],
          "Availabilities": []
        },
        "VirtualStreamLink": null
      }
    
    

    Client

    GET ActiveClientMemberships

    curl -X GET \
      'https://api.mindbodyonline.com/public/v6/client/activeclientmemberships?clientId=someClientId' \
      -H 'Api-Key: {yourApiKey}' \
      -H 'Authorization: {staffAuthToken}' \
      -H 'Content-Type: application/json' \
      -H 'SiteId: {yourSiteId}' \
      -A '{yourAppName}'
    
    var client = new RestClient("https://api.mindbodyonline.com/public/v6/client/activeclientmemberships?clientId=someClientId");
    var request = new RestRequest(Method.GET);
    request.AddHeader("User-Agent", "{yourAppName}");
    request.AddHeader("Authorization", "{staffAuthToken}");
    request.AddHeader("SiteId", "{yourSiteId}");
    request.AddHeader("Api-Key", "{yourApiKey}");
    request.AddHeader("Content-Type", "application/json");
    IRestResponse response = client.Execute(request);
    
    <?php
    
    $request = new HttpRequest();
    $request->setUrl('https://api.mindbodyonline.com/public/v6/client/activeclientmemberships');
    $request->setMethod(HTTP_METH_GET);
    
    $request->setQueryData(array(
      'clientId' => 'someClientId'
    ));
    
    $request->setHeaders(array(
      'User-Agent' => '{yourAppName}',
      'Authorization' => '{staffAuthToken}',
      'SiteId' => '{yourSiteId}',
      'Api-Key' => '{yourApiKey}',
      'Content-Type' => 'application/json'
    ));
    
    try {
      $response = $request->send();
    
      echo $response->getBody();
    } catch (HttpException $ex) {
      echo $ex;
    }
    
    import http.client
    
    conn = http.client.HTTPSConnection("api.mindbodyonline.com")
    
    headers = {
        'Content-Type': "application/json",
        'Api-Key': "{yourApiKey}",
        'SiteId': "{yourSiteId}",
        'Authorization': "{staffAuthToken}",
        'User-Agent': "{yourAppName}"
        }
    
    conn.request("GET", "public/v6/client/activeclientmemberships?clientId=someClientId", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
    
    require 'uri'
    require 'net/http'
    
    url = URI("https://api.mindbodyonline.com/public/v6/client/activeclientmemberships?clientId=someClientId")
    
    http = Net::HTTP.new(url