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

# Associate billing account errors

This topic covers some of the basic error scenarios with the [Associate Billing Account to User](c_associateBillingAccountV2) Process.

## No Account Found

If the user-supplied mobile number do not match any account in the integrated B/OSS, then Storefront Gateway responds to your client with an `HTTP 400` status. The response body includes a `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
   "processId": "ec90ed2c-eca9-42de-9fbc-a81506c5d1e8",
   "processName": "accountAssociation.AssociateAccount.v2.0",
   "stepName": "AccountIdentifierPrompt",
   "lastStep": false,
   "operationErrors": [
      {
         "code": "cannot-find-account",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "Accounts could not be found based on provided parameters",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "lastFailedStepAction": {
      "processId": "ec90ed2c-eca9-42de-9fbc-a81506c5d1e8",
      "processName": "accountAssociation.AssociateAccount.v1.0",
      "stepName": "AccountIdentifierPrompt",
      "parameters": {
         "accountKeys": {
            "key1": "keyValue1",
         }
      }
   }
}
```

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

## Account Already Associated

If the B/OSS returns an account that is already associated to the current User, then the Storefront Gateway responds with an `HTTP 409` status. The body includes a `operationErrors` array with the reason(s) as to what went wrong:

```
**RESPONSE - body**
{
   "processId": "ec90ed2c-eca9-42de-9fbc-a81506c5d1e8",
   "processName": "accountAssociation.AssociateAccount.v2.0",
   "stepName": "AccountIdentifierPrompt",
   "lastStep": false,
   "operationErrors": [
      {
         "code": "invalid-challenge-response",
         "type": "com.uxpsystems.mint.framework.ulm.process.service.ServiceStep.GeneralFailure",
         "message": "The account is already associated to this use",
         "authorities": [
            {
               "authority": "ROLE_USER"
            }
         ]
      }
   ],
   "lastFailedStepAction": {
      "processId": "ec90ed2c-eca9-42de-9fbc-a81506c5d1e8",
      "processName": "accountAssociation.AssociateAccount.v1.0",
      "stepName": "ChallengeQuestionPrompt",
      "parameters": {
         "accountKeys": {
            "key1": "keyValue1",
            "key2": "keyValue2"
         }
      }
   }
}
```

**Note:** If the account is already associated to a separate User, then the response is similar except for the `message`:

```
"message": "The account is already associated to another user."
```

## 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` | `unsupported-identifier-type` | The user supplied an acocunt identifier that is not supported, or does not meet the format defined in the **Valid phone pattern** setting. |
| `409` | `duplicate-identifier` | The account identifier (i.e., the mobile number) is already registered to another Storefront Gateway User. |
| `409` | `already-exist-account` | The account returned by the external service is already associated to the current User, or another User. |
| `409` | `duplicate-account-number` | There is already a Storefront Gateway Account in the data store with a matching account number. |
| **Parent topic:**[Associate Billing Account to User Process](c_associateBillingAccountV2) | | |


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