It allows you:
to insert new purchase orders (master&details in one json file)
to view purchase orders (master&details in one json file) - ordered descending by created date and document date
to print
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an Organization active
to have an Warehouse active
to have a Vendor active with all the mandatory fields
to have a price list active
Columns that can be used as filters:
Organization
DocumentNo
OrderReference
BPartner
IsOpenOrder - use to list only open orders (= not fully shipped or not fully invoiced yet)
DateOrdered - Range
DocumentStatus
PriceList
CreatedBy
Actions can be done:
list
create
Purchase Order fields (Master&Details)
A Purchase Order in SocrateCloud has the following structure:
Master document (see Purchase Order Master) which contains data about header document:
No. document
Order data
Vendor
Sales Reprezentative etc.
Document details (see Purchase Order Details) which contains the products that are ordered with informations about:
Product
Quantity
Selling price
VAT
To update only master data, or a specific order line see Purchase Order Master, Order Details chapters.
URL: URL: https://api.socratecloud.com/webapi/rest/purchase_order/full/list/{version}?accessToken={access_token}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "Demo SRL",
"Created": "2018-08-23 11:18:07+0300",
"CreatedBy": "Ionut Ursuleanu",
"Updated": "2018-08-23 11:18:07+0300",
"UpdatedBy": "Ionut Ursuleanu",
"DocumentNo": "810796",
"OrderReference": null,
"Description": null,
"DocType": "Comanda Furnizor",
"DateOrdered": "2018-08-22 00:00:00+0300",
"DatePromised": "2018-08-22 00:00:00+0300",
"BPartner": "U1",
"BPartnerName": "Ursu Unu",
"BPartnerLocation": "Germany",
"BillBPartner": "U1",
"BillBPartnerName": "Ursu Unu",
"BillLocation": "Brasov",
"BPartnerContact": "Ursu Unu ***",
"BillContact": "Ursu Unu ***",
"Warehouse": "Standard",
"DeliveryTerms": null,
"Currency": "RON",
"SalesRep": "Ionut Ursuleanu",
"PaymentTerm": "30 days",
"TrxOrganization": "dep2",
"Activity": null,
"TotalLines": 700,
"GrandTotal": 833,
"DocumentStatus": "Drafted",
"DocumentAction": "Prepare",
"PaymentMethod": "On Credit",
"PriceList": "Ursu (Achizitie)",
"Status_ID": 1000080,
"Status": "Creată",
"lines": [
{
"Organization": "Demo SRL",
"Created": "2018-08-23 11:18:07+0300",
"CreatedBy": "Ionut Ursuleanu",
"Updated": "2018-08-23 11:18:07+0300",
"UpdatedBy": "Ionut Ursuleanu",
"Active": true,
"Line": 10,
"ID": 1855547,
"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": 1000081,
"Status": "Creat",
}
]
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/purchase_order/full/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Note: We recommend to attend the following steps:
1. If new vendor, create vendor using BPartner create method
2.Create Order
Data format:
{
"Organization": "Demo SRL",
"OrderReference": null,
"Description": null,
"DocType": "Comanda Furnizor",
"DateOrdered": "2018-08-22 00:00:00+0300",
"DatePromised": "2018-08-22 00:00:00+0300",
"BPartner": "U1",
"BPartnerName": "Ursu Unu",
"BPartnerLocation": "Germany",
"BillBPartner": "U1",
"BillBPartnerName": "Ursu Unu",
"BillLocation": "Brasov",
"BPartnerContact": "Ursu Unu ***",
"BillContact": "Ursu Unu ***",
"Warehouse": "Standard",
"DeliveryTerms": null,
"Currency": "RON",
"SalesRep": "Ionut Ursuleanu",
"PaymentTerm": "30 days",
"TrxOrganization": "dep2",
"Activity": null,
"PaymentMethod": "On Credit",
"PriceList": "Ursu (Achizitie)",
"Status_ID": 1000080,
"Status": "Creată",
"lines": [
{
"Organization": "Demo SRL",
"Active": true,
"Line": 20,
"Product": "9195",
"Description": null,
"QtyEntered": 1,
"ListPrice": 700,
"Discount": 0,
"PriceEntered": 700,
"Tax": "19% ",
"TrxOrganization": "Demo SRL",
"Activity": null,
"Status_ID": 1000081,
"Status": "Creat",
}
]
}
URL: https://api.socratecloud.com/webapi/rest/purchase_order/print/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: GET
Return: PDF file