zorihq 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +18 -16
- package/package.json +1 -1
- package/resources/v1/analytics/analytics.d.mts +39 -124
- package/resources/v1/analytics/analytics.d.mts.map +1 -1
- package/resources/v1/analytics/analytics.d.ts +39 -124
- package/resources/v1/analytics/analytics.d.ts.map +1 -1
- package/resources/v1/analytics/analytics.js +0 -4
- package/resources/v1/analytics/analytics.js.map +1 -1
- package/resources/v1/analytics/analytics.mjs +0 -4
- package/resources/v1/analytics/analytics.mjs.map +1 -1
- package/resources/v1/analytics/index.d.mts +1 -2
- package/resources/v1/analytics/index.d.mts.map +1 -1
- package/resources/v1/analytics/index.d.ts +1 -2
- package/resources/v1/analytics/index.d.ts.map +1 -1
- package/resources/v1/analytics/index.js +1 -3
- package/resources/v1/analytics/index.js.map +1 -1
- package/resources/v1/analytics/index.mjs +0 -1
- package/resources/v1/analytics/index.mjs.map +1 -1
- package/resources/v1/index.d.mts +3 -3
- package/resources/v1/index.d.mts.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js +3 -3
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/payment-providers.d.mts +38 -1
- package/resources/v1/payment-providers.d.mts.map +1 -1
- package/resources/v1/payment-providers.d.ts +38 -1
- package/resources/v1/payment-providers.d.ts.map +1 -1
- package/resources/v1/payment-providers.js +15 -0
- package/resources/v1/payment-providers.js.map +1 -1
- package/resources/v1/payment-providers.mjs +15 -0
- package/resources/v1/payment-providers.mjs.map +1 -1
- package/resources/v1/projects.d.mts +0 -3
- package/resources/v1/projects.d.mts.map +1 -1
- package/resources/v1/projects.d.ts +0 -3
- package/resources/v1/projects.d.ts.map +1 -1
- package/resources/v1/projects.js.map +1 -1
- package/resources/v1/projects.mjs.map +1 -1
- package/resources/v1/{analytics/revenue.d.mts → revenue/attribution.d.mts} +21 -19
- package/resources/v1/revenue/attribution.d.mts.map +1 -0
- package/resources/v1/{analytics/revenue.d.ts → revenue/attribution.d.ts} +21 -19
- package/resources/v1/revenue/attribution.d.ts.map +1 -0
- package/resources/v1/revenue/attribution.js +41 -0
- package/resources/v1/revenue/attribution.js.map +1 -0
- package/resources/v1/revenue/attribution.mjs +37 -0
- package/resources/v1/revenue/attribution.mjs.map +1 -0
- package/resources/v1/revenue/conversion.d.mts +34 -0
- package/resources/v1/revenue/conversion.d.mts.map +1 -0
- package/resources/v1/revenue/conversion.d.ts +34 -0
- package/resources/v1/revenue/conversion.d.ts.map +1 -0
- package/resources/v1/revenue/conversion.js +25 -0
- package/resources/v1/revenue/conversion.js.map +1 -0
- package/resources/v1/revenue/conversion.mjs +21 -0
- package/resources/v1/revenue/conversion.mjs.map +1 -0
- package/resources/v1/revenue/customers.d.mts +61 -0
- package/resources/v1/revenue/customers.d.mts.map +1 -0
- package/resources/v1/revenue/customers.d.ts +61 -0
- package/resources/v1/revenue/customers.d.ts.map +1 -0
- package/resources/v1/revenue/customers.js +40 -0
- package/resources/v1/revenue/customers.js.map +1 -0
- package/resources/v1/revenue/customers.mjs +36 -0
- package/resources/v1/revenue/customers.mjs.map +1 -0
- package/resources/v1/revenue/index.d.mts +5 -0
- package/resources/v1/revenue/index.d.mts.map +1 -0
- package/resources/v1/revenue/index.d.ts +5 -0
- package/resources/v1/revenue/index.d.ts.map +1 -0
- package/resources/v1/revenue/index.js +13 -0
- package/resources/v1/revenue/index.js.map +1 -0
- package/resources/v1/revenue/index.mjs +6 -0
- package/resources/v1/revenue/index.mjs.map +1 -0
- package/resources/v1/revenue/revenue.d.mts +252 -0
- package/resources/v1/revenue/revenue.d.mts.map +1 -0
- package/resources/v1/revenue/revenue.d.ts +252 -0
- package/resources/v1/revenue/revenue.d.ts.map +1 -0
- package/resources/v1/revenue/revenue.js +53 -0
- package/resources/v1/revenue/revenue.js.map +1 -0
- package/resources/v1/revenue/revenue.mjs +48 -0
- package/resources/v1/revenue/revenue.mjs.map +1 -0
- package/resources/v1/revenue.d.mts +2 -0
- package/resources/v1/revenue.d.mts.map +1 -0
- package/resources/v1/revenue.d.ts +2 -0
- package/resources/v1/revenue.d.ts.map +1 -0
- package/resources/v1/revenue.js +6 -0
- package/resources/v1/revenue.js.map +1 -0
- package/resources/v1/revenue.mjs +3 -0
- package/resources/v1/revenue.mjs.map +1 -0
- package/resources/v1/v1.d.mts +8 -8
- package/resources/v1/v1.d.mts.map +1 -1
- package/resources/v1/v1.d.ts +8 -8
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js +4 -4
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs +4 -4
- package/resources/v1/v1.mjs.map +1 -1
- package/src/resources/v1/analytics/analytics.ts +56 -175
- package/src/resources/v1/analytics/index.ts +0 -6
- package/src/resources/v1/index.ts +21 -18
- package/src/resources/v1/payment-providers.ts +58 -0
- package/src/resources/v1/projects.ts +0 -5
- package/src/resources/v1/{analytics/revenue.ts → revenue/attribution.ts} +29 -24
- package/src/resources/v1/revenue/conversion.ts +44 -0
- package/src/resources/v1/revenue/customers.ts +77 -0
- package/src/resources/v1/revenue/index.ts +23 -0
- package/src/resources/v1/revenue/revenue.ts +382 -0
- package/src/resources/v1/revenue.ts +3 -0
- package/src/resources/v1/v1.ts +46 -40
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/v1/analytics/revenue.d.mts.map +0 -1
- package/resources/v1/analytics/revenue.d.ts.map +0 -1
- package/resources/v1/analytics/revenue.js +0 -39
- package/resources/v1/analytics/revenue.js.map +0 -1
- package/resources/v1/analytics/revenue.mjs +0 -35
- package/resources/v1/analytics/revenue.mjs.map +0 -1
- package/resources/v1/auth.d.mts +0 -141
- package/resources/v1/auth.d.mts.map +0 -1
- package/resources/v1/auth.d.ts +0 -141
- package/resources/v1/auth.d.ts.map +0 -1
- package/resources/v1/auth.js +0 -95
- package/resources/v1/auth.js.map +0 -1
- package/resources/v1/auth.mjs +0 -91
- package/resources/v1/auth.mjs.map +0 -1
- package/src/resources/v1/auth.ts +0 -210
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
-
import * as
|
|
4
|
+
import * as RevenueAPI from './revenue';
|
|
5
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
7
|
|
|
8
|
-
export class
|
|
8
|
+
export class Attribution extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Get revenue metrics grouped by
|
|
10
|
+
* Get revenue metrics grouped by traffic origin (referrer domain) using
|
|
11
|
+
* first-touch attribution
|
|
11
12
|
*
|
|
12
13
|
* @example
|
|
13
14
|
* ```ts
|
|
14
|
-
* const
|
|
15
|
-
* await client.v1.
|
|
15
|
+
* const attributionByOriginResponse =
|
|
16
|
+
* await client.v1.revenue.attribution.byOrigin({
|
|
16
17
|
* project_id: 'project_id',
|
|
17
18
|
* time_range: 'last_hour',
|
|
18
19
|
* });
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
byOrigin(
|
|
23
|
+
query: AttributionByOriginParams,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<RevenueAPI.AttributionByOriginResponse> {
|
|
26
|
+
return this._client.get('/api/v1/revenue/attribution/origin', { query, ...options });
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
|
-
* Get revenue metrics
|
|
30
|
+
* Get revenue metrics grouped by UTM source, medium, or campaign using first-touch
|
|
31
|
+
* attribution
|
|
27
32
|
*
|
|
28
33
|
* @example
|
|
29
34
|
* ```ts
|
|
30
|
-
* const
|
|
31
|
-
* await client.v1.
|
|
35
|
+
* const attributionByUtmResponse =
|
|
36
|
+
* await client.v1.revenue.attribution.byUtm({
|
|
32
37
|
* project_id: 'project_id',
|
|
33
38
|
* time_range: 'last_hour',
|
|
34
39
|
* });
|
|
35
40
|
* ```
|
|
36
41
|
*/
|
|
37
|
-
|
|
38
|
-
query:
|
|
42
|
+
byUtm(
|
|
43
|
+
query: AttributionByUtmParams,
|
|
39
44
|
options?: RequestOptions,
|
|
40
|
-
): APIPromise<
|
|
41
|
-
return this._client.get('/api/v1/
|
|
45
|
+
): APIPromise<RevenueAPI.AttributionByUtmResponse> {
|
|
46
|
+
return this._client.get('/api/v1/revenue/attribution/utm', { query, ...options });
|
|
42
47
|
}
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
export interface
|
|
50
|
+
export interface AttributionByOriginParams {
|
|
46
51
|
/**
|
|
47
52
|
* Project ID
|
|
48
53
|
*/
|
|
@@ -52,14 +57,9 @@ export interface RevenueByUtmParams {
|
|
|
52
57
|
* Time range
|
|
53
58
|
*/
|
|
54
59
|
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* UTM type: source, medium, or campaign (default: source)
|
|
58
|
-
*/
|
|
59
|
-
utm_type?: string;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export interface
|
|
62
|
+
export interface AttributionByUtmParams {
|
|
63
63
|
/**
|
|
64
64
|
* Project ID
|
|
65
65
|
*/
|
|
@@ -69,11 +69,16 @@ export interface RevenueTimelineParams {
|
|
|
69
69
|
* Time range
|
|
70
70
|
*/
|
|
71
71
|
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* UTM type: source, medium, or campaign (default: source)
|
|
75
|
+
*/
|
|
76
|
+
utm_type?: string;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
export declare namespace
|
|
79
|
+
export declare namespace Attribution {
|
|
75
80
|
export {
|
|
76
|
-
type
|
|
77
|
-
type
|
|
81
|
+
type AttributionByOriginParams as AttributionByOriginParams,
|
|
82
|
+
type AttributionByUtmParams as AttributionByUtmParams,
|
|
78
83
|
};
|
|
79
84
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as RevenueAPI from './revenue';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Conversion extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get conversion funnel metrics including conversion rate, time to purchase, and
|
|
11
|
+
* customer lifetime value
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const conversionMetricsResponse =
|
|
16
|
+
* await client.v1.revenue.conversion.metrics({
|
|
17
|
+
* project_id: 'project_id',
|
|
18
|
+
* time_range: 'last_hour',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
metrics(
|
|
23
|
+
query: ConversionMetricsParams,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<RevenueAPI.ConversionMetricsResponse> {
|
|
26
|
+
return this._client.get('/api/v1/revenue/conversion/metrics', { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ConversionMetricsParams {
|
|
31
|
+
/**
|
|
32
|
+
* Project ID
|
|
33
|
+
*/
|
|
34
|
+
project_id: string;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Time range
|
|
38
|
+
*/
|
|
39
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export declare namespace Conversion {
|
|
43
|
+
export { type ConversionMetricsParams as ConversionMetricsParams };
|
|
44
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as RevenueAPI from './revenue';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Customers extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get detailed revenue information for a specific customer including payment
|
|
11
|
+
* history and attribution
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const customerProfileResponse =
|
|
16
|
+
* await client.v1.revenue.customers.profile({
|
|
17
|
+
* project_id: 'project_id',
|
|
18
|
+
* visitor_id: 'visitor_id',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
profile(
|
|
23
|
+
query: CustomerProfileParams,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): APIPromise<RevenueAPI.CustomerProfileResponse> {
|
|
26
|
+
return this._client.get('/api/v1/revenue/customers/profile', { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get a list of customers ranked by total revenue
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const topCustomersResponse =
|
|
35
|
+
* await client.v1.revenue.customers.top({
|
|
36
|
+
* project_id: 'project_id',
|
|
37
|
+
* time_range: 'last_hour',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
top(query: CustomerTopParams, options?: RequestOptions): APIPromise<RevenueAPI.TopCustomersResponse> {
|
|
42
|
+
return this._client.get('/api/v1/revenue/customers/top', { query, ...options });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CustomerProfileParams {
|
|
47
|
+
/**
|
|
48
|
+
* Project ID
|
|
49
|
+
*/
|
|
50
|
+
project_id: string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Visitor ID
|
|
54
|
+
*/
|
|
55
|
+
visitor_id: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface CustomerTopParams {
|
|
59
|
+
/**
|
|
60
|
+
* Project ID
|
|
61
|
+
*/
|
|
62
|
+
project_id: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Time range
|
|
66
|
+
*/
|
|
67
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of customers to return (default: 50)
|
|
71
|
+
*/
|
|
72
|
+
limit?: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export declare namespace Customers {
|
|
76
|
+
export { type CustomerProfileParams as CustomerProfileParams, type CustomerTopParams as CustomerTopParams };
|
|
77
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export { Attribution, type AttributionByOriginParams, type AttributionByUtmParams } from './attribution';
|
|
4
|
+
export { Conversion, type ConversionMetricsParams } from './conversion';
|
|
5
|
+
export { Customers, type CustomerProfileParams, type CustomerTopParams } from './customers';
|
|
6
|
+
export {
|
|
7
|
+
Revenue,
|
|
8
|
+
type AttributionByOriginResponse,
|
|
9
|
+
type AttributionByUtmResponse,
|
|
10
|
+
type ConversionMetricsResponse,
|
|
11
|
+
type CustomerProfileResponse,
|
|
12
|
+
type DashboardResponse,
|
|
13
|
+
type OriginAttributionDataPoint,
|
|
14
|
+
type Payment,
|
|
15
|
+
type RevenueOverTimeDataPoint,
|
|
16
|
+
type TimelineDataPoint,
|
|
17
|
+
type TimelineResponse,
|
|
18
|
+
type TopCustomer,
|
|
19
|
+
type TopCustomersResponse,
|
|
20
|
+
type UtmAttributionDataPoint,
|
|
21
|
+
type RevenueDashboardParams,
|
|
22
|
+
type RevenueTimelineParams,
|
|
23
|
+
} from './revenue';
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as AttributionAPI from './attribution';
|
|
5
|
+
import { Attribution, AttributionByOriginParams, AttributionByUtmParams } from './attribution';
|
|
6
|
+
import * as ConversionAPI from './conversion';
|
|
7
|
+
import { Conversion, ConversionMetricsParams } from './conversion';
|
|
8
|
+
import * as CustomersAPI from './customers';
|
|
9
|
+
import { CustomerProfileParams, CustomerTopParams, Customers } from './customers';
|
|
10
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
11
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
12
|
+
|
|
13
|
+
export class Revenue extends APIResource {
|
|
14
|
+
attribution: AttributionAPI.Attribution = new AttributionAPI.Attribution(this._client);
|
|
15
|
+
customers: CustomersAPI.Customers = new CustomersAPI.Customers(this._client);
|
|
16
|
+
conversion: ConversionAPI.Conversion = new ConversionAPI.Conversion(this._client);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Get key revenue metrics including total revenue, conversion rate, and average
|
|
20
|
+
* order value
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const dashboardResponse = await client.v1.revenue.dashboard(
|
|
25
|
+
* { project_id: 'project_id', time_range: 'last_hour' },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
dashboard(query: RevenueDashboardParams, options?: RequestOptions): APIPromise<DashboardResponse> {
|
|
30
|
+
return this._client.get('/api/v1/revenue/dashboard', { query, ...options });
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Get revenue metrics over time for chart visualization
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const timelineResponse = await client.v1.revenue.timeline({
|
|
39
|
+
* project_id: 'project_id',
|
|
40
|
+
* time_range: 'last_hour',
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
timeline(query: RevenueTimelineParams, options?: RequestOptions): APIPromise<TimelineResponse> {
|
|
45
|
+
return this._client.get('/api/v1/revenue/timeline', { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface AttributionByOriginResponse {
|
|
50
|
+
data?: Array<OriginAttributionDataPoint>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AttributionByUtmResponse {
|
|
54
|
+
data?: Array<UtmAttributionDataPoint>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ConversionMetricsResponse {
|
|
58
|
+
avg_purchases_per_customer?: number;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Time to conversion
|
|
62
|
+
*/
|
|
63
|
+
avg_time_to_first_purchase_hours?: number;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* % of visitors who paid
|
|
67
|
+
*/
|
|
68
|
+
conversion_rate?: number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Customer value
|
|
72
|
+
*/
|
|
73
|
+
customer_lifetime_value?: number;
|
|
74
|
+
|
|
75
|
+
median_time_to_first_purchase_hours?: number;
|
|
76
|
+
|
|
77
|
+
paying_customers?: number;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Repeat purchase metrics
|
|
81
|
+
*/
|
|
82
|
+
repeat_purchase_rate?: number;
|
|
83
|
+
|
|
84
|
+
total_visitors?: number;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface CustomerProfileResponse {
|
|
88
|
+
avg_order_value?: number;
|
|
89
|
+
|
|
90
|
+
currency?: string;
|
|
91
|
+
|
|
92
|
+
email?: string;
|
|
93
|
+
|
|
94
|
+
external_id?: string;
|
|
95
|
+
|
|
96
|
+
first_payment_date?: string;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Attribution
|
|
100
|
+
*/
|
|
101
|
+
first_traffic_origin?: string;
|
|
102
|
+
|
|
103
|
+
first_utm_campaign?: string;
|
|
104
|
+
|
|
105
|
+
first_utm_medium?: string;
|
|
106
|
+
|
|
107
|
+
first_utm_source?: string;
|
|
108
|
+
|
|
109
|
+
last_payment_date?: string;
|
|
110
|
+
|
|
111
|
+
name?: string;
|
|
112
|
+
|
|
113
|
+
payment_count?: number;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Payment history
|
|
117
|
+
*/
|
|
118
|
+
payments?: Array<Payment>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Revenue over time (last 90 days)
|
|
122
|
+
*/
|
|
123
|
+
revenue_over_time?: Array<RevenueOverTimeDataPoint>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Revenue summary
|
|
127
|
+
*/
|
|
128
|
+
total_revenue?: number;
|
|
129
|
+
|
|
130
|
+
user_id?: string;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Identity
|
|
134
|
+
*/
|
|
135
|
+
visitor_id?: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface DashboardResponse {
|
|
139
|
+
/**
|
|
140
|
+
* Average metrics
|
|
141
|
+
*/
|
|
142
|
+
avg_order_value?: number;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Average revenue per paying customer
|
|
146
|
+
*/
|
|
147
|
+
avg_revenue_per_customer?: number;
|
|
148
|
+
|
|
149
|
+
avg_revenue_per_identified_customer?: number;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Average revenue per session
|
|
153
|
+
*/
|
|
154
|
+
avg_revenue_per_session?: number;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* % of visitors who paid
|
|
158
|
+
*/
|
|
159
|
+
conversion_rate?: number;
|
|
160
|
+
|
|
161
|
+
currency?: string;
|
|
162
|
+
|
|
163
|
+
identified_customer_revenue?: number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Identified customers (have email/user_id)
|
|
167
|
+
*/
|
|
168
|
+
identified_customers?: number;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Customer metrics
|
|
172
|
+
*/
|
|
173
|
+
paying_customers?: number;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Count of successful payments
|
|
177
|
+
*/
|
|
178
|
+
total_payments?: number;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Core revenue metrics
|
|
182
|
+
*/
|
|
183
|
+
total_revenue?: number;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface OriginAttributionDataPoint {
|
|
187
|
+
/**
|
|
188
|
+
* Average revenue per paying customer
|
|
189
|
+
*/
|
|
190
|
+
avg_revenue_per_customer?: number;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* paying_customers / unique_visitors \* 100
|
|
194
|
+
*/
|
|
195
|
+
conversion_rate?: number;
|
|
196
|
+
|
|
197
|
+
currency?: string;
|
|
198
|
+
|
|
199
|
+
origin?: string;
|
|
200
|
+
|
|
201
|
+
paying_customers?: number;
|
|
202
|
+
|
|
203
|
+
payment_count?: number;
|
|
204
|
+
|
|
205
|
+
revenue_percentage?: number;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Revenue in smallest currency unit (cents)
|
|
209
|
+
*/
|
|
210
|
+
total_revenue?: number;
|
|
211
|
+
|
|
212
|
+
unique_visitors?: number;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface Payment {
|
|
216
|
+
amount?: number;
|
|
217
|
+
|
|
218
|
+
currency?: string;
|
|
219
|
+
|
|
220
|
+
payment_id?: string;
|
|
221
|
+
|
|
222
|
+
payment_timestamp?: string;
|
|
223
|
+
|
|
224
|
+
product_name?: string;
|
|
225
|
+
|
|
226
|
+
provider_type?: string;
|
|
227
|
+
|
|
228
|
+
status?: string;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface RevenueOverTimeDataPoint {
|
|
232
|
+
payment_count?: number;
|
|
233
|
+
|
|
234
|
+
timestamp?: string;
|
|
235
|
+
|
|
236
|
+
total_revenue?: number;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface TimelineDataPoint {
|
|
240
|
+
currency?: string;
|
|
241
|
+
|
|
242
|
+
payment_count?: number;
|
|
243
|
+
|
|
244
|
+
timestamp?: string;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Revenue in smallest currency unit (cents)
|
|
248
|
+
*/
|
|
249
|
+
total_revenue?: number;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface TimelineResponse {
|
|
253
|
+
data?: Array<TimelineDataPoint>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface TopCustomer {
|
|
257
|
+
avg_order_value?: number;
|
|
258
|
+
|
|
259
|
+
currency?: string;
|
|
260
|
+
|
|
261
|
+
email?: string;
|
|
262
|
+
|
|
263
|
+
external_id?: string;
|
|
264
|
+
|
|
265
|
+
first_payment_date?: string;
|
|
266
|
+
|
|
267
|
+
first_traffic_origin?: string;
|
|
268
|
+
|
|
269
|
+
last_payment_date?: string;
|
|
270
|
+
|
|
271
|
+
location_country_iso?: string;
|
|
272
|
+
|
|
273
|
+
name?: string;
|
|
274
|
+
|
|
275
|
+
payment_count?: number;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Total revenue in smallest currency unit (cents)
|
|
279
|
+
*/
|
|
280
|
+
total_revenue?: number;
|
|
281
|
+
|
|
282
|
+
user_id?: string;
|
|
283
|
+
|
|
284
|
+
visitor_id?: string;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface TopCustomersResponse {
|
|
288
|
+
customers?: Array<TopCustomer>;
|
|
289
|
+
|
|
290
|
+
total?: number;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export interface UtmAttributionDataPoint {
|
|
294
|
+
/**
|
|
295
|
+
* Average revenue per paying customer
|
|
296
|
+
*/
|
|
297
|
+
avg_revenue_per_customer?: number;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* paying_customers / unique_visitors \* 100
|
|
301
|
+
*/
|
|
302
|
+
conversion_rate?: number;
|
|
303
|
+
|
|
304
|
+
currency?: string;
|
|
305
|
+
|
|
306
|
+
paying_customers?: number;
|
|
307
|
+
|
|
308
|
+
payment_count?: number;
|
|
309
|
+
|
|
310
|
+
revenue_percentage?: number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Revenue in smallest currency unit (cents)
|
|
314
|
+
*/
|
|
315
|
+
total_revenue?: number;
|
|
316
|
+
|
|
317
|
+
unique_visitors?: number;
|
|
318
|
+
|
|
319
|
+
utm_value?: string;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface RevenueDashboardParams {
|
|
323
|
+
/**
|
|
324
|
+
* Project ID
|
|
325
|
+
*/
|
|
326
|
+
project_id: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Time range
|
|
330
|
+
*/
|
|
331
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface RevenueTimelineParams {
|
|
335
|
+
/**
|
|
336
|
+
* Project ID
|
|
337
|
+
*/
|
|
338
|
+
project_id: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Time range
|
|
342
|
+
*/
|
|
343
|
+
time_range: 'last_hour' | 'today' | 'last_7_days' | 'last_30_days' | 'last_90_days';
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
Revenue.Attribution = Attribution;
|
|
347
|
+
Revenue.Customers = Customers;
|
|
348
|
+
Revenue.Conversion = Conversion;
|
|
349
|
+
|
|
350
|
+
export declare namespace Revenue {
|
|
351
|
+
export {
|
|
352
|
+
type AttributionByOriginResponse as AttributionByOriginResponse,
|
|
353
|
+
type AttributionByUtmResponse as AttributionByUtmResponse,
|
|
354
|
+
type ConversionMetricsResponse as ConversionMetricsResponse,
|
|
355
|
+
type CustomerProfileResponse as CustomerProfileResponse,
|
|
356
|
+
type DashboardResponse as DashboardResponse,
|
|
357
|
+
type OriginAttributionDataPoint as OriginAttributionDataPoint,
|
|
358
|
+
type Payment as Payment,
|
|
359
|
+
type RevenueOverTimeDataPoint as RevenueOverTimeDataPoint,
|
|
360
|
+
type TimelineDataPoint as TimelineDataPoint,
|
|
361
|
+
type TimelineResponse as TimelineResponse,
|
|
362
|
+
type TopCustomer as TopCustomer,
|
|
363
|
+
type TopCustomersResponse as TopCustomersResponse,
|
|
364
|
+
type UtmAttributionDataPoint as UtmAttributionDataPoint,
|
|
365
|
+
type RevenueDashboardParams as RevenueDashboardParams,
|
|
366
|
+
type RevenueTimelineParams as RevenueTimelineParams,
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export {
|
|
370
|
+
Attribution as Attribution,
|
|
371
|
+
type AttributionByOriginParams as AttributionByOriginParams,
|
|
372
|
+
type AttributionByUtmParams as AttributionByUtmParams,
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export {
|
|
376
|
+
Customers as Customers,
|
|
377
|
+
type CustomerProfileParams as CustomerProfileParams,
|
|
378
|
+
type CustomerTopParams as CustomerTopParams,
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export { Conversion as Conversion, type ConversionMetricsParams as ConversionMetricsParams };
|
|
382
|
+
}
|