Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Issue with Custom Guzzle Client in authenticationClient for SellingPartnerApi::seller() #848

Open
web-svb opened this issue Jan 31, 2025 · 0 comments

Comments

@web-svb
Copy link

web-svb commented Jan 31, 2025

Problem description:

I'm encountering an issue when passing a custom GuzzleHttp\Client instance as the authenticationClient parameter in SellingPartnerApi::seller(). According to the documentation, this parameter should accept a GuzzleHttp\Client, but when provided, it results in the following error:

Error:

Typed property Saloon\Http\Senders\GuzzleSender::$client must not be accessed before initialization.

Code

Steps to Reproduce
Instantiate a GuzzleHttp\Client with a proxy

$httpClient = new \GuzzleHttp\Client([
    'proxy' => 'http://username:password@proxy_host:port',
    'timeout' => 30,
    'connect_timeout' => 30,
]);

Pass it to SellingPartnerApi::seller()

$api = SellingPartnerApi::seller(
    clientId: $credentials->api_client_id,
    clientSecret: $credentials->api_client_secret,
    refreshToken: $credentials->refresh_token,
    endpoint: Endpoint::NA,
    authenticationClient: $httpClient
);

Attempt to make a request:

$response = $api->sellersV1()->getMarketplaceParticipations();

Additional Information
PHP: 8.4.1
Selling Partner API SDK: 7.2.4 (jlevers/selling-partner-api)
Guzzle: 7.9.2
Laravel: 11.41.3
I've confirmed that the issue persists even when using a clean GuzzleHttp\Client instance without additional configuration.

Is there an internal constraint preventing the use of a custom GuzzleHttp\Client, or is there a required initialization step that is missing? Any guidance would be appreciated.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant