API response header issue Every time get x-shopify-shop-api-call-limit : 1/40 in same API call

Highlighted
New Member
3 0 1

HI,

Getting everty time header response same 1/40 of x-shopify-shop-api-call-limit and when got the 429 response but still getting the same value 1/40 form response header.

<br>HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
<br>X-Shopify-Shop-Api-Call-Limit: 1/40


My Code:

$url = "https://$apikey:$apipass@$apistore/admin/api/2020-01/orders/$order_id/fulfillments.json";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION,
function($ch, $header) use (&$headers){
 $len = strlen($header);
 $header = explode(':', $header, 2);
 if (count($header) < 2) // ignore invalid headers
  return $len;
 $headers[strtolower(trim($header[0]))][] = trim($header[1]);
  return $len;
 }
);
$response = curl_exec($ch);
$errer = curl_error($ch);
print_r($headers['x-shopify-shop-api-call-limit']);



0 Likes