Retrieve subscription plan/product info
Overview
Use the searchProducts method to extract information about the subscription plan/products you configured for your account.
Parameters
Parameters | 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. |
||
SearchOptions |
Object |
||
Name |
Optional (string) |
||
|
Product name. Can be NULL. |
||
|
Codes |
Optional (StringArray) |
|
|
Array of product codes. |
||
Types |
Optional (StringArray) |
||
|
Array of the values representing the type of products. Possible values:
Leave empty to have all product types returned to the search. Can be NULL. If NULL, 2Checkout returns both regular and bundle products. |
||
Enabled |
Optional (boolean) |
||
|
True or false. Can be NULL. |
||
GroupName |
Optional (string) |
||
|
The name of the group that the product is associated with. Can be NULL. |
||
Limit |
Optional (integer) |
||
|
Number of results (products) displayed per page. Default value is 10. Can be NULL. |
||
Page |
Optional (integer) |
||
|
A specific page of search results. Default value is 1. Can be NULL. |
||
|
OrderBy |
Object |
|
|
Defines the order of the returned results. |
||
|
Field |
Optional (string) |
|
|
The name of the field to order the results by. Allowed values: 'ProductStatus', 'ProductName', 'ProductCode', 'UpdateDatetime', 'AvangateId'. Can be NULL. |
||
|
Direction |
Optional (string) |
|
|
Sort results ascending or descending. Allowed values:
Can be NULL (defaults to desc).
|
Request
<?php
require ('PATH_TO_AUTH');
$SearchOptions = new stdClass();
$SearchOptions->Name = '2Checkout Subscription'; //Product name
$SearchOptions->Types = array ('REGULAR', 'BUNDLE'); //product type (standalone), regular or bundle
$SearchOptions->Enabled = True;
//$SearchOptions->GroupName = '';
$SearchOptions->Limit = '10';
$SearchOptions->Page = '10';
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'searchProducts',
'params' => array($sessionID, $SearchOptions)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));
?>
Response
Parameter | Type/Description |
---|---|
Object |