Havoud
Havoud

Reputation: 11

Failing to get Subscription report from app store connect API

Failing to get Subscription report from app store connect API

I am able to get sales report from app store connect API. But when I want to get the subscription reports I face to error 400. I have searched internet to find a sample but I failed to find a proper one.

    import requests
    import datetime
    import json
    import gzip
    api_endpoint = 'https://api.appstoreconnect.apple.com/v1/salesReports'
    headers = {
        'Authorization': f'Bearer {gen_jwt}',
        'Content-Type': 'application/json'
}
    params = {
        'filter[frequency]': 'DAILY',
        'filter[reportType]': 'SUBSCRIPTION_EVENT',
        'filter[reportSubType]': 'SUMMARY',
        'filter[reportDate]': '2023-05-01'
}
    response = requests.get(api_endpoint, headers=headers, params=params)
    response

The weird thing is it works for sales report for any frequency but for subscription or subscription event is not working.

Upvotes: 0

Views: 405

Answers (1)

Havoud
Havoud

Reputation: 11

You need to use
'filter[version]': '1_3' at the end of params

Upvotes: 0

Related Questions