iteminventory.php
The iteminventory.php service retrieves the item inventory with relevant data. We can request the retrieval of the entire inventory status made so far or of one or several specific items, according to a specific period, or based on the warehouses where they are located, by searching using one or several filters (parameters) provided by the needs of the search.
Method of sending data: POST
Requirements fields are :
| Name | Type | Description |
|---|---|---|
| cmd | string | get |
| item_id | number | get: Filters data based on the parameter value. |
| warehouse_id | number | get: Filters data based on the parameter value. |
| item_code | string | get: Filters data based on the parameter value. |
| item_barcode | string | get: Filters data based on the parameter value. |
| item_price | number | get: Filters data based on the parameter value. |
| from_date | string data | get: Filters data based on the parameter value. Implies the data margin from the specified date. |
| to_date | string data | get: Filters data based on the parameter value. Implies the data margin up to the specified date. |
| IsEncrypted | boolean | Calls the decryption function if true. |
| ServerConfig | string(json_encode) | JSON-encoded string containing dynamic attributes for API and database connection. All attributes characterizing the API or the database can be passed as parameters for the desired connection. |
TIP
Attention: For specific commands, parameters are sometimes mandatory, and other times optional. If additional filters(parameters) are needed for searching, they must be added to the backend; otherwise, the request is not considered. In the example request below, only "cmd":"get" in the body would be sufficient to retrieve all data. If specific data is required, then only the filtering parameters explained above should be included. Example Request: To retrieve all data, only "cmd":"get" in the body would suffice. If specific data is needed, include only the filtering parameters explained above.
Example of request
"body": [
{
"cmd": "get",
"item_id": 234,
"warehouse_id": 123,
"item_code": "itemcode",
"item_barcode": "itembarcode",
"item_price": 3234,
"from_date": "data",
}
],
"IsEncrypted": false,
"ServerConfig": " objekti ServerConfig"
}
ServerConfig: string object json
"IsEncrypted": false,
"ServerConfig": "{\"Url_API\":\"\",\"DB_Config\":\"\",\"Company_DB_Name\":\"\",\"HardwareId\":\"\",\"UserInfo\":{\"user_id\":,\"username\":\"\",\"password\":null,\"token\":\"\"}}",
"App": "web",
"Language": "sq-AL"
}
TIP
CAREFUL!Clarification on ServerConfig (data that completes the request) while consuming the services.IsEncrypted: the attribute that calls the decryption function if it is true.
In this case ServerConfig is incomprehensible to read.
IsEncrypted: in case it is false, the ServerConfig attribute (property) which is a string which will be deserialized to return to the json object, must have the following fields required:
DB_Config and Company_DB_Name: The first represents the database in which the part of the configurations related to users and companies is located. If not completed it will take the value predefined by the backend. The second represents the database in which all other actions related to the user will be performed (not necessary for the login).If not completed it does not allow any kind of action in db and generates an error.
Database: object within the object which should have the following fields: Host_IP: database ip (can be local or remote) .e.g: 88.108.108.88. If not completed it will take the default value from the backend.
Port: the port at which the request is received according to the IP specified above. If not met it will receive the default value from the backend.
Password: the user password associated with the database. If not completed it will take the default value from the backend.
Password1: the use of password1 and password2 has not yet been verified. The purpose of use was to divide the password into two parts in such a way that one user does not have full control without cooperating with the other user.
Password2: the use of password1 and password2 has not yet been verified. The purpose of use was to divide the password into two parts in such a way that one user does not have full control without cooperating with the other user.
In each case there are 2 connections with 2 different databases which have in common IP, username, password and port.
If the app is in the same location as the database, then the Host_IP value is localhost, otherwise if the app and database are on different hosts, the value of the Host_IP in the request must be as real as the ip of the database location. psh: 88.108.108.88.
CAREFUL! When you get the ServerConfig copy paste do not leave spaces between objects as it will not be deserialized.
Example of reponse
{
"length": 8,
"body": [
{
"item_id": 176,
"item_barcode": null,
"item_name": "Banane",
"item_code": "16/08",
"item_quantity": 16,
"item_inventory": 16,
"item_quantity_per_warehouse": [
{
"warehouse_id": 4,
"item_quantity": "1",
"warehouse_code": null,
"warehouse_name": "Dyqani"
},
{
"warehouse_id": 1,
"item_quantity": "15",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 303,
"item_barcode": null,
"item_name": "Gjysem produkt",
"item_code": "N0004",
"item_quantity": 176,
"item_inventory": 176,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "-58",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
},
{
"warehouse_id": 6,
"item_quantity": "234",
"warehouse_code": "frank_daja",
"warehouse_name": "Franko Daja MQ"
}
]
},
{
"item_id": 195,
"item_barcode": null,
"item_name": "Double A Leter fotokopje A4, 80 gr./m2",
"item_code": "GV-N3060GAMING OC-12GE",
"item_quantity": 5,
"item_inventory": 5,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "5",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 324,
"item_barcode": null,
"item_name": "Benzine 95 Oktan",
"item_code": "Test78",
"item_quantity": 152,
"item_inventory": 152,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "152",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 295,
"item_barcode": null,
"item_name": "Manaferra",
"item_code": "api_tesz",
"item_quantity": 0,
"item_inventory": 0,
"item_quantity_per_warehouse": [
{
"warehouse_id": 4,
"item_quantity": "6",
"warehouse_code": null,
"warehouse_name": "Dyqani"
},
{
"warehouse_id": 1,
"item_quantity": "-6",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 304,
"item_barcode": null,
"item_name": "Lende Djegese",
"item_code": "N0005",
"item_quantity": -2,
"item_inventory": -2,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "-2",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 112,
"item_barcode": null,
"item_name": "KERCINJA ME SUSAM",
"item_code": "112",
"item_quantity": 0,
"item_inventory": 0,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "0",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
}
]
},
{
"item_id": 1,
"item_barcode": null,
"item_name": "KUKIS AMERIKAN",
"item_code": "1",
"item_quantity": 2989583.16,
"item_inventory": 2989583.16,
"item_quantity_per_warehouse": [
{
"warehouse_id": 1,
"item_quantity": "2989583.16",
"warehouse_code": "MQ",
"warehouse_name": "Magazina Qendrore"
},
{
"warehouse_id": 4,
"item_quantity": "0",
"warehouse_code": null,
"warehouse_name": "Dyqani"
},
{
"warehouse_id": 6,
"item_quantity": "0",
"warehouse_code": "frank_daja",
"warehouse_name": "Franko Daja MQ"
}
]
},
],
"status": {
"code": 600,
"message": "Success!"
},
"response_sent_time": "2024-02-02 11:49:38"
}
No Comments