Made api to transfer data between 1C and WooCommerce. After sampling from the database, I make a request, but the meta data in the database and the created goods are not added (goods are created).
require __DIR__ . '/vendor/autoload.php'; require 'app/bootstrap.php'; use Automattic\WooCommerce\Client; $config = new Config_class(); $result = $config->connect_to_db(); $woocommerce = new Client( 'url', 'ck_', 'cs_', [ 'wp_api' => true, 'version' => 'wc/v1', ] ); if ( $result->num_rows > 0 ) { while($row = $result->fetch_assoc()) { $data = [ 'name' => $row['search_text'], 'type' => 'simple', 'regular_price' => $row['price'], 'description' => $row['product_content'], 'short_description' => $row['pro_title'], 'sku' => $row['barcode'], 'images' => [ [ 'src' => 'url' .$row['photo_id']. '/1_1.jpg', 'position' => 0, 'alt' => $row['pro_title'], ], [ 'src' => 'url' .$row['photo_id']. '/1_2.jpg', 'position' => 1, 'alt' => $row['pro_title'], ] ], 'meta_data' => [ [ 'key' => '_product_id_1c', 'value' => $row['id_1c'] ], ] ]; $post_data = $woocommerce->post('products' , $data); } } Tell me, what am I doing wrong?