Actions2
Overview
This node downloads Apple App Store sales reports, specifically summary sales data filtered by frequency (daily or monthly), vendor number, and report date. It supports two operations: downloading the raw report file or downloading and parsing the report into structured JSON.
Common scenarios include automating the retrieval of sales performance data for analysis, reporting, or integration with other business systems. For example, a mobile app publisher could use this node to regularly fetch monthly sales summaries to update dashboards or trigger alerts based on sales trends.
Properties
| Name | Meaning |
|---|---|
| Frequency | The type of sales report to download: "Daily Sales Report" or "Monthly Sales Report". |
| Vendor Number | The unique identifier for the vendor whose sales report is being requested. |
| Report Date (YYYY-MM-DD) | The specific date of the report to download, formatted as year-month-day. |
| Options | Additional options: - Put Result in Field: The name of the output field where the downloaded or parsed report 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 report file (TSV format).
- The binary data is stored under the field name specified in the "Put Result in Field" option (default "report").
- The JSON part of the output item is empty.
For the Download & Parse operation:
- Outputs JSON data parsed from the TSV report.
- The JSON field contains an array of objects, each representing a row in the report.
- Each object’s keys correspond to the column headers from the report.
- The parsed data is stored under the field name specified in the "Put Result in Field" option (default "report").
Dependencies
- Requires an API key credential for authenticating with the Apple App Store Connect API.
- Uses the Apple App Store Connect API endpoint to request sales reports.
- Uses JWT token generation for authentication, requiring private key, issuer ID, and key ID.
- Uses Axios for HTTP requests.
- Uses zlib to decompress the downloaded gzip report.
- Requires n8n environment configured with the necessary API credentials.
Troubleshooting
- Authentication errors: If the API key or JWT token is invalid or expired, the node will fail to authenticate. Ensure the private key, issuer ID, and key ID are correctly configured and valid.
- Invalid parameters: Providing an incorrect vendor number, report date, or frequency may result in no data or API errors. Verify these inputs carefully.
- Network issues: Connectivity problems can cause request failures. Check network access to the Apple API endpoint.
- Parsing errors: If the report format changes or the file is corrupted, parsing may fail or produce unexpected results.
- Error messages: The node logs API errors to the console and throws them. Review error messages for clues about invalid credentials, missing permissions, or malformed requests.