Retrieve the sales report of a center
NOTE : This API is deprecated. Requesting not to use this API for any new integrations as the data cannot be reconciled to new sales accrual/sales cash reports available in the UI. This API retrieves the list of sales of the specified center during the selected date range.You must specify appropriate details for the center_id, start_date, and end_date parameters in the API request.Note : The date range that you specify cannot be more than seven days.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/sales/salesreport
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| center_id | string | Yes | — | Mandatory Unique 32-character identifier of the center. |
| start_date | string (date) | Yes | — | Mandatory Start date from which the report displays the required data. Here, the start time and date refers to the starting time and date of the specified center, not of UTC. Format:YYYY-MM-DD For example, if you specify 'start_date' as 2020-08-03, this API displays the appointments that have appointment start date beginning from Aug 3, 2020. |
| end_date | string (date) | Yes | — | Mandatory End date (inclusive) until which the report displays the required data. Here, the end time and date refers to the ending time and date of the specified center, not of UTC. Format:YYYY-MM-DD For example, if you specify 'end_date' as 2020-08-05, this API displays the appointments that have appointment start date until Aug 5, 2020 (inclusive). |
| item_type | integer (int32) | No | — | Optional Type of the item (default value is 0): 0 - Service, 2 - Product, 3 - Membership, 4 - Package, 6 - Gift Card, and 7 - All. |
| status | integer (int32) | No | — | Optional Status of the invoice (Default value is 0): 0 - Open, 1 - Closed, and 2 - All. |
Response
Success (200 OK)
{}
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/sales/salesreport?center_id={{center_id}}&start_date={{start_date}}&end_date={{end_date}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/sales/salesreport', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/sales/salesreport',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/sales/salesreport");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/sales/salesreport')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |