I've been trying to retrieve monthly downloads report from app store connect API for a while now, but it seems I'm doing something wrong.
When I'm retrieving DAILY sales report it works just right.
url = f"https://api.appstoreconnect.apple.com/v1/salesReports"
params = {
'filter\[frequency\]': 'DAILY',
'filter\[reportDate\]': '2024-08-10',
'filter\[reportSubType\]': 'SUMMARY',
'filter\[reportType\]': 'SALES',
'filter\[vendorNumber\]': 'XXXXXXXX',
'filter\[version\]': '1_0',
}
headers = {
'Authorization': f'Bearer {jwt_token}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
However, once I try to get MONTHLY sales report the API returns 400 - Bad Request
url = f"https://api.appstoreconnect.apple.com/v1/salesReports"
params = {
'filter\[frequency\]': 'MONTHLY',
'filter\[reportDate\]': '2024-08-10',
'filter\[reportSubType\]': 'SUMMARY',
'filter\[reportType\]': 'SALES',
'filter\[vendorNumber\]': 'XXXXXXXX',
'filter\[version\]': '1_0',
}
headers = {
'Authorization': f'Bearer {jwt_token}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
one of the doc's I;ve been using: https://developer.apple.com/documentation/appstoreconnectapi/get-v1-salesreports#Allowed-values-based-on-sales-report-type
I've also tried to use installs reportType but got the same error
url = f"https://api.appstoreconnect.apple.com/v1/salesReports"
params = {
'filter\[frequency\]': 'MONTHLY',
'filter\[reportDate\]': '2024-08-10',
'filter\[reportSubType\]': 'SUMMARY',
'filter\[reportType\]': 'INSTALLS',
'filter\[vendorNumber\]': 'XXXXXXXX',
'filter\[version\]': '1_2',
}
headers = {
'Authorization': f'Bearer {jwt_token}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
can anyone help?
I tried to get MONTHLY sales report but got 400 - Bad Request
url = f"https://api.appstoreconnect.apple.com/v1/salesReports"
params = {
'filter\[frequency\]': 'MONTHLY',
'filter\[reportDate\]': '2024-08-10',
'filter\[reportSubType\]': 'SUMMARY',
'filter\[reportType\]': 'SALES',
'filter\[vendorNumber\]': 'XXXXXXXX',
'filter\[version\]': '1_0',
}
headers = {
'Authorization': f'Bearer {jwt_token}',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers, params=params)
The API documentation definitely says that all report frequencies, except DAILY, should use YYYY-MM-DD for the report date filter, but the full error returned by the API says differently, so there is conflicting information.
"status" : "400",
"code" : "PARAMETER_ERROR.INVALID.INVALID_COMBINATION",
"title" : "Some provided parameters cannot be used in this combination.",
"detail" : "Invalid combination of date type and date. For daily and weekly reports, use format YYYY-MM-DD. For monthly, use YYYY-MM. For yearly, use YYYY."
So, for your monthly and summary reports, try using the YYYY-MM format.