import { MetricsExportRequest } from "@polar-sh/sdk/models/operations/metricsexport.js";
import { RFCDate } from "@polar-sh/sdk/types/rfcdate.js";
let value: MetricsExportRequest = {
startDate: new RFCDate("2025-05-13"),
endDate: new RFCDate("2024-08-17"),
interval: "month",
organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
};
| Field |
Type |
Required |
Description |
startDate |
RFCDate |
✔️ |
Start date. |
endDate |
RFCDate |
✔️ |
End date. |
timezone |
string |
➖ |
Timezone to use for the timestamps. Default is UTC. |
interval |
components.TimeInterval |
✔️ |
Interval between two timestamps. |
organizationId |
operations.MetricsExportQueryParamOrganizationIDFilter |
➖ |
Filter by organization ID. |
productId |
operations.MetricsExportQueryParamProductIDFilter |
➖ |
Filter by product ID. |
billingType |
operations.MetricsExportQueryParamProductBillingTypeFilter |
➖ |
Filter by billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases. |
customerId |
operations.MetricsExportQueryParamCustomerIDFilter |
➖ |
Filter by customer ID. |
metrics |
string[] |
➖ |
List of metric slugs to include in the export. If not provided, all metrics are exported. |