1

Since, I have worked with magento get method api calls but yet didn't work on post or put method. I am trying to update customers to update their profile in mobile app.

public function update($id){

    $customer = $this->customerRepository->getById($id);


    $customer->setWebsiteId(1);


    $customer->setEmail('alt@gmail.com');

    $customer->setFirstname('ramesh');

    $customer->setLastname('kr');


    $customer->setGroupId('1');




    //printing result
            echo "<pre>";
   print_r($customer);
   $this->customerRepository->save($customer);

    }

I need to change customers details themeseleves. I don't want to add addmin token I want to add customer token

  • is it a custom API or default magento API – Vishwas Bhatnagar Jan 28 '19 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.