Update item variable quantity through API? J Kenneth 10 de septiembre de 2020 07:45 5 comentarios Is it possible to update the quantity of an existing item variable through the API? Comentarios 5 comentarios Ordenar por Fecha Votos Chris Muench 10 de septiembre de 2020 12:07 This is now possible in the latest 17.7 release. 0 J Kenneth 10 de septiembre de 2020 21:38 The quantity field for a variation item is in locations-x-variations-quantity? 0 Chris Muench 10 de septiembre de 2020 22:33 Yes 0 J Kenneth 11 de septiembre de 2020 01:35 Hi Chris, I am having trouble. It is showing an API call but none of my items quantities are being updated. $data = array('locations'=> array( 1 => array( 'variations' => array( 0 => array( 'quantity' => 8 ) ) ) ) ); 0 Chris Muench Editado 11 de septiembre de 2020 01:53 Here is a working code example. Make sure you know the item_id and variation_id <?php//////////////////////////////////////////////////////////$api_base_url = 'http://localhost/phppos/PHP-Point-Of-Sale/index.php/api/v1/';$api_key = '8ooosck0sc0w8g0gk48g044c4cokkgc8kwk8sk08';///////////////////////////////////////////////////////////$item_id = 1;$item_variation_id = 2;$post_data = array('locations' => array("1" => array('variations' => array( array('variation_id' => $item_variation_id,'quantity' => 1000)) )));$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $api_base_url.'items/'.$item_id);curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'x-api-key:'.$api_key,'accept: application/json', ));curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl,CURLOPT_POST, 1);curl_setopt($curl,CURLOPT_POSTFIELDS, json_encode($post_data));$result = json_decode(curl_exec($curl), TRUE);echo '<pre>';var_dump($result);echo '</pre>'; 0 Iniciar sesión para dejar un comentario.
Comentarios
5 comentarios
This is now possible in the latest 17.7 release.
The quantity field for a variation item is in locations-x-variations-quantity?
Yes
Hi Chris,
I am having trouble. It is showing an API call but none of my items quantities are being updated.
Here is a working code example. Make sure you know the item_id and variation_id
Iniciar sesión para dejar un comentario.