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_assettakesmultipart/form-datawith two parts, not JSON::header-rows: 1 Part
Contents
assetInfoA JSON string:
{"brandEntityId": "...", "mediaType": "brandLogo"}assetThe image bytes. PNG, JPEG or GIF.
Required headers:
:header-rows: 1 Header
Value
Content-Typemultipart/form-datawith boundary, set by requests.Accept*/*. A versioned media type answers406.Content-Dispositionattachment; filename="logo.png"Note
mediaTypeis a string, not an object. The contract’s own example shows it as an object and that answers400 The assetInfo field is invalid.brandEntityIdis 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_storesandget_storewere removed: both used/v2/stores, which no longer exists./v2/storesanswers404 Method Not Foundand/v2/stores/{id}answers404 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-datawith two parts, not JSON:assetInfoA JSON string withbrandEntityIdandmediaType.assetThe 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): OnlybrandLogois supported. [optional]filename(string): Name sent inContent-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