19. Requisition
Interface
It allows you:
to insert new requisitions (master&details)
to view requisitions and their details
to process requisitions
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 - Range
DocumentDate - Range
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 (Master&Details)
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
Document details (see Requisition Details):
Organization
Description
Product
Charge
Unit of measure
Quantity Entered
Price Actual
Sales Representative
Business Partner
Project
Project Phase
Project Task
Activity
Campaign
Asset
Organization Trx
Employee
To update only master data, or specific Requisition lines see Requisition Master or Requisition Details chapters.
API Methods:
List:
URL: https://api.socratecloud.com/webapi/rest/requisition/full/list/0?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Available filter parameters:
Organization (Name)
DocumentNo
IsApproved
Activity (Value)
DateRequired - Range
DocumentDate - Range
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": "Demo Org",
"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",
"lines": [
{
"Organization": "Demo Org",
"Created": "2019-06-26 07:59:32+0300",
"CreatedBy": "1000002",
"Updated": "2020-06-11 15:43:40+0300",
"UpdatedBy": "1000002",
"SourceDocNo": "902172",
"Active": true,
"Processed": true,
"Line": 10,
"LineNetAmt": 50,
"SalesRep": "Alin Cruceru",
"SalesRep_ID": 1012786,
"ProductSalesRep": "AdminTitular",
"ProductSalesRep_ID": 1000002,
"Product": "ARTICOL TEST WEBARK",
"ProductName": "Articol test webark",
"Product_ID": 1083257,
"ProductCategory": "Semifabricat",
"Charge": null,
"Charge_ID": null,
"UOM": "Each",
"Internal": true,
"QtyEntered": 5,
"PriceActual": 10,
"Qty": 5,
"QtyRequired": null,
"QtyRequisitionOrdered": 0,
"QtyRemaining": 5,
"QtyReceived": 0,
"InvoicedQty": 0,
"QtyAllocated": 0,
"QtyIssued": 0,
"QtyIssuedRemaining": 5,
"Description": "Demo description",
"BPartner": "Macheta",
"BPartner_ID": 1000003,
"LastVoidedCOF_ID": null,
"OrderLine_ID": null,
"RfQLine_ID": null,
"MovementLine_ID": null,
"DateLastInvoice": null,
"Project": "Test NAP",
"Project_ID": 1003731,
"ProjectPhase": "Faza 1 NAP",
"ProjectPhase_ID": 1002308,
"ProjectTask": "Subfaza 1 NAp",
"ProjectTask_ID": 1000379,
"Activity": "Testare",
"TrxOrganization": "A016",
"Campaign": "MK1",
"Employee": "Angajat 1",
"Employee_ID": 1015935,
"Asset": "C1 - G8 Instrument REF + ACC",
"Asset_ID": 1001110,
"MeanOfConveyance": "B-137-CRL",
"FixedSafetyStock": null,
"InventorySecurityTime": null,
"ReorderTime": null,
"AVCAvgConsumption": null,
"OrderMin": null,
"QtyOrdered": null,
"QtyReserved": null,
"OrderPackQty": null,
"AvgConsumption": null,
"ConsumptionMonth1": null,
"ConsumptionMonth2": null,
"ConsumptionMonth3": null
}
]
}
],
"totalRows": 1
}
Create:
URL: https://api.socratecloud.com/webapi/rest/requisition/full/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (starts 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"
"lines": [
{
"Organization": "Fidelio Farm",
"Active": true,
"Line": 10,
"SalesRep": "Alin Cruceru",
"Product": "ARTICOL TEST WEBARK",
"ProductCategory": "Semifabricat",
"Charge": null,
"UOM": "Each",
"Internal": true,
"QtyEntered": 5,
"PriceActual": 10,
"Qty": 5,
"Description": "Demo description",
"BPartner": "Macheta",
"Project": "Test NAP",
"ProjectPhase": "Faza 1 NAP",
"ProjectTask": "Subfaza 1 NAp",
"Activity": "Testare",
"TrxOrganization": "A016",
"Campaign": "MK1",
"Employee": "Angajat 1",
"Asset": "C1 - G8 Instrument REF + ACC",
"MeanOfConveyance": "B-137-CRL"
}
]
}
Process
URL: https://api.socratecloud.com/webapi/rest/requisition/process/{version}?accessToken={access_token}&DocumentNo={document_no}&DocumentID={document_id}&DocumentAction={document_action}&VoidReason={void_reason} Method: POST
Return: document status for success or error message (starts with "ERROR: ")