Jump to content

[Webservice] Add customers associations using API


airwiches

Recommended Posts

Hi, 

I use the webservice to add customers from my DB to prestashop DB, I've got to pass customers data and insert, but I don't know add groups to associations register.

 

I 've watched at customers/?schema=blank that associations are a subgroup.

How can I add various groups to customer?

 

Thanks.

Link to comment
Share on other sites

this is part of my code

$infos_user = array(
    'id' => '',
    'id_default_group' => $idgroup,
    'id_lang' => '1',
    'newsletter_date_add' => '',
    'ip_registration_newsletter' => '',
    'last_passwd_gen' => date('Y-m-d H:i:s'),
    'secure_key' => '',
    'deleted' => '0',
    'passwd' => $password,
    'lastname' => $surname,
    'firstname' => $name,
    'email' => $email,
    'id_gender' => '0',
    'birthday' => '',
    'newsletter' => '0',
    'optin' => '0',
    'website' => '',
    'company' => $company,
    'siret' => '',
    'ape' => '',
    'outstanding_allow_amount' => '0',
    'show_public_prices' => '0',
    'id_risk' => '0',
    'max_payment_days' => '0',
    'active' => '1',
    'is_guest' => '0',
    'id_shop' => $id,
    'id_shop_group' => '1',
    'note' => '',
    'date_add' =>  date('Y-m-d H:i:s'),
    'date_upd' =>  date('Y-m-d H:i:s'),
    'associations' => How can fill this?
);

Othe question, is that when I add one customer, I watch him at admin panel but I don't watch when I write the url http:/my-shop/customers/api

 

Any solution?

Link to comment
Share on other sites

  • 2 weeks later...

this is part of my code

$infos_user = array(
    'id' => '',
    'id_default_group' => $idgroup,
    'id_lang' => '1',
    'newsletter_date_add' => '',
    'ip_registration_newsletter' => '',
    'last_passwd_gen' => date('Y-m-d H:i:s'),
    'secure_key' => '',
    'deleted' => '0',
    'passwd' => $password,
    'lastname' => $surname,
    'firstname' => $name,
    'email' => $email,
    'id_gender' => '0',
    'birthday' => '',
    'newsletter' => '0',
    'optin' => '0',
    'website' => '',
    'company' => $company,
    'siret' => '',
    'ape' => '',
    'outstanding_allow_amount' => '0',
    'show_public_prices' => '0',
    'id_risk' => '0',
    'max_payment_days' => '0',
    'active' => '1',
    'is_guest' => '0',
    'id_shop' => $id,
    'id_shop_group' => '1',
    'note' => '',
    'date_add' =>  date('Y-m-d H:i:s'),
    'date_upd' =>  date('Y-m-d H:i:s'),
    'associations' => How can fill this?
);

Othe question, is that when I add one customer, I watch him at admin panel but I don't watch when I write the url http:/my-shop/customers/api

 

Any solution?

in order to extract data for customer 1 try:

 

http://yourshop.com/api/customers/1 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...