Peculiarities, differences and work with customers and users

Users


Users are those who have access to the admin panel with different access rights. They may belong to groups of administrators, moderators, etc. to administer content, goods.

Customers

Customers are those who have registered on the site as a client to access their personal account. The personal account displays the order previously made by the client, wishlists, shopping cart, subscription to email newsletters, etc. The client can register delivery addresses for himself so as not to enter them when ordering, etc.

The site administrator can moderate clients by changing them groups, applying group or individual discounts and coupons for them, etc.

Guests

Site visitors may not register in order to place an order (if the store settings allow it). Such users belong to the "Guest" group. When registering, they need to enter information about delivery, payment, in contrast to registered users who have configured this for themselves in their personal account.

How customers and guests are displayed in our orders:

WooCommerce

Customer:


Guest:


This shows that for a customer there are filled out the ID, general information about the customer, as well as shipping address and payment information. The phone in the customer container is not filled because it does not apply to general information about the customer.

The email is also displayed by an additional field in the billing_address container.


Magento 1

Customer:



Guest:



Here too the information that the customer has filled out during the registration gets into the customer container. In the case of a guest, the information he left when placing an order is in the billing information tab.


Magento 2

Similar to the Magento 1.

For a customer when placing an order the address filled in his personal account can be used or some other entered information. All the information on delivery and payment is displayed in the response from the app in the shipping_address and billing_address containers. Also, for the customer, his ID is displayed.



Additional fields are also displayed.

Phone number filled in when ordering or saved in the address in your personal account is displayed in shipping_address and billing_address containers.

The response of an order created by the guest does not display the customer ID. All information that was filled in when creating an order is displayed in the appropriate containers.



Shopify

In Shopify, information about the customers is displayed in the customer container. The phone and email are also pulled from the contact information of the customer.


This phone number may be different from the one filled in by the customer when placing the order.



ID and telephone are not displayed for the guest.

All information left during registration is displayed in the appropriate containers.


WooCommerce

In WooCommerce, order information is also displayed in the corresponding payment and delivery containers.

The email that has left the customer and guest are displayed in the billing_addres container in an additional field. The email field is also filled in the customer container, which is pulled from the field filled out by the customer in the personal account.



This is the order that the guest left:



Here you can see that the guest's ID in WooCommerce is 0.

In the customer container, email is not filled due to the lack of a personal account.

Prestashop

In Prestashop, information about payment and delivery of the order is also displayed in the appropriate containers.

There are additional fields in containers. For the customer, the address that he filled in in his personal account is pulled up.


There is no email in the additional fields. Email is displayed in the customer container.

The order that the guest has created looks like:



In the Prestashop, guests enter the customer table in the admin panel and get identified by email. For such customers there is the "Guests" group. They can be controlled from the admin panel - transferred or added to another group, etc.

Therefore, the guest has an ID in the container of the customer.




Methods for working with customers


There are methods for working with customers on app. You can add, retrieve lists of customers, information about the customer itself, search, add a customer group:


  • customer.list.json

  • customer.count.json

  • customer.info.json

  • customer.find.json

  • customer.add.json

  • customer.group.list.json

  • customer.group.add.json

  • customer.attribute.list.json


The model for adding a customer looks like this:


{
  "email": "string",
  "first_name": "string",
  "last_name": "string",
  "password": "string",
  "group": "string",
  "created_time": "string",
  "modified_time": "string",
  "login": "string",
  "last_login": "string",
  "birth_day": "string",
  "status": "string",
  "news_letter_subscription": false,
  "gender": "string",
  "website": "string",
  "fax": "string",
  "company": "string",
  "phone": "string",
  "address": [
    {
      "address_book_type": "string",
      "address_book_first_name": "string",
      "address_book_last_name": "string",
      "address_book_company": "string",
      "address_book_fax": "string",
      "address_book_phone": "string",
      "address_book_website": "string",
      "address_book_address1": "string",
      "address_book_address2": "string",
      "address_book_city": "string",
      "address_book_country": "string",
      "address_book_state": "string",
      "address_book_postcode": "string",
      "address_book_gender": "string",
      "address_book_region": "string",
      "address_book_default": true
    }
  ]
}

where "email", "first_name", "last_name" are required fields.

The response for customer.info looks like this:


{
  "return_code":0,
  "return_message":"",
  "result":{
      "id":"6",
      "email":"[email protected]",
      "first_name":"Customer",
      "last_name":"Customer",
      "created_time":{
        "value":"2020-10-04T19:59:41+0300",
        "format":"Y-m-d\\TH:i:sO"
      },
      "modified_time":{
        "value":"2020-10-04T19:59:41+0300",
        "format":"Y-m-d\\TH:i:sO"
      },
      "group":[
        {
            "id":"3",
            "name":"Клієнт"
        }
      ],
      "login":null,
      "last_login":null,
      "birth_day":null,
      "status":"enabled",
      "news_letter_subscription":false,
      "gender":"male",
      "stores_ids":[
        "1"
      ],
      "website":"",
      "fax":null,
      "company":"",
      "phone":null,
      "ip_address":null,
      "address_book":[
        {
            "id":"10",
            "type":"billing",
            "first_name":"Customer",
            "last_name":"Customer",
            "postcode":"46000",
            "address1":"Stepana Bandery",
            "address2":"Склад адреси",
            "phone":"012345678",
            "city":"Ternopil",
            "country":{
              "code2":"UA",
              "code3":"UKR",
              "name":"Ukraine"
            },
            "state":null,
            "company":"TestFirma",
            "fax":null,
            "website":null,
            "gender":null,
            "region":null,
            "default":true,
            "additional_fields":{
              "alias":null,
              "other":null,
              "phone_mobile":"",
              "vat_number":null,
              "dni":null
            }
        }
      ],
      "orders_count":null,
      "last_order_id":null,
      "additional_fields":{
        "id_shop_group":1,
        "id_shop":1,
        "id_risk":0,
        "siret":"",
        "ape":"",
        "last_passwd_gen":{
            "value":"2020-10-04T13:59:41+0300",
            "format":"Y-m-d\\TH:i:sO"
        },
        "ip_registration_newsletter":"",
        "newsletter_date_add":null,
        "optin":false,
        "outstanding_allow_amount":0,
        "show_public_prices":false,
        "max_payment_days":0,
        "note":"",
        "is_guest":false
      }
  }
}


There are additional fields that may differ depending on the platform.

The search of customers is done by such fields:  'email', 'first_name', 'last_name'.

To add customer groups with the customer.group.add.json parameter, you need to specify the following fields:

name - required

store_id або store_ids - optional.

There is also customer.attribute.list.json method for Magento (and Demandware) that displays the attributes for a customer.