Glue API: Create customers

Edit on GitHub

Installation

For details on the modules that provide the API functionality and how to install them, see Glue API: Customer Access Feature Integration.

Create a customer

To create a customer, send the request:


POST /customers


Request

Request sample: create a customer

POST http://glue.mysprykershop.com/customers

{
  "data": {
    "type": "customers",
    "attributes": {
        "salutation": "Mrs",
        "firstName":"Sonia",
        "lastName":"Wagner",
        "email":"sonia@spryker.com",
	"gender": "Female",
        "password":"change123",
        "confirmPassword":"change123",
        "acceptedTerms":true
    }
  }
}
ATTRIBUTE TYPE REQUIRED DESCRIPTION
acceptedTerms Boolean Specifies whether the customer has accepted the terms of service. For a new customer to be created, this parameter needs to be set to true.
confirmPassword String Specifies a password confirmation for the account of the new customer.
email String Specifies customer’s last email address. The address must be unique in the system.
gender String Specifies gender of the customer.
firstName String Specifies customer’s first name.
lastName String Specifies customer’s last name.
password String Specifies a password (7 characters or more) for the account of the new customer. This password will be used by the customer to access their account.
salutation String Specifies a salutation for a new customer.

Response

Response sample: create a customer
{
	"data": {
		"type": "customers",
		"id": "DE--25",
		"attributes": {
			"firstName": "Sonia",
			"lastName": "Wagner",
			"gender": null,
			"dateOfBirth": null,
			"salutation": "Mr",
			"createdAt": "2018-11-06 08:15:02.694668",
			"updatedAt": "2018-11-06 08:15:02.694668"
		},
		"links": {
			"self": "http://glue.mysprykershop.com/customers/DE--25"
		}
	}
}

ATTRIBUTE TYPE DESCRIPTION
firstName String Customer’s first name.
lastName String Customer’s last name.
gender String Gender of the customer.
dateOfBirth String Customer’s date of birth.
salutation String Salutation to use when addressing the customer.
createdAt String Account creation date.
updatedAt String Date of the last update.

After creating a customer, users receive a verification email. The email contains a link with the token that confirms and finalizes the customer registration process. Customers click the verification link from the email and finish the registration. Alternatively, you can confirm the customer registration via API (see Confirming customer registration). After confirmation, you can authenticate as a customer to perform requests to the protected resources.