01. Sales Order
Interface
It allows you:
to insert new sales orders (master&details in one json file)
to view sales orders (master&details in one json file) - ordered descending by created date and document date
to print
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:
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z from C_order). The sign used for comparison is ”>” (exclusive). Use this filter to get all the orders modified after the date/time value sent in this parameter.
eg: LastModified=2014-06-13 12:40:00 +0300 if you are in Romania or LastModified=2014-06-13%2012:40:00%20%2b0300
Organization
DocumentNo
OrderReference
BPartner
IsOpenOrder - use to list only open orders (= not fully shipped or not fully invoiced yet)
HasPartialPayments: true/false
DateOrdered - Range
IsSelfService
DocumentStatus
PriceList
CreatedBy
AssetValue
AssetSN
Employee
Project
ProjectPhase
Actions can be done:
list
create
print
Sales Order fields (Master&Details)
A Sales Order in SocrateCloud has the following structure:
Master document (see Sales Order Master) which contains data about header document:
No. document
Order data
Customer
Sales Reprezentative etc.
Document details (see Sales Order Details) which contains the products that are ordered with informations about:
Product
Quantity
Selling price
VAT
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:
DocumentNo -mandatory ( Sales Order document number )
PrintFormatName - optional - to use when you want the sales order to be printed on a specific format.
URL: https://api.socratecloud.comwebapi/rest/order/print/{version}?accessToken={access_token}&DocumentNo={document_no}&PrintFormatName={print_format_name)
Method: GET
Return: PDF file