Main Web API Documentation Information
Actual Page/Function Name:
getSubInventory
Human Readable Name or Caption:
Get Sub Inventory
Page/Function Description:
This method gets sub inventory for a single item or part number.
Page/Function Output Type:
API - JSON or WDDX
Categories:
parts
Extra Page/Function Notes:


Parameters
Scope Name Type Default Description Required Alternates Known Values
Arguments CORP_ID Numeric 0 Pass in the corp id number. Yes
Arguments PART_ID Numeric 0 Pass in the part id. Yes
Arguments STORE_ID Numeric 1 Pass in the store id. If unknown, use a value of 1 for all locations. Yes
Arguments SUB_ID String Pass in a list of sub ids or a single sub id number. It is also ok to leave this blank and that will get all sub id packages that are associated with the parent part id number. Yes
Arguments SUB_DISABLED String 0,1 Pass in a 0 for show and use, a 1 for show but disabled, a 2 for hide. You could also use the string all for all records. This argument could also use a small list of values if needed. Yes
Arguments USE_BALANCE_DATE String Pass in the inventory look-back date. Ok to leave blank. Only pass in a valid date if you want this method to take the look-back date into consideration. If used, only inventory quantities and packages less than or equal to that date will be included. In a way, this date allows you to look-back into the past. The reason it is called the balance date deals with an internal balance sheet (snapshot in time). For your purposes, pretend that it is just an inventory look-back date. Yes


Results
RET_STATUS RET_MAIN_MESSAGE RET_SECOND_MESSAGE Redirect Link Description
ok success This indicates a valid response. There are a number of possible sub arrays that will also be passed back. More information is listed below.
Name Type Description Notes
QRY_SUB_INVENTORY_ATTRIBUTES_ARRAY Array These are the sub attribute columns (dynamic per corporation and per part/item category). AKA - the extra data points. This array has some fairly deep database fields that are stored per sub attribute. Some of them may not be needed. As a side note, there are three main types of sub attributes. They are dates, text or strings, and numeric data fields (different data types). The sub attributes are virtually the custom data points that are stored per part/item category. Here is a list of values passed back in this array:

- ATTRIBUTE_COLUMN - This value is an alphanumeric value that helps us see if the attribute is a number, a date, or a text value. For example: n1 would be a numeric value in the column number 1 place. So, a n5 would be a numeric value in the fifth column. Other values may be something like t1, t7, d1, d10, etc. Each letter/number combo represents a data type and column number. The only text values are n, t, d, and then some other numeric column number.

- ATTRIBUTE_HIDE - This will be a 1 or a 0. It deals with whether or not to show the sub attribute on the invoice (customer receipt). 0=show, 1=hide. Once again, this only deals with show/hide options on the physical invoice or customer receipt.

- ATTRIBUTE_NAME - This is the human readable sub attribute name.

- ATTRIBUTE_REQUIRED - This will be a 1 or a 0. The default is a 0 or don't require the user to input the data. If set to a 1, the sub attribute will be required when first adding in the new sub or child package.

- ATTRIBUTE_SORT - This will be a numeric value or a manual sort order. The default is 100. Basically, we sort all of the sub attributes based off of this manual numeric sort field and then off the auto id number. This is how a user may be able to alter the sort order of where a certain sub attribute shows up.

- ATTRIBUTE_TYPE - This will be a string of date, number, text, or select. Both text and select point to the same table. The main difference deals with the way data is added. The text option means an open entry field (basic text input). The select option means that a preset list has been added (a drop-down list or form option) and the user is able to select an option from the choices provided.

- ATTRIBUTE_VALUES - These are the defaults that get setup per attribute. If there is a list of options, they will have the pipe symbol (|) to separate those values. The default is a blank string.

- COLUMN_NUMBER - This is a numeric value and shows what column is associated with the values that get stored. Without getting super technical, we have three different data types (text, numeric, and dates). Each section restarts the numbering at 1 and goes up from there per part/item category. What this means is that you could have a T1 (text number 1), a D1 (date number 1), and an N1 (numeric number 1). This column number is used inside the database to make sure that stored values get associated with the correct sub attribute column.

- CORP_ID - This is the corporation id (company id or world id number) number.

- DATA_TYPE_TABLE - This will be one of three main database table names. Valid options are: custom_dates, customer_text, and custom_numerics. Behind the scenes, these values make sure that we store the associated values in the correct sub tables based off of the column numbers and data types.

- LABEL_POSITION - This deals with a named position on labels. Valid options are: a blank string, top, middle, bottomLeft, and bottomRight.

- PART_CATEGORY_ID - This is the part/item category id number. All sub attributes are setup based off of a single part category id. In a way, you could say that sub attributes are a virtual database extension (additional data points) per part category.

- SUB_INVENTORY_ATTRIBUTE_ID - This is the auto id number for the sub attribute.

- WEB_SEARCH_BY_ATTRIBUTE - This will either be a 1 or a 0. The default is a 0 or turned off. This field mostly deals with an internal ecommerce or web presence setting. Basically, do you want to be able to search by this sub attribute out on the web (yes/no).

- WEB_SHOW_ATTRIBUTE - This will either be a 1 or a 0. The default is a 0 or turned off. If the value is set to a 1, the sub attribute will show up on the web for the public to see. Some attributes may contain sensitive information and/or internal information. This show/hide options allows you to control that behavior out in the public web or ecommerce area.

- WEB_SORT_BY_ATTRIBUTE - This will either be a 1 or a 0. The default is a 0 or turned off. Once again, this is an internal web/ecommerce setting that helps us with displaying sub or child packages and their sub attributes out on the web.
QRY_SUB_INVENTORY_TEMPLATE_ARRAY Array These are some basic part/item category level values that may be useful. This is a short list (not the full database table schema) and mostly help with a web name and a possible web category description. Even though this is an array, it usually only has one object being passed back. The information being passed back is:

- SUB_TEMPLATE_DESCRIPTION - This is a web description of the part/item category.

- SUB_TEMPLATE_LOCKED - This will either be a 1 or a 0. The default is a 0 or turned off. This is an older field that helped us lock the settings in place. If the part category is unlocked, additional edits were allowed. If set to a 1 (locked), the system wouldn't allow edits unless it was unlocked again. Somewhat of an older field.

- SUB_TEMPLATE_NAME - This is the name of the category. The sub template name and the main part/item category name are often the same. We do allow things to slightly differ, but usually they are the same. For this method, this is the only name that is returned.

- USE_SUB_INVENTORY - This will either be a 1 or a 0. The default is a 0 or turned off. If the value is set to a 1, in theory, there should be at least 1 sub attribute (a date field, a text field, or a numeric field). Originally, this field helped us figure out which category level needed additional logic and attention. Still used, but not as important as it once was.
SUB_ATTRIBUTES_ARRAY Array This is the actual sub or child inventory packages per part/item number. The name may seem to be just the sub attribute values (extra fields and database columns), but this is the real deal. See below for a list of values that are passed back. Each array value will have an object with the following values.

- ACTUAL_STORE_ID - This is the actual store/location id number. The value of the STORE_ID is the store/location initials. Normally, the main store id is under the STORE_ID value. For this method, the developer kinda switched things around. This actual store id is the real id in this case.

- PART_ID - This is the main part id number (auto id per item or per part). This is how the sub or child inventory package is associated with the parent part/item. This value will match the parent item's id number.

- PART_NUMBER - Similar to the part id number, this is the parent part/item's human readable part number. This could be any alphanumeric string. Even though it says number, it is technically a string. For example: A valid part number may be "Snickers" or "Butterfingers" or "ABC-1234"

- PO_INVOICE_LINE_ID - This is a numeric value that is used internally to associate a sub inventory package or child package with a specific PO/Invoice line item id number (auto id for another table - foreign key). This id is usually tied to the PO where the sub inventory package was created and/or first recorded.

- PO_NUMBER - This is usually the PO number where the sub or child package came into existence.

- SPECIAL_DESCRIPTION - The sub description may be set on a per sub or per package basis. It is ok for the sub description to be different then the main parent item description. Sometimes they are the same, sometimes they are different, depending on the situation.

- STORE_ID - Normally, this would be the real store id number. However, for this method, this is the store/location initials (mini version of the store/location name). Think of this value as a string.

- SUB_BAR_CODE - This is a sub barcode that may be set by the corporation on a per sub or per child package level. Usually an alphanumeric string of some sort or another.

- SUB_COST - This is the sub cost for the specific package. Often the cost is left hidden unless trying to add an item to a quote, order, or invoice. Each sub and/or child package has their own sub cost. The parent item holds a single general cost called part_cost. If using subs, make sure and use the correct sub cost.

- SUB_DISABLED - The sub disabled field is a numeric value. The name may be a little bit misleading. Think of it as availability vs disabled. Here are the values: 0=open/use/show (open and ready for use), 1=open/greyed out/disabled (exists but sub or child package has not yet been open), and 2=closed/hide (done - no more quantity). The most common values are 0 and 1.

- SUB_INVENTORY_DATE - This is usually the initial or creation date of the sub package. We also track the dates of all other transactions against this package, but the one returned is usually the beginning date for the package.

- SUB_INVENTORY_ID - This is an auto id number that gets assigned behind the scenes per sub package. We recommend that most of your interactions use a number called the SUB_REFERENCE_ID. When the sub package is created, the sub inventory id and the sub reference id will match. Once the package starts getting used, the sub inventory id will keep auto numbering but the sub reference id will remain the same. Long story made short, even though this is the primary key, we highly recommend using the sub reference id as that will keep the packages tied together as it gets used, sold, and/or distributed in one way or another.

- SUB_INVENTORY_STATUS - This will be a 1 or a 0. The default is a 1 or live/active. If set to a 0, the sub inventory or child package is considered inactive or virtually dead.

- SUB_PRICE - Each package has a possible list price. The pricing can be tricky... There are options for parent pricing, special web pricing, advanced pricing tiers, etc. This is just a set price per package but other options may be used as needed. This of this as a starting place per package.

- SUB_QUANTITY - This is the quantity on hand for a single sub package. Inside the main adilas system, there are a number of protecting conditions that should block any overselling or overusing of a single sub or child package. Once that data is being processed outside, through the API socket, we need you as a developer to help monitor and keep track of things.

- SUB_REFERENCE_ID - This is virtually the sub package or child id number. Technically, the original package gets its id from an auto numbering system, but once created, this sub reference id number is how a single package is tracked through the system. If needed, see the SUB_INVENTORY_ID field above for more information.

- SUB_RFID - Each sub or child package has its own sub RFID tag number. This is an optional field, but may be very important if really tracking full traceability and/or if reporting to some other outside or 3rd party tracking system. Often the sub RFID tag is the key to keeping inventories, in multiple systems straight. As a reference, the parent item has a field called rfid_tag_number that exists on the higher or parent level. It is totally allowed and common that the parent and the sub RFID tags are different. Also, there is another field in this object with the name of SUB_RFID_TAG_NUMBER, both this one SUB_RFID and SUB_RFID_TAG_NUMBER contain the same values. One just has a shorter name.

- SUB_RFID_TAG_NUMBER - See the SUB_RFID field above (duplicate field with a different name).

- TIME_ID - This is a numeric value. The default is 0. If other than 0, the sub inventory or child package is tied to an element of time (robust calendar and scheduling object inside of adilas). If yes, there may be a number of other key pieces of information, phases, sub locations, processes, groupings, etc. that may exist on the element of time. This id number may be used in other look-ups to get additional information.

- VENDOR_PAYEE_ID - This is the parent vendor id number for the main parent part/item. Each sub package (sub inventory record) will hold hands with the parent vendor to help with searching, filtering, and quick look-ups.
dataIn Unable to get a list of sub inventory items as requested. Missing some data. Use your back button and try again. You will get this message if the inbound values do not meet the minimum criteria.
db Unable to get sub inventory quantities. Use your back button and try again. This message is a global catch for the method. If something happens mid stream in the process, you may get this message. It may not be dealing with the actual quantities, but is more of a global error handler.


Samples
Caption Text
JSON
{"API_CALL_FUNCTION_NAME":"getSubInventory","API_USER_PASSWORD":"1234","API_URL_ENCODING":"AUTO","API_INPUT_OUTPUT_TYPE":"JSON","CORP_ID":"53","API_CURRENT_PAYEE_ID":"2","API_USER_NAME":"demo","PART_ID":"225446","SUB_DISABLED":"0,1","USE_BALANCE_DATE":"","API_CORP_KEY_ID":"PLA-0053","SUB_ID":"","STORE_ID":"1"}
Sample response with a couple of values
{"RET_SECOND_MESSAGE":"","QRY_SUB_INVENTORY_ATTRIBUTES_ARRAY":[{"ATTRIBUTE_REQUIRED":0,"ATTRIBUTE_TYPE":"number","COLUMN_NUMBER":1,"DATA_TYPE_TABLE":"custom_numerics","ATTRIBUTE_STATUS":1,"CORP_ID":53,"WEB_SEARCH_BY_ATTRIBUTE":0,"LABEL_POSITION":"","PART_CATEGORY_ID":2741,"ATTRIBUTE_VALUES":"1","ATTRIBUTE_NAME":"Count Per","SUB_INVENTORY_ATTRIBUTE_ID":1,"ATTRIBUTE_COLUMN":"n1","WEB_SHOW_ATTRIBUTE":1,"WEB_SORT_BY_ATTRIBUTE":0,"ATTRIBUTE_SORT":100,"ATTRIBUTE_HIDE":0},{"ATTRIBUTE_REQUIRED":0,"ATTRIBUTE_TYPE":"text","COLUMN_NUMBER":1,"DATA_TYPE_TABLE":"custom_text","ATTRIBUTE_STATUS":1,"CORP_ID":53,"WEB_SEARCH_BY_ATTRIBUTE":0,"LABEL_POSITION":"","PART_CATEGORY_ID":2741,"ATTRIBUTE_VALUES":"","ATTRIBUTE_NAME":"Extras","SUB_INVENTORY_ATTRIBUTE_ID":2,"ATTRIBUTE_COLUMN":"t1","WEB_SHOW_ATTRIBUTE":1,"WEB_SORT_BY_ATTRIBUTE":0,"ATTRIBUTE_SORT":100,"ATTRIBUTE_HIDE":0},{"ATTRIBUTE_REQUIRED":0,"ATTRIBUTE_TYPE":"select","COLUMN_NUMBER":2,"DATA_TYPE_TABLE":"custom_text","ATTRIBUTE_STATUS":1,"CORP_ID":53,"WEB_SEARCH_BY_ATTRIBUTE":0,"LABEL_POSITION":"","PART_CATEGORY_ID":2741,"ATTRIBUTE_VALUES":"Christmas|Halloween|Easter|Thanksgiving|4th of July|Other","ATTRIBUTE_NAME":"Holiday","SUB_INVENTORY_ATTRIBUTE_ID":3,"ATTRIBUTE_COLUMN":"t2","WEB_SHOW_ATTRIBUTE":1,"WEB_SORT_BY_ATTRIBUTE":0,"ATTRIBUTE_SORT":100,"ATTRIBUTE_HIDE":0},{"ATTRIBUTE_REQUIRED":0,"ATTRIBUTE_TYPE":"date","COLUMN_NUMBER":1,"DATA_TYPE_TABLE":"custom_dates","ATTRIBUTE_STATUS":1,"CORP_ID":53,"WEB_SEARCH_BY_ATTRIBUTE":0,"LABEL_POSITION":"","PART_CATEGORY_ID":2741,"ATTRIBUTE_VALUES":"","ATTRIBUTE_NAME":"Best By Date","SUB_INVENTORY_ATTRIBUTE_ID":4,"ATTRIBUTE_COLUMN":"d1","WEB_SHOW_ATTRIBUTE":1,"WEB_SORT_BY_ATTRIBUTE":0,"ATTRIBUTE_SORT":100,"ATTRIBUTE_HIDE":0}],"QRY_SUB_INVENTORY_TEMPLATE_ARRAY":[{"SUB_TEMPLATE_DESCRIPTION":"This category will be used for Candy.","SUB_TEMPLATE_NAME":"Candy","SUB_TEMPLATE_LOCKED":0,"USE_SUB_INVENTORY":1}],"SUB_ATTRIBUTES_ARRAY":[{"SUB_QUANTITY":480.00000,"SUB_COST":0.50000,"SUB_RFID_TAG_NUMBER":"","ACTUAL_STORE_ID":178,"PART_ID":233903,"SPECIAL_DESCRIPTION":"Movie gum drops","SUB_INVENTORY_DATE":"June, 17 2019 00:00:00","PART_NUMBER":"Dots","PO_INVOICE_LINE_ID":953,"PO_NUMBER":42,"SUB_PRICE":0.00000,"SUB_REFERENCE_ID":1,"SUB_DISABLED":0,"TIME_ID":0,"SUB_INVENTORY_ID":1,"STORE_ID":"HQ","SUB_RFID":"","SUB_INVENTORY_STATUS":1,"SUB_BAR_CODE":"b-1","VENDOR_PAYEE_ID":28591},{"SUB_QUANTITY":170.00000,"SUB_COST":0.50000,"SUB_RFID_TAG_NUMBER":"","ACTUAL_STORE_ID":178,"PART_ID":233903,"SPECIAL_DESCRIPTION":"Movie gum drops","SUB_INVENTORY_DATE":"June, 17 2019 00:00:00","PART_NUMBER":"Dots","PO_INVOICE_LINE_ID":954,"PO_NUMBER":42,"SUB_PRICE":0.85000,"SUB_REFERENCE_ID":2,"SUB_DISABLED":0,"TIME_ID":0,"SUB_INVENTORY_ID":2,"STORE_ID":"HQ","SUB_RFID":"","SUB_INVENTORY_STATUS":1,"SUB_BAR_CODE":"b-2","VENDOR_PAYEE_ID":28591},{"SUB_QUANTITY":200.00000,"SUB_COST":0.50000,"SUB_RFID_TAG_NUMBER":"","ACTUAL_STORE_ID":178,"PART_ID":233903,"SPECIAL_DESCRIPTION":"Movie gum drops","SUB_INVENTORY_DATE":"June, 17 2019 00:00:00","PART_NUMBER":"Dots","PO_INVOICE_LINE_ID":954,"PO_NUMBER":42,"SUB_PRICE":0.85000,"SUB_REFERENCE_ID":3,"SUB_DISABLED":1,"TIME_ID":0,"SUB_INVENTORY_ID":3,"STORE_ID":"HQ","SUB_RFID":"","SUB_INVENTORY_STATUS":1,"SUB_BAR_CODE":"b-3","VENDOR_PAYEE_ID":28591},{"SUB_QUANTITY":100.00000,"SUB_COST":0.50000,"SUB_RFID_TAG_NUMBER":"","ACTUAL_STORE_ID":178,"PART_ID":233903,"SPECIAL_DESCRIPTION":"Movie gum drops","SUB_INVENTORY_DATE":"June, 17 2019 00:00:00","PART_NUMBER":"Dots","PO_INVOICE_LINE_ID":954,"PO_NUMBER":42,"SUB_PRICE":0.85000,"SUB_REFERENCE_ID":4,"SUB_DISABLED":1,"TIME_ID":0,"SUB_INVENTORY_ID":4,"STORE_ID":"HQ","SUB_RFID":"","SUB_INVENTORY_STATUS":1,"SUB_BAR_CODE":"b-4","VENDOR_PAYEE_ID":28591}],"RET_STATUS":"ok","RET_MAIN_MESSAGE":"success","RET_TYPE":"success"}
Outside Links
If you want to see this JSON response in a more readable format - we recommend copying the JSON portion into something like https://jsonlint.com/ and then reading it from there. Also, some of the output may look pretty intense due to normal URL encoding. We often have to flatten certain strings to send them over the web (spaces, special characters, etc.). If you need a visual URL decoder page, see the following small adilas tool for URL encoding - https://www.adilas.biz/web/url_encoder.cfm (this tool goes from web URL encoding back to normal English - back and forth).