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

# Leave A/S/F errors

This topic covers some of the basic errors with the [User Leaves an Account, Subscription, and Feature](c_userLeavesASF) Process.

## Association does not exist

If the user (or client) somehow specifies an Account, Subscription, or Feature entitlement entity that is not associated to the current Storefront Gateway User, then the Process returns the following error message:

```
**RESPONSE - body**
{
   "processId": "57afa130-aadd-4f62-ace3-c3e94c974822",
   "processName": "entitlementManagement.UserLeavesASF.v1.0",
   "stepName": "Prompt",
   "lastStep": false,
   "fieldErrors": [
      {
         "field": "entities[0].entityId",
         "code": "ValidEntity",
         "rejectedValue": 6007,
         "message": "User does not currently have an association to one of the specified entities"
      }
   ],
   "lastFailedStepAction": {
      "processId": "1e77f2a6-c0fe-4b39-a742-b53818b832df",
      "processName": "entitlementManagement.UserLeavesASF.v1.0",
      "stepName": "Prompt",
      "output": {
         "validTypes": [
            "account",
            "subscription",
            "feature"
         ]
      },
      "parameters": {
         "entities": [
            {
               "entityType": "account",
               "entityId": 1234
            },
            {
               "entityType": "subscription",
               "entityId": 56789
            }
         ]
      }
   }
}
```

The response also includes a `lastStepFailedAction` object that repeats the previous Process step's response, so the user re-attempt their request.

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

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

| HTTP Status | Storefront Gateway Business Error Code | Description |
| - | - | - |
| `400` | `ValidEntity` | One of the below reasons: - An entity matching the provided identifier does not exist in Storefront Gateway - The entity type provided is invalid - The user does not have an existing association to the selected entity, and thus cannot be removed from it - The user is considered the "Primary" owner of the entity and thus cannot leave it |
| **Parent topic:**[User Leaves a Shared Account, Subscription, or Feature](c_userLeavesASF) | | |


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