16.2 Purchase Order Details
16.2 Purchase Order Details
Interface
It allows you:
to insert new lines (one by one) into an existing purchase orders
to update, delete purchase order lines (one by one)
to view purchase order lines
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an open Purchase Order (document status: Draft, In Progress)
to have products active with all the mandatory fields
the products selected on Purchase Order must have prices defined in the Price List selected on the Purchase Order
Columns that can be used as filters:
DocumentNo (OrderNo)
Line
Product
Mandatory Parameters when inserting order lines:
OrderNo
Actions can be done:
list
insert
update
delete
Sales Order line fields
API Methods:
List:
URL: https://api.socratecloud.com/webapi/rest/purchase_order/line/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}&DocumentNo={order_doc_no}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "Demo SRL",
"Created": "2018-08-22 13:01:00+0300",
"CreatedBy": "Ionut Ursuleanu",
"Updated": "2018-08-22 13:01:00+0300",
"UpdatedBy": "Ionut Ursuleanu",
"Active": true,
"Line": 10,
"ID": 1000001,
"Product": "9195",
"ProductName": "9195",
"Description": null,
"QtyEntered": 1,
"UOM": "Each",
"ListPrice": 700,
"Discount": 0,
"PriceEntered": 700,
"LineNetAmt": 700,
"IsTaxIncluded": false,
"Tax": "19% ",
"TrxOrganization": "Demo SRL",
"Activity": null,
"Status_ID": 1000080,
"Status": "Creată"
},
{
"Organization": "Demo SRL",
"Created": "2018-08-22 13:05:45+0300",
"CreatedBy": "Ionut Ursuleanu",
"Updated": "2018-08-22 13:05:45+0300",
"UpdatedBy": "Ionut Ursuleanu",
"Active": true,
"Line": 20,
"Product": "9195",
"ProductName": "9195",
"Description": null,
"QtyEntered": 1,
"UOM": "Each",
"ListPrice": 700,
"Discount": 0,
"PriceEntered": 700,
"LineNetAmt": 700,
"IsTaxIncluded": false,
"Tax": "19% ",
"TrxOrganization": "Demo SRL",
"Activity": null,
"Status_ID": 1000080,
"Status": "Creată"
}
],
"totalRows": 2
}
Create:
URL: https://api.socratecloud.com/webapi/rest/purchase_order/line/create/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: line no & id for success or error message
Data format:
{
"Organization": "Demo SRL",
"Active": true,
"Line": 10,
"Product": "9195",
"Description": null,
"QtyEntered": 1,
"ListPrice": 700,
"Discount": 0,
"PriceEntered": 700,
"Tax": "19% ",
"TrxOrganization": "Demo SRL",
"Activity": null,
"Status_ID": 1000080,
"Status": "Creată"
}
Update:
URL: https://api.socratecloud.com/webapi/rest/purchase_order/line/update/{version}?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}
Method: POST
Return: line no for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Active": true,
"Line": 30,
"Product": "9195",
"Description": null,
"QtyEntered": 10,
"ListPrice": 700,
"Discount": 0,
"PriceEntered": 700,
"Tax": "20%",
"TrxOrganization": "Demo SRL",
"Activity": null,
"Status_ID": 1000080,
"Status": "Creată"
}
Delete:
URL: https://api.socratecloud.com/webapi/rest/purchase_order/line/delete/{version}?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")