etsy-php-sdk icon indicating copy to clipboard operation
etsy-php-sdk copied to clipboard

how to use PUT method

Open chubinbin opened this issue 2 years ago • 2 comments

updateInventory api return error: Received HTTP status code [400] with error "Missing input parameter: [products]". My data: $data = array(); $data['products'] = array(); $data['products']['sku'] = 'NAPK-EN87454_SHINYSATIN'; $data['products']['property_values'] = array(); $data['products']['property_values']['property_id'] = 513; $data['products']['property_values']['value_ids'] = array(1108719665740); $data['products']['property_values']['values'] = array('Shiny Satin'); $data['products']['offerings'] = array(); $data['products']['offerings']['price'] = 1099; $data['products']['offerings']['quantity'] = 200; $data['products']['offerings']['is_enabled'] = true;

chubinbin avatar Apr 06 '23 07:04 chubinbin

Can you provide a full example of your code, including the call to make the PUT.

rhysnhall avatar Apr 09 '23 09:04 rhysnhall

Can you provide a full example of your code, including the call to make the PUT. $data = array(); $data['products'] = array(); $data['products']['sku'] = 'NAPK-EN87454_SHINYSATIN'; $data['products']['property_values'] = array(); $data['products']['property_values']['property_id'] = 513; $data['products']['property_values']['value_ids'] = array(1108719665740); $data['products']['property_values']['values'] = array('Shiny Satin'); $data['products']['offerings'] = array(); $data['products']['offerings']['price'] = 1099; $data['products']['offerings']['quantity'] = 200; $data['products']['offerings']['is_enabled'] = true;

$etsy = new \Etsy\Etsy($this->api_key, $this->accessToken); $listing = $etsy->getListing($listing_id,array("Shipping","Images","Translations","Inventory","Videos")); $inventory = $listing->updateInventory($data);

chubinbin avatar Apr 10 '23 01:04 chubinbin

Apologies on the delayed response. This repo is now being maintained again. A major updated for the package has been released that will impact this issue. If this is something you still need assistance with, please open a new issue.

rhysnhall avatar Jul 13 '24 06:07 rhysnhall