python-amazon-ad-api 1.8.2__py3-none-any.whl → 2.0.1__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.
ad_api/api/__init__.py CHANGED
@@ -1,7 +1,6 @@
1
1
  from .account import Account
2
2
  from .profiles import Profiles
3
3
  from .manager_accounts import ManagerAccounts
4
- from .invoices import Invoices
5
4
  from .billing import Billing
6
5
  from .account_budgets import AccountBudgets
7
6
  from .eligibility import Eligibility
@@ -38,7 +37,6 @@ __all__ = [
38
37
  "sponsored_display",
39
38
  "Profiles",
40
39
  "ManagerAccounts",
41
- "Invoices",
42
40
  "Billing",
43
41
  "AccountBudgets",
44
42
  "Eligibility",
ad_api/api/billing.py CHANGED
@@ -64,8 +64,7 @@ class Billing(Client):
64
64
  Query
65
65
 
66
66
  - ``criteriaType`` (string): required. ``PAY_NOW`` or ``AUTO_PAY``. The
67
- service answers ``400 Value null at 'criteriaType' failed to satisfy
68
- constraint`` when it is missing. It does not go in the body; this route
67
+ service answers ``400 Value null at 'criteriaType' failed to satisfy constraint`` when it is missing. It does not go in the body; this route
69
68
  takes no body.
70
69
 
71
70
  Returns
@@ -136,8 +135,7 @@ class Billing(Client):
136
135
  Query
137
136
 
138
137
  - ``agreementType`` (string): required. ``AUTO_PAY`` or ``PAY_NOW``. The
139
- service answers ``400 Value null at 'agreementType' failed to satisfy
140
- constraint`` when it is missing. It does not go in the body; this route
138
+ service answers ``400 Value null at 'agreementType' failed to satisfy constraint`` when it is missing. It does not go in the body; this route
141
139
  takes no body.
142
140
 
143
141
  Returns
@@ -219,8 +217,7 @@ class Billing(Client):
219
217
  - ``sort`` (object): ``attribute`` and ``direction``. The only
220
218
  attributes the service accepts are ``invoiceIssuedDate`` and
221
219
  ``invoiceDueDate``; anything else answers
222
- ``400 Invalid input because of error(s): [sort:attribute field is
223
- invalid]``. Those are the names the answer uses, not the filter names:
220
+ ``400 Invalid input because of error(s): [sort:attribute field is invalid]``. Those are the names the answer uses, not the filter names:
224
221
  ``invoiceDate``, ``issuedDate``, ``dueDate``, ``amountDue`` and
225
222
  ``status`` are all refused.
226
223
  - ``maxResults`` (integer): page size.
@@ -268,8 +265,7 @@ class Billing(Client):
268
265
  .. warning::
269
266
 
270
267
  The service refuses marketplace accounts. Called from a regional
271
- seller account it answers ``400 The API doesnot support marketplace
272
- accounts``. It wants a Global, Manager or Sponsored Ads account.
268
+ seller account it answers ``400 The API doesnot support marketplace accounts``. It wants a Global, Manager or Sponsored Ads account.
273
269
 
274
270
  Returns
275
271
  ApiResponse with the profiles and the token for the next page.
@@ -304,8 +300,7 @@ class Billing(Client):
304
300
  .. warning::
305
301
 
306
302
  Same account restriction as ``list_billing_profiles``, and the
307
- message names what it wants: ``only Global, Manager and Sponsored
308
- Ads marketplace accounts are supported``.
303
+ message names what it wants: ``only Global, Manager and Sponsored Ads marketplace accounts are supported``.
309
304
 
310
305
  Returns
311
306
  ApiResponse with one entry per country and profile pairing.
@@ -549,3 +544,44 @@ class Billing(Client):
549
544
  }
550
545
  body = Utils.convert_body(kwargs.pop('body'), False)
551
546
  return self._request(kwargs.pop('path'), data=body, params=kwargs, headers=headers)
547
+
548
+ @sp_endpoint('/invoices', method='GET')
549
+ def list_invoices(self, **kwargs) -> ApiResponse:
550
+ r"""
551
+ Get invoices for advertiser. Requires one of these permissions: ["nemo_transactions_view","nemo_transactions_edit"]
552
+
553
+ query **invoiceStatuses**:*string* | Optional. Available values : ISSUED, PAID_IN_PART, PAID_IN_FULL, WRITTEN_OFF. (Not documented: ACCUMULATING)
554
+
555
+ query **count**:*string* | Optional. Number of records to include in the paged response. Defaults to 100. Cannot be combined with the cursor parameter.
556
+
557
+ query **cursor**:*string* | Optional. A cursor representing how far into a result set this query should begin. In the absence of a cursor the request will default to start index of 0 and page size of 100.
558
+
559
+
560
+ Returns:
561
+
562
+ ApiResponse whose payload carries a second layer::
563
+
564
+ {"status": "success",
565
+ "payload": {"nextCursor": "...", "invoiceSummaries": [...]}}
566
+
567
+ The invoices sit at ``res.payload["payload"]["invoiceSummaries"]``.
568
+ Reading ``res.payload["invoiceSummaries"]`` gives ``None``, because
569
+ that key belongs to the inner object.
570
+
571
+ """
572
+ return self._request(kwargs.pop('path'), params=kwargs)
573
+
574
+ @sp_endpoint('/invoices/{}', method='GET')
575
+ def get_invoice(self, invoiceId, **kwargs) -> ApiResponse:
576
+ r"""
577
+ Get invoice data by invoice ID. Requires one of these permissions: ["nemo_transactions_view","nemo_transactions_edit"]
578
+
579
+ path **invoiceId**:*string* | required. ID of invoice to fetch
580
+
581
+ Returns:
582
+
583
+ ApiResponse with the same two layers as ``list_invoices``: the
584
+ invoice data sits under ``res.payload["payload"]``.
585
+
586
+ """
587
+ return self._request(fill_query_params(kwargs.pop('path'), invoiceId), params=kwargs)
ad_api/api/eligibility.py CHANGED
@@ -74,13 +74,9 @@ class Eligibility(Client):
74
74
  product: Sponsored Products, Sponsored Brands, Sponsored Display,
75
75
  Stores, DirectToConsumer, Amazon Attribution and the rest.
76
76
 
77
- Two media types are declared:
78
-
79
- application/json the default shape, with skipChecks
80
- application/vnd.programeligibility.v2+json
81
- v2, with maxResults and nextToken
82
-
83
- Pass media_type='v2' for the paginated one.
77
+ Two media types are declared: application/json is the default shape, with
78
+ skipChecks, and application/vnd.programeligibility.v2+json is the v2 one,
79
+ with maxResults and nextToken. Pass media_type='v2' for the paginated one.
84
80
  """
85
81
 
86
82
  media_type = kwargs.pop('media_type', None)
ad_api/api/reports.py CHANGED
@@ -41,7 +41,31 @@ class Reports(Client):
41
41
  def get_report(self, reportId, **kwargs) -> ApiResponse:
42
42
  r"""
43
43
  Gets a generation status of a report by id. Uses the reportId value from the response of previously requested report via POST /reporting/reports operation. When status is set to COMPLETED, the report will be available to be downloaded at url.
44
- Report generation can take as long as 3 hours. Repeated calls to check report status may generate a 429 response, indicating that your requests have been throttled. To retrieve reports programmatically, your application logic should institute a delay between requests.
44
+ Report generation can take as long as 3 hours.
45
+
46
+ Throttling
47
+ Repeated calls to check report status may generate a 429 response.
48
+ Amazon publishes no numeric rate limit: the API answers 429 with a
49
+ Retry-After header in seconds, and the limit itself is dynamic and
50
+ follows the overall system load. For the reporting API it follows the
51
+ size of the per-region report queue, so the same polling rate can
52
+ pass at one hour and be rejected at a regional peak.
53
+
54
+ When the Retry-After header is present, wait at least that many
55
+ seconds. When it is missing, fall back to exponential backoff with a
56
+ ceiling and some jitter rather than a fixed delay: Amazon recommends
57
+ exponential backoff on a run of 429s, with longer periods for report
58
+ generation because the dynamic limits move slowly.
59
+
60
+ A 425 is not throttling. Sending the same create request while the
61
+ first is still running answers 425 "The Request is a duplicate of :
62
+ <reportId>". Take the id out of the message and poll it; resending
63
+ keeps answering 425 even though the report already exists. This is
64
+ not part of Amazon's rate limiting documentation, it is what the API
65
+ returns in practice.
66
+
67
+ Source: rate limiting page of the Amazon Ads API documentation,
68
+ https://advertising.amazon.com/API/docs/en-us/reference/concepts/rate-limiting
45
69
 
46
70
  Keyword Args
47
71
  | path **reportId** (number): The report identifier. [required]
@@ -11,8 +11,7 @@ class BudgetRules(Client):
11
11
 
12
12
  .. note::
13
13
  ``budget_recommendations`` only answers with the versioned media type.
14
- Sending ``application/json`` makes the router answer ``404 Could not find
15
- resource``, as if the route did not exist. Amazon routes on media type.
14
+ Sending ``application/json`` makes the router answer ``404 Could not find resource``, as if the route did not exist. Amazon routes on media type.
16
15
 
17
16
  .. note::
18
17
  An unknown ``budgetRuleId`` answers ``400 InvalidParameterValue`` with
@@ -209,8 +208,7 @@ class BudgetRules(Client):
209
208
 
210
209
  .. warning::
211
210
  This route only answers with its versioned media type. With
212
- ``application/json`` the service answers ``404 Could not find
213
- resource``, which reads like a missing route but is only the wrong
211
+ ``application/json`` the service answers ``404 Could not find resource``, which reads like a missing route but is only the wrong
214
212
  media type.
215
213
  """
216
214
  return self._request(kwargs.pop('path'),
@@ -93,8 +93,7 @@ class CampaignsV4(Client):
93
93
 
94
94
  .. note::
95
95
  This route takes ``application/vnd.sbinsights.v4+json``, not the
96
- campaigns media type. With ``application/json`` it answers ``404
97
- Could not find resource``, so the versioned type is what routes it.
96
+ campaigns media type. With ``application/json`` it answers ``404 Could not find resource``, so the versioned type is what routes it.
98
97
 
99
98
  .. note::
100
99
  An empty body answers ``400`` naming ``adGroups``, which is the only
@@ -22,8 +22,7 @@ class Migration(Client):
22
22
  type; a wrong one reads exactly like a missing route.
23
23
 
24
24
  .. note::
25
- ``migration_job_status`` and ``migration_job_results`` answer ``500
26
- INTERNAL_ERROR`` for a job identifier that does not exist, instead of a
25
+ ``migration_job_status`` and ``migration_job_results`` answer ``500 INTERNAL_ERROR`` for a job identifier that does not exist, instead of a
27
26
  400 or a 404. The routes are live; the service trips over an unknown id.
28
27
  """
29
28
 
@@ -10,8 +10,7 @@ class OptimizationRules(Client):
10
10
  service routes on it:
11
11
 
12
12
  .. warning::
13
- With ``application/json`` the router answers ``404 Could not find
14
- resource`` on every route here, which reads like a missing route but is
13
+ With ``application/json`` the router answers ``404 Could not find resource`` on every route here, which reads like a missing route but is
15
14
  only the wrong media type. Verified on ``list`` and ``recommendations``.
16
15
 
17
16
  The two read routes were probed against a live account; the four write routes
ad_api/api/sb/reports.py CHANGED
@@ -47,6 +47,24 @@ class Reports(Client):
47
47
  Request body
48
48
  | **creativeType** (string): [optional] Set to `video` to retrieve a Sponsored Brands video report.
49
49
 
50
+ Throttling
51
+ Polling this route can answer 429. Amazon publishes no numeric rate
52
+ limit: the limit is dynamic and follows the overall system load, and
53
+ for the reporting API it follows the size of the per-region report
54
+ queue, so the same polling rate can pass at one hour and be rejected
55
+ at a regional peak.
56
+
57
+ A 429 carries a Retry-After header in seconds. When it is missing,
58
+ fall back to exponential backoff with a ceiling and some jitter
59
+ rather than a fixed delay.
60
+
61
+ A 425 on the create call is not throttling: "The Request is a
62
+ duplicate of : <reportId>" means the report already exists. Take
63
+ that id and poll it instead of creating another.
64
+
65
+ Source: rate limiting page of the Amazon Ads API documentation,
66
+ https://advertising.amazon.com/API/docs/en-us/reference/concepts/rate-limiting
67
+
50
68
  Returns:
51
69
  ApiResponse
52
70
  """
ad_api/api/sd/reports.py CHANGED
@@ -47,6 +47,24 @@ class Reports(Client):
47
47
  Keyword Args
48
48
  | path **reportId** (string): [required] The report identifier.
49
49
 
50
+ Throttling
51
+ Polling this route can answer 429. Amazon publishes no numeric rate
52
+ limit: the limit is dynamic and follows the overall system load, and
53
+ for the reporting API it follows the size of the per-region report
54
+ queue, so the same polling rate can pass at one hour and be rejected
55
+ at a regional peak.
56
+
57
+ A 429 carries a Retry-After header in seconds. When it is missing,
58
+ fall back to exponential backoff with a ceiling and some jitter
59
+ rather than a fixed delay.
60
+
61
+ A 425 on the create call is not throttling: "The Request is a
62
+ duplicate of : <reportId>" means the report already exists. Take
63
+ that id and poll it instead of creating another.
64
+
65
+ Source: rate limiting page of the Amazon Ads API documentation,
66
+ https://advertising.amazon.com/API/docs/en-us/reference/concepts/rate-limiting
67
+
50
68
  Returns:
51
69
  ApiResponse
52
70
  """
ad_api/api/sp/__init__.py CHANGED
@@ -18,6 +18,9 @@ from .budget_rules_recommendations import BudgetRulesRecommendations
18
18
  from .product_recommendations import ProductRecommendations
19
19
  from .campaigns_budget_usage import CampaignsBudgetUsage
20
20
  from .schedule_based_bid_optimization import ScheduleBasedBidOptimizationRules
21
+ from .target_promotion_groups import TargetPromotionGroups
22
+ from .keyword_groups_recommendations import KeywordGroupsRecommendations
23
+ from .global_recommendations import GlobalRecommendations
21
24
 
22
25
  __all__ = [
23
26
  "CampaignsV3",
@@ -40,4 +43,7 @@ __all__ = [
40
43
  "ProductRecommendations",
41
44
  "CampaignsBudgetUsage",
42
45
  "ScheduleBasedBidOptimizationRules",
46
+ "TargetPromotionGroups",
47
+ "KeywordGroupsRecommendations",
48
+ "GlobalRecommendations",
43
49
  ]
@@ -2,9 +2,46 @@ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
2
 
3
3
 
4
4
  class InitialBudgetRecommendation(Client):
5
- @sp_endpoint('/sp/campaigns/initialbudgetrecommendation', method='POST')
5
+ @sp_endpoint('/sp/campaigns/initialBudgetRecommendation', method='POST')
6
6
  def initial_campaign_budget_recommendation(self, **kwargs) -> ApiResponse:
7
+ r"""
8
+ Creates a daily budget recommendation, with benchmark metrics, while
9
+ creating a new campaign. Nothing is created and nothing is charged.
10
+
11
+ The path carries a capital B: initialBudgetRecommendation. Spelled in
12
+ lower case the gateway does not recognise the route and answers 403
13
+ IncompleteSignatureException, so the case matters here.
14
+
15
+ Request Body [Required]
16
+ | **adGroups** (array): exactly one ad group.
17
+ | **asins** (array): [required] 1 to 50 ASINs.
18
+ | **targetingExpressions** (array): [required] 1 to 100.
19
+ | **type** (string): [required] CLOSE_MATCH, COMPLEMENTS,
20
+ | KEYWORD_BROAD_MATCH, KEYWORD_EXACT_MATCH, KEYWORD_PHRASE_MATCH,
21
+ | LOOSE_MATCH or SUBSTITUTES.
22
+ | **value** (string): [required] must be empty when targetingType
23
+ | is auto. The service rejects a non-empty value with
24
+ | "Targeting expression's value should be empty for auto".
25
+ | **bid** (number): [required] the service rejects a null bid with
26
+ | "TargetingExpression bid cannot be null", even though the
27
+ | contract does not declare it.
28
+ | **bidding** (object): [required]
29
+ | **strategy** (string): [required] AUTO_FOR_SALES,
30
+ | LEGACY_FOR_SALES or MANUAL.
31
+ | **adjustments** (array): up to 2 placement adjustments.
32
+ | **targetingType** (string): [required] auto or manual.
33
+ | **startDate** (string): YYYYMMDD.
34
+ | **endDate** (string): YYYYMMDD.
35
+
36
+ Returns:
37
+ ApiResponse
38
+ dailyBudget, recommendationId, benchmark and specialEvents.
39
+ A dailyBudget of -1 means there is not enough information to
40
+ produce a recommendation.
41
+
42
+ """
43
+
7
44
  json_version = 'application/vnd.spinitialbudgetrecommendation.v3.4+json'
8
45
 
9
- headers = {"Content-Type": json_version}
46
+ headers = {"Accept": json_version, "Content-Type": json_version}
10
47
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -244,3 +244,44 @@ class BudgetRules(Client):
244
244
 
245
245
  """
246
246
  return self._request(fill_query_params(kwargs.pop('path'), budgetRuleId), params=kwargs)
247
+
248
+ @sp_endpoint('/sp/budgetRulesAssociation', method='POST')
249
+ def associate_budget_rules(self, **kwargs) -> ApiResponse:
250
+ r"""
251
+ Associates budget rules to one or more campaigns.
252
+
253
+ A maximum of 250 rules can be associated to a campaign, and each rule
254
+ name associated to a campaign must be unique.
255
+
256
+ Request Body [Required]
257
+ | **budgetRulesAssociations** (array): up to 50 items.
258
+ | **budgetRuleId** (string): [required] The rule identifier.
259
+ | **campaignId** (string): [required] The campaign identifier.
260
+
261
+ Returns:
262
+
263
+ ApiResponse
264
+
265
+ """
266
+ json_version = 'application/json'
267
+ headers = {"Accept": json_version, "Content-Type": json_version}
268
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
269
+
270
+ @sp_endpoint('/sp/budgetRulesAssociation/delete', method='POST')
271
+ def disassociate_budget_rules(self, **kwargs) -> ApiResponse:
272
+ r"""
273
+ Disassociates budget rules from one or more campaigns.
274
+
275
+ Request Body [Required]
276
+ | **budgetRulesDisAssociations** (array): up to 50 items.
277
+ | **budgetRuleId** (string): [required] The rule identifier.
278
+ | **campaignId** (string): [required] The campaign identifier.
279
+
280
+ Returns:
281
+
282
+ ApiResponse
283
+
284
+ """
285
+ json_version = 'application/json'
286
+ headers = {"Accept": json_version, "Content-Type": json_version}
287
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -17,3 +17,28 @@ class BudgetRulesRecommendations(Client):
17
17
  contentType = 'application/vnd.spbudgetrulesrecommendation.v' + str(version) + '+json'
18
18
  headers = {'Content-Type': contentType, "Accept": contentType}
19
19
  return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
20
+
21
+ @sp_endpoint('/sp/v1/events', method='POST')
22
+ def list_rule_events(self, **kwargs) -> ApiResponse:
23
+ r"""
24
+ Gets every special event, individual and grouped, with the date range
25
+ suggested for each one.
26
+
27
+ A rule enables an automatic budget increase for a date range or for a
28
+ special event; this route is what tells you which events exist and
29
+ when, so a rule can point at one.
30
+
31
+ The body is empty and, unusually for this resource, the content type is
32
+ plain application/json rather than one of the application/vnd.sp...
33
+ types.
34
+
35
+ Returns:
36
+
37
+ ApiResponse
38
+ events and groupedEvents, each with its suggested date range.
39
+
40
+ """
41
+ json_version = 'application/json'
42
+
43
+ headers = {"Accept": json_version, "Content-Type": json_version}
44
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body', {}), False), params=kwargs, headers=headers)
@@ -1,4 +1,4 @@
1
- from ad_api.base import Client, sp_endpoint, ApiResponse
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
2
 
3
3
 
4
4
  class CampaignsRecommendations(Client):
@@ -17,3 +17,33 @@ class CampaignsRecommendations(Client):
17
17
 
18
18
  """
19
19
  return self._request(kwargs.pop('path'), params=kwargs)
20
+
21
+ @sp_endpoint('/sp/campaign/recommendations', method='POST')
22
+ def fetch_campaigns_recommendations(self, **kwargs) -> ApiResponse:
23
+ r"""
24
+ Gets the top consolidated recommendations for the campaigns named in the
25
+ body, one recommendation type per campaign. Refreshed every day.
26
+
27
+ The GET on the same path takes no body and returns every recommendation
28
+ the account has; this POST narrows it to the campaigns and types asked
29
+ for. It uses its own content type, v2, where the GET uses v1.
30
+
31
+ Request Body [Required]
32
+ | **campaigns** (array): 1 to 10 campaigns.
33
+ | **campaignId** (string): [required] The campaign identifier.
34
+ | **recommendationType** (string): [required] one of
35
+ | BIDDING_STRATEGY, BUDGET_STRATEGY, KEYWORD, KEYWORD_GROUP,
36
+ | PLACEMENT_BIDDING, SHOPPER_COHORT.
37
+ | **maxResults** (integer): 1 to 5. Defaults to 1.
38
+ | **nextToken** (string): Token for the next page.
39
+
40
+ Returns:
41
+
42
+ ApiResponse
43
+
44
+ """
45
+ json_version = 'application/vnd.spgetcampaignrecommendationsrequest.v2+json'
46
+ response_version = 'application/vnd.spgetcampaignrecommendationsresponse.v2+json'
47
+
48
+ headers = {"Accept": response_version, "Content-Type": json_version}
49
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -0,0 +1,97 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class GlobalRecommendations(Client):
5
+ r"""
6
+ Amazon Ads API - Sponsored Products recommendations across marketplaces.
7
+
8
+ These two routes answer for several countries at once, given the same
9
+ product or the same ad group in each of them, where the per-marketplace
10
+ routes answer for one country.
11
+
12
+ Both are version 5 of the same idea and both take a recommendationType
13
+ that decides which of two request shapes is expected:
14
+
15
+ BIDS_FOR_NEW_AD_GROUP / KEYWORDS_FOR_ASINS
16
+ a list of products, one per country
17
+ BIDS_FOR_EXISTING_AD_GROUP / KEYWORDS_FOR_ADGROUP
18
+ a campaign and ad group that already exist
19
+ """
20
+
21
+ @sp_endpoint('/sp/global/targets/bid/recommendations', method='POST')
22
+ def get_multi_country_bid_recommendations(self, **kwargs) -> ApiResponse:
23
+ r"""
24
+ Recommends bids for targets across several countries.
25
+
26
+ Two request shapes, chosen by recommendationType:
27
+
28
+ BIDS_FOR_EXISTING_AD_GROUP
29
+ adGroupId, campaignId, targetingExpressions, countryCodes.
30
+ BIDS_FOR_NEW_AD_GROUP
31
+ bidding, countryCodes, targetingExpressions, products.
32
+ No adGroupId and no campaignId, the ad group does not exist yet.
33
+
34
+ Request Body [Required]
35
+ | **recommendationType** (string): [required] one of the two above.
36
+ | **countryCodes** (array): target countries. Required by the
37
+ | new-ad-group shape.
38
+ | **targetingExpressions** (array): required by both shapes.
39
+ | **includeAnalysis** (boolean): defaults to false. Set it to true to
40
+ | get the estimated impressions for a range of eight bids per
41
+ | target. The contract says the analysis is only available for
42
+ | existing ad groups in the US marketplace.
43
+ | **adGroupId** (string): existing ad group only.
44
+ | **campaignId** (string): existing ad group only.
45
+ | **products** (array): new ad group only, a list of countryProducts.
46
+ | **bidding** (object): new ad group only.
47
+ | **strategy** (string): [required] the bidding strategy.
48
+ | **adjustments** (array): 1 to 3 placement adjustments.
49
+
50
+ A 422 comes back when the marketplace or the target is not supported.
51
+
52
+ Returns:
53
+
54
+ ApiResponse
55
+
56
+ """
57
+ json_version = 'application/json'
58
+ response_version = 'application/vnd.spthemebasedglobalbidrecommendation.v1+json'
59
+
60
+ headers = {"Accept": response_version, "Content-Type": json_version}
61
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
62
+
63
+ @sp_endpoint('/sp/global/targets/keywords/recommendations/list', method='POST')
64
+ def list_multi_country_keyword_recommendations(self, **kwargs) -> ApiResponse:
65
+ r"""
66
+ Recommends keyword targets, with their bids, across several countries.
67
+
68
+ Two request shapes, chosen by recommendationType:
69
+
70
+ KEYWORDS_FOR_ASINS
71
+ products, a list of countryProducts where each item maps a
72
+ two-letter country code to a product.
73
+ KEYWORDS_FOR_ADGROUP
74
+ adGroupId and campaignId of a global campaign and ad group.
75
+
76
+ Request Body [Required]
77
+ | **recommendationType** (string): [required] KEYWORDS_FOR_ASINS or
78
+ | KEYWORDS_FOR_ADGROUP.
79
+ | **products** (array): up to 50 countryProducts.
80
+ | **targets** (array): up to 100 countryTargets. Each one is an
81
+ | object with matchType and countryKeywords, a map from a
82
+ | two-letter country code to a keyword object.
83
+ | **adGroupId** (string): global ad group, second shape only.
84
+ | **campaignId** (string): global campaign, second shape only.
85
+
86
+ Each country is processed in parallel with the rules of version 5 of the
87
+ per-marketplace keyword recommendation route.
88
+
89
+ Returns:
90
+
91
+ ApiResponse
92
+
93
+ """
94
+ json_version = 'application/vnd.spkeywordsrecommendation.v5+json'
95
+
96
+ headers = {"Accept": json_version, "Content-Type": json_version}
97
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -0,0 +1,34 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class KeywordGroupsRecommendations(Client):
5
+ r"""
6
+ Amazon Ads API - Sponsored Products keyword group recommendations.
7
+
8
+ Keyword Groups is a control for keyword-based campaigns: a collection of
9
+ keywords that reaches a relevant audience as one unit. Once a keyword group
10
+ is created its performance shows up in the search terms report.
11
+
12
+ The route is in beta.
13
+ """
14
+
15
+ @sp_endpoint('/sp/targeting/recommendations/keywordGroups', method='POST')
16
+ def get_keyword_group_recommendations(self, **kwargs) -> ApiResponse:
17
+ r"""
18
+ Recommends keyword group targets for a list of ad ASINs.
19
+
20
+ Request Body [Required]
21
+ | **asins** (array): [required] 1 to 1000 ASINs, 32 characters each.
22
+ | **countryCode** (string): origin country of the ASIN list, used to
23
+ | generate the recommendations.
24
+ | **nextToken** (string): set when the previous answer had more items.
25
+
26
+ Returns:
27
+
28
+ ApiResponse
29
+
30
+ """
31
+ json_version = 'application/vnd.spkeywordgroupsrecommendations.v1.0+json'
32
+
33
+ headers = {"Accept": json_version, "Content-Type": json_version}
34
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -0,0 +1,141 @@
1
+ from ad_api.base import Client, sp_endpoint, ApiResponse, Utils
2
+
3
+
4
+ class TargetPromotionGroups(Client):
5
+ r"""
6
+ Amazon Ads API - Sponsored Products target promotion groups.
7
+
8
+ A target promotion group ties one auto-targeting ad group to the manual
9
+ ad groups that receive the targets promoted out of it: one keyword
10
+ targeting ad group and one product targeting ad group. The auto ad group
11
+ discovers search terms, the manual ad groups carry the promoted targets.
12
+ """
13
+
14
+ @sp_endpoint('/sp/targetPromotionGroups/list', method='POST')
15
+ def list_target_promotion_groups(self, version: int = 1, **kwargs) -> ApiResponse:
16
+ r"""
17
+ list_target_promotion_groups(body: (dict, str)) -> ApiResponse
18
+
19
+ Returns the target promotion groups of an advertiser, and optionally
20
+ of one ad group or one target promotion group.
21
+
22
+ Request Body [optional]
23
+ | **adGroupIdFilter** (object): Ad group identifiers to filter by.
24
+ | **include** (array of string)
25
+ | **targetPromotionGroupIdFilter** (object): Target promotion group identifiers.
26
+ | **include** (array of string)
27
+ | **maxResults** (int): 1 to 1000. Defaults to 1000.
28
+ | **nextToken** (string): Token for the next page.
29
+
30
+ Returns:
31
+ ApiResponse
32
+ """
33
+
34
+ json_version = "application/vnd.sptargetpromotiongroup.v" + str(version) + "+json"
35
+
36
+ headers = {"Accept": json_version, "Content-Type": json_version}
37
+
38
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body', {}), False), params=kwargs, headers=headers)
39
+
40
+ @sp_endpoint('/sp/targetPromotionGroups/targets/list', method='POST')
41
+ def list_target_promotion_group_targets(self, version: int = 1, **kwargs) -> ApiResponse:
42
+ r"""
43
+ list_target_promotion_group_targets(body: (dict, str)) -> ApiResponse
44
+
45
+ Returns the targets created through target promotion groups, for an
46
+ advertiser and optionally for one target promotion group.
47
+
48
+ Request Body [optional]
49
+ | **adGroupIdFilter** (object)
50
+ | **include** (array of string)
51
+ | **targetPromotionGroupIdFilter** (object)
52
+ | **include** (array of string)
53
+ | **maxResults** (int): 1 to 1000. Defaults to 1000.
54
+ | **nextToken** (string): Token for the next page.
55
+
56
+ Returns:
57
+ ApiResponse
58
+ """
59
+
60
+ json_version = "application/vnd.sptargetpromotiongrouptarget.v" + str(version) + "+json"
61
+
62
+ headers = {"Accept": json_version, "Content-Type": json_version}
63
+
64
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body', {}), False), params=kwargs, headers=headers)
65
+
66
+ @sp_endpoint('/sp/targetPromotionGroups/recommendations', method='POST')
67
+ def get_target_promotion_groups_recommendations(self, **kwargs) -> ApiResponse:
68
+ r"""
69
+ get_target_promotion_groups_recommendations(body: (dict, str)) -> ApiResponse
70
+
71
+ Retrieves keyword and product targets of an auto-targeting campaign as
72
+ recommendations for promoting them to a manual-targeting campaign, based
73
+ on performance heuristics of those targets.
74
+
75
+ Request Body [optional]
76
+ | **adGroupIdFilter** (object)
77
+ | **include** (array of string)
78
+ | **adIdFilter** (object)
79
+ | **include** (array of string)
80
+ | **campaignIdFilter** (object)
81
+ | **include** (array of string)
82
+ | **maxResults** (int): 1 to 1000. Defaults to 1000.
83
+ | **nextToken** (string): Token for the next page.
84
+
85
+ Returns:
86
+ ApiResponse
87
+ """
88
+
89
+ json_version = "application/vnd.spTargetPromotionGroupsRecommendations.v1+json"
90
+
91
+ headers = {"Accept": json_version, "Content-Type": json_version}
92
+
93
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body', {}), False), params=kwargs, headers=headers)
94
+
95
+ @sp_endpoint('/sp/targetPromotionGroups', method='POST')
96
+ def create_target_promotion_groups(self, version: int = 1, **kwargs) -> ApiResponse:
97
+ r"""
98
+ create_target_promotion_groups(body: (dict, str)) -> ApiResponse
99
+
100
+ Creates a target promotion group, grouping the auto-targeting ad group
101
+ with the manual keyword targeting ad group and the manual product
102
+ targeting ad group.
103
+
104
+ Request Body [required]
105
+ | **adGroupId** (string): Source ad group of the auto-targeting campaign.
106
+ | **adIds** (array of string): Product ads of that ad group. All the
107
+ | product ads are used when the list is omitted.
108
+ | **existingCampaignDetails** (object): Existing manual ad groups.
109
+ | **newCampaignDetails** (object): Manual campaigns and ad groups to create.
110
+
111
+ Returns:
112
+ ApiResponse
113
+ """
114
+
115
+ json_version = "application/vnd.sptargetpromotiongroup.v" + str(version) + "+json"
116
+
117
+ headers = {"Accept": json_version, "Content-Type": json_version}
118
+
119
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
120
+
121
+ @sp_endpoint('/sp/targetPromotionGroups/targets', method='POST')
122
+ def create_target_promotion_group_targets(self, version: int = 1, **kwargs) -> ApiResponse:
123
+ r"""
124
+ create_target_promotion_group_targets(body: (dict, str)) -> ApiResponse
125
+
126
+ Creates keyword and/or product targets in the manual ad group that is
127
+ part of the target promotion group.
128
+
129
+ Request Body [required]
130
+ | **targetPromotionGroupId** (string): Where the targets are added.
131
+ | **targets** (array): Up to 1000 targets.
132
+
133
+ Returns:
134
+ ApiResponse
135
+ """
136
+
137
+ json_version = "application/vnd.sptargetpromotiongrouptarget.v" + str(version) + "+json"
138
+
139
+ headers = {"Accept": json_version, "Content-Type": json_version}
140
+
141
+ return self._request(kwargs.pop('path'), data=Utils.convert_body(kwargs.pop('body'), False), params=kwargs, headers=headers)
@@ -47,13 +47,11 @@ class AdGroups(Client):
47
47
 
48
48
  Measured on 2026-11-15 against a global advertiser (eleven
49
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
50
+ results by marketplace, and neither of the two above improves on it.
51
+ Sending no account header answers 200 with the same page as sending
52
+ manager_account_id, which is identical. Sending account_id answers 400
53
+ "Multi marketplace query requests only support query by primary resource
54
+ id", and sending both answers the same 400 as account_id alone.
57
55
 
58
56
  So on a global account pass manager_account_id or nothing: account_id
59
57
  breaks the call. Adding campaignIdFilter does not fix it, the refusal
@@ -15,7 +15,7 @@ class AdvertiserAccounts(Client):
15
15
  mutable: currency, time zone, display name, industry, manager link.
16
16
 
17
17
  Unlike Ads, Targets or AdExtensions this is not an ad-product resource, so
18
- there is no ``adProductFilter```; querying is by ``advertiserAccountIdFilter``
18
+ there is no ``adProductFilter``; querying is by ``advertiserAccountIdFilter``
19
19
  or ``isGlobalAccountFilter``.
20
20
 
21
21
  ``managerAccountId`` decides what the account can run: without it the account
@@ -62,9 +62,9 @@ class AdvertiserAccounts(Client):
62
62
  | **businessDetails** (list, exactly 1) [required]
63
63
  Carries either ``addressToken`` for an existing selling account
64
64
  address, or ``address`` when that account has none. Also accepts
65
- ``businessRegistrationNumber`` and ``website`.
65
+ ``businessRegistrationNumber`` and ``website``.
66
66
  | **currencyCode** (string) [optional] Enum of 34 ISO codes,
67
- including ``EUR``, ``USD``, ``GBP`
67
+ including ``EUR``, ``USD``, ``GBP``
68
68
  | **displayName** (string) [optional] name shown for the account
69
69
  | **industryVertical** (string) [optional] Enum of 19 sectors
70
70
  | **isGlobalAccount** (boolean) [optional]
@@ -30,8 +30,7 @@ class BrandStoreEditionPublishVersions(Client):
30
30
  and publish status are all required, each accepting exactly one value.
31
31
 
32
32
  ``StorePublishStatus`` declares two values but the service accepts only one:
33
- asking for ``REVIEW_IN_PROGRESS`` answers ``400 Only DRAFT status query is
34
- supported``. The enum is honest about what exists in the data model, not
33
+ asking for ``REVIEW_IN_PROGRESS`` answers ``400 Only DRAFT status query is supported``. The enum is honest about what exists in the data model, not
35
34
  about what can be queried.
36
35
 
37
36
  The ``storeEditionPublishId`` in the answer is not a plain identifier but a
@@ -52,7 +52,7 @@ class BrandStorePages(Client):
52
52
  Returns
53
53
  ApiResponse. ``payload`` holds ``brandStorePages`` and ``nextToken``.
54
54
  Each page carries ``storeId``, ``editionId``, ``pageId``, ``pageType``,
55
- ``content`` and, when published, ``storeEditionPublishId`.
55
+ ``content`` and, when published, ``storeEditionPublishId``.
56
56
  """
57
57
  headers = {"Accept": "application/json", "Content-Type": "application/json"}
58
58
  return self._request(
ad_api/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.8.2"
1
+ __version__ = "2.0.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-amazon-ad-api
3
- Version: 1.8.2
3
+ Version: 2.0.1
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
@@ -245,6 +245,22 @@ except AdvertisingApiException as error:
245
245
  ```
246
246
 
247
247
 
248
+ ### Migrating from 1.x
249
+
250
+ `ad_api.api.Invoices` no longer exists. Amazon serves `/invoices` and
251
+ `/invoices/{invoiceId}` from the same contract as the rest of billing, so both
252
+ methods moved to `Billing`:
253
+
254
+ ```python
255
+ # before
256
+ from ad_api.api import Invoices
257
+ Invoices(account=store).list_invoices()
258
+
259
+ # now
260
+ from ad_api.api import Billing
261
+ Billing(account=store).list_invoices()
262
+ ```
263
+
248
264
  ### [Modules Available Common Resources](https://python-amazon-ad-api.readthedocs.io/en/latest/api.html)
249
265
 
250
266
  | Module | Vendor contract | Vendor docs |
@@ -252,7 +268,6 @@ except AdvertisingApiException as error:
252
268
  | [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
269
  | [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
270
  | [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
- | [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
271
  | [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) |
257
272
  | [Account Budgets](https://python-amazon-ad-api.readthedocs.io/en/latest/api/account_budgets.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/Advertisers_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/account-budgets/) |
258
273
  | [Audiences](https://python-amazon-ad-api.readthedocs.io/en/latest/api/audiences.html) | [contract](https://d1y2lf8k3vrkfu.cloudfront.net/openapi/en-us/dest/Audiences_prod_3p.json) | [docs](https://advertising.amazon.com/API/docs/en-us/audiences/) |
@@ -1,19 +1,18 @@
1
1
  ad_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- ad_api/version.py,sha256=d6593s-XBNvVxri9lr2qLUDZQ3Zk3-VXHEwdb4pj8qA,22
3
- ad_api/api/__init__.py,sha256=M07SD5BRC1L4_PqxLc8cKPI9Iq5zC2jPhkFUeHoh6CM,1632
2
+ ad_api/version.py,sha256=wAxkK8w13vqoF47A8iqWdSlIgRRXmZiQ0R4wePZfzhs,22
3
+ ad_api/api/__init__.py,sha256=7Uqrkek5BFADpIb2Ctk-xRfSld4U4iYkvZLxtPx2CeU,1585
4
4
  ad_api/api/account.py,sha256=CmOvCfHoPWaeTUJvtB0pNoNulZVSz4oMMCKIpVTpHos,2931
5
5
  ad_api/api/account_budgets.py,sha256=jFce5eLWAFK3ydjnYR7_Sv7B0-gHTG5bMTx_TcHyy1A,2319
6
6
  ad_api/api/advertising_test_account.py,sha256=btOVbdk2tBDmyKSJaQbcIFyzNG8KFJVUmTe4p9xMhpU,1507
7
7
  ad_api/api/attribution.py,sha256=TWYJSEqG2Li2qQRSSv8GtE2WOiK_RJICCeyN-xVrF6A,7273
8
8
  ad_api/api/audiences.py,sha256=TQPt4avswFdCodNfQGDGxcJ2mY2LP2BfYvjxP6oJ0qY,3491
9
- ad_api/api/billing.py,sha256=pmBQzejCM8YIsI51KTVunDTVTKMIaox0D2B4acH4w6Y,23526
9
+ ad_api/api/billing.py,sha256=ZSRaEyepCRk0H9SK65A9VeR1kz0F0BDre6Nxxa497EE,25330
10
10
  ad_api/api/brand_metrics.py,sha256=DVg9qu_-sALxaQhQjRG6Isi_5SYxA5nmTg99jTe5Tls,9237
11
11
  ad_api/api/creative_assets.py,sha256=u0bCnioUFpGOQO5Z_MO0ErSLcAgSZB5GWM5wm2oW6L0,9687
12
- ad_api/api/eligibility.py,sha256=LS8CsTXRRVyBdVWOH_3cVybxTXUHahZMsrQHwdmuSxA,3893
12
+ ad_api/api/eligibility.py,sha256=3hKloUciUZ4CplJkaHvrteUEuhv37-sVrQUYnfIMuZU,3824
13
13
  ad_api/api/exports.py,sha256=keAy7JJJgfOBh6DHZCVzpfSV9Fb2vm4eluzB0JGyjp8,7758
14
14
  ad_api/api/history.py,sha256=tB4XawmQNxDMolaubDUjuIHtrYXRFuhOr4WCB8OJ1t8,2568
15
15
  ad_api/api/insights.py,sha256=b0m2_khfDGskbvn4sidsUpOvV-gr2bsjUup0kSo8HV8,2398
16
- ad_api/api/invoices.py,sha256=k3QYOM1B82tx9QSm-x3cDsDYVJ8E6eosQHSHgcYGcbY,1959
17
16
  ad_api/api/localization.py,sha256=HdkChAawloJ8zj5rCye9NVf7kLnQ7vW6aKsBLZ2W-gI,17158
18
17
  ad_api/api/manager_accounts.py,sha256=tnmJxOGIKTuJ3i8wciwfs931REW0aeNKQiqCpBrTZ2Y,5107
19
18
  ad_api/api/metadata.py,sha256=vWPbDGvEB72421fjSu4KrNkTdrIijHTPV8k36hceSbA,2406
@@ -21,7 +20,7 @@ ad_api/api/portfolios.py,sha256=Oe3LS2HsjMJSq1Id8cwOWrH2AiPMcBb7oTkFHjudnTI,7103
21
20
  ad_api/api/portfolios_v3.py,sha256=tpjf0MqTmJYRHrrSDfik8N0mWJFOo6aFGyTQdAPpimk,7440
22
21
  ad_api/api/profiles.py,sha256=mMSCUd5HdR_nFBDFngLY94tIfMCA4yGnjHz-PSMe0rE,7200
23
22
  ad_api/api/recommendations.py,sha256=_r4LsJkRTkiuOvzS7wrtR2ZmxA7gGe-T4jRDAqM6pRo,6198
24
- ad_api/api/reports.py,sha256=gNmDHLULD2uaJgsMpIbCX9kabwhMXRr9WfZBtHUdsOY,6043
23
+ ad_api/api/reports.py,sha256=YWXpeROlvL7bwKlj3cCfh9TYYS_iYBzmOyoCq4b1-o0,7278
25
24
  ad_api/api/stores.py,sha256=bvEguxr9A8Liy1TlVDDRNvJ_r5Twc9YGNfvsOpBdUNo,2616
26
25
  ad_api/api/stream.py,sha256=JpnF8SKniOAHiEnEq1RPrh6tNy-Q2-8GPBTmnlxEXqQ,2989
27
26
  ad_api/api/validation_configurations.py,sha256=BBoUv7iWJjB33Wp4pClNbzSUX9iNW36lJEIDn6CqgD8,4008
@@ -33,21 +32,21 @@ ad_api/api/sb/ads_v4.py,sha256=L0f2rCxUMPOVTFZ7jl43TQTkI7MOBdLZ7CGO-KxsXPQ,11501
33
32
  ad_api/api/sb/benchmarks.py,sha256=eeWv2rrRf4ttK-oI1EEEiui_rl_sxJk9yXcu6sDSfhg,3645
34
33
  ad_api/api/sb/bid_recommendations.py,sha256=ssO9XwYC9wK2GFaLtcsC-D3cZhDpCclcu1r01LTkZAw,2297
35
34
  ad_api/api/sb/brands.py,sha256=XIMDzV0tJoPiOcY0KoCKcyIwYLPMlJ-zkB2SeRVMF4Q,1376
36
- ad_api/api/sb/budget_rules.py,sha256=8hyJ4yD-myR4atYmTm8KsTSB5ZNfASGe2fxgwRv4SRs,10029
35
+ ad_api/api/sb/budget_rules.py,sha256=D3bvcIdgzMV5_dN3OFeNubwxgbOE97D0pGmMk-fn7ic,10009
37
36
  ad_api/api/sb/campaigns.py,sha256=41yRnrgvx4-9Zra7Zdqtzr2Ptq__YD-mHOWbACaEQOk,13674
38
- ad_api/api/sb/campaigns_v4.py,sha256=F50vFI2qyIKssEhPFCu4NXnq9trSIGywVNA5uVpp6rc,8504
37
+ ad_api/api/sb/campaigns_v4.py,sha256=jPP48mwvfKnbovDZmiV7qxhK1UHgQ3yTN9aPjvEXBwo,8492
39
38
  ad_api/api/sb/forecast.py,sha256=qf2ivhGX3_dv_uMGP9cmrt_x3S7QLg-P_5nCI8bAr00,3967
40
39
  ad_api/api/sb/keywords.py,sha256=P1dGqcLia349O0CwpBRURlIzgRc0cbFotkAGTSrErt4,7634
41
40
  ad_api/api/sb/keywords_recommendations.py,sha256=oA4FRBwDtk52SZK0RgWvjNQ7K2GX0G2zSoisJGiEYDw,629
42
41
  ad_api/api/sb/landing_page_asins.py,sha256=j3qi2-KccuEzGLZrl6EfZBSikW2R4B4l7TixpkAnTq8,1259
43
42
  ad_api/api/sb/media.py,sha256=JLLpBSSYa5hFEKS8Jf-cIyH8b8yjI23xqLg0KE9OZmw,3637
44
- ad_api/api/sb/migration.py,sha256=QfbtB9yhRDn6OyS-DSypETAhhp_WDJbELRUoBsxc07U,7086
43
+ ad_api/api/sb/migration.py,sha256=iMQQx-V0Prr-0-nLBFdHD5dgcZH5BJntLMp-4Qn0CCc,7078
45
44
  ad_api/api/sb/negative_keywords.py,sha256=uHLtOnu-OUHr23_Yh05qTSlVcnV2ITci6QvaY6n9f_I,6986
46
45
  ad_api/api/sb/negative_product_targeting.py,sha256=QbK1EhhzmnNOzGtbkrAZ4HS5OqiLU3nZBmsl1scd2D0,5085
47
- ad_api/api/sb/optimization_rules.py,sha256=aj9tZwKdaOzjnAN-8FHb49aiejNZKCCCcR8fjffH4k0,6802
46
+ ad_api/api/sb/optimization_rules.py,sha256=Pj0QNv8UrOho8kHRp6gy1Ag1DkpQVf4OAg2SJBuXPMw,6794
48
47
  ad_api/api/sb/product_targeting.py,sha256=o6aB3hIh9jKvi_uTXFi--1hpnPFuXzQ-U9N7VUP_Bz4,5362
49
48
  ad_api/api/sb/recommendations.py,sha256=6fEOdAMKKFGmdDX4Fh4NXHgzSTteu3iT6PuIWwjGWOg,1605
50
- ad_api/api/sb/reports.py,sha256=icw5DpRrqfj0idEo0NN1GPDpIWQun2h_c2Uwc7CpNUA,3801
49
+ ad_api/api/sb/reports.py,sha256=ocxUzPBvZuR19DQO1jGolZK1uvEAB207VebnaweWcqY,4742
51
50
  ad_api/api/sb/stores.py,sha256=g0NbaYcd49JOJg95l4hiyCEreSu7inoWRdbEwT32KgQ,4335
52
51
  ad_api/api/sb/targeting_categories.py,sha256=QqOB2vTiS5c8u9qvbjRpeKJdGBkMWfgwWSoF3h-Eg4c,5114
53
52
  ad_api/api/sb/targeting_recommendations.py,sha256=_7NxD5kC-Od11QOuLT03qpLVxEOIZgy-BtzniWK4CI8,2862
@@ -65,22 +64,24 @@ ad_api/api/sd/negative_product_targeting.py,sha256=E-iWKj4tApI9khxIW1eaVMYyJSMne
65
64
  ad_api/api/sd/product_ads.py,sha256=xrj7xjp5rzO7pVhZCCNLor2X2Ue-r_dxR1-SWbmA4no,7260
66
65
  ad_api/api/sd/product_targeting.py,sha256=w5BuMayi5emarC8neaijnHn_sh_LUgcyyq8nlPtRT1w,13461
67
66
  ad_api/api/sd/recommendations.py,sha256=cwNIlvc3bBnmzKCHmV4KFQP_F4Uora5J5VhRKQKXrtA,1436
68
- ad_api/api/sd/reports.py,sha256=qtzUCJdddYLNKJuJJPPPG6WcMsEUweF8ObU2zSsdpbk,4713
67
+ ad_api/api/sd/reports.py,sha256=xwLOMD_40h_AXM1oj0qwqYazOtw7lexBRpItn_cobkg,5654
69
68
  ad_api/api/sd/snapshots.py,sha256=0Km-7YGm1D_YsravmzomUDa91nVPQZFr_mww_skEwpw,3376
70
69
  ad_api/api/sd/targeting_recommendations.py,sha256=FmuJxGS5GIXod8iFTS1Ryls_-QFTdf8B3uWL_nne80U,3668
71
- ad_api/api/sp/__init__.py,sha256=FSa1GNhjWljF2S3QMXDUtVng3L1YoKeCyXQTro1hYHc,1704
70
+ ad_api/api/sp/__init__.py,sha256=yDBIZXh2PfQQXf95sxflqXNqw86-jlXGZWoHO5U5dis,1988
72
71
  ad_api/api/sp/ad_groups_v3.py,sha256=UCK0es4KvWcYMtlO01pel52T2ZBaWDgW0iGKYueK7Rg,5294
73
72
  ad_api/api/sp/bid_recommendations_v3.py,sha256=gcbPuunUo29SCynBwpvC0F-F3YE4_oNcFLCIOPXotmI,5366
74
- ad_api/api/sp/budget_initial_recommendation.py,sha256=xYmrbJ8AFxc4ineLMrQ6cT9kx2PQnalDXElntxAuobA,529
73
+ ad_api/api/sp/budget_initial_recommendation.py,sha256=10iz_mAUAQ4BY0hMqIUp6cOb7g4JXlRxlEot4pkXTnA,2442
75
74
  ad_api/api/sp/budget_recommendations.py,sha256=Ow8NbZyTua_YqNt_-JjM5dUQN8fq7B862WeQASTuXs8,954
76
- ad_api/api/sp/budget_rules.py,sha256=2fw3D9J-V39I5aFHeO7lj6i8SnXBz0SxOMcmJt59EIM,13113
77
- ad_api/api/sp/budget_rules_recommendations.py,sha256=MRRAWu3FICGrysMZy_JdNWCbr6E2X4_CsPZ3Fsru_qk,961
78
- ad_api/api/sp/campaign_consolidated_recommendations.py,sha256=AZS8A0ZH_GRCZ5uExqfaEN8xHhMNEbg6nSI6LkTsP8I,764
75
+ ad_api/api/sp/budget_rules.py,sha256=o5IlqDSaCb7iN_1j9z2Yem9CmAh_DdJeepcV38ebNGE,14770
76
+ ad_api/api/sp/budget_rules_recommendations.py,sha256=e_nhrHMymC1p-kL3JutGTtiI43q3wFt7ASkvXRBxcDo,1942
77
+ ad_api/api/sp/campaign_consolidated_recommendations.py,sha256=_5vDRTV4ertZOt0fHGgs6cHcgoVt7rJZbUucg5baRWE,2236
79
78
  ad_api/api/sp/campaign_negative_keywords_v3.py,sha256=3y5PHA_r6GtBAFbAXiGH5q6ByWsG2alA3DCqdRiaO3w,6592
80
79
  ad_api/api/sp/campaign_negative_targets.py,sha256=DTnPtGNie-CJutUYXp3Iu81cTtu4VsvknPaEDvxKJyA,5352
81
80
  ad_api/api/sp/campaigns_budget_usage.py,sha256=njn-Wd3xvbJbL5HMSNQK4RyxCgAflqUgVFo7XhlXmB8,862
82
81
  ad_api/api/sp/campaigns_v3.py,sha256=hT8vVmsvOxllgi9f069q4ha_Dy9Dfm12l2x0vXFvke4,7897
83
82
  ad_api/api/sp/campaings_optimization.py,sha256=CrH9x-KNTsRc56tn_TCDxDTZIF9pYdqDT48LTepys2w,6673
83
+ ad_api/api/sp/global_recommendations.py,sha256=CwadFPTsUqDHcInqHlt2wWVjdekvjaBXG172MPE75Gg,4422
84
+ ad_api/api/sp/keyword_groups_recommendations.py,sha256=XllPWIgvfachK508IhFMjZc5SoYeMszYceYlckeg-S8,1352
84
85
  ad_api/api/sp/keywords_v3.py,sha256=tvpNY0rzCeLVNGLdN2NNa8Y9DyAH9D3GQUnaEieYpXE,3850
85
86
  ad_api/api/sp/negative_keywords_v3.py,sha256=EwCTmQZTUvzaXSdbhOvM4WFJTpl6BsbeJ8DyOQ18r_Y,3914
86
87
  ad_api/api/sp/negative_product_targeting_v3.py,sha256=aAVwLialz5qxO1FfYwA1kJ8I6A8wB14-GBHB-i2tOEQ,6647
@@ -89,15 +90,16 @@ ad_api/api/sp/product_recommendations.py,sha256=vXoZIRqcFc5bo9MUprArKndxcEYe_Puy
89
90
  ad_api/api/sp/product_targeting_v3.py,sha256=vk_T0piHzP5uwt8HSHm5hFKP_0sXJD8nbyooPtM-BTs,9567
90
91
  ad_api/api/sp/ranked_keywords_recommendations.py,sha256=QYFje19TFmwhedh7sn5VJIypL8gp6d6tpBQCpf_SIXw,13094
91
92
  ad_api/api/sp/schedule_based_bid_optimization.py,sha256=G8VkS7iP1lTIAxZgbfRCLz8njw1DkVH9HQPOZ63pWNU,2371
93
+ ad_api/api/sp/target_promotion_groups.py,sha256=g5QbnFFRvzKdmS9blrD9IJcHtq2RtT9CzKlx_WWJd6s,6127
92
94
  ad_api/api/v1/__init__.py,sha256=K7rmsKJnWebiarPZknUIcXJKvoIDPI5dBVNrIJGWa2I,1370
93
95
  ad_api/api/v1/ad_associations.py,sha256=g5L8hAIagmsb-yQ09hP7z1zbVVe868NlpOOokv-Mouc,5812
94
96
  ad_api/api/v1/ad_extensions.py,sha256=kL-7xHaXXqb2jXTwZrY0oGttLAG0CW_IjBAqL_CI92U,5519
95
- ad_api/api/v1/ad_groups.py,sha256=AcJuBswttESCFI7-XidA9mZPVZqp7MozYv8GwAzjYm4,13896
97
+ ad_api/api/v1/ad_groups.py,sha256=Kuiho34wcJju0C_R1tk8kzYF7aoivgpxu15FqDIXnWE,13880
96
98
  ad_api/api/v1/ads.py,sha256=YwZGQ-4WuYquleELtwRI9L8w0fGw7FBRejQE-tZ5hKY,7941
97
- ad_api/api/v1/advertiser_accounts.py,sha256=_Y8GTHgQ2G-RhNg4cuvvfXvjIhLzstQAGSyr1WMRRfg,5405
98
- ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=QFmcWMPwi0f7eW0Ox4pZCvMWHEzeeQc8dIq7_3eeg6Y,4898
99
+ ad_api/api/v1/advertiser_accounts.py,sha256=iRChblxV0HihxgSZ-wn5vrZCDeOydSFmauxlVioWfJg,5406
100
+ ad_api/api/v1/brand_store_edition_publish_versions.py,sha256=HVeO4ZiPdtjVoVoxQk2xIa8fhcLXSMCquSO1CP4Hbu4,4894
99
101
  ad_api/api/v1/brand_store_editions.py,sha256=xW4z2jDWhNJn86tWlT3eLIRr0NEpxLhW1eA-T_hiXcI,2160
100
- ad_api/api/v1/brand_store_pages.py,sha256=TrSQbqlXqFv7i7RooxlFZOBrwYfEMPLvRPSJ9FjO87o,2765
102
+ ad_api/api/v1/brand_store_pages.py,sha256=uag4VY4bWgHnYtk7O1GAPub1KpwUwVLowoP_xEjotzI,2766
101
103
  ad_api/api/v1/brand_stores.py,sha256=zlBsKiOwmdSiIG9filgdqUlPnV6AX-gE6S5nNyAQACc,2131
102
104
  ad_api/api/v1/campaigns.py,sha256=u5PlvoAhgVhMxbCvYkPgqtbYK3TXXcb7TMie0Qjrgwc,9573
103
105
  ad_api/api/v1/geo_locations.py,sha256=gH1kR1rPQuIdzStB6wvWI40-XRo5yFyVI9AYYcjN5_8,2641
@@ -127,8 +129,8 @@ ad_api/base/marketplaces.py,sha256=44lvCcluXNpqTprWQ80e3weSQmQbJoWL-WDSOWVbCyQ,4
127
129
  ad_api/base/utils.py,sha256=_qnCBOvyJTLgaZjJzUWTi38GGLHkQszXELs79133Rb4,5618
128
130
  ad_api/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
131
  ad_api/shared/base_client.py,sha256=zOL_LTh-58URWf3ZDlrwmqXXbd6PX66QF5hrr2p83yY,356
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,,
132
+ python_amazon_ad_api-2.0.1.dist-info/licenses/LICENSE,sha256=h2rpqlmmLy-4l1tN6KpWAFxx1JEMYeEFrMrZUbx_B_o,1105
133
+ python_amazon_ad_api-2.0.1.dist-info/METADATA,sha256=rrGtU41t5ylos1fTGgCnoOby1OuVoqhmweNkP9X6DtI,43541
134
+ python_amazon_ad_api-2.0.1.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
135
+ python_amazon_ad_api-2.0.1.dist-info/top_level.txt,sha256=nN9twUos-8pkP514ZwpvRU9YL9L2XyQyHsMQFfudGTU,7
136
+ python_amazon_ad_api-2.0.1.dist-info/RECORD,,
ad_api/api/invoices.py DELETED
@@ -1,44 +0,0 @@
1
- from ad_api.base import Client, sp_endpoint, fill_query_params, ApiResponse
2
-
3
-
4
- class Invoices(Client):
5
- @sp_endpoint('/invoices', method='GET')
6
- def list_invoices(self, **kwargs) -> ApiResponse:
7
- r"""
8
- Get invoices for advertiser. Requires one of these permissions: ["nemo_transactions_view","nemo_transactions_edit"]
9
-
10
- query **invoiceStatuses**:*string* | Optional. Available values : ISSUED, PAID_IN_PART, PAID_IN_FULL, WRITTEN_OFF. (Not documented: ACCUMULATING)
11
-
12
- query **count**:*string* | Optional. Number of records to include in the paged response. Defaults to 100. Cannot be combined with the cursor parameter.
13
-
14
- query **cursor**:*string* | Optional. A cursor representing how far into a result set this query should begin. In the absence of a cursor the request will default to start index of 0 and page size of 100.
15
-
16
-
17
- Returns:
18
-
19
- ApiResponse whose payload carries a second layer::
20
-
21
- {"status": "success",
22
- "payload": {"nextCursor": "...", "invoiceSummaries": [...]}}
23
-
24
- The invoices sit at ``res.payload["payload"]["invoiceSummaries"]``.
25
- Reading ``res.payload["invoiceSummaries"]`` gives ``None``, because
26
- that key belongs to the inner object.
27
-
28
- """
29
- return self._request(kwargs.pop('path'), params=kwargs)
30
-
31
- @sp_endpoint('/invoices/{}', method='GET')
32
- def get_invoice(self, invoiceId, **kwargs) -> ApiResponse:
33
- r"""
34
- Get invoice data by invoice ID. Requires one of these permissions: ["nemo_transactions_view","nemo_transactions_edit"]
35
-
36
- path **invoiceId**:*string* | required. ID of invoice to fetch
37
-
38
- Returns:
39
-
40
- ApiResponse with the same two layers as ``list_invoices``: the
41
- invoice data sits under ``res.payload["payload"]``.
42
-
43
- """
44
- return self._request(fill_query_params(kwargs.pop('path'), invoiceId), params=kwargs)