01. Sales Order

Interface

It allows you:

Prerequisites:

In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:

Columns that can be used as filters:

Actions can be done:

Sales Order fields (Master&Details)

A Sales Order in SocrateCloud has the following structure:

To update only master data, or a specific order line see Sales Order Master, Order Details chapters.

API Methods:

List:

URL: https://api.socratecloud.com/webapi/rest/order/full/list/{version}?accessToken={access_token}

Method: GET

Return: JSON object with next format:


{

    "data": [

        {

            "Organization": "Demo SRL",

            "Created": "2014-01-17 09:11:53",

            "CreatedBy": "Admin",

            "Updated": "2014-05-07 23:44:18",

            "UpdatedBy": "Admin",

            "DocumentNo": "60300",

            "OrderReference": null,

            "ExternalInvoiceNo": null,

            "ExternalInOutNo": null,

            "Description": "A1 | ** Anulată",

            "DocType": "Standard Order",

            "DateOrdered": "2014-01-28 00:00:00",

            "DatePromised": "2014-01-28 00:00:00",

            "BPartner": "Client 01",

            "BPartnerName": "Client 01",

            "BPartnerLocation": "STRADA",

            "BillBPartnerTaxID": "RO 1234567",

            "BillBPartnerIsIndividual": false,

            "BillBPartnerIsTaxIDValid": false,

            "BillBPartner": "Client 01",

            "BillBPartnerName": "Client 01",

            "BillLocation": "STRADA",

            "BPartnerContact": null,

            "BPartnerContactEmail": null,

            "BPartnerContactPhone": null,

            "BPartnerContactPhone2": null,

            "BillContact": null,

            "BillContactEmail": null,

            "BillContactPhone": null,

            "BillContactPhone2": null,

            "Warehouse": "Standard",

            "DeliveryViaRule": "Shipper",

            "Shipper": null,

            "DeliveryTerms": null,

            "Currency": "RON",

            "SalesRep": "User 1",

            "PaymentTerm": "30 days",

            "TrxOrganization": null,

            "Activity": "Programare",

            "TotalLines": 0,

            "GrandTotal": 0,

            "DocumentStatus": "Voided",

            "DocumentAction": "Complete",

            "PaymentMethod": "On Credit",

            "PriceList": "Standard EUR",

            "IsSelfService": true,

            "BillSendLocation": null,

            "PaymentMode": null,

            "ReceiptNo": 1,

            "AssetValue": "9195",

            "AssetSN": null,

            "Employee": "Loredan",

            "Project" : null,

            "ProjectPhase": null,

            "Status_ID": 1000080,

            "Status": "Creată",

            "Lead_ID": 1000018,

            "LeadDocumentNo": "1000400",

            "BPartnerSR": "Agent Value",

            "BPartnerSRName": "Agent Name",

            "lines": [

                {

                    "Organization": "Demo SRL",

                    "Created": "2014-03-04 06:31:38",

                    "CreatedBy": "SuperUser",

                    "Updated": "2014-03-04 06:31:38",

                    "UpdatedBy": "SuperUser",

                    "IsActive": true,

                    "Line": 10,

                  "ID": 1757141,

                    "Product": "some_product",

                    "ProductName": "some_product",

                    "Description": null,

                    "QtyEntered": 1,

    "UOM_ID": 100,

                    "UOM": "Each",

                    "ListPrice": 150,

                    "Discount": 0,

                    "PriceEntered": 150,

                    "LineNetAmt": 150,

                    "IsTaxIncluded": true,

                    "Tax": "24% ",

                    "TrxOrganization": "Demo SRL",

                    "Activity": null,

                    "AssetValue": "9195",

                    "AssetSN": null,

                    "Employee": "Loredan",

                    "Project" : null,

                    "ProjectPhase": null,

      "ProjectTask": null,

                    "BOMPrice": null,

                    "SecondaryQty": null,

                    "DropShip": false,

                    "Status_ID": 1000081,

                    "Status": "Creat",

                    "Campaign_ID": 1234567,

                    "CampaignValue": "Test Campanie1",

                    "Campaign": "Test Campanie1"

                },

                {

                   "Product": "3210",

                   "QtyEntered": 751

               }

            ],

            "comments": [

                {

                "C_Order_ID": 1141572,

                "C_OrderComment_ID": 1001036,

                "Comments": "test1"

                }

            ]

        }

    ],

    "totalRows": 17

}

Create:

URL: https://api.socratecloud.com/webapi/rest/order/full/create/{version}?accessToken={access_token}

Method: POST


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

Note: We recommend to attend the following steps:

1.  If new customer create customer using BPartner create method

2.Create Order 

Data format:

{

    "Organization": "Demo SRL",

    "DocumentNo": "60300",

    "OrderReference": null,

    "ExternalInvoiceNo": null,

    "ExternalInOutNo": null,

    "Description": "some_description",

    "DocType": "Standard Order",

    "DateOrdered": "2014-01-28 00:00:00",

    "DatePromised": "2014-01-28 00:00:00",

    "BPartner": "Client 01",

    "BPartnerLocation": "STRADA",

    "BPartnerLocation_ID": 1000603,

    "BillBPartner": "Client 01",

    "BillLocation": "STRADA",

    "BillLocation_ID": 1006087,

    "BPartnerContact": null,

    "BPartnerContactEmail": null,

    "BPartnerContactPhone": null,

    "BPartnerContactPhone2": null,

    "BillContact": null,

    "BillContactEmail": null,

    "BillContactPhone": null,

    "BillContactPhone2": null,

    "Warehouse": "Standard",

    "Warehouse_ID": 1000298, 

    "DeliveryViaRule": "Shipper",

    "Shipper": null,

    "DeliveryTerms": null,

    "SalesRep": "Ionut Ursuleanu",

    "PaymentTerm": "30 days",

    "TrxOrganization": null,

    "Activity": "Programare",

    "DocumentAction": "<None>",

    "PaymentMethod": "On Credit",

    "PriceList": "Standard EUR",

    "IsSelfService": true,

    "BillSendLocation": null,

    "PaymentMode": null,

    "ReceiptNo": 1,

    "AssetValue": "9195",

    "AssetSN": null,

    "Employee": "Loredan",

    "Project" : null,

    "ProjectPhase": null,

    "Status_ID": 1000080,

    "Status": "Creată",

    "Lead_ID": 1000018,

    "LeadDocumentNo": "1000400",

    "BPartnerSR": "Agent Value",

    "BPartnerSRName": "Agent Name",

    "lines": [

        {

            "Organization": "Demo SRL",

            "Active": true,

            "Product": "some_product",

            "Description": null,

            "QtyEntered": 1,

    "UOM_ID": 100,

            "UOM": "Each",

            "ListPrice": null,

            "Discount": null,

            "PriceEntered": null,

            "Tax": "24% ",

            "TrxOrganization": "Demo SRL",

            "Activity": "Programare",

            "AssetValue": "9195",

            "AssetSN": null,

            "Employee": "Loredan",

            "Project" : null,

            "ProjectPhase": null,

            "ProjectTask": null,

            "BOMPrice": null,

            "SecondaryQty": null,

            "DropShip": false,

            "Status_ID": 1000081,

            "Status": "Creat",

            "Campaign_ID": 1234567,

            "CampaignValue": "Test Campanie1",

            "Campaign": "Test Campanie1"

        }

    ],

    "comments": [

            {

                "Comments": "test1"

            }

    ]

}

Print:

Parameters:

URL: https://api.socratecloud.comwebapi/rest/order/print/{version}?accessToken={access_token}&DocumentNo={document_no}&PrintFormatName={print_format_name)

Method: GET

Return: PDF file