Skip to content

Get Data Documentation Stock Quantity By Location

seansimit edited this page Mar 30, 2022 · 4 revisions

Get Stock Quantity By Location

When wish to retrieve data from SIMBIZ system. Will require a token to go though the API. There are one way to retrieve token in SIMBIZ system by API as shown at below.

  1. Login

After get the token. You are ready to use the token to start getting stock quantity by location.

Using CURL in terminal console to retrieve the data. (* If there is no data in the data column, user may direct remove the column from the insert data array.)

curl --header "Content-Type: application/x-www-form-urlencoded" 
--request POST 
--data '
{
        "action" : "getStockByLocation",
	"module" : "inventory",
	"uid" : "user",
	"token" : "simit_xxxxxxxxxxxxx-xxxxx",
	"org":"SIMIT",
	"branch":"HQ",
	"items":[
		"STO-0122",
		"STO-0123"
	],
	"separatelocation": 1,
}
’ https://simbiz_system_url/simbiz/api.php
Parameter Defination Example
items An array of item code that wish to search ["FS-S018","STO-GETY0048"]
separatelocation Use to determine want to separate result by location. When setting to 1 the result will separate by location. If setting to 0 the result will not separate by location

The result will return as follow when separate by location

{
    "status": "OK",
    "msg": "",
    "data": {
        "FS-S018": {
            "item_id": "1-1-100",
            "item_code": "STO-0122",
            "item_name": "ITEM1",
            "baseuom_id": "",
            "baseuom_code": "",
            "location": {
                "": {
                    "location_id": "",
                    "location_code": "",
                    "location_name": "",
                    "basequantity": "0.0000"
                }
            }
        },
        "STO-GETY0048": {
            "item_id": "1-1-1000",
            "item_code": "STO-0123",
            "item_name": "ITEM2",
            "baseuom_id": "233",
            "baseuom_code": "UNIT",
            "location": {
                "OR": {
                    "location_id": "737",
                    "location_code": "OR",
                    "location_name": "OR",
                    "basequantity": "1.0000"
                },
                "TYR": {
                    "location_id": "904",
                    "location_code": "TYR",
                    "location_name": "TYR",
                    "basequantity": "5.0000"
                }
            }
        },
    }
}

The result will return as follow when no separate by location

{
    "status": "OK",
    "msg": "",
    "data": {
        "FS-S018": {
            "item_id": "1-1-100",
            "item_code": "STO-0122",
            "item_name": "ITEM1",
            "baseuom_id": "",
            "baseuom_code": "",
            "location": {
                "All": {
                    "location_id": "",
                    "location_code": "All",
                    "location_name": "All",
                    "basequantity": "0.0000"
                }
            }
        },
        "STO-GETY0048": {
            "item_id": "1-1-1000",
            "item_code": "STO-0123",
            "item_name": "ITEM2",
            "baseuom_id": "233",
            "baseuom_code": "UNIT",
            "location": {
                "All": {
                    "location_id": "",
                    "location_code": "All",
                    "location_name": "All",
                    "basequantity": "6.0000"
                }
            }
        },
    }
}

Clone this wiki locally