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

After creating a `Product` object, access it each time a customer purchases or subscribes to it.

The following table shows the methods of access to the `Product` object.

| Name | Description |
| - | - |
| `fetchAll` | Returns all the `Product` objects. |
| `fetchByAccount` | Returns one or more `Product` objects whose `Account` object matches the input. |
| `fetchByMerchantEntitlementId` | Returns all the `Product` objects whose entitlement ID assigned by you (`merchantEntitlementId`) matches the input. |
| `fetchByMerchantProductId` | Returns an `Account` object with the specified `merchantAccountId`. |
| `fetchByVid` | Returns an `Account` object with the specified VID. |

The following example calls two methods. In production, call only one method at a time.

```

$sku = '12345';
$productVid = 'MyProductVindiciaId'; // for illustration purposes only!

// Create a product object
$product = new Product();

// now load an existing product into the Product object
// this example illustrates both methods back-to-back
// but in your code you'll use only one of these methods at a time
$response = $product->fetchByMerchantProductId($sku);
$response = $product->fetchByVid($productVid);

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

The preceding example checks the return array’s `returnCode` to determine if the `fetch` succeeded. A value of `200` indicates success; that is, the `Product` object created earlier now contains the product record you would like to access.

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

**Parent topic:**[Working with Products](../topics/ProgGuide_Products)


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