You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a order and make a post request. However, I get this error when doing so:
"{"Message":"The request is invalid.","ModelState":{"apiOrder":["Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'SS.OpenApi.Models.Orders.Order' because the type requires a JSON object (e.g. {\"name\":\"value\"}) to deserialize correctly.\r\nTo fix this error either change the JSON to a JSON object (e.g. {\"name\":\"value\"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\r\nPath '', line 1, position 1."]}}"
I tried your example order and still got the same error.
After reverse engineering the Guzzle post response, it appears that the shipstation api does not support json arrays anymore(?)
var_dump($this->shipStation->orders->post([$finalOrder], 'createorder')); // does not work
var_dump($this->shipStation->orders->post($finalOrder, 'createorder')); // works fine
I have no idea if things changed or not regarding the shipstation api. It's my first time using it.
Yeah, you're correct. If you look at the test it doesn't pass an array & just the object for the single order. I'll fix the docs. I'm going to close this, let me know if you need anything else!
Hi there,
I'm trying to create a order and make a post request. However, I get this error when doing so:
I tried your example order and still got the same error.
Here's my relevant code.
Here is the order object.
Any ideas?
The text was updated successfully, but these errors were encountered: