Purchase Orders
This domain serves for Purchase Order requests
New PO Number
POSTThis API call generates a new purchase order number based on the existing maximum purchase order number in the database.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be newponum |
Required |
object data |
Empty object. | Required |
Sample Request Body
{
domain: "pos",
action: "newponum",
"data": {}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
string data |
New generated PO number. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "New Po no created",
data: "PO05240015"
}
}
Add Purchase Order
POSTThis API call adds a new purchase order to the database.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be addpo |
Required |
object data |
Contains input parameters. | Required |
string quote_no |
The quote number associated with the purchase order. | Required |
string po_subject |
The subject of the purchase order. | Required |
string supplier_no |
The supplier number associated with the purchase order. | Required |
string po_eta_date |
The estimated time of arrival for the purchase order. | Required |
string po_note |
The note associated with the purchase order. | Required |
Sample Request Body
{
domain: "pos",
action: "addpo",
data: {
quote_no: "Q05240073",
po_subject: "TEST Purchase Order for Window Components",
supplier_no: "S03240002",
po_eta_date: "2024-06-15",
po_note: "test PO note"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int id |
The ID of the newly added purchase order. |
string po_no |
The generated purchase order number. |
string supplier_no |
The supplier number associated with the purchase order. |
string po_subject |
The subject of the purchase order. |
string po_comment |
The comment associated with the purchase order. |
string po_eta_date |
The estimated time of arrival for the purchase order. |
string po_arrived_date |
The date when the purchase order arrived. |
string po_note |
The note associated with the purchase order. |
string quote_no |
The quote number associated with the purchase order. |
string added_date |
The date when the purchase order was added. |
int po_status |
The status of the purchase order. |
int user_id |
The ID of the user who added the purchase order. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Po added",
data: {
id: 17,
po_no: "PO05240016",
supplier_no: "S03240002",
po_subject: "TEST Purchase Order for Window Components",
po_comment: null,
po_eta_date: "2024-06-15",
po_arrived_date: null,
po_note: null,
quote_no: "Q05240073",
added_date: "2024-05-24",
po_status: 0,
user_id: 69
}
}
}
Delete Purchase Order
POSTThis API call deletes a purchase order from the database.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be deletepo |
Required |
object data |
Contains input parameters. | Required |
string po_no |
The purchase order number to be deleted. | Required |
Sample Request Body
{
domain: "pos",
action: "deletepo",
data: {
po_no: "PO05240016"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Additional data related to the deletion operation. 1 for success. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "PO Deleted",
data: 1
}
}
Update Purchase Order Date
POSTThis API call updates the added date of a purchase order in the database.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be update_po_date |
Required |
object data |
Contains input parameters. | Required |
int id |
The ID of the purchase order to be updated. | Required |
string added_date |
The new added date to be set for the purchase order. | Required |
Sample Request Body
{
domain: "pos",
action: "update_po_date",
data: {
id: "18",
added_date: "2024-08-15"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Additional data related to the update operation. 1 for success. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Po Updated",
data: 1
}
}
Update Purchase Order Arrival Date
POSTThis API call updates the arrival date of a purchase order in the database and adds a story to the associated quote.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be update_po_arrive_date |
Required |
object data |
Contains input parameters. | Required |
int id |
The ID of the purchase order to be updated. | Required |
string po_no |
The purchase order number to be updated. | Required |
string arrive_date |
The new arrival date to be set for the purchase order. | Required |
string quote_no |
The quote number associated with the purchase order. | Required |
string job_no |
The job number associated with the purchase order. | Required |
string supplier_no |
The supplier number associated with the purchase order. | Required |
Sample Request Body
{
domain: "pos",
action: "update_po_arrive_date",
data: {
id: "18",
po_no: "PO05240016",
arrive_date: "2024-09-15",
quote_no: "Q05240073",
job_no: "Q05240073",
supplier_no: "S03240002"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Additional data related to the update operation. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Po arrive date Updated",
data: 0
}
}
Update Purchase Order Comment
POSTThis API call updates the added date of a purchase order in the database.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be update_po_comment |
Required |
object data |
Contains input parameters. | Required |
int id |
The ID of the purchase order to be updated. | Required |
string comment |
The new comment to be set for the purchase order. | Required |
Sample Request Body
{
domain: "pos",
action: "update_po_comment",
data: {
id: "18",
comment: "TEST comment PO"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Additional data related to the update operation. 1 for success. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "Po comment Updated",
data: 1
}
}
Get Po Products
POSTThis API call retrieves products associated with a purchase order.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be get_po_products |
Required |
object data |
Contains input parameters. | Required |
int user_id |
The user ID. | Required |
string po_no |
The purchase order number. | Required |
Sample Request Body
{
domain: "pos",
action: "get_po_products",
data: {
user_id: 69,
po_no: "PO03240013"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int draw |
Current draw count for data table processing. |
int recordsTotal |
Total number of records available. |
int recordsFiltered |
Total number of records after filtering. |
list data > data |
This contain list of result objects retrieved for query. |
string DT_RowId |
The row ID identifier in the data table. |
string id |
The unique ID of the purchase order. |
string p_id |
The product ID. |
string p_name |
The product name. |
string p_desc |
The product description. |
string p_qty |
The product quantity. |
string p_unit_type |
The product unit type. |
string p_unit_price |
The product unit price. |
string p_note |
The product note. |
string p_jobs_no |
The product job number. |
string po_no |
The purchase order number. |
string supplier_no |
The supplier number. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "PO Products Read",
data: {
draw: 0,
recordsTotal: 7,
recordsFiltered: 7,
data: [
{
DT_RowId: "row_7",
id: "7",
p_id: "1",
p_name: "TEST2",
p_desc: "TEST2",
p_qty: "3",
p_unit_type: "set",
p_unit_price: "20",
p_note: "Test add PRoduct",
p_jobs_no: "",
po_no: "PO03240013",
supplier_no: "S03240001"
}
]
}
}
}
Add Po Product
POSTThis API call adds a product to a purchase order.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be add_po_product |
Required |
object data |
Contains input parameters. | Required |
int user_id |
The user ID. | Required |
string po_no |
The purchase order number. | Required |
string supplier_no |
The supplier number. | Required |
int p_id |
The product ID. | Required |
int p_qty |
The product quantity. | Required |
string p_note |
The product note. | Required |
Sample Request Body
{
domain: "pos",
action: "add_po_product",
data: {
user_id: 69,
po_no: "PO03240013",
supplier_no: "S03240001",
p_id: 1,
p_qty: 3,
p_note: "Add Test Product"
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
object data |
This contain result data object of the API call. |
int po_product_id |
The ID of the added product in the purchase order. |
string p_name |
The product name. |
string p_description |
The product description. |
string p_note |
The product note. |
string p_unit_price |
The product unit price. |
int p_qty |
The product quantity. |
string p_unit_type |
The product unit type. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "PO Products Added",
data: {
po_product_id: 14,
p_name: "TEST2",
p_description: "TEST2",
p_note: "Add Test Product",
p_unit_price: "20",
p_qty: 3,
p_unit_type: "set"
}
}
}
Delete Po Product
POSTThis API call deletes a product from a purchase order.
Request Paramters
string pos |
Value should be customer |
Required |
string action |
Value should be delete_po_product |
Required |
object data |
Contains input parameters. | Required |
int user_id |
The user ID. | Required |
int po_product_id |
The ID of the product in the purchase order to be deleted. | Required |
Sample Request Body
{
domain: "pos",
action: "delete_po_product",
data: {
user_id: 69,
po_product_id: 14
}
}
Response Paramters
string status |
This indicate the status of the response. success is the expected value. |
string message |
This explains the reson for status. |
int data |
Additional data related to the delete operation. 1 for success. |
Sample Response
{
status: "success",
data: {
status: "success",
message: "PO Poduct Deleted",
data: 1
}
}