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

# User Leaves a Shared Account, Subscription, or Feature

This enables a user,who is sharing access to another user's account or service (represented in Storefront Gateway as a Storefront Gateway Account, Subscription, or Feature), to voluntarily give up their access to that account or service.

This enables a user,who is sharing access to another user's account or service (represented in Storefront Gateway as a Storefront Gateway Account, Subscription, or Feature), to voluntarily give up their access to that account or service.

This process is distinct from the [Revoke Access to an Account, Subscription, or Feature](c_revokeAccessASF) Process, wherein the associated Group Primary User (or Admin User, set by the Primary) revokes access from another end user.

**Note:** Refer to the [Associate Billing Account](c_associateBillingAccountV2) and [Share Access to an Account, Subscription, or Feature](c_shareAccessASF) Processes for more details on how accounts and services are provisioned into Storefront Gateway's data model, and how Storefront Gateway leverages User and Group associations to enable shared access to client services.

## Process Flow

This flow describes the Process at a high level.

**Preconditions**

* The user is currently authenticated.
* The user is currently sharing access to an account or service owned by another user. In other words, the current Storefront Gateway User is associated to the specified Storefront Gateway Account(s), Subscription(s), or Feature(s), but they are not the Primary of that A/S/F.
* The current user is not the Primary User of the Group to which the A/S/F entitlement entities are associated.

**Basic Flow**

1. The user authenticates and navigates to the service management section of your client application.

2. The user selects to relinquish access to one or more accounts or services that they are sharing, and the client invokes the Process.

   **Note:** The Process requires the client to specify the target accounts or services to remove by their unique, internal `id` number (a property on every Storefront Gateway entity). The client can leverage additional Storefront Gateway APIs to retrieve the relevant information:

   * `GET user/groups` – Retrieves a list of Groups to which the current User is associated. Each Group includes an `id` property.
   * `GET user/accounts` – Retrieves a list of the Accounts to which the current User is associated. Each Account includes an `id` property.
   * `GET user/subscriptions` – Retrieves a list of the Subscriptions to which the current User is associated. Each Subscription includes an `id` property.
   * `GET user/feature` – Retrieves a list of the Accounts to which the current User is associated. Each account includes an `id` property.
     Whether or not the client retrieves and retains this information prior to Process invocation (e.g., when a user first authenticates into the application, or visits their "user profile" or equivalent), or during Process execution, is entirely up to your client developers.

3. The client passes the user's selection to the Process, and Storefront Gateway removes the association(s) between the User entity and the specified account(s), subscription(s), or feature(s).
   * More specifically, the Storefront Gateway removes the association current Storefront Gateway User entity and the specified entitlement entities.
   * Removing a User entity from a single entity in an A/S/F hierarchy does not cascade up or down that hierarchy. In other words, if a User entity is associated to both an Account and a Subscription within a single A/S/F hierarchy, revoking one association does not affect the other.

4. (**Conditional**) If the current user has no other associations to Accounts, Subscriptions, or Features in the associated Storefront Gateway Group, the they are automatically removed from the Group.

**Post-conditions**

* The current user no longer has access to the account(s) or service(s) that were previously shared with them.
* Storefront Gateway sends a notification message to the Primary User's preferred contact channel.

**Possible or Common Errors**

* The current user is not currently associated to the specified entity.
* The current user is the Group Primary, and therefore cannot leave the associated A/S/F.

## Settings

This Process currently has no relevant settings that configure the Process API response or Process logic/behavior.

However, additional settings may be introduced over the course of future releases.

## User Journey Diagram

This diagram illustrates the standard user journey using the **User Leaves A/S/F** Process.

<img src="https://mintcdn.com/amdocs-spbu/_Twl74NQXCAg2nPh/marketONE/sgProcessGuide/images/sfgw_userJourneyUserLeavesASF.png?fit=max&auto=format&n=_Twl74NQXCAg2nPh&q=85&s=7adf6192618eaa752d02d20eae6d37af" alt="" width="1750" height="2191" data-path="marketONE/sgProcessGuide/images/sfgw_userJourneyUserLeavesASF.png" />

## Use Cases

The following use cases provide guided API walk-throughs of this Process for client developers:

* [User leaves account or service](c_useCaseLeaveASF)

* [Single step leave account or service](c_useCaseSingleStepLeaveASF)

* [Leave A/S/F errors](c_leaveASFerrors)

* **[User leaves a shared A/S/F](c_useCaseLeaveASF)**

* **[Single step leave A/S/F](c_useCaseSingleStepLeaveASF)**

* **[Leave A/S/F errors](c_leaveASFerrors)**

**Parent topic:**[Account Association & Management Processes](../images/c_accountProcesses)


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