Revenue
API endpoint for retrieving workspace revenue transactions and analytics
/revenueHeaders
x-api-keystringrequiredYour Track My Posts API key
Query Parameters
workspaceSlugstringrequiredWorkspace slug identifier
Example: my-workspace
sincestringStart date filter (YYYY-MM-DD or ISO 8601 format)
Example: 2024-01-01
untilstringEnd date filter (YYYY-MM-DD or ISO 8601 format)
Example: 2024-12-31
prevSincestringPrevious period start date for comparison (YYYY-MM-DD or ISO 8601 format). When provided with prevUntil, the response includes previousSummary for period-over-period comparisons.
Example: 2023-12-01
prevUntilstringPrevious period end date for comparison (YYYY-MM-DD or ISO 8601 format). When provided with prevSince, the response includes previousSummary for period-over-period comparisons.
Example: 2023-12-31
providerstringFilter by integration provider. Use 'all' to include all providers.
Example: stripe
eventTypesarrayFilter by event types (comma-separated or array)
Example: purchaserenewal
pageintegerPage number (1-indexed)
Example: 1
pageSizeintegerNumber of items per page (alias: limit)
Example: 20
limitintegerNumber of items per page (alias for pageSize)
Example: 20
includeSeriesbooleanInclude time series data in response
sortBystringField to sort by
Example: occurredAt
sortOrderstringSort order
Example: desc
Responses
curl "https://api.trackmyposts.com/revenue?workspaceSlug=my-workspace&since=2024-01-01&until=2024-12-31&prevSince=2023-12-01&prevUntil=2023-12-31&provider=stripe&eventTypes=purchase%2Crenewal&page=1&pageSize=20&limit=20&includeSeries=false&sortBy=occurredAt&sortOrder=desc" \
-H "x-api-key: YOUR_API_KEY"{
"items": [
{
"id": "evt_1234567890",
"workspaceId": "workspace-123",
"integrationId": "int_1234567890",
"eventType": "purchase",
"amountCents": 999,
"currency": "USD",
"externalId": "txn_1234567890",
"metadata": {
"productId": "prod_123"
},
"occurredAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:05.000Z",
"provider": "stripe"
}
],
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8,
"hasNext": true,
"hasPrev": false,
"summary": {
"currency": "USD",
"grossRevenueCents": 99900,
"netRevenueCents": 94900,
"refundCents": 5000,
"recurringNetCents": 45000,
"purchaseCount": 50,
"subscriptionPurchaseCount": 30,
"renewalCount": 20,
"refundCount": 5,
"cancellationCount": 2,
"positiveChargeCount": 100,
"trialCount": 10,
"trialConversionCount": 8,
"trialConversionRate": 0.8,
"cancellationRate": 0.04,
"refundRate": 0.05,
"mrrCents": 94900,
"averageOrderValueCents": 949,
"uniqueCancelledSubs": 2,
"uniqueActiveSubs": 48
},
"previousSummary": {
"currency": "USD",
"grossRevenueCents": 85000,
"netRevenueCents": 81000,
"refundCents": 4000,
"recurringNetCents": 38000,
"purchaseCount": 42,
"subscriptionPurchaseCount": 25,
"renewalCount": 18,
"refundCount": 4,
"cancellationCount": 1,
"positiveChargeCount": 85,
"trialCount": 8,
"trialConversionCount": 6,
"trialConversionRate": 0.75,
"cancellationRate": 0.023,
"refundRate": 0.047,
"mrrCents": 81000,
"averageOrderValueCents": 953,
"uniqueCancelledSubs": 1,
"uniqueActiveSubs": 42
}
}Data Structures
Explore all data structures used in this API endpoint
curl "https://api.trackmyposts.com/revenue?workspaceSlug=my-workspace&since=2024-01-01&until=2024-12-31&prevSince=2023-12-01&prevUntil=2023-12-31&provider=stripe&eventTypes=purchase%2Crenewal&page=1&pageSize=20&limit=20&includeSeries=false&sortBy=occurredAt&sortOrder=desc" \
-H "x-api-key: YOUR_API_KEY"{
"items": [
{
"id": "evt_1234567890",
"workspaceId": "workspace-123",
"integrationId": "int_1234567890",
"eventType": "purchase",
"amountCents": 999,
"currency": "USD",
"externalId": "txn_1234567890",
"metadata": {
"productId": "prod_123"
},
"occurredAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:05.000Z",
"provider": "stripe"
}
],
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8,
"hasNext": true,
"hasPrev": false,
"summary": {
"currency": "USD",
"grossRevenueCents": 99900,
"netRevenueCents": 94900,
"refundCents": 5000,
"recurringNetCents": 45000,
"purchaseCount": 50,
"subscriptionPurchaseCount": 30,
"renewalCount": 20,
"refundCount": 5,
"cancellationCount": 2,
"positiveChargeCount": 100,
"trialCount": 10,
"trialConversionCount": 8,
"trialConversionRate": 0.8,
"cancellationRate": 0.04,
"refundRate": 0.05,
"mrrCents": 94900,
"averageOrderValueCents": 949,
"uniqueCancelledSubs": 2,
"uniqueActiveSubs": 48
},
"previousSummary": {
"currency": "USD",
"grossRevenueCents": 85000,
"netRevenueCents": 81000,
"refundCents": 4000,
"recurringNetCents": 38000,
"purchaseCount": 42,
"subscriptionPurchaseCount": 25,
"renewalCount": 18,
"refundCount": 4,
"cancellationCount": 1,
"positiveChargeCount": 85,
"trialCount": 8,
"trialConversionCount": 6,
"trialConversionRate": 0.75,
"cancellationRate": 0.023,
"refundRate": 0.047,
"mrrCents": 81000,
"averageOrderValueCents": 953,
"uniqueCancelledSubs": 1,
"uniqueActiveSubs": 42
}
}