Search orders

Use the searchOrders method via JSON-RPC API 6.0 to retrieve multiple orders depending on the filter parameters.

Request parameters

Parameter
Type / Description

sessionID

Required (string)

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.

Optional (object)

Use this object to configure your search order options.

Request sample

<?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 successful searchOrders call via JSON-RPC API 6.0 returns:

Parameter
Type / Description

Items

Array of objects

An array of Order Information objects, with catalog products or with dynamic products.

Pagination

Object

Pagination object with the following parameters: Page, Limit, Count.

Last updated

Was this helpful?