> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/product/search-products.md).

# Search products

Use the **searchProducts** method to extract information about the subscription plan/products you configured for your account.

## Pagination

Use pagination to decrease the request loading time, while better handling the returning responses.

Pagination works on **all** the search methods existing on 2Checkout API 6.0. The default pagination behavior is to display page 1 with 10 results. The maximum number of items displayed on a single page is 200.

To use pagination, include the `Pagination` object inside the search method call, using the parameters below:

<table><thead><tr><th width="174.5333251953125">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>Pagination</code></td><td><strong>Object</strong> <br>Details below.</td></tr><tr><td><code>Pagination.Page</code></td><td><strong>Optional (integer)</strong><br>A specific page of search results. Default value is 1. Can be NULL.<br>Set the number of pages that should be returned.</td></tr><tr><td><code>Pagination.Limit</code></td><td><p><strong>Optional (integer)</strong></p><p>Number of results (products) displayed per page. Default value is 10. Can be NULL.<br>Set a limit for the number of results that should be returned.</p></td></tr></tbody></table>

## Request parameters

| Parameter                  | Type / Description                                                                                                                                                                                                                                                                                                                  |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sessionID`                | <p><strong>Required (string)</strong><br>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionID</code> expires in <strong>10 minutes</strong>.</p>                              |
| `SearchOptions`            | **Object**                                                                                                                                                                                                                                                                                                                          |
| `SearchOptions.Name`       | <p><strong>Optional (string)</strong><br>Product name. Can be NULL.</p>                                                                                                                                                                                                                                                             |
| `SearchOptions.Codes`      | <p><strong>Optional (string array)</strong></p><p>Array of product codes.</p>                                                                                                                                                                                                                                                       |
| `SearchOptions.Types`      | <p><strong>Optional (string array)</strong></p><p>Array of the values representing the type of products. Possible values:</p><ul><li>REGULAR</li><li>BUNDLE</li><li>ADDON</li></ul><p>Leave empty to have all product types returned to the search. Can be NULL. If NULL, 2Checkout returns regular, bundle and addon products.</p> |
| `SearchOptions.Enabled`    | <p><strong>Optional (boolean)</strong><br>True or false. Can be NULL.</p>                                                                                                                                                                                                                                                           |
| `SearchOptions.GroupName`  | <p><strong>Optional (string)</strong></p><p>The name of the group that the product is associated with. Can be NULL.</p>                                                                                                                                                                                                             |
| `SearchOptions.Pagination` | <p><strong>Object</strong><br>See the <a href="#pagination">Pagination </a>section.</p>                                                                                                                                                                                                                                             |
| `SearchOptions.OrderBy`    | <p><strong>Object</strong></p><p>Defines the order of the returned results.</p>                                                                                                                                                                                                                                                     |
| `SearchOptions.Field`      | <p><strong>Optional (string)</strong></p><p>The name of the field to order the results by. Allowed values:</p><ul><li>ProductStatus</li><li>ProductName</li><li>ProductCode</li><li>UpdateDatetime</li><li>AvangateId</li></ul><p>Can be NULL.</p>                                                                                  |
| `SearchOptions.Direction`  | <p><strong>Optional (string)</strong></p><p>Sort results ascending or descending. Allowed values:</p><ul><li>asc</li><li>desc (default)</li></ul><p>Can be NULL (defaults to desc).</p>                                                                                                                                             |

### Request sample

```php
<?php

$vendorCode = 'YOUR_VENDOR_CODE';
$apiKey     = 'YOUR_API_KEY';
$date       = gmdate('Y-m-d H:i:s');
$hash       = hash_hmac(
    'md5',
    strlen($vendorCode) . $vendorCode . strlen($date) . $date,
    $apiKey
);

try {
    $client = new SoapClient(
        'https://api.2checkout.com/soap/6.0?wsdl',
        ['cache_wsdl' => WSDL_CACHE_NONE]
    );

    $sessionID = $client->login($vendorCode, $date, $hash);

    $SearchOptions = new stdClass();
    $SearchOptions->Name = '2Checkout Subscription'; //Product name
    $SearchOptions->Types = array('REGULAR', 'BUNDLE'); //regular or bundle products
    //$SearchOptions->Types = array('ADDON'); //use this instead for addon products only
    $SearchOptions->Enabled = true;
    //$SearchOptions->GroupName = '';
    $SearchOptions->Limit = '10';
    $SearchOptions->Page = '10';

    $result = $client->searchProducts($sessionID, $SearchOptions);
    var_dump($result);

} catch (SoapFault $e) {
    echo 'SoapFault: ' . $e->getMessage() . PHP_EOL;

```

## Response parameters

<table><thead><tr><th width="121.2000732421875">Parameter</th><th>Type</th></tr></thead><tbody><tr><td><a href="https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-responses/product.md"><code>Product</code></a></td><td><strong>Object</strong></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/product/search-products.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
