fillup / walmart-partner-api-sdk-php

PHP client for Walmart Partner APIs
MIT License
37 stars 51 forks source link

Bad Request with Order::list function #45

Open shamelessApathy opened 7 years ago

shamelessApathy commented 7 years ago

Here is my code I'm using to get an order list, I've tried this on mock and on prod env. public function order_list() { $client = new Order([ 'consumerId' => getenv('WALMART_API_KEY'), 'privateKey' => getenv('WALMART_SECRET_KEY'), 'wmConsumerChannelType' => getenv('WM_CONSUMER_CHANNEL_TYPE') ], Order::ENV_MOCK);

    $orders = $client->list();
    var_dump($orders);
} 

It gives me this error in the browser

CommandClientException in AbstractClient.php line 171: Error executing command: Client error response [url] /v3/orders [status code] 400 [reason phrase] Bad Request

Is there something I'm doing wrong with formulating the request with the API? It returns a bad request both from walmart and from the mock.

Here's the error walmart api returns for same function

CommandClientException in AbstractClient.php line 171: Error executing command: Client error response [url] https://marketplace.walmartapis.com/v3/orders [status code] 400 [reason phrase] Bad Request

fillup commented 7 years ago

The mock environment only supports specific requests and is primarily used for unit testing, so it could be that what you are trying wont work with the mocks already in place.

Check out the library docs at https://github.com/fillup/walmart-partner-api-sdk-php/blob/develop/docs/order.md and make sure you're providing the appropriate parameters to the list function.