public function authenticate()
    {
        $request = new Request($this->handler);
        $this->token = $request->execute(
            RequestMethods::HTTP_POST,
            $this->makeUrl(RequestMethods::DOMUSERP_API_PEDIDOVENDA . '/auth'),
            [
                'json' => [
                    'login'    => $this->username,
                    'password' => $this->password
                ]
            ]
        )->token;

        return $this;
    }
public function authenticate()
    {
        $request = new Request($this->handler);
        $this->token = $request->execute(
            RequestMethods::HTTP_POST,
            $this->makeUrl(RequestMethods::DOMUSERP_API_PEDIDOVENDA . '/auth'),
            [
                'json' => [
                    'login'    => $this->username,
                    'password' => $this->password
                ]
            ]
        )->token;

        return $this;
    }
public function authenticate ( ) { $ request = new Request ( $ this -> handler ) ; $ this -> token = $ request -> execute ( RequestMethods :: HTTP_POST , $ this -> makeUrl ( RequestMethods :: DOMUSERP_API_PEDIDOVENDA . '/auth' ) , [ 'json' => [ 'login' => $ this -> username , 'password' => $ this -> password ] ] ) -> token ; return $ this ; }
Request an access token and sets it to the client.

@return $this
@throws \GuzzleHttp\Exception\GuzzleException
Request an access token and sets it to the client .