Question

I have created customer custom attributes.But those custom attributes not saved in the admin using the API.

I have created one file in the root.When I run this file only email , firstname , lastname saved but my custom attribute not saving. Please help me as soon as possible.

<?php
    ini_set('display_errors', 1);

    $client = new SoapClient('http://hauserph.nextmp.net/api/v2_soap/?wsdl');

    $session = $client->login('hausertest', 'nvKTbozp8B');

    $result = $client->customerCustomerCreate($session,
    array(
    'email' => 'customer-mail@example.org',
    'firstname' => 'Dough',
     'lastname' => 'Deeks', 
     'fcc_consent' => 'dfgfdgsdfg',
     'password' => 'password',
      'website_id' => 1,
       'store_id' => 1, 
       'group_id' => 1,
       'rp_token' => 'gfhfhfghf',
       'rp_token_created_at' => 'fgdgd',
       'state_license_num' => 'dfgffd',
       'dea_license' => 'dfgfsdgdf',
       'dea_expiredate' => 'fgsdfgdf',
       'state_expiredate' => 'gsdfgsdf'
       )

    );

    echo '<pre>';
    print_r($result);

    ?>
Was it helpful?

Solution

Please Try This

 $client = new SoapClient('http://www.url.co/api/soap/?wsdl');

    // If somestuff requires api authentification,
    // then get a session token
    $session = $client->login('user', 'password');
    $result = $client->call($session,'customer.create',array(array('email' => 'mailakki@example.org', 'firstname' => 'Dough', 'lastname' => 'Deeks', 'fcc_consent' => 'testfcc','password' => 'password', 'website_id' => 1, 'store_id' => 1, 'group_id' => 1,'rp_token' => 'ro_test_token','rp_token_created_at' => '10-12-2017','state_license_num' => '786512','dea_license' => 'ide_1234','dea_expiredate' => '16-12-2017','state_expiredate' => '19-12-2017')));

    var_dump ($result);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top