python-amazon-ad-api 1.8.1__py3-none-any.whl → 1.8.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,22 @@ class AdGroups(Client):
42
42
  | **nextToken** (string) [optional] Token to navigate to the next page
43
43
 
44
44
  Headers
45
- | **Amazon-Ads-AccountId** (string) [optional] Advertiser account identifier
45
+ | **account_id** (string) -> Amazon-Ads-AccountId
46
+ | **manager_account_id** (string) -> Amazon-Ads-Manager-AccountId
47
+
48
+ Measured on 2026-11-15 against a global advertiser (eleven
49
+ marketplaces). The Scope header this client already sends filters the
50
+ results by marketplace, and neither of the two above improves on it:
51
+
52
+ no account header 200, same page as manager
53
+ manager_account_id 200, identical answer
54
+ account_id 400 "Multi marketplace query requests only
55
+ support query by primary resource id"
56
+ both 400, the same as account_id alone
57
+
58
+ So on a global account pass manager_account_id or nothing: account_id
59
+ breaks the call. Adding campaignIdFilter does not fix it, the refusal
60
+ is about the header and not about the body.
46
61
 
47
62
  Returns
48
63
  ApiResponse
@@ -51,6 +66,16 @@ class AdGroups(Client):
51
66
  """
52
67
  schema_version = 'application/json'
53
68
  headers = {"Accept": schema_version, "Content-Type": schema_version}
69
+
70
+ # Optional account headers, taken from kwargs and removed before the
71
+ # query is built: left in kwargs they would travel in the query string.
72
+ account_id = kwargs.pop('account_id', None)
73
+ manager_account_id = kwargs.pop('manager_account_id', None)
74
+ if account_id:
75
+ headers["Amazon-Ads-AccountId"] = account_id
76
+ if manager_account_id:
77
+ headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
78
+
54
79
  body = kwargs.pop('body', None)
55
80
  return self._request(kwargs.pop('path'), params=kwargs, headers=headers,
56
81
  **({'data': Utils.convert_body(body, False)} if body is not None else {}))
@@ -57,6 +57,18 @@ class LocationIndexes(Client):
57
57
  Keyword Args
58
58
  | **maxResults** (int): page size.
59
59
  | **nextToken** (string): the token from the previous page.
60
+ | **account_id** (string) -> Amazon-Ads-AccountId header.
61
+ | **manager_account_id** (string) -> Amazon-Ads-Manager-AccountId.
62
+
63
+ This family does not declare Amazon-Advertising-API-Scope in its
64
+ contract, and the Scope the client sends does not help: without one of
65
+ the two account headers the route answers 401, with or without Scope
66
+ (measured 2026-11-15). Either header alone unlocks it; both together
67
+ answer 400, the same Multi marketplace query refusal.
68
+
69
+ The call returns None when the request fails: an empty
70
+ locationIndexes list is a working call on an account with no indexes
71
+ created, which is not the same thing.
60
72
 
61
73
  Returns:
62
74
  | ApiResponse
@@ -65,6 +77,16 @@ class LocationIndexes(Client):
65
77
  """
66
78
  schema_version = 'application/json'
67
79
  headers = {"Accept": schema_version, "Content-Type": schema_version}
80
+
81
+ # Optional account headers, taken from kwargs and removed before the
82
+ # query is built: left in kwargs they would travel in the query string.
83
+ account_id = kwargs.pop('account_id', None)
84
+ manager_account_id = kwargs.pop('manager_account_id', None)
85
+ if account_id:
86
+ headers["Amazon-Ads-AccountId"] = account_id
87
+ if manager_account_id:
88
+ headers["Amazon-Ads-Manager-AccountId"] = manager_account_id
89
+
68
90
  return self._request(kwargs.pop('path'), params=kwargs, headers=headers)
69
91
 
70
92
  @sp_endpoint('/adsApi/v1/retrieve/locationIndexes', method='POST')
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.8.1"
1
+ __version__ = "1.8.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.8.1
3
+ Version: 1.8.2
4
4
  Summary: Python wrapper for the Amazon Advertising API
5
5
  Home-page: https://github.com/denisneuf/python-amazon-ad-api
6
6
  Author: Daniel Alvaro
@@ -249,8 +249,8 @@ except AdvertisingApiException as error:
249
249
 
250
250
  | Module | Vendor contract | Vendor docs |
251
251
  |---|---|---|
252
- | [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html) | [contract](https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/profiles/3-0/openapi.yaml) | [docs](https://advertising.amazon.com/API/docs/en-us/reference/profiles) |
253
- | [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/ManagerAccount_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/reference/v0/managerAccount) |
252
+ | [Profiles](https://python-amazon-ad-api.readthedocs.io/en/latest/api/profiles.html) | [contract](https://d3a0d0y2hgofx6.cloudfront.net/openapi/en-us/profiles/3-0/openapi.yaml) | [docs](https://advertising.amazon.com/API/docs/en-us/reference/2/profiles) |
253
+ | [Manager Accounts](https://python-amazon-ad-api.readthedocs.io/en/latest/api/manager_accounts.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/ManagerAccount_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/reference/1-0/managerAccount) |
254
254
  | [PortfoliosV3](https://python-amazon-ad-api.readthedocs.io/en/latest/api/portfoliosV3.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/Portfolios_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/reference/portfolios) |
255
255
  | [Invoices](https://python-amazon-ad-api.readthedocs.io/en/latest/api/invoices.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AdvertisingBilling_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/billing) |
256
256
  | [Billing](https://python-amazon-ad-api.readthedocs.io/en/latest/api/billing.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AdvertisingBilling_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/billing) |
@@ -317,6 +317,7 @@ except AdvertisingApiException as error:
317
317
  | [Geo Locations](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/geo_locations.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AmazonAdsAPIALLGeoLocationsContract_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/api-spec-v1-geolocations) |
318
318
  | [Location Indexes](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/location_indexes.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AmazonAdsAPIALLLocationIndexesContract_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/api-spec-v1-locationindexes) |
319
319
  | [Recommendation Types](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/recommendation_types.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AmazonAdsAPIALLRecommendationTypesContract_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/api-spec-v1-recommendation-types) |
320
+ | [Portfolios](https://python-amazon-ad-api.readthedocs.io/en/latest/v1/portfolios.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/AmazonAdsAPIALLPortfoliosContract_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/api-spec-v1-portfolios) |
320
321
 
321
322
  ### [Modules Available Sponsored Products](https://python-amazon-ad-api.readthedocs.io/en/latest/sp.html)
322
323
 
@@ -1,5 +1,5 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=6cud5pVpwnMsz6fxZVA6qWcQVSpLQXd0ddN6ip-1M_8,22
2
+ ad_api/version.py,sha256=d6593s-XBNvVxri9lr2qLUDZQ3Zk3-VXHEwdb4pj8qA,22
3
3
  ad_api/api/__init__.py,sha256=M07SD5BRC1L4_PqxLc8cKPI9Iq5zC2jPhkFUeHoh6CM,1632
4
4
  ad_api/api/account.py,sha256=CmOvCfHoPWaeTUJvtB0pNoNulZVSz4oMMCKIpVTpHos,2931
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
@@ -92,7 +92,7 @@ ad_api/api/sp/schedule_based_bid_optimization.py,sha256=G8VkS7iP1lTIAxZgbfRCLz8n
92
92
  ad_api/api/v1/__init__.py,sha256=K7rmsKJnWebiarPZknUIcXJKvoIDPI5dBVNrIJGWa2I,1370
93
93
  ad_api/api/v1/ad_associations.py,sha256=g5L8hAIagmsb-yQ09hP7z1zbVVe868NlpOOokv-Mouc,5812
94
94
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
95
- ad_api/api/v1/ad_groups.py,sha256=pQhCVdve_O6kbL4mBA5bxxhKcKNl_BKqa7z9DvrxwaM,12626
95
+ ad_api/api/v1/ad_groups.py,sha256=AcJuBswttESCFI7-XidA9mZPVZqp7MozYv8GwAzjYm4,13896
96
96
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
97
97
  ad_api/api/v1/advertiser_accounts.py,sha256=_Y8GTHgQ2G-RhNg4cuvvfXvjIhLzstQAGSyr1WMRRfg,5405
98
98
  ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=QFmcWMPwi0f7eW0Ox4pZCvMWHEzeeQc8dIq7_3eeg6Y,4898
@@ -103,7 +103,7 @@ ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,95
103
103
  ad_api/api/v1/geo_locations.py,sha256=gH1kR1rPQuIdzStB6wvWI40-XRo5yFyVI9AYYcjN5_8,2641
104
104
  ad_api/api/v1/label_object_associations.py,sha256=zXuD5cUAfqL-PRObvjOM54KC356HFqnzA5ehpGSJPYk,2597
105
105
  ad_api/api/v1/labels.py,sha256=jjPmafIQZTh99Ztj5MCcDC7UyoFFN0YuWdn2syqd3Yg,2438
106
- ad_api/api/v1/location_indexes.py,sha256=Z3-z3NShmUyHFYxnAQlSKOG3z0nek4UgTte8CIxCKiU,4712
106
+ ad_api/api/v1/location_indexes.py,sha256=F9mV1gBwIcFU4WAsYylgO98T_ZapWb_YoA8etJK2Xvo,5880
107
107
  ad_api/api/v1/manager_accounts.py,sha256=cNAs1Qq6SYG0y4_4UpNBDfItqBJ1NvYACsIvFc8h-rw,4980
108
108
  ad_api/api/v1/portfolios.py,sha256=W9NFWJFZ5y8H76WwSmznc6BFHRjDN8XSMxZ2d3-pe9o,7872
109
109
  ad_api/api/v1/recommendation_types.py,sha256=aEBfXu1EhzcRk9Nhin8_ieFiNnBiusX_vWviJw_qD08,2077
@@ -127,8 +127,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
127
127
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
128
128
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
129
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
130
- python_amazon_ad_api-1.8.1.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
131
- python_amazon_ad_api-1.8.1.dist-info/METADATA,sha256=lhKvzO63RXLbZ5LLXs2qdJ_xK0sSwvPSfyNRPFEu7eQ,43130
132
- python_amazon_ad_api-1.8.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
133
- python_amazon_ad_api-1.8.1.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
134
- python_amazon_ad_api-1.8.1.dist-info/RECORD,,
130
+ python_amazon_ad_api-1.8.2.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
131
+ python_amazon_ad_api-1.8.2.dist-info/METADATA,sha256=f8qsG5UPB_wdGiLlQS3Sc5IXi41hK7C8ec_LDKveXWU,43421
132
+ python_amazon_ad_api-1.8.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
133
+ python_amazon_ad_api-1.8.2.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
134
+ python_amazon_ad_api-1.8.2.dist-info/RECORD,,