It allows you:
to insert new General Distributions (master document)
to process existent General Distributions (Change Document Action: Prepare, Complete, Void etc)
to update existing General Distributions
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!
to view General Distributions master document data - ordered descending by created date and document date
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 Customer active with all the mandatory fields
to have a price list active
Columns that can be used as filters:
Organization
DocumentNo
BPartner
Actions can be done:
list
insert
update
General Distributions fields (Master Document)
A General Distribution in SocrateCloud has the following structure:
Master document which contains data about header document:
No. document
General Distribution data
Customer
Employee
etc.
Document details (see General Distributions Details) which contains informations about:
Product
Quantity
Currency
Price, etc
URL: https://api.socratecloud.com/webapi/rest/distribution/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "TESTIRINA SRL",
"OrganizationValue": "TESTIRINA",
"DocumentNo": "RGA 1000029",
"DateAcct": "2020-10-14 00:00:00+0000",
"BPartner": "1000024",
"DocType": "General Distribution",
"DocStatus": "CO",
"DocAction": "CL",
"Description": "test 1234",
"DistributionType": "DWA",
"SourceDocType": "AP Invoice"
}
],
"totalRows": 17
}
URL: https://api.socratecloud.com/webapi/rest/distribution/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"OrganizationValue": "TESTIRINA",
"DocumentNo": "RGA 1000029",
"DateAcct": "2020-10-14 00:00:00+0000",
"BPartner": "1000024",
"DocType": "General Distribution",
"DocStatus": "CO",
"DocAction": "CL",
"Description": "test 1234",
"DistributionType": "D-P",
"SourceDocType": "AP Invoice"
}
URL: https://api.socratecloud.com/webapi/rest/distribution/update/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"OrganizationValue": "TESTIRINA",
"DocumentNo": "RGA 1000029",
"DateAcct": "2020-10-14 00:00:00+0000",
"BPartner": "1000024",
"DocType": "General Distribution",
"DocStatus": "CO",
"DocAction": "CL",
"Description": "test 1234",
"DistributionType": "D-P",
"SourceDocType": "AP Invoice"
}
Note: If you don't transmit a field, then the value of that field will be deleted!! (except of not updatable fields)