22. General Distributions

01. General Distributions

Interface

It allows you:

  • to insert new general distributions (master&details in one json file)

  • to view general distributions (master&details in one json file) - 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

  • create

General Distribution fields (Master&Details)

A General Distribution in SocrateCloud has the following structure:

  • Master document which contains data about header document:

    • No. document

    • General Distribution data

    • Customer

    • etc.

  • Document details (see General Distributions Details) which contains informations about:

    • Product

    • Quantity

    • Currency

    • Price

    • Employee

    • etc

To update only master data, or a specific distribution line see General Distribution Master, General Distribution Details chapters.

API Methods:

List:

URL: https://api.socratecloud.com/webapi/rest/distribution/list_full/{version}?accessToken={access_token}

Method: GET

Return: JSON object with next format:

{

"data": [

{

"Organization": "TESTIRINA SRL",

"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",

"lines": [

{

"Organization": "TESTIRINA SRL",

"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",

"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",

"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/full/create/{version}?accessToken={access_token}

Method: POST

Return: document no for success or error message (start with "ERROR: ")

Data format:

{

"Organization": "TESTIRINA SRL",

"DocumentNo": "RGA 1000001",

"DateAcct": "2020-10-15 00:00:00+0000",

"BPartner": "1000024",

"DocType": "General Distribution",

"DocStatus": "DR",

"DocAction": "CO",

"Description": "test 123",

"DistributionType": "D-P",

"SourceDocType": "AP Invoice",

"lines": [

{

"Organization": "TESTIRINA SRL",

"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",

"Account": "Patrimoniul regiei",

"BPartner": "1000024",

"Employee": "ANA OBRETIN",

"Product": "001",

"Charge": "Cheltuieli cu salariile-421",

"Warehouse": "Standard",

"AssetValue": "1000055",

"Project": "PACHE_1",

"ProjectPhase": "pache_fz_1",

"ProjectSubPhase": "pache_A",

"Campaign": "Campanie testare API",

"Activity": "Dulgherie",

"SalesRegion": "REGIUNEA TRANSILVANIA",

"LocationFrom": "Sfantu Gheorghe",

"LocationTo": "Alba Iulia",

"Contract": "1000002",

"User1": null,

"User2": null,

"CardNumber": "numar_card_1234"

}

]

}