protected function requestAppAccessToken()
    {
        $credentials = $this->authHelper->generateAppCredentials($this->apiKey, $this->apiSecret);

        $endpoint = '/oauth2/token';

        $url = $this->urlHelper->joinSlugs([$this->baseUrl, $endpoint]);

        $data = ['grant_type' => 'client_credentials'];

        $headers = [
            'Authorization' => 'Basic ' . $credentials,
            'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8'
        ];

        $response = $this->courier->post($url, $data, $headers)->toArray();

        return $response['access_token'];
    }