Skip to content
This repository was archived by the owner on Jan 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions mws/mws.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'Products',
'Recommendations',
'Sellers',
'Finances',
]

# See https://images-na.ssl-images-amazon.com/images/G/01/mwsportal/doc/en_US/bde/MWSDeveloperGuide._V357736853_.pdf
Expand Down Expand Up @@ -602,6 +603,64 @@ def list_marketplace_participations_by_next_token(self, token):
return self.make_request(data)


class Finances(MWS):
"""Amazon Finances API"""

URI = "/Finances/2015-05-01"
VERSION = "2015-05-01"
NS = '{https://mws.amazonservices.com/Finances/2015-05-01}'

def list_financial_event_groups(
self,
created_after=None,
created_before=None,
max_results=None
):
"""Returns a list of financial event groups"""
data = dict(Action='ListFinancialEventGroups',
FinancialEventGroupStartedAfter=created_after,
FinancialEventGroupStartedBefore=created_before,
MaxResultsPerPage=max_results,
)
return self.make_request(data)

def list_financial_event_groups_by_next_token(self, token):
"""Returns a list of financial event groups"""
data = dict(Action='ListFinancialEventGroupsByNextToken',
NextToken=token
)
return self.make_request(data)

def list_financial_events(
self,
financial_event_group_id=None,
amazon_order_id=None,
posted_after=None,
posted_before=None,
max_results=None
):
""" Returns financial events for a user-provided FinancialEventGroupId
or AmazonOrderId
"""
data = dict(Action='ListFinancialEvents',
FinancialEventGroupId=financial_event_group_id,
AmazonOrderId=amazon_order_id,
PostedAfter=posted_after,
PostedBefore=posted_before,
MaxResultsPerPage=max_results,
)
return self.make_request(data)

def list_financial_events_by_next_token(self, token):
""" Returns financial events for a user-provided FinancialEventGroupId
or AmazonOrderId
"""
data = dict(Action='ListFinancialEventsByNextToken',
NextToken=token
)
return self.make_request(data)


# * Fulfillment APIs * #


Expand Down