01. Products
Interface
It allows you:
to get the products catalogue with information about product, current price list, current inventory. You can acces only products with 'IsSelfService' checkbox marked (Y).
to write new products along with sales price in the default price list.
to set a standard picture (get & delete also).
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have at least one TaxCategory with one default tax
to have the default PriceList with at least one PriceListVersion
to have at least one warehouse
Columns that can be used as filters:
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z, max date from Product, Price, Inventory). The sign used for comparison is ”>” (exclusive). Use this filter to get all the products/prices/inventory modified after the date/time value sent in this parameter.
Language (eg: ”ro_RO”, ”en_EN”, ”bg_BG” etc) - if null or unprovided then English is the base language for all fields.
Organization
Value
Name
UPC_SKU
ProductCategory
ProductSubCategory
PriceList
if not included, a default sales price list in the base currency must exist (isDefault, IsSaleList)
if included, the respective price list must be marked as a sales prices list (IsSaleList)
FamilyType
ProductFamily
HasStock
Active
CreatedBy
Tax
AttributeSet
Attribute
AttributeValue
AttributeValueList
IsSold
IsGenerallyValid
SalesRep_ID
SalesRep
GuaranteeDays
GuaranteeDaysMin
ProductType
Actions can be done:
list
create
update
delete
API Methods:
List:
URL: https://api.socratecloud.com/webapi/rest/product/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Available filter parameters:
Language
Organization
Value
only from v3: it is allowed to search with "like" function on this parameter. Ex. Value=%25string, in that case the sistem will list all products which contain value like %string%.
Name
only from v3: it is allowed to search with "like" function on this parameter. Ex. Name=%25string, in that case the sistem will list all products which contain name like %string%.
UPC_SKU
only from v3: it is allowed to search with "like" function on this parameter. Ex. UPC_SKU=%25string, in that case the sistem will list all products which contain UPC or SKU like %string%.
ProductCategory
only from v3: it is allowed to search with "like" function on this parameter. Ex. ProductCategory=%25string, in that case the sistem will list all products which belong to ProductCategory like %string%.
PriceList
FamilyType
ProductType
HasStock
IsSold
Active
CreatedBy
Tax
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z, max date from Product, Price, Inventory). The sign used for comparison is ”>” (exclusive). Use this filter to get all the products/prices/inventory modified after the date/time value sent in this parameter. (for e g: LastModified=2014-06-13 12:40:00 +0300 if you are in Romania or: LastModified=2014-06-13%2012:40:00%20%2b0300)
AttributeSet
Attribute
AttributeValue
AttributeValueList
The value of this parameter should be provided in the format of a JSON object whose field names are the attribute names on which to filter and the values of the fields are the attribute values on which to filter. If for an attribute it is wanted to filter for many values of the attribute the value of the field should be provided in the form of a JSON array.
Ex.
{
"attribute_name1":"attribute_value1", --> single attribute value
"attribute_name2":"attribute_value2", --> single attribute value
"attribute_name3":["attribute_value3","attribute_value4","attribute_value5"] --> multiple attribute values
}
The filter is applied with logical AND between the values of different attributes and with logical OR between the values of the same attribute.
Ex. For the example above JSON will translate to the following filter
attribute_name1=attribute_value1 AND attribute_name2=attribute_value2 AND (attribute_name3=attribute_value3 OR attribute_name3=attribute_value4 OR attribute_name3=attribute_value5)
GuaranteeDaysMin
Return: JSON object with next format:
{
"data": [
{
"Organization": "Demo SRL",
"Created": "2020-02-27 12:36:31+0000",
"CreatedBy": "DEMO",
"Updated": "2022-05-11 12:05:35+0000",
"UpdatedBy": "DEMO",
"Value": "030",
"Name": "PRODUCT 30",
"Description": null,
"Help": null,
"UPC": "030",
"SKU": "030",
"Active": true,
"UOM": "Each",
"OfferUOM": null,
"OfferUOMCoef": null,
"TaxCategory": "TVA",
"ProductCategory": "FOOD PRODUCTS",
"ProductSubcategory": null,
"ProductFamily": "FAMILIE PRODUS TEST_1",
"FamilyType": "TIP FAMILIE TEST",
"ProductType": "Item",
"NetWeight": 0.24,
"Weight": 0.25,
"Volume": 1,
"QtyOnHand": 0,
"QtyAvailable": 0,
"HasStock": false,
"PriceList": "Vanzare RON",
"PriceListVersion": "Vanzare RON vers1",
"Currency": "RON",
"IsTaxIncluded": false,
"IsSold": true,
"ListPrice": null,
"StdPrice": null,
"Tax": "19%",
"TaxRate": 19,
"AttributeSet": "Proprietate Produs 30",
"attributes": {
"Proprietate test 1": "white",
"Proprietate noua 1": "Black"
},
"Organization_ID": 1005272,
"Product_ID": 1121036,
"TaxCategory_ID": 1000812,
"UOM_ID": 100,
"ProductCategory_ID": 1003060,
"ProductSubcategory_ID": null,
"ProductFamily_ID": 1001416,
"IsPurchased": true,
"IsStocked": true,
"VersionNo": "2",
"Classification": "A",
"DocumentNote": null,
"GuaranteeDays": 12,
"AttributeSet_ID": 1001933,
"Make": "FABRICA TEST",
"Model": "Model_test",
"CreatedBy_ID": 1014218,
"UpdatedBy_ID": 1014218,
"ProductPurchasings": [],
"SalesRep": "REPR_NOU",
"SalesRep_ID": 1030593,
"SubscriptionType": null,
"SubscriptionType_ID": null,
"GuaranteeDaysMin": 5,
"Discontinued": false
}
],
"totalRows": 1
}
List full:
URL: https://api.socratecloud.com/webapi/rest/product/full/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Available filter parameters:
Language
Organization
Value
only from v3: it is allowed to search with "like" function on this parameter. Ex. Value=%25string, in that case the sistem will list all products which contain value like %string%.
Name
only from v3: it is allowed to search with "like" function on this parameter. Ex. Name=%25string, in that case the sistem will list all products which contain name like %string%.
UPC_SKU
only from v3: it is allowed to search with "like" function on this parameter. Ex. UPC_SKU=%25string, in that case the sistem will list all products which contain UPC or SKU like %string%.
ProductCategory
only from v3: it is allowed to search with "like" function on this parameter. Ex. ProductCategory=%25string, in that case the sistem will list all products which belong to ProductCategory like %string%.
PriceList
FamilyType
ProductType
HasStock
Active
CreatedBy
Tax
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z, max date from Product, Price, Inventory). The sign used for comparison is ”>” (exclusive). Use this filter to get all the products/prices/inventory modified after the date/time value sent in this parameter. (for e g: LastModified=2014-06-13 12:40:00 +0300 if you are in Romania or: LastModified=2014-06-13%2012:40:00%20%2b0300)
AttributeSet
Attribute
AttributeValue
AttributeValueList
IsSold
IsGenerallyValid
The value of this parameter should be provided in the format of a JSON object whose field names are the attribute names on which to filter and the values of the fields are the attribute values on which to filter. If for an attribute it is wanted to filter for many values of the attribute the value of the field should be provided in the form of a JSON array.
Ex.
{
"attribute_name1":"attribute_value1", --> single attribute value
"attribute_name2":"attribute_value2", --> single attribute value
"attribute_name3":["attribute_value3","attribute_value4","attribute_value5"] --> multiple attribute values
}
The filter is applied with logical AND between the values of different attributes and with logical OR between the values of the same attribute.
Ex. For the example above JSON will translate to the following filter
attribute_name1=attribute_value1 AND attribute_name2=attribute_value2 AND (attribute_name3=attribute_value3 OR attribute_name3=attribute_value4 OR attribute_name3=attribute_value5)
GuaranteeDaysMin
Return: JSON object with next format:
{
"data": [
{
"Organization": "DEMO SRL",
"Created": "2020-02-27 12:36:31+0000",
"CreatedBy": "User_1",
"Updated": "2022-05-11 12:05:35+0000",
"UpdatedBy": "User_1",
"Value": "030",
"Name": "PRODUCT 30",
"Description": null,
"Help": null,
"UPC": "030",
"SKU": "030",
"Active": true,
"UOM": "Each",
"OfferUOM": null,
"OfferUOMCoef": null,
"TaxCategory": "TVA",
"ProductCategory": "FOOD PRODUCTS",
"ProductSubcategory": null,
"ProductFamily": "FAMILIE PRODUS TEST_1",
"FamilyType": "TIP FAMILIE TEST",
"ProductType": "Item",
"NetWeight": 0.24,
"Weight": 0.25,
"Volume": 1,
"QtyOnHand": 0,
"QtyAvailable": 0,
"HasStock": false,
"PriceList": "Vanzare RON",
"PriceListVersion": "Vanzare RON vers1",
"Currency": "RON",
"IsTaxIncluded": false,
"IsSold": true,
"ListPrice": null,
"StdPrice": null,
"Tax": "19%",
"TaxRate": 19,
"AttributeSet": "Proprietate Produs 30",
"attributes": {
"Proprietate test 1": "white",
"Proprietate noua 1": "Black"
},
"Organization_ID": 1005272,
"Product_ID": 1121036,
"TaxCategory_ID": 1000812,
"UOM_ID": 100,
"ProductCategory_ID": 1003060,
"ProductSubcategory_ID": null,
"ProductFamily_ID": 1001416,
"IsPurchased": true,
"IsStocked": true,
"VersionNo": "2",
"Classification": "A",
"DocumentNote": null,
"GuaranteeDays": 12,
"AttributeSet_ID": 1001933,
"Make": "FABRICA TEST",
"Model": "Model_test",
"CreatedBy_ID": 1014218,
"UpdatedBy_ID": 1014218,
"BPartnerProducts": [
{
"Organization": "DEMO SRL",
"Created": "2022-05-12 09:59:41+0000",
"CreatedBy": "User_1",
"Updated": "2022-05-12 09:59:41+0000",
"UpdatedBy": "User_1",
"Product": "030",
"ProductName": "PRODUCT 30",
"ProductUOM": "Each",
"BPartner": "CT1",
"BPartnerName": "CLIENT TEST 1",
"Description": "some_product 030",
"Active": true,
"IsGenerallyValid": false,
"VendorProductNo": "Tcode030",
"VendorCategory": null,
"Manufacturer": "TestPROD",
"QualityRating": 0,
"ShelfLifeMinPct": 1,
"ShelfLifeMinDays": 20,
"OrderUOM": "Each",
"OrderUOMCoef": 24,
"Order_Min": 48,
"ShipUOM": "Bax",
"ShipUOMCoef": 48,
"InvoiceUOM": "Bax",
"InvoiceUOMCoef": 48
}
],
"ProductPurchasings": [
{
"Organization_ID": 1005272,
"Active": true,
"Created": "2020-02-27 12:37:34+0000",
"CreatedBy": 1014218,
"Updated": "2020-02-27 12:37:34+0000",
"UpdatedBy": 1014218,
"CurrentVendor": true,
"UOM_ID": 100,
"Currency_ID": 102,
"ListPrice": 0,
"POPrice": 0,
"PriceEffective": null,
"LastPOPrice": 0,
"LastInvoicePrice": null,
"UPC": null,
"PartnerCategory": null,
"Discontinued": false,
"DiscontinuedBy": null,
"MinimumOrderQty": 1,
"OrderPackQty": 1,
"CostPerOrder": null,
"ActualDeliveryTime": null,
"LeadTime": null,
"RoyaltyAmount": null,
"Manufacturer": null,
"QualityRating": null,
"Description": null,
"PartnerProductKey": "030",
"BPartner_ID": 1018006,
"CalendarUpdated": null
}
],
"SalesRep": "REPR_NOU",
"SalesRep_ID": 1030593,
"SubscriptionType": null,
"SubscriptionType_ID": null,
"GuaranteeDaysMin": 5,
"Discontinued": false
}
],
"totalRows": 1
}
Create:
URL: https://api.socratecloud.com/webapi/rest/product/create/{version}?accessToken={access_token}
Method: POST
Return: product value for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Value": "9865953956",
"Name": "some_name",
"Description": null,
"Help": null,
"UPC": null,
"SKU": null,
"Active": true,
"UOM": "Each",
"TaxCategory": "TVA 24%",
"ProductCategory": "English Book",
"ProductSubcategory": null,
"ProductFamily": null,
"FamilyType": null,
"ProductType": "Item",
"NetWeight": 0,
"Volume": 0,
"PriceList": null,
"PriceListVersion": null,
"ListPrice": null,
"StdPrice": "100",
"IsSold": false,
"AttributeSet": "W&H",
"attributes": {
"Width": 10,
"Height": 25},
"SalesRep": "AdminTitular",
"SalesRep_ID": null,
"SubscriptionType": "Abonament Food",
"SubscriptionType_ID": 1000006,
"Model": null,
"GuaranteeDays": null,
"GuaranteeDaysMin": 30
}
Create full:
URL:https://api.socratecloud.com/webapi/rest/product/full/create/{version}?accessToken={access_token}
Method: POST
Return: product value for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Created": "2007-08-22 08:30:19+0300",
"CreatedBy": "System",
"Updated": "2015-01-29 09:05:26+0200",
"UpdatedBy": "Florin David",
"Value": "Standard Product For BBX TEEESt",
"Name": "Standard",
"Description": null,
"Help": null,
"UPC": "123",
"SKU": "2222",
"Active": true,
"UOM": "Each",
"OfferUOM": null,
"OfferUOMCoef": null,
"TaxCategory": "SCUTIT",
"ProductCategory": "Autoturisme",
"ProductSubcategory": null,
"ProductFamily": null,
"FamilyType": "Nokia",
"ProductType": "Item",
"NetWeight": null,
"Weight": 20,
"Volume": null,
"QtyOnHand": 17,
"QtyAvailable": 1,
"HasStock": true,
"PriceList": "C1PiatraOnline",
"PriceListVersion": "10/09/2019",
"Currency": "RON",
"IsTaxIncluded": false,
"IsSold": true,
"ListPrice": null,
"StdPrice": 10,
"Tax": null,
"TaxRate": null,
"AttributeSet": "Inaltime si culoare",
"attributes": {
"Inaltime": "120"
},
"Organization_ID": 1000001,
"Product_ID": 1000001,
"TaxCategory_ID": 1000001,
"UOM_ID": 100,
"ProductCategory_ID": 1000014,
"ProductSubcategory_ID": null,
"ProductFamily_ID": null,
"IsPurchased": true,
"IsStocked": true,
"VersionNo": null,
"Classification": null,
"DocumentNote": null,
"GuaranteeDays": null,
"AttributeSet_ID": 1000000,
"Make": "Mercedes",
"Model": "C KLASS",
"RDS_ID_Inventory": null,
"RDS_SubcategorieTehnica": null,
"CreatedBy_ID": 0,
"UpdatedBy_ID": 1000054,
"BPartnerProducts": [],
"ProductPurchasings": [
{
"Organization_ID": 1000001,
"Active": true,
"Created": "2020-07-10 13:00:15+0300",
"CreatedBy": 1000002,
"Updated": "2020-07-10 14:07:25+0300",
"UpdatedBy": 1000002,
"CurrentVendor": false,
"UOM_ID": 100,
"Currency_ID": 102,
"ListPrice": 11.5,
"POPrice": 9.5,
"PriceEffective": null,
"UPC": null,
"PartnerCategory": null,
"Discontinued": false,
"DiscontinuedBy": null,
"MinimumOrderQty": 1,
"OrderPackQty": 1,
"CostPerOrder": 0.5,
"LeadTime": 0,
"RoyaltyAmount": 0,
"Manufacturer": null,
"QualityRating": 0,
"Description": null,
"PartnerProductKey": "TDK91TEST",
"BPartner_ID": 1000003,
"CalendarUpdated": null
}
],
"SalesRep": null,
"SalesRep_ID": null,
"SubscriptionType": null,
"SubscriptionType_ID": null,
"GuaranteeDaysMin": 30
}
Update:
URL: https://api.socratecloud.com/webapi/rest/product/update/{version}?accessToken={access_token}&Value={product_value}
Method: POST
Return: product value for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "Demo SRL",
"Value": "9865953956",
"Name": "new_name",
"Description": null,
"Help": null,
"UPC": null,
"SKU": null,
"Active": true,
"UOM": "Each",
"TaxCategory": "TVA 24%",
"ProductCategory": "English Book",
"ProductSubcategory": null,
"ProductFamily": null,
"FamilyType": null,
"ProductType": "Item",
"NetWeight": 0,
"Volume": 0,
"PriceList": null,
"PriceListVersion": null,
"ListPrice": null,
"StdPrice": "100",
"IsSold": false,
"SalesRep": "AdminTitular",
"SalesRep_ID": null,
"SubscriptionType": "Abonament Food",
"SubscriptionType_ID": 1000006,
"GuaranteeDays": null,
"GuaranteeDaysMin": 30
"AttributeSet": "W&H",
"attributes": {
"Width": 10,
"Height": 25}
}
Delete:
URL: https://api.socratecloud.com/webapi/rest/product/delete/{version}?&accessToken={access_token}&Value={product_value}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")
Get picture:
URL: https://api.socratecloud.com/webapi/rest/product/picture/{version}?startRow={0}&endRow={100}&accessToken={access_token}&Value={product_value}
Method: GET
Available parameters:
Value (mandatory) - product code
FileName - picture file name to get. If not specified the filename will default to picture.png
Return: File or 204/"No Content" if no picture found
Set picture:
URL: https://api.socratecloud.com/webapi/rest/product/picture/set/{version}?startRow={0}&endRow={100}&accessToken={access_token}&Value={product_value}
Method: POST
Available parameters:
Value (mandatory) - product code
FileName - picture file name. If not specified the filename will default to picture.png
Return 'Ok' for success or error message (start with "ERROR: ")
Note: Only image files are accepted
Delete picture:
URL: https://api.socratecloud.com/webapi/rest/product/picture/delete/{version}?startRow={0}&endRow={100}&accessToken={access_token}&Value={product_value}
Method: POST
Available parameters:
Value (mandatory) - product code
FileName - picture file name. If not specified the filename will default to picture.png
Return 'Ok' for success or error message (start with "ERROR: ")
List picture:
URL: https://api.socratecloud.com/webapi/rest/product/picture/list/{version}?accessToken={access_token}&Value={product_value}
Method: GET
Available parameters:
Value (mandatory) - product code
Return: JSON with the following format
{
"data": [
{
"FileName": "20x20.gif",
"Length": 784
},
{
"FileName": "800x600.jpg",
"Length": 7767
}
],
"totalRows": 2
}