I am attempting to first update a brand, then create a product using the Bigcommerce API. I am doing so with the following code:
Bigcommerce::updateBrand(48, ['name'=>'Del Sol']);
echo "Brand Updated";
Bigcommerce::createProduct(['name'=>'New Test'.rand(), 'weight'=>3, 'price'=>3, 'availability'=>'available', 'categories'=>[1582], 'type'=>'physical']);
echo "Product Created";
This results in an Bigcommerce\Api\NetworkError
being returned, with the message Empty reply from server
.
If I run either of the commands above by themselves, the request succeeds. If I switch the order of the commands, so that the product is created and then the brand is updated, both requests succeed. However, when I run them as shown, the updateBrand
command works correctly, but the createProduct
command hangs for a while and then throws the Bigcommerce\Api\NetworkError
.
Why would this be happening?