NAV Navbar

Mindbody Consumer API

Getting Started

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

  1. Create a Mindbody developer account.
  2. Write your application, using the Mindbody playground for development and testing.
  3. Request approval from Mindbody to take your application live.
  4. This account will be referred as third parties having access to consumer information.

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
  2. Click Submit.
    You can then log in to your developer account from https://developers.mindbodyonline.com/Home/LogIn

Using the playground

Login to Playground

After logging in, you will land in the playground environment on the Mindbody Developer Portal.

Create OAuth Client

  1. Enable the OAuth Client for your developer account: Enable the OAuth Client by filling up Contact API Support form by specifying below information in the description field “Please enable the OAuth client for consumer API” for the developer account associated with the email id: .
  2. Create OAuth Client: To create an OAuth client, go to Profile dropdown -> Account -> API Credentials -> OAuth.
  3. Select the type (Native, Single-page, Web) of application you want to build.
  4. In the Create Client wizard, please fill all mandatory fields and set the value in “Client Use for” dropdown as “Consumer API Access”.
  5. In the New Client Secret wizard, copy the client secret value and close the wizard. Now you will be able to see created OAuth client.

Note: OAuth 2.0 is the industry-standard protocol for authorization. OAuth clients are applications that securely authenticate with the Mindbody Identity Provider without revealing the user’s identity or credentials.

Create test consumer account (Optional)

Create a new test consumer account on https://account.mindbodyonline.com

Get Consumer Consent

Call identity OAuth 2.0 endpoints to get the consumer token for the consented consumer (this can be a test consumer account which you can use for the playground).

  1. To initiate sign-in workflow use https://signin.mindbodyonline.com/connect/authorize
  2. You can get the access token from https://signin.mindbodyonline.com/connect/token

Note: The users should use Mindbody credentials to provide a consent to the third parties.

Generate Test Data

After getting a consumer token, you need to create test data using Consumer API endpoints from Consumer Test Data

Fetch Test Data

This test data can be fetched using the below endpoints in a Playground environment. Get Visits Get Purchases

Go Live

After testing in a playground environment, you can click on go-live on the developer portal to move your account to production. As our team reviews, it might take a couple of business days to bring you to live in production. Your billing will start on the day you go live.

Note

  1. Remember to disconnect test consumer accounts (if you have created them) during playground testing to avoid billing after going live in production.
  2. Please review consumer API pricing before going live in production.

Important things to remember

  1. The consumer’s visit and purchase data will be available 24 hours after they provide consent.
  2. In the playground environment, you will be able to fetch only test data using the purchase and visit endpoints.
  3. You can set the test flag in visits and purchase endpoints to get test data post go live.
  4. Disconnect your test consumer accounts in the production environment using the disconnectConsumer endpoint to avoid additional billing for these accounts. Mindbody does not differentiate consumer accounts in the playground and production environment.
  5. Test Data will be removed 30 days after creation, and the partner will have to re-create the data.

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 following Swagger documentation where you can explore API calls in your browser.

OAuth Sign In Swagger - Sign In API Swagger documentation

Postman

Check out the Consumer API Postman Customer Collection. It helps to create and fetch diverse test data.

Run in Postman

Sample Code

Check out the code of the sample application we have created to explain how one can integrate with Consumer API.

Frequently Asked Questions

This section provides answers to questions that we hear frequently from developers.

What is a Mindbody account?

A Mindbody account is a secure login that allows your clients to use a single username and password across the MINDBODY family of products. This means that a client who finds your business through the MINDBODY app can use that same login on a desktop computer or your branded mobile app without the need to register a new account.

You can verify if your clients have a Mindbody account linked to your business under their client info screen. Click here to learn more. https://support.mindbodyonline.com/s/article/MINDBODY-Account-FAQ?language=en_US

For more information about the MINDBODY account, please visit this link - https://support.mindbodyonline.com/s/article/MINDBODY-Account-FAQ?language=en_US

Why is Mindbody making the switch to OAuth?

OAuth is an open-standard authorization protocol or framework that provides applications the ability to secure designated access. This authentication protocol approves one application interacting with another on your behalf, without sharing any passwords.

Do I have to use a full-page redirect in my integration?

Yes. While registering OAuth client, redirect URL needs to be configured for the full-page redirect.

Can I use my access tokens in any of Mindbody’s other APIs?

Yes, with the right scope(s), you should be able to access Public APIs V6, Platform APIs, and Consumer APIs.

Do I need to swap out my entire integration to use Mindbody accounts?

Now Mindbody APIs can work with the new consumer token that can be retrieved using OAuth workflow for Mindbody accounts.

Authentication

HTTPS

All calls to the Consumer 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, and Authorization headers:

curl -X GET \
  'https://api.mindbodyonline.com/partnergateway/accounts/v1/me' \
  -H 'Api-Key: {yourApiKey}' \
  -H 'authorization: {staffUserToken}' \
  -A '{yourAppName}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/accounts/v1/me");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "{staffUserToken}");
request.AddHeader("Api-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/accounts/v1/me');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Authorization' => '{staffUserToken}',
  '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}",
    'authorization': "{staffUserToken}"
    }

conn.request("GET", "/partnergateway/accounts/v1/me", headers=headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/accounts/v1/me")

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["authorization"] = '{staffUserToken}'

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

The Mindbody Consumer API self-service API key management. When using the Consumer API, you must pass an API-Key header in your request to authenticate your integration.

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

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 headers.

OAuth

OAuth is another way to authorize endpoints by obtaining an access token. The OAuth 2.0 authorization is a framework that allows users 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 requests 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 a bearer access token to call Consumer 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=offline_access PG.ConsumerActivity.Api.Read&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=offline_access PG.ConsumerActivity.Api.Read&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=offline_access PG.ConsumerActivity.Api.Read&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=offline_access PG.ConsumerActivity.Api.Read&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=offline_access PG.ConsumerActivity.Api.Read&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 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 offline_access PG.ConsumerActivity.Api.Read. 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.

Response

After a consumer navigates to the authorized 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
302 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}&scope= offline_access PG.ConsumerActivity.Api.Read'
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}&scope= offline_access PG.ConsumerActivity.Api.Read", 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}&scope= offline_access PG.ConsumerActivity.Api.Read');

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}&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}&scope= offline_access  PG.ConsumerActivity.Api.Read"

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 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 offline_access PG.ConsumerActivity.Api.Read. 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 is used to associate a Client session with an ID Token.

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.

Base URL

https://api.mindbodyonline.com/partnergateway/consumeractivity

Handling Errors

To help with troubleshooting your integration, the Consumer 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.

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 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 the 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
invalid_api_key API Key provided in the request is not valid.
invalid_request One or more parameter(s) of the request is not valid or missing.
invalid_application The application partner is associated with must be active.
invalid_token OAuth client in the token is not valid.
resource_not_found Resource requested in the request does not exist.
missing_required_scope OAuth scopes are missing in the token provided.
unauthorized User is not authorized for provided request.
forbidden Request is forbidden due to invalid data provided in the request.
Conflict Conflict in the request due to invalid data provided in the request.
internal_server_error An internal error occurred on the server during request processing.

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 integration with the Mindbody Consumer 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.

Endpoints

Consumer

This section contains endpoints related to Consumer Activity for Visits & Purchases

GET Consumer Visits

Example request passing API-Key and Bearer Token:

curl -X GET \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/visits' \
  -H 'API-Key: {yourApiKey}' \
  -H 'Authorization: Bearer {accessToken}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/visits");
var request = new RestRequest(Method.GET);
request.AddHeader("API-Key", "{yourApiKey}");
request.AddHeader("Authorization", "Bearer {accessToken}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/visits');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'API-Key' => '{yourApiKey}',
  'Authorization' => 'Bearer {accessToken}'
));

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}",
    'Authorization': "Bearer {accessToken}"
    }

conn.request("GET", "partnergateway/consumer/activity/v1/visits", headers=headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/visits")

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["Authorization"] = 'Bearer {accessToken}'

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

Return a list of all verified visits of a consumer for a given duration

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/visits

Query Parameters

Name Type Description
startDate string Start date of the visit activity. It should be in “yyyy-mm-dd” format and it cannot be older than 3 months.
endDate string End date of the visit activity. It should be in “yyyy-mm-dd” format and future date is not allowed.
isTestData boolean Is test data of visit activity. If enabled then return test data of consumer else provide actual data.

Response

Example Response

"visits":[
        {
          "consumerId": "1234",
          "serviceName": "Gym Arrival",
          "serviceCategory": "Gym Arrival",
          "paymentMethod": "cash",
          "amountPaid": 25,
          "visitDate": "2021-09-30T08:51:58.610Z",
          "bookingDate": "2021-09-30T08:51:58.610Z",
          "businessName": "GymBusiness",
          "locationName": "Gym Location",
          "addressLine1": "SR street",
          "addressLine2": "SR block",
          "city": "Pune",
          "stateCode": "MM",
          "countryCode": "IN",
          "postalCode": "411038"
        },
        {
          "consumerId": "12345",
          "serviceName": "Yoga class",
          "serviceCategory": "Yoga",
          "paymentMethod": "cheque",
          "amountPaid": 10,
          "visitDate": "2021-09-30T08:51:58.610Z",
          "bookingDate": "2021-09-30T08:51:58.610Z",
          "businessName": "GymBusiness",
          "locationName": "Gym Location",
          "addressLine1": "SR street",
          "addressLine2": "SR block",
          "city": "Pune",
          "stateCode": "MM",
          "countryCode": "IN",
          "postalCode": "411038"
        }
    ]
Name Type Description
visits list of objects A list of all verified visits of a consumer for a given duration. See Visit for a description of the Visit information.

GET Consumer Purchases

Example request passing API-Key and Bearer Token:

curl -X GET \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/purchases' \
  -H 'API-Key: {yourApiKey}' \
  -H 'Authorization: Bearer {accessToken}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/purchases");
var request = new RestRequest(Method.GET);
request.AddHeader("API-Key", "{yourApiKey}");
request.AddHeader("Authorization", "Bearer {accessToken}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/purchases');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'API-Key' => '{yourApiKey}',
  'Authorization' => 'Bearer {accessToken}'
));

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}",
    'Authorization': "Bearer {accessToken}"
    }

conn.request("GET", "partnergateway/consumer/activity/v1/purchases", headers=headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/purchases")

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["Authorization"] = 'Bearer {accessToken}'

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

Return a list of all verified purchases of a consumer for a given duration

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/purchases

Query Parameters

Name Type Description
startDate string Start date of the purchase activity. It should be in “yyyy-mm-dd” format and it cannot be older than 3 months.
endDate string End date of the purchase activity. It should be in “yyyy-mm-dd” format and future date is not allowed.
isTestData boolean Is test data of purchase activity. If enabled then return test data of consumer else provide actual data.

Response

Example Response

    "purchases": [
        {
          "consumerId": "1234",
          "productName": "Yoga matt",
          "productCategory": "Yoga",
          "paymentMethod": "cash",
          "amountPaid": 10,
          "purchaseDate": "2021-09-30T11:13:47.953Z",
          "productType": "Retail",
          "quantity": 2
        },
        {
          "consumerId": "12345",
          "productName": "Gym gloves",
          "productCategory": "Gym",
          "paymentMethod": "cheque",
          "amountPaid": 50,
          "purchaseDate": "2021-09-30T11:13:47.953Z",
          "productType": "Retail",
          "quantity": 1
        }
    ]
Name Type Description
Purchase list of objects A list of all verified purchases of a consumer for a given duration. See Purchase for a description of the Purchase information.

DELETE Consumer

Example request passing API-Key and Bearer Token:

# curl -X DELETE \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/consumer' \
  -H 'API-Key: {yourApiKey}' \
  -H 'Authorization: Bearer {accessToken}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/consumer");
var request = new RestRequest(Method.DELETE);
request.AddHeader("API-Key", "{yourApiKey}");
request.AddHeader("Authorization", "Bearer {accessToken}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/consumer');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'API-Key' => '{yourApiKey}',
  'Authorization' => 'Bearer {accessToken}'
));

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}",
    'Authorization': "Bearer {accessToken}"
    }

conn.request("DELETE", "/partnergateway/consumer/activity/v1/consumer", headers=headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/consumer")

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

request = Net::HTTP::Delete.new(url)
request["API-Key"] = '{yourApiKey}'
request["Authorization"] = 'Bearer {accessToken}'

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

Disconnects consumer from partner

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/consumer

Response

Status Code Description
204 Disconnects consumer from partner

Business Directory

This section contains endpoints related to Business Directory

GET Business Directory

Example request passing API-Key:

curl -X GET \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/businesses' \
  -H 'API-Key: {yourApiKey}' \

var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/businesses");
var request = new RestRequest(Method.GET);
request.AddHeader("API-Key", "{yourApiKey}");
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/businesses');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  '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}",
    }

conn.request("GET", "partnergateway/consumer/activity/v1/businesses", headers=headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/businesses")

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}'

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

Returns a list of the businesses on the Mindbody Platform

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/businesses

Query Parameters

Name Type Description
pageNumber number Indicates the number of a page. For page number, only values greater than 0 are valid. Page number defaults to 1.
businessIds list of string Business Ids are the Ids of businesses to restrict results to.

Response

Example Response

{
  "pageCount": 10,
    "businesses":[
        {
          "id" = "fdcaf363-9952-4896-b7f7-da3158954f4a",
          "name" = "Chaitanya's Studio",
          "websiteUrl" = "https://www.test.com",
          "locations" = 
          [
            {
                "id" = "db9441b0-9545-47fa-808a-7588df1445d7",
                "name" = "Location 1",
                "addressLine1" = "Address Line 1",
                "addressLine2" = "Address Line 2",
                "city" = "Pune",
                "stateProvCode" = "MM",
                "postalCode" = "411038",
                "countryCode" = "IN",
                "bookingUrl" = "http://www.test123.com"
            }
          ]
        }
    ]
}
Name Type Description
pageCount number The total number of pages.
businesses list of objects A list of business data. See Business for a description of the Business information.

Consumer Test Data

This section contains endpoints related to creating Consumer Activity test data for Visits & Purchases

POST Test Data For Visits

Example request passing API-Key and Bearer Token:

curl -X POST \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/visit' \
  -H 'API-Key: {yourApiKey}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json' \
  -d '{
    "serviceName": "{serviceName}",
    "serviceCategory": "{serviceCategory}",
    "paymentMethod": "{paymentMethod}",
    "amountPaid": {amountPaid},
    "visitDate": "{visitDate}",
    "bookingDate": "{bookingDate}",
    "businessName": "{businessName}",
    "locationName": "{locationName}",
    "addressLine1": "{addressLine1}",
    "addressLine2": "{addressLine2}",
    "city": "{city}",
    "stateCode": "{stateCode}",
    "countryCode": "{countryCode}",
    "postalCode": "{postalCode}"
}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/visit");
var request = new RestRequest(Method.POST);
request.AddHeader("API-Key", "{yourApiKey}");
request.AddHeader("Authorization", "Bearer {accessToken}");
request.AddParameter("application/json", "{\r\n    \"serviceName\": \"{serviceName}\",\r\n    \"serviceCategory\": \"{serviceCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n      \"visitDate\": \"{visitDate}\",\r\n    \"bookingDate\": \"{bookingDate}\",\r\n    \"businessName\": \"{businessName}\",\r\n    \"locationName\": \"{locationName}\",\r\n    \"addressLine1\": \"{addressLine1}\",\r\n    \"addressLine2\": \"{addressLine2}\",\r\n    \"city\": \"{city}\",\r\n    \"stateCode\": \"{stateCode}\",\r\n    \"countryCode\": \"{countryCode}\",\r\n    \"postalCode\": \"{postalCode}\",\r\n    ]\r\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/visit');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'API-Key' => '{yourApiKey}',
  'Authorization' => 'Bearer {accessToken}'
));

$request->setBody('{
    "serviceName": "{serviceName}",
    "serviceCategory": "{serviceCategory}",
    "paymentMethod": "{paymentMethod}",
    "amountPaid": {amountPaid},
    "visitDate": "{visitDate}",
    "bookingDate": "{bookingDate}",
    "businessName": "{businessName}",
    "locationName": "{locationName}",
    "addressLine1": "{addressLine1}",
    "addressLine2": "{addressLine2}",
    "city": "{city}",
    "stateCode": "{stateCode}",
    "countryCode": "{countryCode}",
    "postalCode": "{postalCode}"
}');


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    \"serviceName\": \"{serviceName}\",\r\n    \"serviceCategory\": \"{serviceCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n     \"visitDate\": \"{visitDate}\",\r\n    \"bookingDate\": \"{bookingDate}\",\r\n    \"businessName\": \"{businessName}\",\r\n    \"locationName\": \"{locationName}\",\r\n    \"addressLine1\": \"{addressLine1}\",\r\n    \"addressLine2\": \"{addressLine2}\",\r\n    \"city\": \"{city}\",\r\n    \"stateCode\": \"{stateCode}\",\r\n    \"countryCode\": \"{countryCode}\",\r\n    \"postalCode\": \"{postalCode}\",\r\n   ]\r\n}"

headers = {
    'API-Key': "{yourApiKey}",
    'Authorization': "Bearer {accessToken}"
    }

conn.request("POST", "/partnergateway/consumer/activity/v1/simulate/visit", payload, headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/visit")

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["API-Key"] = '{yourApiKey}'
request["Authorization"] = 'Bearer {accessToken}'
request.body = "{\r\n    \"serviceName\": \"{serviceName}\",\r\n    \"serviceCategory\": \"{serviceCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n    \"visitDate\": \"{visitDate}\",\r\n    \"bookingDate\": \"{bookingDate}\",\r\n    \"businessName\": \"{businessName}\",\r\n    \"locationName\": \"{locationName}\",\r\n    \"addressLine1\": \"{addressLine1}\",\r\n    \"addressLine2\": \"{addressLine2}\",\r\n    \"city\": \"{city}\",\r\n    \"stateCode\": \"{stateCode}\",\r\n    \"countryCode\": \"{countryCode}\",\r\n    \"postalCode\": \"{postalCode}\",\r\n   ]\r\n}"



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

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/visit

Create a new test visit

Request Body

Name Type Description
serviceName string The service name of the visit
serviceCategory string The service category of the visit
paymentMethod string The payment method of the visit
amountPaid number The amount paid for the visit
visitDate string The date of the visit
bookingDate string The booking date of the visit
businessName string The business name of the site where this visit was made
locationName string The location name of the site where this visit was made
addressLine1 string The first line of the visit location’s street address
addressLine2 string A second address line for the visit location’s street address, if needed
city string The visit location’s city
stateCode string The visit location’s state or province code
countryCode string The visit location’s country code
postalCode string The visit location’s postal code

Response

Status Code Description
201 Visit test data created successfully.

POST Test Data For Purchases

Example request passing API-Key and Bearer Token:

curl -X POST \
  'https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/purchase' \
  -H 'API-Key: {yourApiKey}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'Content-Type: application/json' \
  -d '{
    "productName": "{productName}",
    "productCategory": "{productCategory}",
    "paymentMethod": "{paymentMethod}",
    "amountPaid": {amountPaid},
    "purchaseDate": "{purchaseDate}",
    "quantity": {quantity}
}'
var client = new RestClient("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/purchase");
var request = new RestRequest(Method.POST);
request.AddHeader("API-Key", "{yourApiKey}");
request.AddHeader("Authorization", "Bearer {accessToken}");
request.AddParameter("application/json", "{\r\n    \"productName\": \"{productName}\",\r\n    \"productCategory\": \"{productCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n      \"purchaseDate\": \"{purchaseDate}\",\r\n    \"quantity\": \"{quantity}\",\r\n    ]\r\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php

$request = new HttpRequest();
$request->setUrl('https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/purchase');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'API-Key' => '{yourApiKey}',
  'Authorization' => 'Bearer {accessToken}'
));

$request->setBody('{
    "productName": "{productName}",
    "productCategory": "{productCategory}",
    "paymentMethod": "{paymentMethod}",
    "amountPaid": {amountPaid},
    "purchaseDate": "{purchaseDate}",
    "quantity": {quantity}
}');


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    \"productName\": \"{productName}\",\r\n    \"productCategory\": \"{productCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n     \"purchaseDate\": \"{purchaseDate}\",\r\n    \"quantity\": \"{quantity}\",\r\n   ]\r\n}"

headers = {
    'API-Key': "{yourApiKey}",
    'Authorization': "Bearer {accessToken}"
    }

conn.request("POST", "/partnergateway/consumer/activity/v1/simulate/purchase", payload, headers)

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

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

url = URI("https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/purchase")

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["API-Key"] = '{yourApiKey}'
request["Authorization"] = 'Bearer {accessToken}'
request.body = "{\r\n    \"productName\": \"{productName}\",\r\n    \"productCategory\": \"{productCategory}\",\r\n    \"paymentMethod\": \"{paymentMethod}\",\r\n    \"amountPaid\": \"{amountPaid}\",\r\n    \"purchaseDate\": \"{purchaseDate}\",\r\n    \"quantity\": \"{quantity}\",\r\n   ]\r\n}"



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

https://api.mindbodyonline.com/partnergateway/consumer/activity/v1/simulate/purchase

Create a new test purchase

Request Body

Name Type Description
productName string The service name of the purchase
productCategory string The service category of the purchase
paymentMethod string The payment method of the purchase
amountPaid number The amount Paid for the purchase
purchaseDate string The date of the purchase
quantity number The booking date of the purchase

Response

Status Code Description
201 Purchase test data created successfully.

Shared Resources

Visit

Example Response

{
    "consumerId": "1234",
    "serviceName": "Cycling",
    "serviceCategory": "Cycling",
    "paymentMethod": "cash",
    "amountPaid": 20,
    "visitDate": "2021-09-30T08:51:58.610Z",
    "bookingDate": "2021-09-30T08:51:58.610Z",
    "businessName": "GymBusiness",
    "locationName": "Gym Location",
    "addressLine1": "SR street",
    "addressLine2": "SR block",
    "city": "Pune",
    "stateCode": "MM",
    "countryCode": "IN",
    "postalCode": "411038"
}

Visit contains verified visits of a consumer for a given duration.

Name Type Description
consumerId string The Id of the consumer.
serviceName string The service name of the visit.
serviceCategory string The service category of the visit.
paymentMethod string The payment method of the visit.
amountPaid number The amount paid for the visit.
visitDate string The date of the visit.
bookingDate string The booking date of the visit.
businessName string The business name of the site where this visit was made.
locationName string The location name of the site where this visit was made.
addressLine1 string The first line of the visit location’s street address.
addressLine2 string A second address line for the visit location’s street address, if needed.
city string The visit location’s city.
stateCode string The visit location’s state or province code.
countryCode string The visit location’s country code.
postalCode string The visit location’s postal code.

Purchase

Example Response

{
      "consumerId": "1234",
      "productName": "Fitness Class substription",
      "productCategory": "Cycling",
      "paymentMethod": "Cash",
      "amountPaid": 50,
      "purchaseDate": "2021-10-01T05:11:17.305Z",
      "productType": "Class",
      "quantity": 10
}

Purchase contains verified purchases of a consumer for a given duration.

Name Type Description
consumerId string The Id of the consumer.
productName string The product name of the purchase.
productCategory string The product category of the purchase.
paymentMethod string The payment method of the purchase.
amountPaid number The amount paid for the purchase.
purchaseDate string The date of the purchase.
productType string The product type of the purchase.
quantity number The quantity of the product purchased.

CreateVisit

Example Response

{
  "serviceName": "Cycling",
  "serviceCategory": "Cycling",
  "paymentMethod": "Cash",
  "amountPaid": 10,
  "visitDate": "2021-10-01T05:43:30.057Z",
  "bookingDate": "2021-09-30T05:43:30.057Z",
  "businessName": "GymBusiness",
  "locationName": "Gym Location",
  "addressLine1": "SR street",
  "addressLine2": "SR block",
  "city": "Pune",
  "stateCode": "MM",
  "countryCode": "IN",
  "postalCode": "411038"
}

CreateVisit contains verified visits of a consumer for a given duration.

Name Type Description
serviceName string The service name of the visit.
serviceCategory string The service category of the visit.
paymentMethod string The payment method of the visit.
amountPaid number The amount paid for the visit.
visitDate string The date of the visit.
bookingDate string The booking date of the visit.
businessName string The business name of the site where this visit was made.
locationName string The location name of the site where this visit was made.
addressLine1 string The first line of the visit location’s street address.
addressLine2 string A second address line for the visit location’s street address, if needed.
city string The visit location’s city.
stateCode string The visit location’s state or province code.
countryCode string The visit location’s country code.
postalCode string The visit location’s postal code.

Business

Example Response

{
  "id": "fdcaf363-9952-4896-b7f7-da3158954f4a",
  "name": "Chaitanya's Studio",
  "websiteUrl": "https://www.test.com",
  "locations":
  [
    {
        "id": "db9441b0-9545-47fa-808a-7588df1445d7",
        "name": "Location 1",
        "addressLine1": "Address Line 1",
        "addressLine2": "Address Line 2",
        "city": "Pune",
        "stateProvCode": "MM",
        "postalCode": "411038",
        "countryCode": "IN",
        "bookingUrl": "http://www.test123.com"
    }
   ]
}

Business contains business information.

Name Type Description
id number The id of the business.
name string The name of the business.
websiteUrl string The website url of the business.
locations list of objects The locations of the business.
id number The id of the location of business.
name string The name of the location of business.
addressLine1 string The first line of the business location’s street address.
addressLine2 string A second address line for the business location’s street address, if needed.
city string The business location’s city.
stateProvCode string The business location’s state or province code.
postalCode string The business location’s postal code.
countryCode string The business location’s country code.
bookingUrl string The booking url of the business.

CreatePurchase

Example Response

{
  "productName": "Fitness Class substription",
  "productCategory": "Cycling",
  "paymentMethod": "Cash",
  "amountPaid": 25,
  "purchaseDate": "2021-10-01T05:48:58.287Z",
  "quantity": 5
}

CreatePurchase contains verified purchases of a consumer for a given duration.

Name Type Description
productName string The product name of the purchase.
productCategory string The product category of the purchase.
paymentMethod string The payment method of the purchase.
amountPaid number The amount paid for the purchase.
purchaseDate string The date of the purchase.
quantity number The quantity of the product purchased.
;