22.1 General Distributions Details
1.2 General Distributions Details
Interface
It allows you:
to insert new lines (one by one) into an existing General Distribution
to update, delete General Distribution lines (one by one)
to view General Distributions lines
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an open General Distributions (document status: Draft, In Progress)
Columns that can be used as filters:
DocumentNo (OrderNo)
Line
Product
AssetValue
Employee
Mandatory Parameters when inserting order lines:
DocumentNo
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
Sales Reprezentative etc.
Document details (see General Distributions Details) which contains informations about:
Product
Quantity
Selling price
VAT
General Distributions line fields
API Methods:
List:
URL: https://api.socratecloud.com/webapi/rest/distribution/line/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}&DocumentNo={Documentno}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "TESTIRINA SRL",
"OrganizationValue": "TESTIRINA",
"Distribution_ID": 1001549,
"Created": "2020-10-16 11:08:25+0000",
"CreatedBy": "TESTIRINA_Admin",
"Updated": "2020-10-16 11:08:25+0000",
"UpdatedBy": "TESTIRINA_Admin",
"Description": "descriere detaliu test",
"Qty": 10,
"UOM": "Each",
"Price": 150,
"Percentage": 100,
"Amount": 1500,
"Currency": "RON",
"CurrencyType": "Spot",
"Tax": "5%",
"DeductibleAmt": 100,
"NonDeductibleAmt": 150,
"DeductibleQty": 1,
"NonDeductibleQty": 2,
"TrxOrganization": "ADM",
"TrxOrganizationValue": "ADM",
"Account": "Patrimoniul regiei",
"BPartner": "1000024",
"Employee": "ANA OBRETIN",
"Product": "001",
"Charge": "Cheltuieli cu salariile-421",
"Warehouse": "Standard",
"AssetValue": "1000055",
"Line": 10,
"Project": "PACHE_1",
"ProjectPhase": "pache_fz_1",
"ProjectSubPhase": "pache_A",
"Campaign": "Campanie testare API",
"Activity": "Dulgherie",
"ActivityValue": "1000002",
"SalesRegion": "REGIUNEA TRANSILVANIA",
"LocationFrom": "Sfantu Gheorghe",
"LocationTo": "Alba Iulia",
"Contract": "1000002",
"User1": null,
"User2": null,
"CardNumber": "numar_card_1234",
"ResourceName": null,
"DistributionLine_ID": 1002250
}
],
"totalRows": 1
}
Create:
URL: https://api.socratecloud.com/webapi/rest/distribution/line/create/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: line no for success or error message (start with "ERROR: ")
Data format:
{
"OrganizationValue": "TESTIRINA",
"Distribution_ID": 1001549,
"Created": "2020-10-16 11:08:25+0000",
"CreatedBy": "TESTIRINA_Admin",
"Updated": "2020-10-16 11:08:25+0000",
"UpdatedBy": "TESTIRINA_Admin",
"Description": "descriere detaliu test",
"Qty": 10,
"UOM": "Each",
"Price": 150,
"Percentage": 100,
"Amount": 1500,
"Currency": "RON",
"CurrencyType": "Spot",
"Tax": "5%",
"DeductibleAmt": 100,
"NonDeductibleAmt": 150,
"DeductibleQty": 1,
"NonDeductibleQty": 2,
"TrxOrganization": "ADM",
"TrxOrganizationValue": "ADM",
"Account": "Patrimoniul regiei",
"BPartner": "1000024",
"Employee": "ANA OBRETIN",
"Product": "001",
"Charge": "Cheltuieli cu salariile-421",
"Warehouse": "Standard",
"AssetValue": "1000055",
"Line": 10,
"Project": "PACHE_1",
"ProjectPhase": "pache_fz_1",
"ProjectSubPhase": "pache_A",
"Campaign": "Campanie testare API",
"ActivityValue": "1000002",
"SalesRegion": "REGIUNEA TRANSILVANIA",
"LocationFrom": "Sfantu Gheorghe",
"LocationTo": "Alba Iulia",
"Contract": "1000002",
"User1": null,
"User2": null,
"CardNumber": "numar_card_1234",
"ResourceName": null,
"DistributionLine_ID": 1002250
}
Update:
URL: https://api.socratecloud.com/webapi/rest/distribution/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:
{
"OrganizationValue": "TESTIRINA",
"Distribution_ID": 1001549,
"Created": "2020-10-16 11:08:25+0000",
"CreatedBy": "TESTIRINA_Admin",
"Updated": "2020-10-16 11:08:25+0000",
"UpdatedBy": "TESTIRINA_Admin",
"Description": "descriere detaliu test",
"Qty": 10,
"UOM": "Each",
"Price": 150,
"Percentage": 100,
"Amount": 1500,
"Currency": "RON",
"CurrencyType": "Spot",
"Tax": "5%",
"DeductibleAmt": 100,
"NonDeductibleAmt": 150,
"DeductibleQty": 1,
"NonDeductibleQty": 2,
"TrxOrganizationValue": "ADM",
"Account": "Patrimoniul regiei",
"BPartner": "1000024",
"Employee": "ANA OBRETIN",
"Product": "001",
"Charge": "Cheltuieli cu salariile-421",
"Warehouse": "Standard",
"AssetValue": "1000055",
"Line": 10,
"Project": "PACHE_1",
"ProjectPhase": "pache_fz_1",
"ProjectSubPhase": "pache_A",
"Campaign": "Campanie testare API",
"ActivityValue": "1000002",
"SalesRegion": "REGIUNEA TRANSILVANIA",
"LocationFrom": "Sfantu Gheorghe",
"LocationTo": "Alba Iulia",
"Contract": "1000002",
"User1": null,
"User2": null,
"CardNumber": "numar_card_1234",
"ResourceName": null,
"DistributionLine_ID": 1002250
}