Skip to content

Allow any regional marketplace to get marketplace participation#399

Merged
saleweaver merged 2 commits intosaleweaver:masterfrom
dvukolovAC:master
Feb 18, 2022
Merged

Allow any regional marketplace to get marketplace participation#399
saleweaver merged 2 commits intosaleweaver:masterfrom
dvukolovAC:master

Conversation

@dvukolovAC
Copy link
Contributor

The original SP-API getMarketplaceParticipations operation takes no parameters. The regional endpoint (e.g. https://sellingpartnerapi-na.amazon.com) plus credentials are sufficient to obtain the full list of marketplaces where the seller is present.

Before the proposed change, we had to store the originally authorized marketplace ID alongside credentials to make the call work. Say, a seller is present in Japan, but not in Singapore in the Far East region. Then the following code would run correctly:

from sp_api.api import Sellers
from sp_api.base import Marketplaces

sellers = Sellers(marketplace=Marketplaces.JP, credentials=credentials)
result = sellers.get_marketplace_participation()
print(result.payload)

Whereas the same code with marketplace=Marketplaces.SG, would raise an exception:

sp_api.base.exceptions.SellingApiForbiddenException: 
[{'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''}]

The code change allows specifying any marketplace from a particular region to obtain the list of countries where the seller is present.

@saleweaver
Copy link
Owner

🙏 Thank you. Can you please bump the version in version, I can create a release then. Should be 0.13.5

@saleweaver saleweaver merged commit f6b7b08 into saleweaver:master Feb 18, 2022
@saleweaver
Copy link
Owner

Thx, I release now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants