products/bulkInsert
Bulk insert a list of products into codebookie. Any products thats have an existing SKU in codebookie will have the details overwritten.
Parameter | Type | Description | Required |
---|---|---|---|
api_token | string | API Token | YES |
products | array | Array of products array must contain the following: sku product_name website_id | YES |
Example PHP Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
require "codeBookie.php"; $codeBookie = new CodeBookie(); $products[0] = [ 'sku'=>1, 'product_name'=>'Product 1', 'website_id'=>100 ]; $products[1] = [ 'sku'=>2, 'product_name'=>'Product 2', 'website_id'=>100 ]; $products[2] = [ 'sku'=>3, 'product_name'=>'Product 3', 'website_id'=>100 ]; $result = $codeBookie->insertBulkProducts($products); |
Output:
Variable | Type | Description |
---|---|---|
status | string | OK or ERROR |
message | string | description of error if status is ERROR |
invalid_entries | array | returns array of entries that are invalid |
updated_entries | array | returns array of entries that were updated via an existing SKU number |
new_entries | array | returns array of entries that have been added into codebookie |