younifyd
Menu

Authorize Passwordless Customer

Authorize Passwordless Customer

POST/organizations/{organizationId}/oauth2/passwordless/login

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Authorize Passwordless Customer action (under Auth (SLAS)).
  3. Fill in the fields below, then reference the result from later steps as {{authorizePasswordlessCustomer.response.data}}.

Request

Path parameters

organizationIdstringrequired

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](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/get-started.html#instance-types).

Query parameters

register_customerstring

When set to `true`, creates a new customer profile in B2C Commerce if one doesn't already exist. Requires `last_name` and `email` body parameters unless `user_id` is an email address. Optionally accepts `first_name` and `phone_number` body parameters. If the customer profile doesn't exist, it is created when the TOTP is validated via the `passwordless/token` endpoint. When set to `false` (or omitted), no customer profile is created in B2C Commerce.

strict_verifyboolean

When set to `true`, blocks the passwordless login request and returns a `400` error if the shopper's email is not verified. Use this to enforce shopper email verification before allowing passwordless authentication. Available in B2C Commerce version 26.6 and later. Default: `false`

Default false

Headers

Authorizationstring

Base64-encoded string for HTTP Basic authentication. The string is composed of a client ID and client secret, separated by a colon (`:`), for example: `clientId:clientSecret`

Request body

Enter the body as JSON in the step's Body field.

user_idstringrequired

User ID for logging in.

modestringrequired

Password Action delivery modes

One ofcallbacksmsemail

localestring

The locale of the template. Required when the mode is `email` or `sms`.

usidstring

The shopper's unique identifier, if known. If not provided, a new USID is generated.

channel_idstringrequired

The channel (B2C Commerce site) that the user is associated with.

callback_uristring

The callback URI. Required when the mode is `callback`. The `callback_uri` property will be validated against the callback URIs that have been registered with the SLAS client. The callback URI _must_ be a `POST` endpoint because the token will be included in the body. Wildcards are not allowed in the callback_uri because this is a security risk that can expose the token. This is not considered an OAuth2 callback_url.

last_namestring

The user's last name. Required when `register_customer` is `true`. The `last_name` parameter is not used when `register_customer` parameter is not added or is `false`.

emailstring

The user's email address. Required when `register_customer` is `true` and `user_id` is not an email address. The `email` parameter is not used when `register_customer` parameter is not added or is `false`.

first_namestring

The user's first name. Optional when `register_customer` is `true`. The `first_name` parameter is not used when `register_customer` parameter is not added or is `false`.

phone_numberstring

The user's phone number. Optional when `register_customer` is `true`. The `phone_number` parameter is not used when `register_customer` parameter is not added or is `false`.

customer_nostring

The customer number assigned to the shopper profile when `register_customer` is set to `true`. If the `customer_no` already exists, the request fails. The `customer_no` parameter is optional and only used when `register_customer` is set to `true`.

json
{
  "user_id": "samantha.sampleson@example.com",
  "mode": "email",
  "channel_id": "RefArch",
  "locale": "en-us",
  "usid": "18cda486-fe32-4e27-888b-6e4f89938e67",
  "callback_uri": "http://localhost:9050/passwordless/login/callback",
  "last_name": "Sampleson",
  "email": "samantha.sampleson@example.com",
  "first_name": "Samantha",
  "phone_number": 17776665555,
  "customer_no": 123456789
}

Response

Returns 200 with a string. Read it in later steps with {{authorizePasswordlessCustomer.response.data.<field>}}.

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.