Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

basePath = /smartfin/api/v1/wh

Warehouses - Post

Get company

Get warehouse list that is visible to current user

Request

URL:

  • {basePath}/wh/select

Method:

  • POST

Headers:

  • Content-Type: application/json

  • token

JSON Body:

  • {}

Response

Code Block
{
    "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"
            },
            {
                "wh_id": 164,
                "wh_name": "KKK",
                "update_time": null,
                "update_by": null,
                "create_by": 2,
                "create_time": "2023-08-23 14:07:19",
                "user_id": null,
                "wh_entity": "KKK",
                "wh_add": "KKK",
                "company_id": 119,
                "c_name": "test2",
                "u_name": null
            },
        ],
        "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": []
        }
    }
}

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)

...

Update/insert warehouse

Inserts/Update warehouse

Request

URL:

  • {basePath}/wh/upsert

Method:

  • POST

Headers:

  • Content-Type: application/json

  • token

JSON Body:

  • insert_list: warehouse/s to be inserted

Code Block
[
  {
         "wh_name":"MARK",
         "wh_entity":"TEST1",
         "wh_add":"TEST_ADDRESS",
         "company_id":119
  }
]
  • update_list: warehouse/s to be updated

Code Block
[
  {
         "wh_id":174,
         "wh_name":"WH_NAME",
         "wh_entity":"TEST2",
         "wh_add":"TESTADD1",
         "company_id":119
  }
]

Response

Code Block
{
    "error_code": 0,
    "value": {
        "whs": [
            {
                "wh_id": 176,
                "wh_name": "MARK",
                "update_time": null,
                "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 - Postresponse format.

Insert and Update would fail if there is an existing warehouse/s with the same wh_name, wh_entity or same wh_name

...

Delete company

Deletes single/ multiple warehouse by id

Request

URL:

  • {basePath}/wh/delete

Method:

  • DELETE

Headers:

  • Content-Type: application/json

  • token

JSON Body:

  • del_ids: list of ids to be deleted

Code Block
[109]

Response

Code Block
// Same format as {basePath}/wh/select response body

Notes

The returned response format are the same as Warehouses - Postresponse format.