Sales Data
Claret Sales data APIs
The Sales GET
endpoint is paginated, so please refer to the Pagination documentation prior to usage.
As with all Claret API endpoints, the Sales APIs require token authentication. For instructions on how to retrieve and pass through the authentication token, please refer to the Authentication documentation.
All API documentation herein contains a {tenant}
section of the URL path. These should always be replaced with the name of the actual tenant making the API call (i.e., demo
, zymoeno
, etc.)
GET Sales
Sales data is available to retrieve at our RESTful GET
endpoint, and the structure of that data is somewhat customizable via the arguments described below.
GET
https://plan.claret.app/{tenant}/api/v1/sales
Retrieve paginated historical, forecast or transactional sales data.
Query Parameters
Name | Type | Description |
---|---|---|
sale_type_name* | string | The |
start_date* | date string | The start date of the query pull. Based on the sell_date. Format: YYYY-MM-DD |
duration* | integer | Integer value representing the number of days from the start date that the query should pull data for. |
include_flattened_hierarchy | tiny integer (1 or 0) | When set to |
current_index* | integer | For data loads larger than 1000 records, this parameter will not be required on the initial request, but must be included for each additional request. Please see the Pagination documentation for details. |
The following examples contain the data structure for responses with and without the include_flattened_hierarchy
flag
POST Sales
Sales data can be posted to Claret using the RESTful POST
endpoint outlined below.
Please Note: This endpoint is currently in beta, and may not behave as expected.
⚠️ Do not use for production data.
POST
https://plan.claret.app/{tenant}/api/v1/sales
🚧 UNDER CONSTRUCTION 🚧
The POST
endpoint for Sales records receives an arguments
object and a content
array of Sales objects to be processed.
Request Body
Name | Type | Description |
---|---|---|
arguments* | Object | The object containing key/value pairs for arguments pertaining to each of the objects within the "content" section - the "global" parameters for the request, as it were. |
content* | Array | An array containing each of the Sales records objects that will be processed as part of the request. |
(arguments) sale_type_name* | string | As part of the |
(arguments) create_missing_item_customer_group | tiny integer (1 or 0) | As part of the |
(content) item_name* | string | As part of each object contained in the |
(content) customer_group_name* | string | As part of each object contained in the |
(content) sell_date* | date string | As part of each object contained in the |
(content) timing_interval_name* | string | As part of each object contained in the |
(content) quantity* | integer | As part of each object contained in the |
Last updated