-
I've been trying to get the inventory ledger report with this code but it only returns an empty document with only the column names: report_type = ReportType.GET_LEDGER_SUMMARY_VIEW_DATA The document I download only has this: "Date" "FNSKU" "ASIN" "MSKU" "Title" "Disposition" "Starting Warehouse Balance" "In Transit Between Warehouses" "Receipts" "Customer Shipments" "Customer Returns" "Vendor Returns" "Warehouse Transfer In/Out" "Found" "Lost" "Damaged" "Disposed" "Other Events" "Ending Warehouse Balance" "Unknown Events" "Location" |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I figured it out if anyone else is having problems with it, you need to add dataStartTime and dataEndTime in ISO 8601 date time format. This is the full python code I used for reference : from sp_api.base import Marketplaces credentials = dict( report_data ='' res_reports = Reports(credentials=credentials, marketplace=Marketplaces.US).create_report(reportType=report_type,reportOptions={"aggregateByLocation":"COUNTRY","aggregatedByTimePeriod":"DAILY"},dataStartTime=start_date,dataEndTime=end_date) res = Reports(credentials=credentials, marketplace=Marketplaces.US) while data.payload.get('processingStatus') not in [ProcessingStatus.DONE, ProcessingStatus.FATAL,ProcessingStatus.CANCELLED]: if data.payload.get('processingStatus') in [ProcessingStatus.FATAL, ProcessingStatus.CANCELLED]: else: report_url = report_data.payload.get('url') |
Beta Was this translation helpful? Give feedback.
I figured it out if anyone else is having problems with it, you need to add dataStartTime and dataEndTime in ISO 8601 date time format. This is the full python code I used for reference :
from sp_api.base import Marketplaces
from sp_api.base import Granularity, ReportType, ProcessingStatus
from sp_api.base.reportTypes import ReportType
from sp_api.api import Reports
from datetime import datetime, timedelta, timezone
from datetime import date
import pandas as pd
import gzip
credentials = dict(
refresh_token='refreshtoken',
lwa_app_id='appid',
# From Seller Central, named CLIENT IDENTIFIER on website.
lwa_client_secret=clientsecret',
# From Seller Central, named CLIENT SECRET on website.
aw…