POST

get_customer

This action implements retrieval of user data from your shop, e.g. for the “Shopgate Connect” procedure. If a customer already has an account in your online shop, you can allow them to use their credentials to log in, register and place orders on the mobile website.

Query parameters

action
string

Requested method

required
default : get_customer
shop_number
string

Your shop number. Example: “11413”

required
trace_id
string

Unique request trace ID. Example: “sma-9412”

required
user
string

User (on most systems the email address).

required
pass
string

Password

required

Response

application/json
array[object]
error
integer

False means there was no error

required
error_text
string or null

null means no error.

required
shopgate_library_version
string

Shopgate Library version. Example: “2.5.0”

required
plugin_version
string

Plugin version. Example: “2.5.3”

required
trace_id
string

Request trace-ID, needed as reference for contact Example: “sma-4f99573d74ae1”

required
user_data
object

Error Codes

Code Description
2 cannot open/create logfile(s)
10 invalid value in configuration
11 error reading or writing configuration
20 no action specified
21 unknown action requested
22 disabled action requested
23 wrong response format
35 parameter “user” missing
36 parameter “pass” missing
37 parameter “user_data” missing
70 no addresses found for customer
71 wrong username or password
72 customer account not confirmed
73 unknown error while customer login
83 database error
100 no connection to server
101 Unknown action
102 error code received from merchant API
120 authentication failed
999 Unknown error

Example

{
  "error": 0,
  "error_text": null,
  "shopgate_library_version": "2.1.0",
  "plugin_version": "2.1.0",
  "trace_id": "sma-9412",
  "user_data": {
    "customer_id": "99",
    "customer_number": null,
    "customer_groups": [
      {
        "id": "1",
        "name": "General"
      },
      {
        "id": "13",
        "name": "BestFriendOfCeo"
      }
    ],
    "first_name": "Max",
    "last_name": "Mustermann",
    "gender": "m",
    "birthday": "1982-07-01",
    "phone": "+49 (221) 123456780",
    "mobile": null,
    "mail": "maeximilian+chen@shopgate.com",
    "newsletter_subscription": 0,
    "custom_fields": [
      {
        "label": "Birthday",
        "internal_field_name": "dob",
        "value": "1982-05-26"
      }
    ],
    "customer_group": null,
    "customer_group_id": null
  },
  "addresses": [
    {
      "id": "288",
      "is_invoice_address": 1,
      "is_delivery_address": 1,
      "first_name": "Max",
      "last_name": "Mustermann",
      "gender": "m",
      "birthday": "1982-07-01",
      "company": "Musterfirma GmbH",
      "street_1": "Schloßstraße 10",
      "street_2": "Altstadt-Süd",
      "zipcode": "50667",
      "city": "Köln",
      "country": "DE",
      "state": null,
      "phone": "+49 (221) 123456780",
      "mobile": null,
      "mail": null,
      "custom_fields": [
        {
          "label": "Floor",
          "internal_field_name": "floor",
          "value": "2nd"
        }
      ]
    },
    {
      "id": "289",
      "is_invoice_address": 0,
      "is_delivery_address": 0,
      "first_name": "Hannah",
      "last_name": "Jones",
      "gender": "f",
      "birthday": null,
      "company": "",
      "street_1": "221B Baker Street",
      "street_2": "",
      "zipcode": "NW1 6XE",
      "city": "London",
      "country": "GB",
      "state": null,
      "phone": "",
      "mobile": null,
      "mail": null,
      "custom_fields": [
        {
          "label": "Floor",
          "internal_field_name": "floor",
          "value": "ground floor"
        }
      ]
    },
    {
      "id": "290",
      "is_invoice_address": 1,
      "is_delivery_address": 0,
      "first_name": "Thomas",
      "last_name": "Jefferson",
      "gender": "m",
      "birthday": "1743-04-13",
      "company": "W.D.C. Inc.",
      "street_1": "10 Hopton Gardens, Hopton Street",
      "street_2": "Southwark",
      "zipcode": "SE1 9JJ",
      "city": "London",
      "country": "GB",
      "state": null,
      "phone": "+44 20 1234 56789",
      "mobile": null,
      "mail": null,
      "custom_fields": [
        {
          "label": "Floor",
          "internal_field_name": "floor",
          "value": "basement"
        }
      ]
    }
  ]
}