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

# Send Verification Errors

These are the most common cases and error codes returned by [Send Verification](c_sendVerification) Process.

This topic covers some of the basic errors with the [Send Verification](c_sendVerification) Process.

## No authN ID provided

If the client invokes this Process without a valid authN ID in the request body, or in the request URL, then Storefront Gateway responds with an`HTTP 400` status. The response body includes a `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
    "operationErrors": [
        {
            "code": "invalid-authnIdentifier",
            "message": "authnIdentifier cannot be empty",
            "authorities": [
                {
                    "authority": "ROLE_USER"
                }
            ]
        }
    ],
    "processId": "7e08a75c-5655-4dc6-b4d0-76024ee8411b",
    "processName": "userManagement.SendVerification.v1.0",
    "stepName": "StartStep",
    "lastStep": false
}
```

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `lastStep` | Boolean that indicates whether or not this was the last step in the Process. |
| `stepName` | The internal name of the step that the Process is currently on / just executed. |
| `lastFailedStepAction` | Object that repeats the previous Process step's details and required input. This allows the client to essentially retry the failed request. |
| `operationErrors` | Array of possible error objects. Each object describes a separate error condition. |
| `code` | An 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 (i.e., a Process requires a user to be authenticated to Storefront Gateway, however they are currently anonymous). |

## Invalid authN ID

If the client invokes this Process with an authN ID that is not in a valid email/mobile format, then Storefront Gateway responds with a `HTTP 400` status. The body includes a `fieldErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
   "processId": "bfa9edf9-ef65-4b9d-874b-5e637fc6c540",
   "stepName": "StartStep",
   "processName": "userManagement.SendVerification.v1.0",
   "lastStep": false,
   "fieldErrors": [
      {
         "field": "authnIdentifier",
         "code": "ValidAuthnIdentifier",
         "rejectedValue": "bob",
         "message": "Invalid format for authentication identifier"
      }
   ]
}
```

| `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. |
| `fieldError` | 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. |

## AuthN ID does not exist (user is authenticated)

If this the client invokes this Process in an **authenticated session** (i.e., there is an authenticated user) and the request specifies an authN ID that does not correspond with an existing authN ID within Storefront Gateway, then Storefront Gateway responds with an`HTTP 400` status. The body includes a `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
   "operationErrors": [
      {
         "code": "authn-identifier-not-found",
         "type": "com.uxpsystems.mint.framework.commons.exception.PlatformException",
         "message": "Requested authentication identifier cannot be verified",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "processId": "6989418a-cc77-47cf-8a0d-589f4af9d28d",
   "lastStep": false,
   "processName": "userManagement.SendVerification.v1.0",
   "stepName": "StartStep"
}
```

| `processId` | The unique identifier for this instance of the Process. |
| - | - |
| `processName` | Full name of the Process, including the category and version number. |
| `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 specific error condition. |
| `code` | An 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. |

## AuthN ID does not exist (anonymous)

If this the client invokes this Process from an anonymous context (i.e., there is no authenticated user) and the request specifies an authN ID that does not correspond with an existing authN ID within Storefront Gateway, then Storefront Gateway responds "normally" without any viible error:

```
**RESPONSE - body**
{
   "processId": "a9d49c9c-3f61-40a3-b147-222e3ddf12d8",
   "processName": "userManagement.SendVerification.v1.0",
   "lastStep": true,
   "output": {
      "pkat": "6a5f2ff6-a5d1-4ae7-aa91-5edb49fdacc7"
   }
}
```

In this scenario, Storefront Gateway takes no action on the back end, but delivers a successful response with a generated PKAT (Proof Key for Action Token) value *as if* a new action token was sent. This is a security measure to prevent malicious actors from utilizing a public API to determine which authN IDs exist in Storefront Gateway and which do not.

## Error Codes

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

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

| HTTP Status | Storefront Gateway Business Error Code | Description |
| - | - | - |
| `400` | `invalid-authnIdentifier` | An authentication identifier was not provided, or the value provided is not a valid e-mail address or phone number. |
| `400` | `authn-identifier-not-found` | The authentication identifier provided does not exist, or is not associated with the currently authenticated user. |

**Parent topic:**[Send Verification Process](c_sendVerification)


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