I am attempting to generate orders on my BigCommerce store using the BigCommerce API. I am using the code below to accomplish this. I am able to ping BigCommerce just fine and I get no errors in the php code. The problem is that it doesn't ever generate the order on my Bigcommerce store.
require('vendor/autoload.php');
use Bigcommerce\Api\Client as Bigcommerce;
Bigcommerce::configure(array(
'store_url' => 'https://my-store.bigcommerce.com/',
'username' => 'admin',
'api_key' => 'XXXXXX'
));
$ping = Bigcommerce::getTime();
if ($ping){ echo $ping->format('H:i:s');}
$createFields = array(
"customer_id" => 0,
"date_created" => $today,
"status_id" => 1,
"billing_address" => array(
"first_name" => "Trisha",
"last_name" => "McLaughlin",
"company" => "",
"street_1" => "12345 W Anderson Ln",
"street_2" => "",
"city" => "Austin",
"state" => "Texas",
"zip" => "78757",
"country" => "United States",
"country_iso2" => "US",
"phone" => "",
"email" => "elsie@example.com"),
"shipping_addresses" => array(
"first_name" => "Trisha",
"last_name" => "McLaughlin",
"company" => "",
"street_1" => "12345 W Anderson Ln",
"street_2" => "",
"city" => "Austin",
"state" => "Texas",
"zip" => "78757",
"country" => "United States",
"country_iso2" => "US",
"phone" => "",
"email" => "elsie@example.com"),
"external_source" => "POS",
"products" => array(
"product_id" => "90",
"quantity" => "1"));
print_r(Bigcommerce::createOrder($createFields));
What am I missing?
Am I using the BigCommerce API incorrectly?
Any help on figuring out why my code isn't generating orders on my Bigcommerce store would be awesome!