Actions2
Overview
This node downloads and optionally parses financial reports from the Apple App Store Connect API. It is designed to retrieve either summary financial reports or detailed financial reports for a specified vendor, date, and region.
Common scenarios where this node is beneficial include:
- Automating the retrieval of monthly financial data for app sales and in-app purchases.
- Integrating Apple App Store financial data into business intelligence or accounting workflows.
- Parsing detailed transaction-level data for deeper analysis of sales performance by country or currency.
For example, a user can configure the node to download the financial report for vendor number "123456" for March 2024 across all regions, then parse and output the structured data directly into their workflow for further processing.
Properties
Name | Meaning |
---|---|
Report Type | The type of financial report to download: either "Financial Report" (summary) or "Financial Detail Report" (detailed transactions). |
Vendor Number | The unique identifier of the vendor whose report is being requested. |
Report Date (YYYY-MM) | The month and year of the report in "YYYY-MM" format (e.g., "2024-03"). |
Region Code | The region code for the report; use "ZZ" or "Z1" to request data for all regions. |
Options | Additional options: - Put Result in Field: The name of the output field where the parsed data will be stored (default is "report"). |
Output
The node outputs an array of items corresponding to each input item processed.
For the Download operation:
- Outputs binary data containing the raw TSV report file.
- The binary data is named
report_<Report Date>.tsv
. - The JSON part of the output is empty.
For the Download & Parse operation:
- Parses the downloaded TSV report into structured JSON.
- The parsed data is placed under a JSON field named as per the "Put Result in Field" option (default
"report"
), with suffixes depending on the report type:- For Financial Detail Report:
<field>_meta
: Metadata key-value pairs extracted from the top of the report.<field>_detailed
: Array of detailed transaction objects.<field>_aggregated
: Array of aggregated summary objects.
- For Financial Report (summary):
<field>_detailed
: Array of detailed summary rows.<field>_aggregated
: Array of aggregated summary rows.
- For Financial Detail Report:
The JSON structure provides easy access to both detailed and aggregated financial data for further automation or analysis.
Dependencies
- Requires an API authentication token credential for Apple App Store Connect API.
- Uses the following npm packages bundled within the node:
axios
for HTTP requests.jsonwebtoken
for creating JWT tokens used in API authentication.zlib
for decompressing the downloaded gzip report files.
- No additional external configuration beyond providing valid API credentials is needed.
Troubleshooting
Common issues:
- Invalid or expired API credentials will cause authentication errors.
- Incorrect vendor number, report date, or region code may result in no data or API errors.
- Network connectivity problems can prevent downloading the report.
Error messages:
- Errors from the Apple API are logged with the prefix "Apple API error:" followed by the message.
- If the JWT token generation fails due to malformed keys, ensure the private key is correctly formatted and provided.
Resolutions:
- Verify that the API credentials are correct and have necessary permissions.
- Double-check input parameters for correctness and formatting.
- Ensure network access to Apple's API endpoints.
- Confirm the private key is properly formatted with line breaks if pasted manually.