shippo-php-client
shippo-php-client copied to clipboard
Empty extra array results in API failure
Setting extra
to []
results in a JSON encoded array instead of an object. The Shippo API rejects this format with the following message:
{"shipment": [{"extra": ["Invalid format of the 'extra' object. The accepted format is 'extra': {}"]}]}
Perhaps JSON_FORCE_OBJECT
or dropping empty extra
parameter could be used to resolve this from the PHP library side.
Something changed recently at the API end because until last week the array format was working, but now all of my calls with an empty array fail. I will manually ensure that no empty array is passed to the PHP client, but thought you should be aware.
This is on version 1.4.3
Hi.
We recently did some changes to the API because we noticed that some calls included an empty array for extras and that would result in a 500 response. So we added the proper status code and error to the response.
We'll look into how the error response is parsed on the library side so it can be surfaced properly.
Thanks.
any news?