I am creating application about sending message to customer on various events like order place, order fulfill, fulfillment cancel ,refund, order track and order cancel.
I am using webbook for it and i am not getting phone number in fulfillments/create and fulfillments/update webbook.
Kindly make sure that i am getting all data but not only receiving phone number.
Please anyone have suggestion or answer then please help me as soon as possible.
This is the code sample…
<?php
include("include/connection.php");
include("variables.php");
$last_data="SELECT * FROM table_nameORDER BY id DESC LIMIT 1";
$result = $mysql->query($last_data);
$row = $result->fetch_assoc();
$api = "api key";
$access_token = "access token";
$webhook_url = "url";
$webhook_topic = "fulfillments/create";
$params = array(
"webhook" => array(
"topic" => $webhook_topic,
"address" => $webhook_url,
"format" => "json"
),
);
$url = "[https://shop_name.myshopify.com/admin/api/2023-01/webhooks.json](https://shop_name.myshopify.com/admin/api/2023-01/webhooks.json)";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
"X-Shopify-Access-Token: {$access_token}",
"Content-Type: application/json"
));
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
curl_close($curl);
?>