POST

register_customer

Query parameters

action
string

Requested method

required
default : register_customer
shop_number
string

Your shop number.

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
user_data
object
gender
string or null

Customer’s gender. Allowed values: null - no selection | “m” - male | “f” - female | “d” - diverse

1 validation
registration_date
string

User registration date DATETIME UTC, ISO 8601. Example: “2013-02-08T09:20:25+01:00”

1 validation + required
first_name
string

First name.

required
last_name
string

Last name.

required
birthday
string

Birthday

1 validation
phone
string

Customer phone number

mobile
string

Customer mobile phone number

mail
string
required
custom_fields
array[object]
addresses
array[object]

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
83 database error
100 no connection to server
101 Unknown action
102 error code received from merchant API
120 authentication failed
220 failed to create user
221 user already exists
222 data fields are missing
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"
        }
      ]
    }
  ]
}