Stock List Rules
Whippy Ware enables stock calculation based on stock locations and providers. In order to do this, the user needs to define a calculation rule which will work in the background of the application. The brand provides stock providers, stock locations, and location-based/independent safety stocks to be used for the preparation of a stock list. Stock list rules should be defined to do this. Rule types can be as follows;
List Stock List Rules
This method is used to list objects of StockListRule model.
GET
List-Stock-List-Rules
Path: /api/v1/stock-list-rules/
Parameters
api_token
string
header
The API key of the customer account
limit
integer
query
The amount of line items returned per page
page
string
query
The number of page returned
Example Request
Example Response (200 OK)
The response includes the following parameters.
id
string
The primary key of the created list
name
string
The name of the rule
rule_type
string
The type of the rule
rule
dictionary
The rule of the stock list
created_date
date
The creation date
modified_date
date
The last modified date
is_active
boolean
The activation status of the rule
Stock List Rule Instance
This method is used to get stock list rule instance specified with the Rule ID.
GET
Stock-List-Rule-Instance
Path: api/v1/stock-list-rules/{rule_id}/
Parameters
api_token
string
header
The API key of the customer account
{rule_id}
string
query
The ID of the rule
Example Request
Example Response (200 OK)
The response includes the following parameters.
id
string
The primary key of the created list
name
string
The name of the rule
rule_type
string
The type of the rule
rule
dictionary
The rule of the stock list
created_date
date
The creation date
modified_date
date
The last modified date
is_active
boolean
The activation status of the rule
Filters
The applicable filters are as follows.
Create Stock List Rule
This method is used to create a new stock list rule object based on the information in the request body.
POST
Create-Stock-List-Rule
Path: /api/v1/stock-list-rules/
Example Request
Example Response (201 Created)
The response includes the following parameters.
id
string
The primary key of the created list
name
string
The name of the rule
rule_type
string
The type of the rule
rule
dictionary
The rule of the stock list
created_date
date
The creation date
modified_date
date
The last modified date
is_active
boolean
The activation status of the rule
Search Stock List Rules
This method is used to search stock list rules.
GET
Search-Stock-List-Rules
Path: /api/v1/stock-list-rules/?name=<string>&is_active=<string>&rule_type=<string>&sort=<string>&page=<integer>&limit=<integer>
Parameters
api_token
string
header
The API key of the customer account
name
string
query
The name of the rule
rule_type
string
query
The type of the rule
is_active
boolean
query
The activation status of the rule
limit
integer
query
The amount of line items returned per page
page
string
query
The number of page returned
Example Request
Example Response (200 OK)
The list of stock list rule objects according to the filter parameters is returned.
Filters
The following filters can be applied via the request URL.
Stock List Rule Partial Update
This method is used to partially update a stock-list-rule object.
PATCH
Stock-List-Rule-Partial-Update
Path: /api/v1/stock-list-rules/{rule_id}/
Parameters
api_token
string
header
The API key of the customer account
{rule_id}
string
query
The stock list rule ID
Example Request
Example Response (200 OK)
The response includes the following parameters.
id
string
The primary key of the created list
name
string
The name of the rule
rule_type
string
The type of the rule
rule
dictionary
The rule of the stock list
is_active
boolean
The activation status of the rule
Stock List Rule Full Update
This method is used to update all fields of the specified stock list rule object with PUT request.
PUT
Stock-List-Rule-Full-Update
Path: /api/v1/stock-list-rules/{rule_id}/
Parameters
api_token
string
header
The API key of the customer account
{rule_id}
string
query
The stock list rule ID
Example Request
Example Response (200 OK)
Last updated
Was this helpful?