Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel
Table of Contents
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

...

Info

The response of the following APIs will be returned as compressed form. To decompress it, please install https://www.npmjs.com/package/pako plugin and using the specific function ( inflate ) to decompress the response body.

...

POST /smartfin/api/v1/stockmgmt/select

Get all stocks that are visible to current user.

Info

During the implementation of HTTP service, HttpHeaders of each request need to be set as the format below:

Code Block
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

...

JSON Body:

Code Block
{
   "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

...

Code Block
s_date, e_date - string

...

Information about last updated time for the data and the user who updating the data.

Code Block
create_time, create_by, create_by_name - string

Information about created time for the data and the user who creating the data.

Code Block
user_id, stock_id, phy_trade_id, wh_id - integer

  • 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.

Update / Insert Stock Details

...

Insert new or update existing stock details into database

Authentication / Authorization

  •  API Key

Headers

Schema

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT <<YOUR_API_KEY_HERE>> (required)

Request ( Update )

Example:

JSON Body:

...

Code Block
group_name - string
maf_group_id - integer

  • maf_group_id - A unique group ID where the stock belongs to.

Code Block
wh_add, wh_entity, wh_name - string
wh_id - integer

  • 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

  •  API Key

Headers

Schema

...

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT <<YOUR_API_KEY_HERE>> (required)

Request ( Update )

Example:

JSON Body:

Code Block
{
   "phy_trade_ids":[
      59106
   ],
   "update_list":[
      {
         "transstock_supplierid":""35178,
         "slotstock_nodate":"2023-09-11",
         "stock_qtytype":1111,
         "matchphy_trade_id":3517859106,
         "stock_swh_dateid":""184,
         "stock_e_dateaction":""1,
         "etatrans_notesupplier":"",
         "codslot_dateno":"",
         "coststock_nameqty":""111,
         "costmatch_amtid":""35178,
         "coststock_s_ccydate":"",
         "ticketstock_refe_nodate":"",
         "remarkseta_note":"",
         "blcod_nodate":"9",
         "lcost_portname":"",
         "etdcost_amt":"",
         "dcost_portccy":"",
         "dticket_ref_norno":"",
         "cc_dateremarks":"",
         "dobl_dateno":"9",
         "stockl_brandport":"OFFSHOREP",
         "stock_specetd":"OFFSHOREP",
         "cargod_ops_idport":38301"",
         "deliveryd_rulenor":"",
         "link_phy_trade_idcc_date":"",
         "stockdo_contract_qtydate":1111"",
         "pairstock_typebrand":null"OFFSHOREP",
         "stock_spec":"OFFSHOREP",
 }    ],    "scargo_ops_dateid":"2023-01-01",38301,
         "edelivery_daterule":"2023-12-15",
    "phy_products":[] }

Request ( Insert )

Example:

JSON Body:

Code Block{
    "link_phy_trade_
ids
id":
[
"",
     
60667 ],
    "
insert
stock_contract_
list
qty":
[
1111,
      
{
   "pair_type":null
      
"stock_id":"",
}
   ],
   
"
stock
s_date":"2023-
12
01-01",
   
"e_date":"2023-12-15",
   
"
stock
phy_
type
products":
1,
[]
}

Request ( Insert )

Example:

JSON Body:

Code Block
{
      "phy_trade_idids":60667,[
      60667
   ],
   "stockinsert_wh_idlist":183,[
      {
         "stock_actionid":2"",
         "transstock_supplierdate":"2023-12-01",
         "slotstock_notype":""1,
         "stockphy_trade_qtyid":100060667,
         "matchstock_wh_id":""183,
         "stock_s_dateaction":""2,
         "stocktrans_e_datesupplier":"",
         "etaslot_noteno":"",
         "codstock_dateqty":""1000,
         "costmatch_nameid":"",
         "coststock_s_amtdate":"",
         "coststock_e_ccydate":"",
         "ticketeta_ref_nonote":"",
         "remarkscod_date":"",
         "blcost_noname":"",
         "lcost_portamt":"",
         "etdcost_ccy":"",
         "d_portticket_ref_no":"",
         "remarks":"",
         "dbl_norno":"",
         "cc_datel_port":"",
         "etd":"",
         "dod_dateport":"",
         "stock_brand":"",
         "stock_spec":"",
         "cargo_ops_id":39833,
         "delivery_rule":"",
         "link_phy_trade_id":"",
         "stock_contract_qty":1000
      }
          "d_nor":"",
         "cc_date":"",
         "do_date":"",
         "stock_brand":"",
         "stock_spec":"",
         "cargo_ops_id":39833,
         "delivery_rule":"",
         "link_phy_trade_id":"",
         "stock_contract_qty":1000
      }
   ],
   "s_date":"2023-01-01",
   "e_date":"2023-12-15",
   "phy_products":[
      
   ]
}

Schema

...

Code Block
s_date, e_date - string
  • Filter the stocks according to the given date range ( s_date = start date, e_date = end date )

Code Block
phy_trade_ids - array[number]

  • 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.) )

Code Block
insert_list - array[object]

Code Block
update_list - array[object]

Response:

Delete Stock Details

...

DELETE/smartfin/api/v1/stockmgmt/delete

Deletes single / multiple stock details according to its stock_id

Authentication / Authorization

  •  API Key

Headers

Schema

...

Headers:

  • Content-Type: application/json

Authorization:

  • string - JWT <<YOUR_API_KEY_HERE>> (required)

Request

Example:

JSON Body:

Code Block
{
   "del_ids":[1004],
   "phy_products":[],
   "phy_trade_ids":[54794],
   "s_date":"2023-01-01",
   "e_date":"2023-12
-15", "phy_products":[ ] }

Schema

Code Block
s_date, e_date - string
  • Filter the stocks according to the given date range ( s_date = start date, e_date = end date )

Code Block
phy_trade_ids - array[number]

  • 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.) )

Code Block
insert_list - array[object]

  • Contain the same parameters as stmg in response body of ( Please refer to the request body 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 array

  • Consists of new stock detail/s to be inserted into database.

Code Block
update_list - array[object]

...

Contain the same parameters as items in response body of ( Please refer to the request body above for the required parameters that needs to be included into request )

...

-15",
   "pair_types":[],
   "stock_lvls": ["EX"], // all the stock lvl in stock details are EX
   "is_ap": false //since stock lvl is EX, this will be false
}
Code Block
del_ids - array[integer]
  • An array that consists unique stock_id, that user would like to delete from.

Code Block
phy_trade_ids - array[number]
  • 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: