Product Error



Hello, I’m new to Moltin.
I’m trying to make an app that list products depending on Categories, Like sections for each category. I created the products in the website, and the categories.
But when I try to Get the products, it shows this error that I cant understand.

Products error couldNotParseData(underlyingError: Optional(Swift.DecodingError.keyNotFound(CodingKeys(stringValue: “width”, intValue: nil), Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: “meta”, intValue: nil), CodingKeys(stringValue: “dimensions”, intValue: nil)], debugDescription: “No value associated with key CodingKeys(stringValue: “width”, intValue: nil) (“width”).”, underlyingError: nil))))


Hi @futaim!

Have you by any chance created a custom product model with a flow field? This looks like Swift’s Codable method is trying to parse a field called width under the dimensions model, but it can’t find it and it believes that it should not be optional.



Hi , Thank you for replying to me ^^

I actually, created product on my Moltin dashboard, and filled the fields for product. And I created categories also.
So I cant understand what do you mean by custom product model ^^
I understand from the code error, that it cant find width… but I didn’t know how to fix this ^^

I use the project sample, which is provided by Moltin… and it works… But, when I put my client ID and change it to match my store… It doesn’t work… it doesn’t show the products I have or anything ^^


Hey @futaim ,

Wanted to see if you were still having a problem. Can you pass through some of the code you are using or I am happy to hope on a quick screen share to help you get rolling.



Heyy @GeorgeF,
Thank you… Yess I couldnt solve this problem :frowning:
The thing is… I downloaded Swift project ( from Moltin website)…I run it and it works fine.
Then I changed the ID to my client ID… and some things to suit my store.
Then it didnt work at all… it doesn’t show category Name, and show Product Error.
I didn’t play with the code… thats why I don’t know where is the problem ^^


It is most likely that your products do not have the same fields or that same catalog hierarchy.


Hi @futaim

Just checking on, did you manage to resolve this issue with @GeorgeF ?




Hi @drew
yes everything’s fine ^^
Thank you