Ponytech / appstoreconnectapi

Python wrapper around Apple App Store Api
https://ponytech.net/projects/app-store-connect
MIT License
159 stars 74 forks source link

Un-hardcode Finance reportType #45

Closed andrew-forbes-93 closed 2 years ago

andrew-forbes-93 commented 2 years ago

https://github.com/Ponytech/appstoreconnectapi/blob/1c4cac1cd1d84a7189e3a9e8d2c23d62bbc0a7fa/appstoreconnect/api.py#L639

Hi all, not sure if there's any activity here anymore. Thank you for this API! I'd like to use the download_finance_reports function to download FINANCE_DETAIL reports but the value is hardcoded as just FINANCE.

Just curious if there's a reason this is the case? Maybe that wasn't an option when this package was created. Ideally it would just be another filter where I can set the value myself

ppawlak commented 2 years ago

Hi,

Sorry for this very late reply, I should have replied earlier. This project this still active when I'm not busy elsewhere.

To answer your question, the FINANCE value is not hard-coded but provided as a default value. You can pass an other reportType like this:

api.download_finance_reports(filters={'vendorNumber': '123456', 'reportDate': '2021-10', 'reportType': 'FINANCE_DETAIL'}, save_to='finance.csv'

Please let me know if you have success with this: whatever date I try I always get this error: There were no sales for the date specified.

Documentation on Apple website is not very clear: image

There are 2 possible values but it is always one of them... 😕

andrew-forbes-93 commented 2 years ago

Ha! Thank you, I'd forgotten about this. I think I eventually discovered that I could do exactly what you posted.

Thanks again, this library has saved me a lot of time :)

On Thu, Jun 16, 2022 at 2:42 PM ppawlak @.***> wrote:

Hi,

Sorry for this very late reply, I should have replied earlier. This project this still active when I'm not busy elsewhere.

To answer your question, the FINANCE value is not hard-coded but provided as a default value. You can pass an other reportType like this:

api.download_finance_reports(filters={'vendorNumber': '123456', 'reportDate': '2021-10', 'reportType': 'FINANCE_DETAIL'}, save_to='finance.csv'

Please let me know if you have success with this: whatever date I try I always get this error: There were no sales for the date specified.

Documentation https://developer.apple.com/documentation/appstoreconnectapi/download_finance_reports on Apple website is not very clear: [image: image] https://user-images.githubusercontent.com/1941270/174159956-e5db81e3-f440-4b25-a182-643d54a95d87.png

There are 2 possible values but it is always one of them... 😕

— Reply to this email directly, view it on GitHub https://github.com/Ponytech/appstoreconnectapi/issues/45#issuecomment-1158111285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOKU7LY4EN4WBSY66HK75DTVPOGT7ANCNFSM5Q7HVTXA . You are receiving this because you authored the thread.Message ID: @.***>

ppawlak commented 2 years ago

Thanks again, this library has saved me a lot of time :)

I'm really glad to hear that 😃