basePath = /smartfin/api/v1
Warehouses - Post
...
Get company
...
Get warehouse list that is visible to current user
...
Request
URL:
Method:
Headers:
Content-Type: application/json
token
JSON Body:
...
Response
...
Table of Contents |
---|
minLevel | 1 |
---|
maxLevel | 2 |
---|
outline | false |
---|
type | list |
---|
printable | false |
---|
|
Base Url: /smartfin/api/v1/wh
Retrieve Warehouse’s Data
...
POST/smartfin/api/v1/wh/select
Retrieve all of the warehouse’s data under the current user
Authentication / Authorization
Schema
...
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
Response
Example:
Code Block |
---|
{
"error_code": 0,
"value": {
" |
|
wh_add"OOOO","company_id": 119,
cname"test2"unull}, {whid165whname""update0823143104updateby65createby2createtime2023-08-23 14:07:39user65whentityKKK1whadd "KKK","company_id": 119,cname"test2"uCareers}, {whid164whname"KKK"updatenullupdatebynullcreateby2createtime2023-08-23 14:07:19usernullwhentityKKKwhaddKKK,"company_id": 119, cname"test2","u_name":null}
],dropdown_list": {\u4e2d\u50a8\u65b0\u6e2f",
|
|
"wh_entity": [
KKK1\u4e2d\u50a8\u65b0\u6e2fMARKWAREHOUSECARKIKIKTESTCAR14SALESXNEW ELOLOLO1\u5170\u8003\u660c\u76db",
" |
|
XX2"\u5170\u8003\u660c\u76db",
DGG1HAHASALES34MARKS"BUY ENTITY",ADMIN",MARKX\u4e2d\u50a8\u65b0\u6e2f",
" |
|
KKK]"wh_name": [\u4e2d\u50a8\u65b0\u6e2f54546MARKWAREHOUSECARNEW NAMETESTCAR1\u9752\u5c9b\u6e2f-\u7eac\u56db\u8def",
" |
|
554SALESXu9752u5c9bu6e2f-\u7eac\u56db\u8defXX2222\u5170\u8003\u660c\u76dbBUY NAME1HAHASALESJIJI, "MARKS",
MARKX, "ADMIN",
"KKK"
],
"validation": []
}
}
}Notes | Returns a list of objects (whs ), each representing a warehouse (in descending order of wh_id ) a list of wh_entity present in the data a list of wh_name present in the data a list of validation that been used to indicate the list that is not able to add a new value (it is empty, all of the lists are able to update and add a new value)
|
---|
Warehouses - Upsert ( Update/ Insert )
Update/insert warehouse | Inserts/Update warehouse |
---|
Request | URL:
Method:
Headers:
JSON Body:
Code Block |
---|
[
{
"wh_name":"MARK",
"wh_entity":"TEST1",
"wh_add":"TEST_ADDRESS",
"company_id":119
}
] |
Code Block |
[
{
"wh_id":174,Schema
...
In whs
,
Code Block |
---|
whs - array[object] |
An array of object that contains warehouse’s data
Code Block |
---|
update_time, u_name, update_by - string |
Information about last updated time for the data and the user who updating the data.
Code Block |
---|
create_time, c_name, create_by - string |
Information about created time for the data and the user who creating the data.
Code Block |
---|
user_id, wh_id, company_id - integer |
user_id
- User Id ( who the data belongs to)
entity_id
- A unique ID assigned to the data. This ID can be used to retrieve warehouse data.
company_id
- The main company Id for the data.
Code Block |
---|
wh_name, wh_entity, wh_add - string |
wh_name
- Warehouse name
wh_entity
- Warehouse Entity
wh_add
- Warehouse address
Info |
---|
wh_name , wh_entity and wh_add cannot be duplicated,
|
In dropdown_list
,
Code Block |
---|
wh_entity , wh_name - array[string] |
a list of string
that serve as dropdown list for selection purpose.
Code Block |
---|
validation - array[string] |
a list of validation
that been used to indicate the name of array in dropdown_list
that is not able to add a new value (it is empty, all of the array are able to update and add a new value
Update / Insert Warehouse Data
...
POST/smartfin/api/v1/wh/upsert
Insert new or update existing warehouse data in database
Authentication / Authorization
Schema
...
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: Code Block |
---|
{
"insert_list":[
{
"wh_name":" |
|
WH_NAMETEST2TESTADD1TEST_ADDRESS",
"company_id":119
|
|
}
]Response | Code Block |
{"error_code": 0,
value{"whs":[{ "wh_name":"WH_NAME",
"wh_ |
|
id 176 "name MARK
updatetimenull, "update_by": null,
"create_by": 2,
"create_time": "2023-11-02 11:57:10",
"user_id": null,
"wh_entity": "TEST1",
"wh_add": "TEST_ADDRESS",
"company_id": 119,
"c_name": "test2",
"u_name": null
},
{
"wh_id": 174,
"wh_name": "WH_NAME",
"update_time": "2023-11-02 11:57:10",
"update_by": 2,
"create_by": 2,
"create_time": "2023-11-01 11:50:35",
"user_id": 2,
"wh_entity": "TEST2",
"wh_add": "TESTADD1",
"company_id": 119,
"c_name": "test2",
"u_name": "test2"
},
],
"dropdown_list": {
"wh_entity": [
"KKK1",
"\u4e2d\u50a8\u65b0\u6e2f",
"MARK",
"WAREHOUSE",
"CAR",
"TEST",
"CAR1",
"4",
"SALESX",
"NEW E",
"LOLOLO1",
"XX",
"TEST1",
"2",
"\u5170\u8003\u660c\u76db",
"DGG",
"1",
"HAHA",
"SALES",
"34",
"TEST2",
"MARKS",
"BUY ENTITY",
"ADMIN",
"MARKX",
"KKK"
],
"wh_name": [
"\u4e2d\u50a8\u65b0\u6e2f",
"54546",
"MARK",
"WAREHOUSE",
"CAR",
"NEW NAME",
"WH_NAME",
"TEST",
"CAR1",
"55",
"4",
"SALESX",
"\u9752\u5c9b\u6e2f-\u7eac\u56db\u8def",
"XX",
"222",
"2",
"\u5170\u8003\u660c\u76db",
"BUY NAME",
"1",
"HAHA",
"SALES",
"MARKS",
"MARKX",
"ADMIN",
"KKK"
],
"validation": []
}
}Notes | The returned response format are the same as Warehouses - Post response format.
Insert and Update Schema
...
Code Block |
---|
insert_list - array[object] |
Contain the same parameters as whs
in response body of https://mafint.atlassian.net/wiki/spaces/MAD/pages/2128248833/Warehouses#Retrieve-Warehouse%E2%80%99s-Data ( Refer to the definition of each parameter )
wh_id
does not need to be parsed and not required in this array
Consists of new warehouse data to be inserted into database.
Code Block |
---|
update_list - array[object] |
Contain the same parameters as whs
in response body of https://mafint.atlassian.net/wiki/spaces/MAD/pages/2128248833/Warehouses#Retrieve-Warehouse%E2%80%99s-Data ( Refer to the definition of each parameter )
Consists of existing warehouse data to be updated into database.
Warning |
---|
Insert process would fail if there is an existing warehouse with the same wh_name, wh_entity and same wh_name Update process would fail if there is an existing warehouse |
...
with the same wh_name, wh_entity |
...
...
Warehouses - Delete
...
Response:
Delete Warehouse Data
...
DELETE/smartfin/api/v1/wh/delete
Deletes single / multiple warehouse
...
Request
...
URL:
Method:
Headers:
Content-Type: application/json
token
JSON Body:
del_ids
: list of ids to be deleted
...
Response
...
Code Block |
---|
// Same format as {basePath}/wh/select response body |
...
Notes
...
data according to its wh_id
Authentication / Authorization
Schema
...
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: Code Block |
---|
{
"del_ids":[109]
} |
|
Code Block |
---|
del_ids - array[integer] |
An array that consists of unique wh_id
, that user would like to delete from.
Response: