Stores

Vendor docs

https://advertising.amazon.com/API/docs/en-us/sponsored-brands/3-0/openapi/prod

Specification

https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/sponsored-brands/3-0/openapi.yaml

class ad_api.api.sb.Stores(account: str = 'default', marketplace: Marketplaces = Marketplaces.EU, credentials: Dict[str, str] | None = None, proxies: Dict[str, str] | None = None, verify: bool = True, timeout: int | None = None, debug: bool = False, access_token: str | None = None, verify_additional_credentials: bool = True)

Use the Amazon Advertising API for Sponsored Brands for campaign, ad group, keyword, negative keyword, drafts, Stores, landing pages, and Brands management operations. For more information about Sponsored Brands, see the Sponsored Brands Support Center. For onboarding information, see the account setup topic.

### Request format

create_asset takes multipart/form-data with two parts, not JSON:

:header-rows: 1

Part

Contents

assetInfo

A JSON string: {"brandEntityId": "...", "mediaType": "brandLogo"}

asset

The image bytes. PNG, JPEG or GIF.

Required headers:

:header-rows: 1

Header

Value

Content-Type

multipart/form-data with boundary, set by requests.

Accept

*/*. A versioned media type answers 406.

Content-Disposition

attachment; filename="logo.png"

Note

mediaType is a string, not an object. The contract’s own example shows it as an object and that answers 400 The assetInfo field is invalid. brandEntityId is required for sellers even though the contract marks it optional, which applies to vendors only.

Image constraints: smaller than 1MB, at least 400x400 pixels.

### Example python

from ad_api.api.sb import Stores

stores = Stores(account='account_name', debug=False)

response = stores.create_asset(
    image='./logo.png',
    brandEntityId='ENTITY000000000000',
    mediaType='brandLogo',
)
print(response.payload)

### Notes

list_stores and get_store were removed: both used /v2/stores, which no longer exists. /v2/stores answers 404 Method Not Found and /v2/stores/{id} answers 404 Could not find resource.

list_assets(**kwargs) → ApiResponse

For sellers or vendors, gets an array of assets associated with the specified brand entity identifier. Vendors are not required to specify a brand entity identifier, and in this case all assets associated with the vendor are returned.

Keyword Args
query brandEntityId (string): For sellers, this field is required. It is the Brand entity identifier of the Brand for which assets are returned. This identifier is retrieved using the getBrands operation. For vendors, this field is optional. If a vendor does not specify this field, all assets associated with the vendor are returned. For more information about the difference between a seller and a vendor, see the Amazon Advertising FAQ. [required]
query mediaType (string): Specifies the media types used to filter the returned array. Currently, only the brandLogo type is supported. If not specified, all media types are returned. Available values : brandLogo, image [optional]
Returns:

ApiResponse

create_asset(image, brandEntityId, mediaType='brandLogo', filename=None, **kwargs) → ApiResponse

Creates a new image asset and stores it in the Store Assets Library.

The endpoint takes multipart/form-data with two parts, not JSON:

  • assetInfo A JSON string with brandEntityId and mediaType.

  • asset The image bytes. PNG, JPEG or GIF, under 1MB and at least 400x400 pixels.

Keyword Args

  • image (str or bytes): A file path, or the raw image bytes. [required]

  • brandEntityId (string): The Brand entity identifier. Required for sellers, optional for vendors. [required]

  • mediaType (string): Only brandLogo is supported. [optional]

  • filename (string): Name sent in Content-Disposition. Taken from the path when a path is given. [optional]

Returns:

ApiResponse

Documentation: https://advertising.amazon.com/API/docs/en-us/sponsored-brands/3-0/openapi#tag/Stores