Accounting » Configuration

Configuration

Introduction

Configuration uses the OData standard with HATEOAS-style navigation links to expose data and allow querying of the specific information that is needed. The Configuration resource provides read-only access to Tax Rates, Revenue Categories, Payment Methods, and Products.

While it is possible to pull all Configuration data at once, we recommend that you only retrieve the specific information that you need in order to ensure efficiency and scalability for your application.

How It Works

Check out the resource specification here.

Currently, only users with the role of MINDBODY Owner and the MINDBODY Automated System have permission to access this resource.

How To Use It

  • Scoping

    Every request to the Configuration endpoint must be scoped; a URL convention is used to specify the request scope. Currently the only supported scope type is subscriber, so every request must include the subscriber id.
    Requests should look like:
    https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration, where {subscriberId} is the supplied subscriber id.

  • odata.metadata=full

    You can use the $format parameter to specify the verbosity of the output; supplying "odata.metadata=full" will ensure all possible OData links are returned in the payload.

    For example, the following request:
    https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration?$format=application/json;odata.metadata=full
    will return a payload that looks like the following:

    {
        "@odata.context":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/$metadata#Configuration,
        "value":[
            {
                "@odata.type":"#subscriber.mindbodyonline.com.AccountingConfiguration",
                "@odata.id":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')",
                "@odata.editLink":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')",
                "Id":"{subscriberId}",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/TaxRates/$ref",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/TaxRates",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/RevenueCategories/$ref",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/RevenueCategories",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/PaymentMethods/$ref",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/PaymentMethods",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/Products/$ref",
                "[email protected]":"https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration('{subscriberId}')/Products"
            }
        ]
    }
                                    

    As you can see, the payload provides you with all possible links to retrieve the contained resources within the Configuration resource.

    Note that the above example payload provides you with the editLink for the resource, as specified by the OData standard, but as mentioned, the link is non-functional. The Configuration endpoint is read-only.

  • Fetching Contained Resources

    You have 2 options when trying to fetch the data contained within the Configuration resource. As illustrated above, you can use the navigation links provided when odata.metadata=full is specified to drill down into the contained resources.

    You can also utilize the $expand parameter in order to retrieve the information you need. Doing it this way allows for slightly more flexibility, because you can specify all the information you need at once (if you need more than one of the contained resources on Configuration) For example, retrieving all Tax Rates and Products on the Configuration would look like:
    https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration?$expand=TaxRates,Products
    This approach also allows you to provide specific filters on the contained resources that you retrieve. For example, a request to retrieve only the Tax Rates utilized at location 1 would look like:
    https://subscriber.mindbodyonline.com/odata/v4/Subscriber_{subscriberId}/Configuration?$expand=TaxRates($filter=LocationId eq '1')

Helpful Links