Accounting API

Introduction

The Accounting API is split into two main areas: 1) read-only access of resources pertinent to accounting needs, and 2) action that can be taken to link, configure, and maintain an accounting integration between MINDBODY and a third party.

Accounting Resources

These read-only, RESTful endpoints utilize the OData protocol to expose accounting resources with enhanced querying capability. You can visit the official OData website to learn more, but the basic idea is that you're able to drive which data is returned via simple query string parameters. Given a complex resource with navigation properties, you can choose to select out only those properties you're interested in, or conversely, expand out the properties you need to access. Simple filters can be included to ensure that the payload contains the data you need. Paging can also be accomplished easily, using the provided HATEOAS-style links that enable you to query the next page of results.

Our main goal in implementing the OData protocol is to ensure scalability on both sides of the request. The built-in paging that OData provides makes each server invocation more lightweight while still providing an easy-to-use system. In addition, you can tailor the payloads to your specific needs, ensuring that the data transfer time is not too long.

Things to keep in mind:

  • Filter specifications are not passed directly into our data access layer, so that no query vulnerabilities are exposed. But this also means that it's possible for there to be slight discrepancies between our data access layer and what is actually aligned with your request and returned by the API layer. However, the server guarantees consistent ordering, so you should always be able to navigate through all pages of results to get what you need.
  • While the OData protocol specifies all CRUD operations, the resources provided through the Accounting API are strictly read-only.
  • All OData requests share a common root URL, "odata", and from there the version must be specified. It is recommended for all new applications that you use the latest version available, which is currently version 4. The request URLs to OData resources will look like:

https://subscriber.mindbodyonline.com/odata/v4/...

The Resources:

  • Configuration

    Information that defines a subscriber's accounting setup lives in Configuration. This includes Tax Rates, Revenue Categories, Payment Methods, and Products.

  • Orders

    Completed sales that can be queried for accounting purposes.

  • History of Sent Data

    A historical log of all attempts made to sync data with an accounting partner, including information about time, status, and data synced.

Integration Actions

Integration actions are driven by the state of the integration (View the EIntegrationStatus Contract). It works like a state machine, as shown in the following diagram:

Integration State Diagram

The following endpoints are all the actions that can be taken to either discover and validate a current state, or attempt to transition from one state to another:

  • Initialize: Discover the current state of an integration, potentially as a precursor to additional action.
  • Map: Save the configuration on a stored integration (only valid for integrations in the state of Initialized or Configured).
  • Refresh: Manually pull new integration partner data into cache.
  • Remove: Remove a stored integration completely.
  • Resync: Retry a specific sync attempt.
  • Save: Save sync options on an integration and (potentially) move its state from Intialized to Configured.
  • SaveXeroTaxRate: Create a TaxRate within Xero.
  • Sync: Trigger a sync of data.

Try out these actions for yourself.