Ich erhielt eine Antwort von BigCommerce und es war keine Hilfe.
Ich habe das mit Hilfe von "how to use basic authorization in php curl", "" und "JSON" herausgefunden.
Ich habe diesen Code in einer. PHP-Datei auf einem GoDaddy gehosteten Server mit PHP 5.6.22 und Curl 7.36.0 ausgeführt.
<?php
$username = "Username";
$password = "API Token";
$URL = "https://store.com/api/v2/orders/count.json";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //Timeout after 30 seconds
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); //Get status code
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response);
echo "Count = " . $result->count; //Total orders
echo "<br />" . $result->statuses[8]->name . " = " . $result->statuses[8]->count; //Shipped orders
?>