@revkeen/sdk 1.20260411.859 → 1.20260412.863

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.
@@ -1,3 +1,4 @@
1
+ import type * as RevKeen from "../../../../index.js";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -33,6 +34,13 @@ export interface CreatePriceRequest {
33
34
  nickname?: string;
34
35
  /** Stable key for API lookups */
35
36
  lookup_key?: string;
37
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */
38
+ billing_scheme?: CreatePriceRequest.BillingScheme;
39
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */
40
+ tiers_mode?: CreatePriceRequest.TiersMode;
41
+ /** Price tiers (ordered by `up_to`, min 2, max 50). Required when `billing_scheme` is `tiered`. Final tier MUST have `up_to: null`. */
42
+ tiers?: RevKeen.PriceTier[];
43
+ transform_quantity?: RevKeen.TransformQuantity;
36
44
  /** Custom key-value metadata */
37
45
  metadata?: Record<string, unknown>;
38
46
  }
@@ -58,5 +66,17 @@ export declare namespace CreatePriceRequest {
58
66
  readonly Year: "year";
59
67
  };
60
68
  type Interval = (typeof Interval)[keyof typeof Interval];
69
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */
70
+ const BillingScheme: {
71
+ readonly PerUnit: "per_unit";
72
+ readonly Tiered: "tiered";
73
+ };
74
+ type BillingScheme = (typeof BillingScheme)[keyof typeof BillingScheme];
75
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */
76
+ const TiersMode: {
77
+ readonly Graduated: "graduated";
78
+ readonly Volume: "volume";
79
+ };
80
+ type TiersMode = (typeof TiersMode)[keyof typeof TiersMode];
61
81
  }
62
82
  //# sourceMappingURL=CreatePriceRequest.d.ts.map
@@ -19,5 +19,15 @@ export var CreatePriceRequest;
19
19
  Month: "month",
20
20
  Year: "year",
21
21
  };
22
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */
23
+ CreatePriceRequest.BillingScheme = {
24
+ PerUnit: "per_unit",
25
+ Tiered: "tiered",
26
+ };
27
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */
28
+ CreatePriceRequest.TiersMode = {
29
+ Graduated: "graduated",
30
+ Volume: "volume",
31
+ };
22
32
  })(CreatePriceRequest || (CreatePriceRequest = {}));
23
33
  //# sourceMappingURL=CreatePriceRequest.js.map
@@ -1,5 +1,7 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import type * as RevKeen from "../../../../index.js";
4
+
3
5
  /**
4
6
  * @example
5
7
  * {
@@ -35,6 +37,13 @@ export interface CreatePriceRequest {
35
37
  nickname?: string;
36
38
  /** Stable key for API lookups */
37
39
  lookup_key?: string;
40
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */
41
+ billing_scheme?: CreatePriceRequest.BillingScheme;
42
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */
43
+ tiers_mode?: CreatePriceRequest.TiersMode;
44
+ /** Price tiers (ordered by `up_to`, min 2, max 50). Required when `billing_scheme` is `tiered`. Final tier MUST have `up_to: null`. */
45
+ tiers?: RevKeen.PriceTier[];
46
+ transform_quantity?: RevKeen.TransformQuantity;
38
47
  /** Custom key-value metadata */
39
48
  metadata?: Record<string, unknown>;
40
49
  }
@@ -61,4 +70,16 @@ export namespace CreatePriceRequest {
61
70
  Year: "year",
62
71
  } as const;
63
72
  export type Interval = (typeof Interval)[keyof typeof Interval];
73
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` with `tiers_mode` + `tiers` for graduated or volume pricing. */
74
+ export const BillingScheme = {
75
+ PerUnit: "per_unit",
76
+ Tiered: "tiered",
77
+ } as const;
78
+ export type BillingScheme = (typeof BillingScheme)[keyof typeof BillingScheme];
79
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be omitted otherwise. */
80
+ export const TiersMode = {
81
+ Graduated: "graduated",
82
+ Volume: "volume",
83
+ } as const;
84
+ export type TiersMode = (typeof TiersMode)[keyof typeof TiersMode];
64
85
  }
@@ -1,3 +1,4 @@
1
+ import type * as RevKeen from "../index.js";
1
2
  /**
2
3
  * A price defines how much and how often to charge for a product. A single product can have multiple prices for different currencies, intervals, or tiers.
3
4
  */
@@ -36,6 +37,14 @@ export interface Price {
36
37
  nickname?: string | null;
37
38
  /** Stable key for API lookups */
38
39
  lookup_key?: string | null;
40
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */
41
+ billing_scheme: Price.BillingScheme;
42
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */
43
+ tiers_mode?: Price.TiersMode | null;
44
+ /** Price tiers (ordered by `up_to`). Present only when `billing_scheme` is `tiered`. At least 2 tiers, final tier MUST have `up_to: null`. Immutable after creation. */
45
+ tiers?: RevKeen.PriceTier[] | null;
46
+ /** Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation. */
47
+ transform_quantity?: Price.TransformQuantity | null;
39
48
  /** Custom key-value metadata */
40
49
  metadata?: Record<string, unknown>;
41
50
  /** Creation timestamp */
@@ -70,5 +79,34 @@ export declare namespace Price {
70
79
  readonly Year: "year";
71
80
  };
72
81
  type Interval = (typeof Interval)[keyof typeof Interval];
82
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */
83
+ const BillingScheme: {
84
+ readonly PerUnit: "per_unit";
85
+ readonly Tiered: "tiered";
86
+ };
87
+ type BillingScheme = (typeof BillingScheme)[keyof typeof BillingScheme];
88
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */
89
+ const TiersMode: {
90
+ readonly Graduated: "graduated";
91
+ readonly Volume: "volume";
92
+ };
93
+ type TiersMode = (typeof TiersMode)[keyof typeof TiersMode];
94
+ /**
95
+ * Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation.
96
+ */
97
+ interface TransformQuantity {
98
+ /** Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */
99
+ divide_by: number;
100
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
101
+ round: TransformQuantity.Round;
102
+ }
103
+ namespace TransformQuantity {
104
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
105
+ const Round: {
106
+ readonly Up: "up";
107
+ readonly Down: "down";
108
+ };
109
+ type Round = (typeof Round)[keyof typeof Round];
110
+ }
73
111
  }
74
112
  //# sourceMappingURL=Price.d.ts.map
@@ -23,5 +23,23 @@ export var Price;
23
23
  Month: "month",
24
24
  Year: "year",
25
25
  };
26
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */
27
+ Price.BillingScheme = {
28
+ PerUnit: "per_unit",
29
+ Tiered: "tiered",
30
+ };
31
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */
32
+ Price.TiersMode = {
33
+ Graduated: "graduated",
34
+ Volume: "volume",
35
+ };
36
+ let TransformQuantity;
37
+ (function (TransformQuantity) {
38
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
39
+ TransformQuantity.Round = {
40
+ Up: "up",
41
+ Down: "down",
42
+ };
43
+ })(TransformQuantity = Price.TransformQuantity || (Price.TransformQuantity = {}));
26
44
  })(Price || (Price = {}));
27
45
  //# sourceMappingURL=Price.js.map
@@ -1,5 +1,7 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ import type * as RevKeen from "../index.js";
4
+
3
5
  /**
4
6
  * A price defines how much and how often to charge for a product. A single product can have multiple prices for different currencies, intervals, or tiers.
5
7
  */
@@ -38,6 +40,14 @@ export interface Price {
38
40
  nickname?: string | null;
39
41
  /** Stable key for API lookups */
40
42
  lookup_key?: string | null;
43
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */
44
+ billing_scheme: Price.BillingScheme;
45
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */
46
+ tiers_mode?: Price.TiersMode | null;
47
+ /** Price tiers (ordered by `up_to`). Present only when `billing_scheme` is `tiered`. At least 2 tiers, final tier MUST have `up_to: null`. Immutable after creation. */
48
+ tiers?: RevKeen.PriceTier[] | null;
49
+ /** Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation. */
50
+ transform_quantity?: Price.TransformQuantity | null;
41
51
  /** Custom key-value metadata */
42
52
  metadata?: Record<string, unknown>;
43
53
  /** Creation timestamp */
@@ -73,4 +83,35 @@ export namespace Price {
73
83
  Year: "year",
74
84
  } as const;
75
85
  export type Interval = (typeof Interval)[keyof typeof Interval];
86
+ /** Billing scheme. Defaults to `per_unit`. Set to `tiered` along with `tiers_mode` + `tiers` to use graduated or volume pricing. */
87
+ export const BillingScheme = {
88
+ PerUnit: "per_unit",
89
+ Tiered: "tiered",
90
+ } as const;
91
+ export type BillingScheme = (typeof BillingScheme)[keyof typeof BillingScheme];
92
+ /** Tiered pricing mode. Required when `billing_scheme` is `tiered`, must be null otherwise. */
93
+ export const TiersMode = {
94
+ Graduated: "graduated",
95
+ Volume: "volume",
96
+ } as const;
97
+ export type TiersMode = (typeof TiersMode)[keyof typeof TiersMode];
98
+
99
+ /**
100
+ * Optional quantity transform (package pricing) applied before tier lookup. Immutable after creation.
101
+ */
102
+ export interface TransformQuantity {
103
+ /** Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */
104
+ divide_by: number;
105
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
106
+ round: TransformQuantity.Round;
107
+ }
108
+
109
+ export namespace TransformQuantity {
110
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
111
+ export const Round = {
112
+ Up: "up",
113
+ Down: "down",
114
+ } as const;
115
+ export type Round = (typeof Round)[keyof typeof Round];
116
+ }
76
117
  }
@@ -0,0 +1,9 @@
1
+ export interface PriceTier {
2
+ /** Upper bound of this tier (1-based inclusive). `null` = open-ended catch-all. Only the FINAL tier may set `up_to: null`. */
3
+ up_to: number | null;
4
+ /** Per-unit charge in minor currency units (cents). May be null if the tier charges only a flat fee. */
5
+ unit_amount_minor: number | null;
6
+ /** Flat fee charged once when quantity enters this tier. May be null if the tier charges only a per-unit amount. */
7
+ flat_amount_minor: number | null;
8
+ }
9
+ //# sourceMappingURL=PriceTier.d.ts.map
@@ -0,0 +1,3 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
3
+ //# sourceMappingURL=PriceTier.js.map
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ export interface PriceTier {
4
+ /** Upper bound of this tier (1-based inclusive). `null` = open-ended catch-all. Only the FINAL tier may set `up_to: null`. */
5
+ up_to: number | null;
6
+ /** Per-unit charge in minor currency units (cents). May be null if the tier charges only a flat fee. */
7
+ unit_amount_minor: number | null;
8
+ /** Flat fee charged once when quantity enters this tier. May be null if the tier charges only a per-unit amount. */
9
+ flat_amount_minor: number | null;
10
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Optional quantity transform (package pricing) applied before tier lookup.
3
+ */
4
+ export interface TransformQuantity {
5
+ /** Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */
6
+ divide_by: number;
7
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
8
+ round: TransformQuantity.Round;
9
+ }
10
+ export declare namespace TransformQuantity {
11
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
12
+ const Round: {
13
+ readonly Up: "up";
14
+ readonly Down: "down";
15
+ };
16
+ type Round = (typeof Round)[keyof typeof Round];
17
+ }
18
+ //# sourceMappingURL=TransformQuantity.d.ts.map
@@ -0,0 +1,10 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var TransformQuantity;
3
+ (function (TransformQuantity) {
4
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
5
+ TransformQuantity.Round = {
6
+ Up: "up",
7
+ Down: "down",
8
+ };
9
+ })(TransformQuantity || (TransformQuantity = {}));
10
+ //# sourceMappingURL=TransformQuantity.js.map
@@ -0,0 +1,20 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ /**
4
+ * Optional quantity transform (package pricing) applied before tier lookup.
5
+ */
6
+ export interface TransformQuantity {
7
+ /** Package size — quantity is divided by this value before pricing. Must be >= 1. Example: `divide_by: 10` with `round: up` charges per pack of 10. */
8
+ divide_by: number;
9
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
10
+ round: TransformQuantity.Round;
11
+ }
12
+
13
+ export namespace TransformQuantity {
14
+ /** Rounding mode when quantity is not an exact multiple of `divide_by`. */
15
+ export const Round = {
16
+ Up: "up",
17
+ Down: "down",
18
+ } as const;
19
+ export type Round = (typeof Round)[keyof typeof Round];
20
+ }
@@ -98,6 +98,7 @@ export * from "./PhaseItem.js";
98
98
  export * from "./Price.js";
99
99
  export * from "./PriceErrorResponse.js";
100
100
  export * from "./PriceListResponse.js";
101
+ export * from "./PriceTier.js";
101
102
  export * from "./Product.js";
102
103
  export * from "./ProductCreateResponse.js";
103
104
  export * from "./ProductErrorResponse.js";
@@ -146,6 +147,7 @@ export * from "./Transaction.js";
146
147
  export * from "./TransactionListResponse.js";
147
148
  export * from "./TransactionRetrieveResponse.js";
148
149
  export * from "./TransactionReversalEligibilityResponse.js";
150
+ export * from "./TransformQuantity.js";
149
151
  export * from "./UnauthorizedErrorBody.js";
150
152
  export * from "./UpdateMeterResponse.js";
151
153
  export * from "./UsageAggregateResponse.js";
@@ -98,6 +98,7 @@ export * from "./PhaseItem.js";
98
98
  export * from "./Price.js";
99
99
  export * from "./PriceErrorResponse.js";
100
100
  export * from "./PriceListResponse.js";
101
+ export * from "./PriceTier.js";
101
102
  export * from "./Product.js";
102
103
  export * from "./ProductCreateResponse.js";
103
104
  export * from "./ProductErrorResponse.js";
@@ -146,6 +147,7 @@ export * from "./Transaction.js";
146
147
  export * from "./TransactionListResponse.js";
147
148
  export * from "./TransactionRetrieveResponse.js";
148
149
  export * from "./TransactionReversalEligibilityResponse.js";
150
+ export * from "./TransformQuantity.js";
149
151
  export * from "./UnauthorizedErrorBody.js";
150
152
  export * from "./UpdateMeterResponse.js";
151
153
  export * from "./UsageAggregateResponse.js";
@@ -98,6 +98,7 @@ export * from "./PhaseItem.js";
98
98
  export * from "./Price.js";
99
99
  export * from "./PriceErrorResponse.js";
100
100
  export * from "./PriceListResponse.js";
101
+ export * from "./PriceTier.js";
101
102
  export * from "./Product.js";
102
103
  export * from "./ProductCreateResponse.js";
103
104
  export * from "./ProductErrorResponse.js";
@@ -146,6 +147,7 @@ export * from "./Transaction.js";
146
147
  export * from "./TransactionListResponse.js";
147
148
  export * from "./TransactionRetrieveResponse.js";
148
149
  export * from "./TransactionReversalEligibilityResponse.js";
150
+ export * from "./TransformQuantity.js";
149
151
  export * from "./UnauthorizedErrorBody.js";
150
152
  export * from "./UpdateMeterResponse.js";
151
153
  export * from "./UsageAggregateResponse.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revkeen/sdk",
3
- "version": "1.20260411.859",
3
+ "version": "1.20260412.863",
4
4
  "description": "RevKeen API SDK - Stripe-like billing infrastructure for your SaaS",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",