Some content on this site may not be available right now. We are aware and actively monitoring the situation.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Retrieve the addons of a product

Use the getProductAddons method to retrieve the addon products associated with a regular product.

Request 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.

ProductCode

Required (string)

The unique code of the regular product.

Request sample

<?php
require ('PATH_TO_AUTH');

$jsonRpcRequest = array (
'method' => 'getProductAddons',
'params' => array($sessionID, 'MAIN_PRODUCT_CODE'),
'id' => $i++,
'jsonrpc' => '2.0'
);

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Response

Parameter
Type/Description

ProductCode

The unique code of the addon product.

ProductName

The name of the addon product.

ProductType

Always ADDON.

Response sample

Error codes

Error code
Description

ADDON_SUBSCRIPTIONS_NOT_ENABLED

Add-ons are not enabled for your 2Checkout account.

PRODUCT_NOT_FOUND

The regular product cannot be found.

INVALID_PRODUCT

ProductCode is not a regular product.

Last updated

Was this helpful?