> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Onboard user with mobile number

This is the mobile-driven onboarding use case delivered by the [Onboard User with Email and Mobile](c_onboardUserEmailMobile) Process.

The flow is similar to the [email-driven use case](c_useCaseOnboardEmail), except the verification action token is sent to the user over SMS. In this example, the token is sent as a short-form One-time Passcode (OTP). Instead of clicking a link, the end user manually enters the supplied OTP to the UI for verification.

The Process consumes the user's mobile number and password, creates a new unique Storefront Gateway User entity, and then registers the submitted mobile as an attribute and authentication identifier (authN ID) on that entity. Both the Storefront Gateway User and the authN ID attribute are created with an `activating` status, pending verification.

<img src="https://mintcdn.com/amdocs-spbu/0TZ9XF1Mst_2ATcV/marketONE/sgProcessGuide/images/sfgw_umlOnboardUserMobile.png?fit=max&auto=format&n=0TZ9XF1Mst_2ATcV&q=85&s=217996ee9a3ff4be2ba14bd9dc2b2f0b" alt="" width="907" height="609" data-path="marketONE/sgProcessGuide/images/sfgw_umlOnboardUserMobile.png" />

## Initial Request

Your client calls the [Process Start](c_processStart) API to initialize the Process:

```
**REQUEST - POST https://\{your.url\}/process/start/onboard.OnboardUserWithEmailMobile.v1.0**
<no body>
```

## Response

Storefront Gateway responds with a request for user information:

```
**RESPONSE - body**
{ 
   "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
   "processName:" "onboard.OnboardUserWithEmailMobile.v1.0" 
   "displayMessage": "Please Enter User details for self onboarding", 
   "parameters": { 
      "email": "String", 
      "phone": "String", 
      "credential": "String", 
      "firstName": "String", 
      "lastName": "String", 
      "displayName": "String", 
      "lang": "String" 
   }, 
   "stepName": "UserDetailsPrompt", 
   "lastStep": false 
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `stepName` | Name of the specific step that the Process is currently on. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `displayMessage` | Optional message that the UI can display to the end user. |
| `parameters` | Object that specifies the info this Process requires to continue its task. |
| `email` | (**Conditional**) The user's email address. **Mandatory** if `phone` is not provided. |
| `phone` | (**Conditional**) The user's mobile phone number. **Mandatory** if `email` is not provided. |
| `credential` | (**Mandatory**) The user's desired password. |
| `firstName` | (**Optional**) The user's first name. |
| `lastName` | (**Optional**) The user's last name. |
| `displayName` | (**Optional**) A display name for the user. This could be just a combination of the user's first and last name or a nickname. |
| `lang` | (**Optional**) The user's preferred language. |

## Next Request: User Details

Your client calls the Process Step API, and passes the user-supplied info to the Process.

```
**PUT https://\{your.url\}/process/step**
{ 
   "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
   "parameters": { 
      "credential": "GoodPas$word123", 
      "phone": "4161234567" 
   } 
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `parameters` | Data object that contains the data requested in the previous Process response. |
| `phone` | The user's mobile number. |
| `credential` | The user's desired password. |

## Process Complete

If the mobile and password pass validation, the Process completes its task and returns a `200 HTTP` status.

```
**RESPONSE - body**
{ 
   "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
   "processName": "onboard.OnboardUserWithEmailMobile.v1.0", 
   "output": { 
      "pkat": "sdfsd-gfsdfgsd-sdgsdg-sfddsf-dsfsdf", 
   }, 
   "lastStep": true 
}
```

Storefront Gateway also sends an [action token](c_actionTokens) out to the user's mobile number as an SMS.

**OTP Verification & Resend Verification**

Any Process step that sends a Storefront Gateway action token also returns a corresponding PKAT to the client application. In order to enable OTP verification on the UI, the client **must** retain the PKAT returned by the final Process step. The PKAT, along with the user-supplied OTP, is required for the [GET /session/token?customToken=\{OTP}\&pkat=\{pkat}](c_sessionToken)\`\` API to invoke the subsequent **Activate User** Process to complete the user onboarding.

In cases where the user is anonymous, the PKAT is required if the application wants to provide a quick token resend option on the UI, using the `[PUT /session/token?pkat=\{pkat\}](c_putSessionToken)` API. This method applies to cases where the user is anonymous (i.e., they are not authenticated in Storefront Gateway). However, if the user is currently authenticated in Storefront Gateway, the client application can instead invoke the **Resend Verification** Process for this purpose.

| `processId` | Unique identifier for the current instance of this Process. | |
| - | - | - |
| `processName` | Full name of the Process, including the category and version number. | |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. | |
| `output` | Object that contains data that the client can consume, retain, and use for additional operations. | |
| | `pkat` | Unique [Proof Key for Action Token](c_actionTokens) that corresponds to an existing action token. |
| The end user has successfully onboarded with their mobile number. The User entity is stored with an `activating` status. The phone number is stored as an attribute on the User entity, and it also has an activating status. The end user will need to verify their phone number and fully Activate their User identity. | | |

**Parent topic:**[Onboard and Authenticate with Mobile Number](userOnboardAuthWithMobile)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.