> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accessing Existing Customer Accounts

After creating a customer account, it must be accessed each time the customer is involved in a transaction.

The following table lists the methods available to access the `Account` object.

| Method | Description |
| - | - |
| `fetchByEmail` | Returns the `Account` object with the specified email address. |
| `fetchByMerchantAccountId` | Returns the `Account` object with the specified `merchantAccountId`. |
| `fetchByPaymentMethod` | Returns all the `Account` objects with the specified payment method. |
| `fetchByVid` | Returns the `Account` object with the specified VID. |
| `fetchByWebSessionVid` | Returns the `Account` object with the specified `WebSession` VID. |
| `fetchCreatedSince` | Returns `Account` objects based on creation date. |

The following example demonstrates all three methods. In production code, call only one method at a time.

```

$customerID = '1234-5678-9000';
$accountVid = 'MyCustomerVindiciaId'; // for illustration purposes only!

// Create an account object
$account = new Account();

// now load a customer account into the account object
// this example illustrates all three methods back-to-back
// but in your code you'll use only one of these methods at a time

$response = $account->fetchByMerchantAccountId($customerID);
$response = $account->fetchByVID($accountVid);
// fetchByEmail returns an array of accounts with matching email
// So in that case $response will contain an array
$response = $account->fetchByEmail('somebody@yahoo.com');

if($response['returnCode'] == 200) {
   print "ok\n"; # 200 is HTTP status code for success
}
```

The preceding example checks the return array’s `returnCode`, which corresponds to a standard HTTP status code, to determine if the fetch is successful. A value of `200` indicates success, that is, the `Account` object that you created earlier now contains the customer record you would like to access.

For more information, see The Account Object in the ***Subscribe API Guide***.

**Parent topic:**[Working with Accounts](../topics/ProgGuide_Accounts)


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