Stock Details
Base Url: /smartfin/api/v1/stockmgmt
The response of the following APIs will be returned as compressed form. To decompress it, please install npm: pako plugin and using the specific function ( inflate
) to decompress the response body.
During the implementation of HTTP service, HttpHeaders
of each request need to be set as the format below:
headers: new HttpHeaders({
'Content-Type': 'application/json'
}),
responseType: 'arraybuffer' as 'json'
Retrieve Stock Details
POST /smartfin/api/v1/stockmgmt/select
Get all stocks that are visible to current user.
Authentication / Authorization
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: {
"s_date":"2023-01-01",
"e_date":"2023-12-15",
"phy_trade_ids":[],
"stock_lvls": ["EX"], // all the stock lvl in stock details are EX
"is_ap": false //since stock lvl is EX, this will be false
} |
Schema
s_date, e_date - string
Filter the stocks according to the given date range ( s_date = start date, e_date = end date )
Filter the stock details according to the physical trade id given in the body (each stock detail is assigned to a physical trade id. The response will only return the stock with the given physical trade id, regardless of
s_date and e_date
parsed.)
Response
Example:
Returns
|
Schema
Information about last updated time for the data and the user who updating the data.
Information about created time for the data and the user who creating the data.
user_id
- User Id ( who the data belongs to)stock_id
- A unique ID assigned to the data. This ID can be used to retrieve stock details.phy_trade_id
- The physical trade id that assigned with the stock.wh_id
- The warehouse id that are assigned with the stock.
maf_group_id
- A unique group ID where the stock belongs to.
wh_id
- A unique warehouse ID where the stock belongs to.wh_add, wh_entity, wh_name
- related details of the warehouse.
Update / Insert Stock Details
Update:
POST /smartfin/api/v1/stockmgmt/execution_update
Insert:
POST /smartfin/api/v1/stockmgmt/execution_insert
Insert new or update existing stock details into database
Authentication / Authorization
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request ( Update )
Example:
JSON Body: |
Request ( Insert )
Example:
JSON Body: |
Schema
Filter the stocks according to the given date range ( s_date = start date, e_date = end date )
The physical trade id/s that will be updated ( when the valid id is parsed, the trade’s stock details will be updated ( stock quantity, un-stock quantity etc.) )
Contain the same parameters as
stmg
in response body of Stock Details | Response ( Please refer to the request body Stock Details | Request ( Insert ) above for the required parameters that needs to be included into request )stock_id
does not need to be parsed and not required in this arrayConsists of new stock detail/s to be inserted into database.
Contain the same parameters as
items
in response body of Stock Details | Response ( Please refer to the request body Stock Details | Request ( Update ) above for the required parameters that needs to be included into request )Consists of existing stock detail/s to be updated into database.
Response:
Same as the response body from Stock Details | Response ( Refer to the definition of each parameter )
Delete Stock Details
DELETE /smartfin/api/v1/stockmgmt/delete
Deletes single / multiple stock details according to its stock_id
Authentication / Authorization
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: |
An array that consists unique
stock_id
, that user would like to delete from.
The physical trade id/s that will be updated ( when the valid id is parsed, the trade’s stock details will be updated ( stock quantity, un-stock quantity etc.) )
Response:
Same as the response body from Stock Details | Response ( Refer to the definition of each parameter )