Retrieve the consumption details of products for a center
This API retrieves the consumption details of all products for the specified center.
You must specify appropriate details for the center_id, start_date, and end_date parameters. Optionally, you can provide the necessary details for the report_type and product_code parameters.
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/inventory/stock_movement
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 consumption details of all products are to be retrieved. |
| end_date | string (date) | Yes | — | Mandatory End date until which the consumption details of all products are to be retrieved. |
| report_type | enum (1, 2, 3) | No | 1 | Optional Indicates the report for the specific type of products: 1 - All, 2 - retail, and 3 - Consumable. Default value: 1. |
| product_code | string | No | — | Optional Product code for which the report has to be fetched. Default value: null. |
Response
Success (200 OK)
{}
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/inventory/stock_movement?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/inventory/stock_movement', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/inventory/stock_movement',
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/inventory/stock_movement");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/inventory/stock_movement')
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 |