> 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/json-rpc-api-reference/json-rpc-api-6.0/api-requests/order-search-options/search-orders.md).

# Search orders

Use the **searchOrders** method via JSON-RPC API 6.0 to retrieve multiple orders depending on the filter parameters.&#x20;

{% hint style="info" %}
To retrieve all the orders of a specific customer, use the [**getCustomerOrders**](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/customer/retrieve-customer-orders.md) method. It returns the same Items and Pagination structure as **searchOrders**.
{% endhint %}

## Request parameters <a href="#request-parameters" id="request-parameters"></a>

<table><thead><tr><th width="189.4666748046875">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><p><strong>Required (string)</strong></p><p>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 10 minutes.</p></td></tr><tr><td><a href="/json-rpc-api-reference/json-rpc-api-6.0/api-requests/order-search-options.md"><code>orderSearchOptions</code></a></td><td><p><strong>Optional (object)</strong></p><p>Use this object to configure your search order options.</p></td></tr></tbody></table>

### Request sample <a href="#request-example" id="request-example"></a>

```php
<?php

require ('PATH_TO_AUTH');

$orderSearchOptions = new stdClass();
$orderSearchOptions->StartDate = “2020-01-23”;
$orderSearchOptions->PartnerOrders = true;
$orderSearchOptions->Pagination = new stdClass();$orderSearchOptions->Pagination->Page = 2;
$orderSearchOptions->Pagination->Limit = 25;

try {
    $orders = $client->searchOrders($sessionID, $orderSearchOptions);
}
catch (SoapFault $e) {
    echo "orders: " . $e->getMessage();
    exit;
}

var_dump("orders", $orders);
               
?>
```

## Response parameters <a href="#response" id="response"></a>

A successful **searchOrders** call via JSON-RPC API 6.0 returns:

<table><thead><tr><th width="137.2000732421875">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>Items</code></td><td><p><strong>Array of objects</strong></p><p>An array of Order Information objects, with <a href="/json-rpc-api-reference/json-rpc-api-6.0/api-responses/order-with-catalog-products.md">catalog products</a> or with <a href="/json-rpc-api-reference/json-rpc-api-6.0/api-responses/order-with-dynamic-products.md">dynamic products</a>.</p></td></tr><tr><td><code>Pagination</code></td><td><p><strong>Object</strong></p><p>Pagination object with the following parameters: <code>Page</code>, <code>Limit</code>, <code>Count</code>.</p></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/json-rpc-api-reference/json-rpc-api-6.0/api-requests/order-search-options/search-orders.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.
