Customer to edit personal account details

Customer to edit personal account details

pgupta
Shopify Partner
18 0 3

Hi,

 

Currently i am looking into the feature to allow the customer to edit his firstname,lastname and email when he logs into the account under account details section. But unfortunately shopify doesn't have this feature. 

 

I have created a small private app using laravel shopify and used the below code edit the customer details. Will there be any issue of rate limting or URL blockage while if it comes from multiple request to the admin API URL. Please help me with the correct and better approach to achieve the requirement without purchasing the app. 

 

$url='/admin/api/2022-01/customers/{customer_id}.json';

$method = 'PUT';
$variables =
array (
'id' => $request["customer_id"],
'first_name' => $request["first_name"],
'last_name' => $request["last_name"],
'email' => $request["email"]
);
$jsonArray = array('customer' => $variables);
$headers = array(
'X-Shopify-Access-Token:'.{accessTokengoes here},
'Content-Type: application/json'
);
$jsonArray=json_encode($jsonArray);

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL =>$url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_POSTFIELDS=> $jsonArray,
CURLOPT_HTTPHEADER => $headers,
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
Reply 1 (1)

pgupta
Shopify Partner
18 0 3

Any response please.