> ## 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.

# Onboarding Errors

These are the most common error cases and error codes returned by the [Onboard User with Email and Mobile](c_onboardUserEmailMobile) Process.

## Invalid Credentials

If the user provides an invalid password (e.g., the password fails to meet the password complexity rules), then the Process responds with a `HTTP 400` status code. The body includes a `fieldErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{ 
   "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
   "processName": "onboard.OnboardUserWithEmailMobile.v1.0",
   "stepName": "UserDetailsPrompt" 
   "lastStep": false,  
   "fieldErrors": [ 
      { 
         "field": "credential", 
         "code": "NotWeakPassword", 
         "rejectedValue": "test", 
         "message": "password-regex-rule-violation-.*[0-9].*" 
     }, 
     { 
         "field": "credential", 
         "code": "NotWeakPassword", 
         "rejectedValue": "test", 
         "message": "blacklisted-password" 
     }, 
     { 
         "field": "credential", 
         "code": "NotWeakPassword", 
         "rejectedValue": "test", 
         "message": "password-regex-rule-violation-.{8,}" 
     }, 
     { 
         "field": "credential", 
         "code": "NotWeakPassword", 
         "rejectedValue": "test", 
         "message": "password-regex-rule-violation-.*[A-Z].*" 
     } 
   ], 
   "lastFailedStepAction": { 
      "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
      "displayMessage": "Please Enter User details for self onboarding", 
      "parameters": { 
         "email": "String", 
         "phone": "String", 
         "credential": "String",
         "displayName": "String", 
         "lang": "String",
      }, 
      "stepName": "UserDetailsPrompt" 
   } 
}
```

In the above example, objects in the `fieldErrors` array indicate the following:

* The password fails to include at least one number (0-9)
* The password is on an internal list of commonly banned passwords
* The password fails to meet the minimum length of (8 characters)
* The password fails to include at least one capital (A-Z)

**Note:** Password rules are controlled by the **Password complexity rules** setting. Your organization's Admin users can sign into the MarketONE Admin console and modify this setting as desired.

The Process error response also includes a `lastStepFailedAction` object that repeats the previous Process step's request. The user can re-attempt their request with a different (ideally stronger) password, and complete their onboarding as normal.

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `fieldErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `field` | The name of the specific field where the error occurred. |
| `code` | An error object's internal code name. |
| `rejectedValue` | The actual value that caused the error |
| `message` | Optional message that describes the error. |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to retry the failed request. |

## AuthN ID is Already Used

If the user provides an authN ID that already exists in Storefront Gateway, the Process responds with an `HTTP 401` status code. The response body includes an `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{ 
   "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
   "stepName": "UserDetailsPrompt" 
   "lastStep": false, 
   "operationErrors": [ 
      { 
         "code": "already-exist-phone", 
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure", 
         "message": "Failed to create a user with duplicated phone number", 
         "authorities": [
            {
               "authority": "ROLE_ANONYMOUS"
            }
         ] 
     }, 
   "lastFailedStepAction": { 
      "processId": "8bca30ca-dd44-4050-aece-53b0dbed1922", 
      "displayMessage": "Please Enter User details for self onboarding", 
      "parameters": { 
         "email": "String", 
         "phone": "String", 
         "credential": "String",
         "displayName": "String", 
         "lang": "String",
      },
      "stepName": "UserDetailsPrompt" 
   } 
}
```

The Process error response also includes a `lastStepFailedAction` object that repeats the previous Process step's request. The user can make sure they entered the correct authN ID (email or mobile), retry their request, and complete the Process as usual.

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `operationErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | Error object's internal code name. |
| `type` | Internal reference of the operation error type. |
| `message` | Optional message that describes the error in a human readable format. |
| `authorities` | The list of authority roles currently granted to the user. Can be used to help supply context to authorization errors (e.g., if Process requires a user to be authenticated to Storefront Gateway, but they are currently anonymous). |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to retry the failed request. |

## Error Codes

Below is a list of potential error codes that may be returned during the execution of this Process.

| HTTP Status | Storefront Gateway Error Code | Description |
| - | - | - |
| `400` | `process-terminated-with-too-many-retries` | The Process terminated after too many consecutive user input attempts. |

**Note:** See [Common Process Error Codes](c_commonProcessErrors).

| HTTP Status | Storefront Gateway Business Error Code | Description |
| - | - | - |
| `400` | `NotWeakPassword` | The password provided did not meet the minimum criteria for a sufficiently complex password. |
| `400` | `NotEmpty` | No password was supplied. |
| `400` | `user-without-authnid` | An attempt was made to update the user's password, but they do not have a corresponding authentication identifier (thus rendering a password useless). |
| `400` | `invalid-credential` | The user provided an incorrect value as their current password. |

**Parent topic:**[Onboard User with Email and Mobile Process](c_onboardUserEmailMobile)


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