> ## 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 declines invitation

In this use case, a user receives an invitation to share access to another user's account or service (represented in Storefront Gateway by Account, Subscription, and Feature entitlement entities), but they explicitly decline the invitation.

<img src="https://mintcdn.com/amdocs-spbu/0TZ9XF1Mst_2ATcV/marketONE/sgProcessGuide/images/sfgw_umlAcceptDeclineDecline.png?fit=max&auto=format&n=0TZ9XF1Mst_2ATcV&q=85&s=1445d0175047c17800425f177062670c" alt="" width="701" height="739" data-path="marketONE/sgProcessGuide/images/sfgw_umlAcceptDeclineDecline.png" />

## Initial Request

The invitee clicks the invitation link, which then redirects them back to a dedicated landing page in your application. Your client takes the action token value directly from the redirect URL, and calls the [Session Token](c_sessionToken) API with the token value as a URL parameter. This initializes the Process:

```
**GET https://\{your.url\}/session/token?value=681e508b-aa16-48db-a9f7-3d58d464e7c3**
<no body>
```

## Response: Accept or Decline

Storefront Gateway responds with a prompt for the user to explicitly accept or decline the invitation:

```
**RESPONSE - body**
{
   "processId": "de4f55a4-e9df-4142-98b4-5de739c82188",
   "processName": "entitlementManagement.UserAcceptDeclineInvite.v1.0",
   "stepName": "AcceptPrompt",
   "displayMessage": "Please input required information",
   "parameters": {
      "accept": "Boolean"
   }
}
```

| `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. |
| `displayMessage` | Optional message that the UI can display to the user. |
| `parameters` | Object that specifies the info this Process requires to continue its task. |
| `accept` | Boolean that indicates if the user accepts the service invitation. |

## Final Request: User Declines

The user explicitly declines, and your client passes this choice back to the Process through the [Process Step](c_processStep) API:

```
**PUT https://\{your.url\}/process/step**
{
   "processId": "c18d8e7b-6817-4a0c-9ca8-76036b82b0fc",
   "parameters": {
      "accept": **false**   
   }
}
```

| `processId` | Unique identifier for the current instance of this Process. |
| - | - |
| `parameters` | Object that contains the data requested in the previous Process response. |
| `accept` | Boolean that indicates if the user accepts the service invitation. |

## Process Complete

The Process removes the associations to the service(s) previously created when the invitation to share was performed. The Process ends, and returns a `200 HTTP` status:

```
**RESPONSE - body**
{
   "processId": "c18d8e7b-6817-4a0c-9ca8-76036b82b0fc",
   "processName": "entitlementManagement.UserAcceptDeclineInvite.v1.0",
   "lastStep": true,
   "userAuthenticated": **false
**}
```

The current user is **not** authenticated, whether they are an existing Storefront Gateway User or not.

| `processId` | The unique identifier for this instance of the 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. |
| `runtimeId` | Identifier of the Storefront Gateway Runtime entity currently associated to the Storefront Gateway User entity. \*\*About Runtime Entities:\*\*Upon user creation or authentication, Storefront Gateway looks for a JRUNTIMEID cookie in the end user's browser or application. If no cookie is found, Storefront Gateway creates a Runtime Entity with a unique ID and associates it to the user during the login phase. Storefront Gateway will generate and pass a corresponding JRUNTIMEID cookie for clients to store and return with subsequent requests. |
| `userId` | The unique identifier of the current user. |
| `userAuthenticated` | Boolean that indicates if the user was authenticated into Storefront Gateway. |
| **Parent topic:**[Accept or Decline Service Invitation Process](c_acceptDeclineServiceInvitation) | |


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