For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set partner

Set the partner for the current shopping cart session. It's mandatory to set the partner for the current cart session to use all Channel Manager methods except login, getPartnerByCode, getPartnerSingleSignOn and searchPartners.

Request parameters

Parameter
Type / Description

sessionID

Required (string) Session identifier, output of the Login method. An exception will be thrown if the values are incorrect.

partnerCode

Required (string) Unique identifier that you need to specify when creating a partner in the Control Panel. You can find it under the General Information area when editing partner details.

Request sample

<?php

require ('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication

$partnerCode = 'YOUR_PARTNER_CODE';

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

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

Response parameters

Parameter
Type / Description

Result

Boolean True or false

Errors

Error
Description

INVALID_PARTNER

Partner code is mandatory.

INVALID_PARTNER

Provided partner code is not associated with an active partner account in the Avangate system.

Last updated

Was this helpful?