Shopper Customers

POST Register a new customer.

POST /organizations/{organizationId}/customers

Operation ID: registerCustomer. Security: ShopperToken (sfcc.shopper-customers.register, sfcc.shopper-standard); ShopperClientContextToken (sfcc.shopper-customers.register, sfcc.shopper-standard).

Mandatory data includes the credentials, profile last name, and email. This endpoint requires a guest JSON Web Token (JWT) from the Shopper Login and API Access Service. The return type object for this endpoint is a common customer object shared by multiple Shopper Customer endpoints. In this case, all customer object details are returned, but attributes that are not included in the response, although they might be part of the customer object, are ignored. For example, although address information is included in the customer object, it is not displayed in the response for this endpoint and is ignored.

Parameters

  • organizationId (path, OrganizationId, required) An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character realm identifier and a 3-character instance type identifier.

    Example

    f_ecom_zzxy_prd
  • siteId (query, SiteId, required) The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

    Example: SiteId

    RefArch
  • sfdc_usid (header, string (uuid)) A unique shopper identifier (USID) for tracking client context. Used with endpoints secured with ShopperClientContextToken. This header is required for all endpoints secured with ShopperClientContextToken.
    Example: 550e8400-e29b-41d4-a716-446655440000.
  • sfdc_shopper_context (header, string) Shopper context information (for example clientIP, sourceCode, and customQualifiers) passed in from a trusted backend application.

Request body (required)

Media type: application/json. Schema: CustomerRegistration.

Example: CustomerRegistrationBody

{
  "password": "12345!aBcD",
  "customer": {
    "login": "jsmith",
    "email": "jsmith@test.com",
    "firstName": "John",
    "lastName": "Smith"
  }
}

Responses

  • 200 Success

    Media type: application/json. Schema: Customer.

    Example: customerRegistrationResponse

    {
      "authType": "registered",
      "crmContactId": "003xx000004WhKe",
      "creationDate": "2020-02-13T17:44:15.892Z",
      "customerId": "abkd9LhOWzAiAFubdEDChtkMHW",
      "customerNo": "00006002",
      "email": "jsmith@test.com",
      "emailVerified": false,
      "enabled": true,
      "firstName": "John",
      "hasPassword": true,
      "lastModified": "2020-02-13T17:44:15.898Z",
      "lastName": "Smith",
      "login": "jsmith"
    }
  • 400 CustomerId URL parameter does not match the verified customer represented by the JWT token.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: registerCustomer400

    {
      "title": "Invalid Customer",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/invalid-customer",
      "detail": "The customer is invalid."
    }
  • 401 In the case of type credentials, the username is unknown or the password does not match. In the case of type session, the session is no longer active or the dwsecuretoken value is invalid. In both cases, the customer is disabled or locked.

    Media type: application/problem+json. Schema: ErrorResponse.

    Example: registerCustomer401

    {
      "title": "Authentication Failed",
      "type": "https://api.commercecloud.salesforce.com/documentation/error/v1/errors/authentication-failed",
      "detail": "Customer authentication based on JohnSmith failed.",
      "credentialType": "JohnSmith"
    }