Customer

magento.customer

Customer API for magento

copyright:
  1. 2010 by Sharoon Thomas.
copyright:
  1. 2010 by Openlabs Technologies & Consulting (P) LTD.
license:

AGPLv3, see LICENSE for more details

class customer.Customer(url, username, password, version='1.3.2.4', full_url=False, protocol='xmlrpc')

Customer API

Example usage:

from magento import Customer as CustomerAPI

with CustomerAPI(url, username, password) as customer_api:
    return customer_api.list()
list(filters=None)

Retreive list of customers

Parameters:
  • filters

    Dictionary of filters.

    Format: {<attribute>:{<operator>:<value>}}

    Example: {‘firstname’:{‘ilike’:’sharoon’}}

Returns:

List of dictionaries of matching records

create(data)

Create a customer using the given data

Parameters:
  • data – Dictionary of values
Returns:

Integer ID of new record

info(id, attributes=None)

Retrieve customer data

Parameters:
  • id – ID of customer
  • attributesList of attributes needed
update(id, data)

Update a customer using the given data

Parameters:
  • id – ID of the customer record to modify
  • data – Dictionary of values
Returns:

Boolean

delete(id)

Delete a customer

Parameters:
  • id – ID of customer to delete
Returns:

Boolean

class customer.CustomerGroup(url, username, password, version='1.3.2.4', full_url=False, protocol='xmlrpc')

Customer Group API to connect to magento

list()

Retreive list of customers

Returns:List of dictionaries of matching records
class customer.CustomerAddress(url, username, password, version='1.3.2.4', full_url=False, protocol='xmlrpc')

Customer Address API

list(customer_id)

Retreive list of customer Addresses

Parameters:
  • customer_id – ID of customer whose address needs to be fetched
Returns:

List of dictionaries of matching records

create(customer_id, data)

Create a customer using the given data

Parameters:
  • customer_id – ID of customer, whose address is being added
  • data – Dictionary of values (country, zip, city, etc...)
Returns:

Integer ID of new record

info(id)

Retrieve customer data

Parameters:
  • id – ID of customer
update(id, data)

Update a customer address using the given data

Parameters:
  • id – ID of the customer address record to modify
  • data – Dictionary of values
Returns:

Boolean

delete(id)

Delete a customer address

Parameters:
  • id – ID of address to delete
Returns:

Boolean

Previous topic

Catalog

Next topic

Directory