Authorization

class sp_api.api.Authorization(marketplace: Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None, proxies=None, verify=True, timeout=None, version=None, credential_providers=None)

Authorization SP-API Client :link:

The Selling Partner API for Authorization helps developers manage authorizations and check the specific permissions associated with a given authorization.

grantless_scope: str = 'sellingpartnerapi::migration'
get_authorization_code(self, **kwargs) ApiResponse

With the getAuthorizationCode operation, you can request a Login With Amazon (LWA) authorization code that will allow you to call a Selling Partner API on behalf of a seller who has already authorized you to call Amazon Marketplace Web Service (Amazon MWS). You specify a developer ID, an MWS auth token, and a seller ID. Taken together, these represent the Amazon MWS authorization that the seller previously granted you. The operation returns an LWA authorization code that can be exchanged for a refresh token and access token representing authorization to call the Selling Partner API on the seller’s behalf. By using this API, sellers who have already authorized you for Amazon MWS do not need to re-authorize you for the Selling Partner API.

Usage Plan:

Rate (requests per second)

Burst

1

5

For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.

Examples

literal blocks:

res = Authorization().get_authorization_code(
    mwsAuthToken='test',
    developerId='test',
    sellingPartnerId='test'
)
Parameters:
  • sellingPartnerId (key) – string | * REQUIRED The seller ID of the seller for whom you are requesting Selling Partner API authorization. This must be the seller ID of the seller who authorized your application on the Marketplace Appstore.

  • developerId (key) – string | * REQUIRED Your developer ID. This must be one of the developer ID values that you provided when you registered your application in Developer Central.

  • mwsAuthToken (key) – string | * REQUIRED The MWS Auth Token that was generated when the seller authorized your application on the Marketplace Appstore.

Return type:

ApiResponse