Profile: comichael

  • 21

Thx for your reply (and sorry about failed image formatting above).

We're using MongoExpress and I have confirmed that data is not updated in the database, even if HTTP gives 200/OK.  

Also checked this product in the front store UI (no category assigned).

We were able to update product name for product via API, so DB connection is to be OK.

There is always an explaination for issues like this.  Please check what "states" could give 200/OK without updating the DB.

We will try to set up the API as a local api test sandbox as mentioned, but I guess this will take some time.

Saturday, March 30, 2019 5:06 AM


We are still working on the API. I have struggled with this issue for some time now and realize I might just ask for help.

Problem is assigning category to product . This gives 200/OK but is not updated in MongoDB.

Do you see what the problem might be?

Testing for this product (ID 5c9c2e851c149e000188462f)


...and this category (ID 5c6697123945712d04312c17)


Fiddler POST request gives 200 OK


...but DB is not updated


Can you see the problem?
Will appreciate any help on this!

Also, some suggestions
1) Article / guide on how to set up sandbox for testing/debugging API requests
2) Possible to define relations to Categories/Pictures etc in "main" JSON for Insert/Update product (I understand it's not possible today)

Thursday, March 28, 2019 8:57 AM

Hi, thanks a lot for helping to debug this.

I've been reading up on this, and it seems that both the trailing "Z" and "+01:00" are valid time formats according to ISO 8601. (Z means UTC and +01:00 means UTC plus 1 hour).

What is *not* valid however, is the commas in the dates that I have tried to send.

I'm not sure where/when/why the dots in my test have been replaced by commas (as in "2019-03-16T06,03,28.991Z), but it seems that dates from GN API has the correct format.

Sorry for the inconvenience as this apparently is not a bug after all.

Saturday, March 23, 2019 12:48 AM


"PreOrderAvailabilityStartDateTimeUtc": null,
  "CallForPrice": false,
  "Price": 727,
  "OldPrice": 830,
  "CatalogPrice": 830,
  "ProductCost": 0,
  "CustomerEntersPrice": false,
  "MinimumCustomerEnteredPrice": 0,
  "MaximumCustomerEnteredPrice": 0,
  "BasepriceEnabled": false,
  "BasepriceAmount": 0,
  "BasepriceUnitId": "5c66970e3945712d0430e819",
  "BasepriceBaseAmount": 0,
  "BasepriceBaseUnitId": "5c66970e3945712d0430e819",
  "UnitId": null,
  "MarkAsNew": false,
  "MarkAsNewStartDateTimeUtc": null,
  "MarkAsNewEndDateTimeUtc": null,
  "Weight": 2,
  "Length": 2,
  "Width": 2,
  "Height": 2,
  "AvailableStartDateTimeUtc": null,
  "AvailableEndDateTimeUtc": null,
  "StartPrice": 0,
  "AuctionEnded": false,
  "DisplayOrder": 0,
  "DisplayOrderCategory": 0,
  "DisplayOrderManufacturer": 0,
  "Published": true,
  "CreatedOnUtc": "2019-02-15T10,40,22.78Z",
  "UpdatedOnUtc": "2019-03-16T06,03,28.991Z",
  "Sold": 4,
  "Viewed": 10,
  "OnSale": 0,
  "Flag": null,
  "Id": "5c6697163945712d04312e7a",
  "Categories": [],
  "Manufacturers": [],
  "Pictures": [],
  "SpecificationAttribute": [],
  "TierPrices": [],
  "WarehouseInventory": [],
  "AttributeMappings": [],
  "AttributeCombinations": []


HTTP/1.1 400 Bad Request
Date: Thu, 21 Mar 2019 15:47:13 GMT
Content-Type: application/json; odata.metadata=minimal; odata.streaming=true; charset=utf-8
Server: Kestrel
Transfer-Encoding: chunked
X-Powered-By: GrandNode
OData-Version: 4.0
X-Content-Type-Options: nosniff

{"error":{"code":"","message":"The input was not valid.","details":[{"code":"","message":"The input was not valid."}]}}

Thursday, March 21, 2019 5:04 PM

Thx for feedback.

OK, so we’re trying the simple solution first: Update using POST to our store API http://[OUR_DOMAIN]/odata/product , with similar JSON as received from GET.

However, the POST gives a 400 Bad Request result. We have not implemented SSL yet so just using http.

I have looked at the API source code and understand that the product’s Id should be specified in the JSON, and not be part of the url, and that it needs to be POST and not PUT.

Authorization is OK using Bearer, and have checked that JSON syntax is valid. I have tried to “wrap” the JSON in different ways with curly braces and labels, but have not been able to get this to work.

I’m pasting the raw request and response from Fiddler below. Any suggestions that can help us solve this are appreciated.

Note: I have not included the contents of the Categories / Manufacturers arrays (etc) in the bottom in the request.


POST http://[----SNIP---].no/odata/product HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6I[----SNIP----]gFN-i7WaIrY6sxLieM
Content-Type: application/json; charset=utf-8
Content-Length: 3977
Host: [----SNIP---].no

  "ProductType": "SimpleProduct",
  "ParentGroupedProductId": null,
  "VisibleIndividually": true,
  "SeName": "fahrenheit-451-by-ray-bradbury",
  "ShortDescription": "TESTVINNER!",
  "FullDescription": "<h4>CONTINENTAL CONTIPREMIUMCONTACT5 </h4>\r\n<ul>\r\n<li>2. plass i ADAC sommerdekktest 2018</li>\r\n<li>Testvinner GTÜ sommerdekktest 2017</li>\r\n<li>Andreplass Aftonbladets sommerdekktest 2017</li>\r\n<li>Testvinner ADAC sommerdekktest 2016</li>\r\n<li>Tredjeplass på sommerdekktestet til NAF 2016</li>\r\n</ul>",
  "AdminComment": null,
  "ProductTemplateId": "5c6697123945712d04312bdf",
  "VendorId": null,
  "ShowOnHomePage": false,
  "MetaKeywords": null,
  "MetaDescription": null,
  "MetaTitle": null,
  "AllowCustomerReviews": true,
  "ApprovedRatingSum": 4,
  "NotApprovedRatingSum": 0,
  "ApprovedTotalReviews": 1,
  "NotApprovedTotalReviews": 0,
  "ExternalId": null,
  "Sku": "TTPAH45-0S11S",
  "ManufacturerPartNumber": null,
  "Gtin": null,
  "IsGiftCard": false,
  "GiftCardType": "Virtual",
  "OverriddenGiftCardAmount": null,
  "RequireOtherProducts": false,
  "RequiredProductIds": null,
  "AutomaticallyAddRequiredProducts": false,
  "IsDownload": false,
  "DownloadId": null,
  "UnlimitedDownloads": false,
  "DownloadActivationType": "WhenOrderIsPaid",
  "MaxNumberOfDownloads": 0,
  "DownloadExpirationDays": null,
  "HasSampleDownload": false,
  "SampleDownloadId": null,
  "HasUserAgreement": false,
  "UserAgreementText": null,
  "IsRecurring": false,
  "RecurringCycleLength": 0,
  "RecurringTotalCycles": 0,
  "RecurringCyclePeriod": "Days",
  "IncBothDate": false,
  "Interval": 0,
  "IntervalUnitType": "Minute",
  "IsShipEnabled": true,
  "IsFreeShipping": true,
  "ShipSeparately": false,
  "AdditionalShippingCharge": 0,
  "DeliveryDateId": null,
  "IsTaxExempt": false,
  "TaxCategoryId": "5c66970e3945712d0430e81e",
  "IsTelecommunicationsOrBroadcastingOrElectronicServices": false,
  "UseMultipleWarehouses": false,
  "WarehouseId": null,
  "StockQuantity": 9996,
  "ManageInventoryMethod": "ManageStock",
  "DisplayStockAvailability": true,
  "DisplayStockQuantity": false,
  "MinStockQuantity": 0,
  "LowStock": false,
  "LowStockActivity": "DisableBuyButton",
  "NotifyAdminForQuantityBelow": 1,
  "BackorderMode": "NoBackorders",
  "AllowBackInStockSubscriptions": false,
  "OrderMinimumQuantity": 1,
  "OrderMaximumQuantity": 10000,
  "AllowedQuantities": null,
  "AllowAddingOnlyExistingAttributeCombinations": false,
  "NotReturnable": false,
  "DisableBuyButton": false,
  "DisableWishlistButton": false,
  "AvailableForPreOrder": false,

Thursday, March 21, 2019 5:02 PM

What is the minimal JSON neccessary for updating a product via the API?

The documentation states:

you must enter all fields that exist and enter the ID of product which you want update

Is the solution to load the existing product object from the API and use that for modifications?

Tuesday, March 19, 2019 6:57 PM

If so, what are these differences, and which modifications would be needed in code?

Example: Payment plugin is used in nopCommerce, must be able to use in GrandNode implementation.

Tuesday, March 5, 2019 1:04 AM

Thanks a lot! Been stuck with this for days, changing this setting was the solution.

Thursday, February 21, 2019 11:07 AM

Thx for your replies. This works fine out of the box - your first answer made me realize that this is just a "dev problem". I just need to log in as different users when running from Visual Studio, so that the front-end user language won't affect the current backend language.

(Sidenote: A lot of translations in the Norwegian lang file are obviously machine-translated. We have imporoved some 100s of incorrect translations, and will probably continue to do so. When our translations are done, we'll be happy to share this as a continous open source file.)

Thursday, February 21, 2019 11:00 AM


In category page or search result page, filter for specification attributes does not appear.

Done so far:

-Multiple spec attributes are defined
-Spec attributes added to multiple products (in Spec Attributes tab on Prroduct Edit page)
-Products are linked to same category (in Mappings tab on Product Edit page)
-"Allow Filtering" is checked for all attributes
-Tested both checked and unchecked "Show on product page"
-In mappings, "Is featured product" is not checked.

In CatalogPagingFilteringModel.PrepareSpecsFilters(..) , allFilters is null (e.g, not found in cache). We have not had time to do any further debugging.

Any suggestions?

Tuesday, February 19, 2019 11:06 PM