Accounting » AccountingIntegration/SaveXeroTaxRate

AccountingIntegration/SaveXeroTaxRate

Introduction

The SaveXeroTaxRate endpoint provides a way to create TaxRates within Xero. This allows your app to give the user the option of creating a TaxRate, when there is not an existing one that they wish to map their MINDBODY TaxRate to.

Note that this endpoint is specific to the accounting partner Xero; as more partners are added and the need arises, additional endpoints would be created to handle data creation within those integration partners.

How It Works

POST the necessary information using the SaveXeroTaxRateRequest object. The request against Xero's API is evented out; when it is processed and gets a successful response from Xero, it triggers a refresh (or hydration) of our cached data from Xero.

Currently, only users with the role of MINDBODY Owner have permission to access the SaveXeroTaxRate endpoint.

How To Use It

  • Scoping

    URL conventions are used to specify the request scope. Every request must provide 2 scope parameters: the subscriber domain scope (Subscriber/Region/Custom) and the accounting integration type scope. Currently the only supported domain scope type is subscriber, so every request must include the subscriber id. The only supported integration type for this endpoint is EAccountingIntegrationType.Xero.

    All requests should look like:
    https://subscriber.mindbodyonline.com/Subscriber_{subscriberId}/AccountingIntegration/Type_Xero/SaveXeroTaxRate, where {subscriberId} is the supplied subscriber id.

  • Detecting the New Rate

    If your app needs to know when the TaxRate has been successfully added and pull it into the UI, you can follow a process similar to detecting the success of a Refresh call (see Determining the Refresh is Complete). You would store the timestamp at which you initiated the call, and then poll the Initialize endpoint and look for an entry in InspectionTimes more recent than your timestamp. Once it exists, the lists of TaxRates returned in the XeroConfiguration model should contain the new rate; if it does not, something failed in the process of communication with Xero's API, and you should offer the user the chance to try the action again later.

    If you poll, we recommend the interval be no less than 5 seconds, with an exponential backoff.

Helpful Links