public function createRequest($method, $url, array $options = [])
    {
        $request = parent::createRequest($method, $url, $options);

        $query = $request->getQuery();

        $auth = $request->getConfig()->get('auth');

        // The 'auth' configuration must be valid
        if ((!is_array($auth)) || (count($auth) < 3) || ($auth[2] != Client::$AUTH_TYPE)) {
            throw new RuntimeException("Authorization information not provided");
        }

        $id = $auth[0];
        $secret = $auth[1];

        // Add API User ID to the query
        $query->set('api_id', $id);

        // Add timestamp to the query
        if (!$query->hasKey('api_ts')) {
            $query->set('api_ts', time());
        }

        // Add version to the query
        $query->set('api_ver', '2');

        // Add hash to the query
        $hash = $this->generateMac($request->getUrl(), $request->getQuery()->toArray(), $secret);
        $query->set('api_mac', $hash);

        return $request;
    }