# Club Automation

## Gaining API access

To get API credentials to access Club Automation data you will either need to be Daxko partner or, if you are Club Automation customer, you'll need to contact your Daxko rep.

{% embed url="<https://docs.partners.daxko.com/#getting-api-access>" %}

## Require credentials

To authenticate with Club Automation's APIs you'll need a `client_id` (corresponds to the API client), `client_secret`, and `scope_id` (corresponds to the Club Automation instance you are accessing). These are [entered in the Middle app connection](https://docs.middle.app/middle-docs/building-workflows#app-connection).

| key             | value                                                                                                                                                                                                                                         |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `client_id`     | This will be the username you were provided when your API credentials were generated.                                                                                                                                                         |
| `client_secret` | This will be the password you were provided when your API credentials were generated. **Your password should be securely stored and should only be required when you first generate your access token.**                                      |
| `scope`         | This is the ID for the customer/client you are trying to programmatically interact with. *Note that, while you may have access to multiple clients in your account, you will need to generate a new token for each client you are accessing.* |
| `grant_type`    | This will always be set to `client_credentials`when getting a new token.                                                                                                                                                                      |

{% embed url="<https://docs.partners.daxko.com/tutorials/authentication/#getting-a-new-set-of-jwt-credentials>" %}

## Sales data

Middle uses Club Automation's reports API to pull sales data. Middle uses the `BETA - Financial Sales Revenue` report.

{% hint style="warning" %}
You'll need to confirm that your API client has access to the reports API
{% endhint %}
