Actions2
Overview
This node downloads and optionally parses financial reports from the Apple App Store Connect API. It is useful for automating retrieval of sales and financial data related to apps, enabling further analysis or integration into business workflows.
Common scenarios include:
- Automatically fetching monthly financial reports for accounting or revenue tracking.
- Parsing detailed transaction data to analyze sales by country or product.
- Downloading raw report files for archival or manual processing.
For example, a user can configure the node to download the "Financial Detail Report" for a specific vendor and month, then parse it to extract structured JSON data about transactions and aggregated sales figures.
Properties
| Name | Meaning |
|---|---|
| Report Type | The type of financial report to retrieve. Options: "Financial Report", "Financial Detail Report" |
| Vendor Number | The unique identifier number of the vendor (required) |
| Report Date (YYYY-MM) | The year and month of the report in format YYYY-MM (required) |
| Region Code | The region code for the report, e.g., "ZZ" or "Z1" for all regions (required) |
| Options | Additional options: |
| Put Result in Field | The name of the output field where the parsed or downloaded data will be stored (default: "report") |
Output
The node outputs an array of items corresponding to each input item processed.
For Download operation:
- Outputs binary data containing the raw report file (TSV format).
- The binary data is stored under the field name
report(or custom field if specified).
For Download & Parse operation:
Outputs JSON data with the parsed content of the report.
The JSON structure depends on the report type:
Financial Detail Report (
FINANCE_DETAIL):<result_field>_meta: Metadata key-value pairs extracted from the report header.<result_field>_detailed: Array of detailed transaction objects.<result_field>_aggregated: Array of aggregated sales data by country and currency.
Financial Report (
FINANCIAL):<result_field>_detailed: Array of detailed sales records.<result_field>_aggregated: Array of aggregated sales data.
The <result_field> is the configured output field name (default "report").
Dependencies
- Requires an API key credential for authenticating with the Apple App Store Connect API.
- Uses JWT token generation with ES256 algorithm for authentication.
- Makes HTTP GET requests to the Apple financeReports endpoint.
- Uses Node.js built-in modules for URL parameter encoding and gzip decompression.
- Axios library is used for HTTP requests.
- n8n helper methods are used to prepare binary data for output.
Troubleshooting
- Authentication errors: If the API key or credentials are invalid or expired, the node will fail to fetch the report. Ensure the API key is correctly configured and has necessary permissions.
- Invalid parameters: Providing incorrect vendor number, report date, or region code may result in empty responses or errors from the API.
- Parsing issues: If the report format changes or contains unexpected data, parsing might fail or produce incomplete results.
- Network errors: Connectivity issues or API rate limits can cause request failures.
- Common error message:
"Apple API error: <message>"indicates a failure during the HTTP request. Check credentials, network, and parameter correctness.