It allows you:
to insert new requisition (master document)
to process (update, delete) existing requisitions
for update it is necessary to provide all the updatable fields in JSON even if the value is not changed. The missing fields will get their value removed!
delete will remove all the related details!
to view requisition master document data
Prerequisites:
In order to use this API Method for inserting or updating data there must be accomplished the following requirements in SocrateCloud:
to have an active Organization.
to have an active Employee (User)
to have an active Warehouse
to have an active Price List
Columns that can be used as filters:
Organization (Name)
DocumentNo
IsApproved
Activity (Value)
DateRequired
DocumentDate
User (Name)
User_ID (AD_User_ID)
BPartner (Value)
BPartner_ID (M_BPartner_ID)
Project (Value)
ProjectPhase (Name)
ProjectTask (Name)
Employee (Value)
Asset (Value)
DocumentStatus (Name)
PriceList (Name)
Warehouse (Value)
Warehouse_ID
Actions that can be done:
list
create
process
Requisition fields
In SocrateCloud, a Requisition has the following structure:
Master document (see Requisition Master) which contains data about the header document:
Organization
Document Type
DocumentNo
Date Required
Document Date
User
Priority Rule
Warehuse
Price List
AutoInternal
Description
Project
Project Phase
Project Task
Activity
Campaign
Asset
Organization Trx
Employee
URL: https://api.socratecloud.com/webapi/rest/requisition/list/0?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Available filter parameters:
Organization (Name)
DocumentNo
IsApproved
Activity (Value)
DateRequired
DocumentDate
User (Name)
User_ID (AD_User_ID)
BPartner (Value)
BPartner_ID (M_BPartner_ID)
Project (Value)
ProjectPhase (Name)
ProjectTask (Name)
Employee (Value)
Asset (Value)
DocumentStatus (Name)
PriceList (Name)
Warehouse (Value)
Warehouse_ID
Return: JSON object with next format:
{
"data": [
{
"Requisition_ID": 1006674,
"Organization": "Fidelio Farm",
"Created": "2019-06-26 07:59:32+0300",
"CreatedBy": "1000002",
"Updated": "2020-06-11 15:45:33+0300",
"UpdatedBy": "1000002",
"DocumentNo": "902172",
"Active": true,
"DocType": "Necesar Aprovizionare",
"Description": "linie descriere 1",
"DateRequired": "2019-06-30 00:00:00+0300",
"DocumentDate": "2019-06-30 00:00:00+0300",
"User": "Tert Razvan",
"User_ID": 1008170,
"Warehouse": "Depozit Fidelio",
"Warehouse_ID": 1001185,
"Priority": "Medium",
"PriceList": "Achizitie RON",
"BPartner": "Macheta",
"BPartner_ID": 1000003,
"TotalLines": 50,
"Project": "Test NAP",
"Project_ID": 1003731,
"ProjectPhase": "Faza 1 NAP",
"ProjectPhase_ID": 1002308,
"ProjectTask": "Subfaza 1 NAp",
"ProjectTask_ID": 1000379,
"AutoInternal": true,
"Approved": true,
"Activity": "Programare",
"TrxOrganization": "F12",
"Campaign": "Campanie Razvan",
"Employee": "Adi G",
"Employee_ID": 1007189,
"Asset": "Automat cafea",
"Asset_ID": 1000080,
"DocStatus": "Completed",
"DocAction": "Close"
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/expense_report/update/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo Org",
"DocumentNo": "902172",
"Active": true,
"DocType": "Purchase Requisition",
"Description": "linie descriere 1",
"DateRequired": "2019-06-30 00:00:00+0300",
"DocumentDate": "2019-06-30 00:00:00+0300",
"User": "Tert Razvan",
"Warehouse": "Depozit Fidelio",
"Priority": "Medium",
"PriceList": "Achizitie RON",
"BPartner": "Macheta",
"Project": "Test NAP",
"ProjectPhase": "Faza 1 NAP",
"ProjectTask": "Subfaza 1 NAp",
"AutoInternal": true,
"Approved": true,
"Activity": "Programare",
"TrxOrganization": "F12",
"Campaign": "Campanie Razvan",
"Employee": "Adi G",
"Asset": "Automat cafea",
"DocAction": "Close"
}
URL: https://api.socratecloud.com/webapi/rest/requisition/delete/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")
URL: https://api.socratecloud.com/webapi/rest/requisition/process/{version}?accessToken={access_token}&DocumentNo={document_no}&DocumentAction={document_action}
Available document actions: CO (Complete), VO (Void), CL (Close), PR (Prepare), AP (Approve)
Method: POST
Return: Document status for success or error message (start with "ERROR: ")
Add attachment:
Files can be added in .jpg or .pdf format, with the picture of the signature or in other purposes.
URL: https://api.socratecloud.com/webapi/rest/requisition/attachment/add/{version}?accessToken={acess_token}&DocumentNo={document_no}&FileName={file_name}
Method: POST
Return: "Ok" for success or error message (start with "ERROR: ")
Content-Type: multipart/form-data; boundary={boundary}
--boundary
Content-Disposition: attachment;
filename : "{filename}"
Content-Type: {mime_type}
raw document data
Delete Attachment:
URL: https://api.socratecloud.com/webapi/rest/requisition/attachment/delete/{version}?accessToken={acess_token}&DocumentNo={document_no}&FileName={file_name}
Method: POST
Return: "Ok" for success or error message (start with "ERROR: ")