Warehouses
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
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: {} |
Response
Example:
{
"error_code": 0,
"value": {
"whs": [
{
"wh_id": 174,
"wh_name": "JIJI",
"update_time": null,
"update_by": null,
"create_by": 2,
"create_time": "2023-11-01 11:50:35",
"user_id": null,
"wh_entity": "KIKIK",
"wh_add": "OOOO",
"company_id": 119,
"c_name": "test2",
"u_name": null
},
{
"wh_id": 165,
"wh_name": "2",
"update_time": "2023-08-23 14:31:04",
"update_by": 65,
"create_by": 2,
"create_time": "2023-08-23 14:07:39",
"user_id": 65,
"wh_entity": "KKK1",
"wh_add": "KKK",
"company_id": 119,
"c_name": "test2",
"u_name": "Careers"
},
],
"dropdown_list": {
"wh_entity": [
"KKK1",
"\u4e2d\u50a8\u65b0\u6e2f",
"MARK",
"WAREHOUSE",
"CAR",
"KIKIK",
"TEST",
"CAR1",
"4",
"SALESX",
"NEW E",
"LOLOLO1",
"XX",
"2",
"\u5170\u8003\u660c\u76db",
"DGG",
"1",
"HAHA",
"SALES",
"34",
"MARKS",
"BUY ENTITY",
"ADMIN",
"MARKX",
"KKK"
],
"wh_name": [
"\u4e2d\u50a8\u65b0\u6e2f",
"54546",
"MARK",
"WAREHOUSE",
"CAR",
"NEW NAME",
"TEST",
"CAR1",
"55",
"4",
"SALESX",
"\u9752\u5c9b\u6e2f-\u7eac\u56db\u8def",
"XX",
"222",
"2",
"\u5170\u8003\u660c\u76db",
"BUY NAME",
"1",
"HAHA",
"SALES",
"JIJI",
"MARKS",
"MARKX",
"ADMIN",
"KKK"
],
"validation": []
}
}
} |
Schema
In whs
,
whs - array[object]
An array of object that contains warehouse’s data
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)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.
wh_name
- Warehouse namewh_entity
- Warehouse Entitywh_add
- Warehouse address
wh_name
, wh_entity
and wh_add
cannot be duplicated,
Eg.
wh_name
of ‘WAREHOUSE' ,wh_entity
of ‘ENTITY’wh_add
of 'ADDRESS’ will not allow to be stored if the samewh_name
,wh_entity
andwh_add
has been created in database.
In dropdown_list
,
a list of
string
that serve as dropdown list for selection purpose.
a list of
validation
that been used to indicate the name of array indropdown_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
Headers
Schema
Headers:
Content-Type: application/json
Authorization:
string - JWT <<YOUR_API_KEY_HERE>> (required)
Request
Example:
JSON Body: |
Schema
Contain the same parameters as
whs
in response body of Warehouses | Retrieve Warehouse’s Data ( Refer to the definition of each parameter )wh_id
does not need to be parsed and not required in this arrayConsists of new warehouse data to be inserted into database.
Contain the same parameters as
whs
in response body of Warehouses | Retrieve Warehouse’s Data ( Refer to the definition of each parameter )Consists of existing warehouse data to be updated into database.
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
and same wh_name
Response:
Same as the response body from Warehouses | Retrieve Warehouse’s Data ( Refer to the definition of each parameter )
Delete Warehouse Data
DELETE /smartfin/api/v1/wh/delete
Deletes single / multiple warehouse data according to its wh_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 of unique
wh_id
, that user would like to delete from.
Response:
Same as the response body from Warehouses | Retrieve Warehouse’s Data ( Refer to the definition of each parameter )