Main Web API Documentation Information
Actual Page/Function Name:
addMainPO
Human Readable Name or Caption:
Add Main PO
Page/Function Description:
This method will add a new PO to the database.
Page/Function Output Type:
API - JSON or WDDX
Categories:
purchase order
Extra Page/Function Notes:
The PO is the starting point to either order or receive inventory. The PO main is the top section that holds the main values like vendor, order date, received date, total cost and notes. The main also hold the PO type, there are six different types.


Parameters
Scope Name Type Default Description Required Alternates Known Values
Arguments ADJUSTED_DATE_TIME String Pass in the adjusted date and time stamp for the history. Yes
Arguments CORP_ID Numeric 0 Pass in the corp id number. Yes
Arguments EXTERNAL_INVOICE_NUMBER String Ok to leave blank or empty Pass in the external invoice number. This is not required. It is the actual Invoice number from the Vendor you are ordering the Inventory from. May not be known. Yes
Arguments PO_AMOUNT Numeric 0 Pass in the PO total amount. Yes
Arguments PO_CREATED_BY_ID Numeric 0 Pass in the payee id number of the person creating the PO. Yes
Arguments PO_DATE String Pass in the PO date. Yes
Arguments PO_DATE_RECEIVED String Pass in the PO received date. This is when the items are in hand and ready to be entered into the system. Yes
Arguments PO_NOTES String Pass in the PO notes. Yes
Arguments PO_RECEIVED Numeric 0 Pass in a 1 for received and a 0 for not yet received or pending. Yes
Arguments PO_RECEIVED_BY_ID Numeric 0 Pass in the payee id number of the person who received the PO into inventory. Yes
Arguments PO_TYPE_ID Numeric 0 Pass in the PO type id number. - See the Comments section for the 7 different types. Very Important Yes
Arguments STORE_ID Numeric 0 Pass in the location id number. Yes
Arguments VENDOR_PAYEE_ID Numeric 0 Pass in the vendor payee id number. Yes
Arguments VENDOR_PAYEE_ID2 String 1 Pass in the second vendor payee id number. If unknown use 1 as default. Yes
Arguments WAS_PO_REQUEST String auto Pass in the string auto for the system to fill it out. Pass in a value of 1 or 0 to force the setting. Yes


Results
RET_STATUS RET_MAIN_MESSAGE RET_SECOND_MESSAGE Redirect Link Description
ok success This assumes that everything went well.
dataIn Unable to add the new PO. Missing some data. Use your back button and try again. This is returned if missing one or more of the following arguments: CORP_ID, PO_CREATED_BY_ID, PO_NOTES, PO_TYPE_ID, STORE_ID, VENDOR_PAYEE_ID.
dataIn2 Unable to add the new PO. Missing some date information. Use your back button and try again. This is returned if one or more of the following arguments are not dates: ADJUSTED_DATE_TIME, PO_DATE, PO_DATE_RECEIVED.
zeroCorpPOType Unable to find the corporation PO type requested. Use your back button and try again. This is returned if no corp PO types could be found associated with the CORP_ID.
zeroPOType Unable to find the PO type requested. Use your back button and try again. This is returned if no PO type could be found associated with the PO_TYPE_ID.
db Unable to connect to the database. The new PO was not added to the database. Use your back button and try again. This is a catch for any errors that occur while accessing the database.


Samples
Caption Text
JSON
{ "API_CALL_FUNCTION_NAME": "addMainPO", "ADJUSTED_DATE_TIME": "2025-08-04 09:16:00", "CORP_ID": 53, "EXTERNAL_INVOICE_NUMBER": "3456", "PO_AMOUNT": 1000.50, "PO_CREATED_BY_ID": 3, "PO_DATE": "2025-08-04", "PO_DATE_RECEIVED": "2025-08-05", "PO_NOTES": "PO for door parts (EPS, screws)", "PO_RECEIVED": 0, "PO_RECEIVED_BY_ID": 3, "PO_TYPE_ID": 2, "STORE_ID": 178, "VENDOR_PAYEE_ID": 3, "VENDOR_PAYEE_ID2": "1", "WAS_PO_REQUEST": "0", "API_CORP_KEY_ID": "PLA-0053", "API_USER_NAME": "demo", "API_USER_PASSWORD": "1234", "API_INPUT_OUTPUT_TYPE": "JSON", "API_CURRENT_PAYEE_ID":"3", "API_URL_ENCODING": "AUTO" }