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

Update order reseller information

Use this method to update the reseller information defined for a specific order.

Request parameters

Parameter
Type / Description

sessionID

Required (string) Session identifier, which is the 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.

ResellerCode

Required (string) Unique, system generated reseller identifier.

OrderRefNo

Required (string) The unique, system-generated identifier of a partner order.

Request sample

<?php

declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = 'MERCHANT';
    public const MERCHANT_KEY = 'SECRET_KEY';
    public const URL = 'https://api.2checkout.com/soap/6.0';
    public const ACTION = 'updateOrderReseller';
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "PartnerCode": "Test Avangate",
    "ResellerCode": "DB6F1A946E",
    "OrderRefNo": 731522351
}
JSON;

}
class Client
{
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }
        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);
        $args = array_filter([$sessionId, $payload]);
        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url.'?wsdl',
            [
                'location' => $url,
                'cache_wsdl' => WSDL_CACHE_NONE,
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode).$merchantCode.strlen($date).$date;
        $algo = 'sha256';
        $hash = hash_hmac($algo, $string, $key);
        $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
        return $client->login($merchantCode, $date, $hash, $algo);
    }
}
try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}

Errors

Error
Description

Missing required parameter: PartnerCode

Add the PartnerCode parameter.

Missing required parameter: ResellerCode

Add the ResellerCode parameter.

Missing required parameter: OrderRefNo

Add the OrderRefNo parameter.

INVALID_ID_SALE

Invalid order reference.

Last updated

Was this helpful?