Ah good to know that that is the right order to create a product. And deleting a product is in reverse order?
I noticed then when setting product.Id in the JSON and then Posting a new product the Id isn't taken but instead SmartStore creates it own id, is this correct?
For Example:
Content-Length: 282
Expect: 100-continue
Connection: Keep-Alive
{
"ProductTypeId": 5,
"Name": "Cool Product",
"ShortDescription": "This is a short dessdfdsfdsf",
"FullDescription": "<p>Long text here</p>",
"Sku": "1456",
"Price": "34.95",
"OldPrice": "44.95",
"SpecialPrice": "20.56",
"Published": true,
"Id": 100
}
Response:
200 OK
{
"odata.metadata": "http://shop.domain.nl/odata/v1/$metadata#Products/@Element",
"ProductTypeId": 5,
"ParentGroupedProductId": 0,
"VisibleIndividually": false,
"Name": "Cool Product",
"ShortDescription": "This is a short dessdfdsfdsf",
"FullDescription": "<p>Long text here</p>",
"AdminComment": null,
"ProductTemplateId": 0,
"ShowOnHomePage": false,
"HomePageDisplayOrder": 0,
"MetaKeywords": null,
"MetaDescription": null,
"MetaTitle": null,
"AllowCustomerReviews": false,
"ApprovedRatingSum": 0,
"NotApprovedRatingSum": 0,
"ApprovedTotalReviews": 0,
"NotApprovedTotalReviews": 0,
"SubjectToAcl": false,
"LimitedToStores": false,
"Sku": "1456",
"ManufacturerPartNumber": null,
"Gtin": null,
"IsGiftCard": false,
"GiftCardTypeId": 0,
"RequireOtherProducts": false,
"RequiredProductIds": null,
"AutomaticallyAddRequiredProducts": false,
"IsDownload": false,
"UnlimitedDownloads": false,
"MaxNumberOfDownloads": 0,
"DownloadExpirationDays": null,
"DownloadActivationTypeId": 0,
"HasSampleDownload": false,
"SampleDownloadId": null,
"HasUserAgreement": false,
"UserAgreementText": null,
"IsRecurring": false,
"RecurringCycleLength": 0,
"RecurringCyclePeriodId": 0,
"RecurringTotalCycles": 0,
"IsShipEnabled": false,
"IsFreeShipping": false,
"AdditionalShippingCharge": "0",
"IsTaxExempt": false,
"IsEsd": false,
"TaxCategoryId": 0,
"ManageInventoryMethodId": 0,
"StockQuantity": 0,
"DisplayStockAvailability": false,
"DisplayStockQuantity": false,
"MinStockQuantity": 0,
"LowStockActivityId": 0,
"NotifyAdminForQuantityBelow": 0,
"BackorderModeId": 0,
"AllowBackInStockSubscriptions": false,
"OrderMinimumQuantity": 0,
"OrderMaximumQuantity": 0,
"QuantityStep": 0,
"QuantiyControlType": "Spinner",
"HideQuantityControl": false,
"AllowedQuantities": null,
"DisableBuyButton": false,
"DisableWishlistButton": false,
"AvailableForPreOrder": false,
"CallForPrice": false,
"Price": "34.95",
"OldPrice": "44.95",
"ProductCost": "0",
"SpecialPrice": "20.56",
"SpecialPriceStartDateTimeUtc": null,
"SpecialPriceEndDateTimeUtc": null,
"CustomerEntersPrice": false,
"MinimumCustomerEnteredPrice": "0",
"MaximumCustomerEnteredPrice": "0",
"HasTierPrices": false,
"LowestAttributeCombinationPrice": null,
"HasDiscountsApplied": false,
"Weight": "0",
"Length": "0",
"Width": "0",
"Height": "0",
"AvailableStartDateTimeUtc": null,
"AvailableEndDateTimeUtc": null,
"DisplayOrder": 0,
"Published": true,
"IsSystemProduct": false,
"SystemName": null,
"CreatedOnUtc": "2019-09-13T09:20:00.1805115Z",
"UpdatedOnUtc": "2019-09-13T09:20:00.1805115Z",
"DeliveryTimeId": null,
"QuantityUnitId": null,
"CustomsTariffNumber": null,
"CountryOfOriginId": null,
"BasePriceEnabled": false,
"BasePriceMeasureUnit": null,
"BasePriceAmount": null,
"BasePriceBaseAmount": null,
"BundleTitleText": null,
"BundlePerItemShipping": false,
"BundlePerItemPricing": false,
"BundlePerItemShoppingCart": false,
"MainPictureId": null,
"HasPreviewPicture": false,
"ProductType": "SimpleProduct",
"BackorderMode": "NoBackorders",
"DownloadActivationType": "0",
"GiftCardType": "Virtual",
"LowStockActivity": "Nothing",
"ManageInventoryMethod": "DontManageStock",
"RecurringCyclePeriod": "Days",
"Id": 17
}
As you can see i post a new product with ID 100 and get a response back saying it is added and has ID 17?
By the way, why don't you do a CSV import?
Well the reason why no CSV import is because the Middleware application would constantly sync our CRM/ERP system with the store. Meaning that after the initial sync with our CRM/ERP system to the webshop it then has to maintain products, categories, users and order information. The webshop has to be seen as a service we provide for our B2B customers and subdealers so they can check pricing and stuff but our CRM/ERP system we use is leading(Because webshop is just 3% of our revenue), so the webshop must slave to it.
In the live situation it would be like:
Event CRM/ERP system product added/changed/deleted --> Action: Update webshop by adding/updating/deleting product.
Or
Webshop event(by receiving email):User has placed webshop order placed --> Action: Get new order info and create new order in CRM/ERP system which tels a employee to handle this new order.
This also applies for customers, these must match the customer profiles in our CRM/ERP system.
**** EDIT ****
I now see that the import module is very powerfull and could also be scheduled, i will playarround with this features to see if it wroks for importing products and stuff. What i do mis is the import for brands? And how can you import/add images and PDF to a product? We now copy the image to the ImportProfile root with the filename as: %SKU%_1.jpg for one picture and _2 for the second etc...