Skip to content
Advertisement

Bigcommerce cart 422: Missing required fields error

I’m using Laravel to consume the Bigcommerce V3 API.

I have ben able to succesfully create a new cart. But when trying to add an item to it, I keep getting a 422: Missing required fields error.

I’m making my request trough Guzzle like this:

JavaScript

The product I’m trying to add has no options or modifiers, so I don’t understand what could wrong with my request. According to the docs, this should be all that’s needed.

Does anyone have any idea what could be wrong? I tried contacting support, but to no avail. Thanks in advance!

Advertisement

Answer

line_items is an array of objects. Try wrapping your product data in an object.

Like this:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement