Overview

The Analytics Report Export APIs allow merchants to export Loop Analytics reports programmatically using the Public Admin API.

Unlike standard APIs that return data immediately, these endpoints trigger an asynchronous export job. Once the report has been generated, Loop sends a webhook containing a secure URL to download the generated CSV.

Refer to the individual endpoint documentation for request parameters, response schema, and examples.


Supported Reports


Implementation Guide

  1. Subscribe to the Required Webhook Topics.

    Before triggering a report export, merchants must subscribe to the following webhook topics using the Webhook Subscription API.

    1. analytics_report/export_completed : Triggered when a report has been generated successfully. The payload includes a downloadable CSV URL.
    2. analytics_report/export_failed : Triggered if the report generation fails. The payload includes the reason for failure.
  2. Generate a API Token

    The Report Export APIs require authentication using a Merchant API Token. Get the Loop API token from the Admin Portal under:

    Admin Portal → Settings → API Tokens

  3. Trigger the Report Export

    Call the desired Report Export endpoint with the appropriate filters, receive an exportId indicating the request has been accepted for processing, wait for Loop to send a webhook notification once the report generation is complete, and use the secure s3Url provided in the webhook to download the generated CSV for successful exports.


Webhook Payload

Both analytics_report/export_completed and analytics_report/export_failed use the same payload structure.

  • exportId - Unique identifier of the export request. Matches the value returned by the Report Export API.
  • storeId - Unique identifier of the Loop store.
  • myshopifyDomain - Merchant's Shopify domain.
  • reportKey - Internal identifier of the exported report.
  • reportLabel - Human-readable name of the exported report.
  • status - Export status (COMPLETED or FAILED).
  • s3Url - Secure URL to download the generated CSV. Available only for successful exports.
  • failureReason - Reason for failure. Present only when the export fails.
  • filtersApplied - Filters used while generating the report.
  • createdAt - Timestamp when the export request was created.
  • completedAt - Timestamp when the export completed or failed.