@solvapay/server 1.0.1-preview.3 → 1.0.1-preview.4

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/dist/index.d.ts CHANGED
@@ -1,214 +1,83 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
2
- interface WebhookEvent {
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
+ interface WebhookProduct {
3
+ reference: string;
4
+ }
5
+ interface CustomerWebhookObject {
6
+ id: string;
7
+ created: number;
8
+ product: WebhookProduct | null;
9
+ reference?: string;
10
+ name?: string;
11
+ email?: string;
12
+ telephone?: string;
13
+ status?: string;
14
+ }
15
+ type WebhookPayloadObject = Record<string, unknown>;
16
+ type WebhookEventObjectMap = {
17
+ 'payment.succeeded': WebhookPayloadObject;
18
+ 'payment.failed': WebhookPayloadObject;
19
+ 'payment.refunded': WebhookPayloadObject;
20
+ 'payment.refund_failed': WebhookPayloadObject;
21
+ 'purchase.created': WebhookPayloadObject;
22
+ 'purchase.updated': WebhookPayloadObject;
23
+ 'purchase.cancelled': WebhookPayloadObject;
24
+ 'purchase.expired': WebhookPayloadObject;
25
+ 'purchase.suspended': WebhookPayloadObject;
26
+ 'customer.created': CustomerWebhookObject;
27
+ 'customer.updated': CustomerWebhookObject;
28
+ 'customer.deleted': CustomerWebhookObject;
29
+ 'checkout_session.created': WebhookPayloadObject;
30
+ };
31
+ type WebhookEventForType<TType extends WebhookEventType> = {
3
32
  id: string;
4
- type: WebhookEventType;
33
+ type: TType;
5
34
  created: number;
6
35
  api_version: string;
7
36
  data: {
8
- object: Record<string, any>;
9
- previous_attributes: Record<string, any> | null;
37
+ object: WebhookEventObjectMap[TType];
38
+ previous_attributes: Record<string, unknown> | null;
10
39
  };
11
40
  livemode: boolean;
12
41
  request: {
13
42
  id: string | null;
14
43
  idempotency_key: string | null;
15
44
  };
16
- }
45
+ };
46
+ type WebhookEvent = {
47
+ [TType in WebhookEventType]: WebhookEventForType<TType>;
48
+ }[WebhookEventType];
17
49
 
18
50
  interface components {
19
51
  schemas: {
20
- UpdateProviderDto: {
21
- /** @description Legal entity information */
22
- legalEntity?: Record<string, never>;
23
- /**
24
- * Provider description
25
- * @example My business
26
- */
27
- description?: string;
28
- /**
29
- * Business website URL
30
- * @example https://example.com
31
- */
32
- website?: string;
52
+ CreatePaymentIntentDto: {
53
+ productRef?: string;
54
+ customerReference: string;
55
+ planRef?: string;
56
+ pricingTier?: string;
33
57
  /**
34
- * Business type
35
- * @example individual
58
+ * @default product
36
59
  * @enum {string}
37
60
  */
38
- businessType?: "individual" | "company";
39
- /**
40
- * Business email address
41
- * @example business@example.com
42
- */
43
- businessEmail?: string;
44
- /**
45
- * Support email address
46
- * @example support@example.com
47
- */
48
- supportEmail?: string;
49
- /**
50
- * Business telephone number
51
- * @example +1234567890
52
- */
53
- telephone?: string;
54
- /**
55
- * Support telephone number
56
- * @example +1234567890
57
- */
58
- supportTelephone?: string;
59
- /**
60
- * Default currency code
61
- * @example usd
62
- */
63
- defaultCurrency?: string;
64
- /** @description Arbitrary metadata */
65
- metadata?: Record<string, never>;
66
- /** @description Terms of Service acceptance */
67
- tosAcceptance?: Record<string, never>;
68
- };
69
- CreateSecretKey: Record<string, never>;
70
- CreateUser: Record<string, never>;
71
- UpdateUser: Record<string, never>;
72
- UpdateProfile: Record<string, never>;
73
- UpdatePreferences: Record<string, never>;
74
- RequestEmailChange: {
75
- newEmail: string;
76
- };
77
- VerifyEmailChange: {
78
- code: string;
79
- };
80
- CreateUiCheckoutSessionRequest: {
81
- /**
82
- * Customer reference
83
- * @example cus_3c4d5e6f7g8h
84
- */
61
+ purpose: "product" | "credit_topup" | "usage_billing";
62
+ amount?: number;
63
+ currency?: string;
64
+ description?: string;
65
+ };
66
+ CreateCheckoutSessionRequest: {
85
67
  customerRef: string;
86
- /**
87
- * Plan reference (optional)
88
- * @example pln_2b3c4d5e6f7g
89
- */
68
+ productRef?: string;
90
69
  planRef?: string;
91
- /**
92
- * Product reference (required)
93
- * @example prd_1a2b3c4d5e6f
94
- */
95
- productRef: string;
96
- };
97
- CheckoutSessionResponse: {
98
- /**
99
- * Checkout session ID
100
- * @example 507f1f77bcf86cd799439011
101
- */
102
- id: string;
103
- /**
104
- * Public session ID used in checkout URL
105
- * @example a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
106
- */
107
- sessionId: string;
108
- /**
109
- * Amount in cents
110
- * @example 2999
111
- */
112
- amount: number;
113
- /**
114
- * Currency code
115
- * @example USD
116
- */
117
- currency: string;
118
- /**
119
- * Session status
120
- * @example active
121
- */
122
- status: string;
123
- /**
124
- * Checkout URL to open the checkout page
125
- * @example https://solvapay.com/customer/checkout?id=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
126
- */
127
- checkoutUrl: string;
128
- };
129
- SelectCustomerSessionProductRequest: {
130
- /**
131
- * Product reference or ID to scope the customer manage session
132
- * @example prd_1a2b3c4d5e6f
133
- */
134
- productRef: string;
70
+ returnUrl?: string;
71
+ /** @enum {string} */
72
+ purpose?: "credit_topup";
135
73
  };
136
- CancelRenewalRequest: {
137
- /** @description Reason for cancelling renewal */
74
+ CancelPurchaseRequest: {
138
75
  reason?: string;
139
76
  };
140
- ExternalAccount: {
141
- /**
142
- * Country code
143
- * @example US
144
- */
145
- country: string;
146
- /**
147
- * Currency code
148
- * @example usd
149
- */
150
- currency: string;
151
- /**
152
- * Account holder name
153
- * @example John Doe
154
- */
155
- accountHolderName: string;
156
- /**
157
- * Account holder type
158
- * @example individual
159
- * @enum {string}
160
- */
161
- accountHolderType: "individual" | "company";
162
- /**
163
- * Routing number
164
- * @example 110000000
165
- */
166
- routingNumber: string;
167
- /**
168
- * Account number
169
- * @example 000123456789
170
- */
171
- accountNumber: string;
172
- };
173
- TosAcceptance: {
174
- /**
175
- * IP address of user accepting ToS
176
- * @example 192.168.1.1
177
- */
178
- ip: string;
179
- };
180
- UpdateConnectedAccount: {
181
- /**
182
- * Business website URL
183
- * @example https://example.com
184
- */
185
- website?: string;
186
- /** @description External bank account */
187
- externalAccount?: components["schemas"]["ExternalAccount"];
188
- /** @description Terms of Service acceptance */
189
- tosAcceptance?: components["schemas"]["TosAcceptance"];
190
- };
191
- CreateCheckoutSessionRequest: {
192
- /**
193
- * Customer reference identifier
194
- * @example cus_3c4d5e6f7g8h
195
- */
196
- customerRef: string;
197
- /**
198
- * Product reference identifier
199
- * @example prd_1A2B3C4D
200
- */
77
+ ProcessPaymentIntentDto: {
201
78
  productRef: string;
202
- /**
203
- * Plan reference identifier (optional)
204
- * @example pln_2b3c4d5e6f7g
205
- */
79
+ customerRef: string;
206
80
  planRef?: string;
207
- /**
208
- * URL to redirect to after successful payment (optional)
209
- * @example https://example.com/payment-success
210
- */
211
- returnUrl?: string;
212
81
  };
213
82
  CreateCheckoutSessionResponse: {
214
83
  /**
@@ -222,141 +91,13 @@ interface components {
222
91
  */
223
92
  checkoutUrl: string;
224
93
  };
225
- Signup: {
226
- name: string;
227
- email: string;
228
- /** @enum {string} */
229
- type?: "provider" | "admin" | "super_admin";
230
- };
231
- AuthUserDto: {
232
- id: string;
233
- name: string;
234
- email: string;
235
- /** @enum {string} */
236
- type: "provider" | "admin" | "super_admin";
237
- emailVerified: boolean;
238
- /** @enum {string} */
239
- authProvider: "local" | "google" | "github" | "facebook";
240
- providerId?: string;
241
- providerRole?: string;
242
- preferences?: Record<string, never>;
243
- };
244
- AuthResponse: {
245
- user: components["schemas"]["AuthUserDto"];
246
- accessToken?: string;
247
- refreshToken?: string;
248
- expiresIn?: number;
249
- message?: string;
250
- requiresMfa?: boolean;
251
- requiresMfaSetup?: boolean;
252
- };
253
- Login: {
254
- /** @description Email to send a 6-digit login code to */
255
- email: string;
256
- };
257
- VerifyLoginCode: {
258
- email: string;
259
- /** @description 6-digit login code sent to email */
260
- code: string;
261
- };
262
- VerifyEmail: {
263
- emailVerificationCode: string;
264
- };
265
- DynamicClientRegistrationDto: {
266
- /** @example My AI Agent */
267
- client_name: string;
268
- /**
269
- * @example [
270
- * "https://agent.example.com/callback"
271
- * ]
272
- */
273
- redirect_uris: string[];
274
- /**
275
- * @example [
276
- * "authorization_code",
277
- * "refresh_token"
278
- * ]
279
- */
280
- grant_types?: string[];
281
- /**
282
- * @example [
283
- * "code"
284
- * ]
285
- */
286
- response_types?: string[];
287
- /** @example agent-123 */
288
- software_id?: string;
289
- /** @example 1.0.0 */
290
- software_version?: string;
291
- /** @example https://example.com/logo.png */
292
- logo_uri?: string;
293
- /** @example https://example.com/tos */
294
- tos_uri?: string;
295
- /** @example https://example.com/policy */
296
- policy_uri?: string;
297
- /** @example https://example.com */
298
- client_uri?: string;
299
- };
300
- DynamicClientRegistrationResponseDto: {
301
- /** @example client-id-123 */
302
- client_id: string;
303
- /** @example client-secret-456 */
304
- client_secret: string;
305
- /** @example 1734567890 */
306
- client_id_issued_at: number;
307
- /** @example 0 */
308
- client_secret_expires_at: number;
309
- /** @example My AI Agent */
310
- client_name: string;
311
- /**
312
- * @example [
313
- * "https://agent.example.com/callback"
314
- * ]
315
- */
316
- redirect_uris: string[];
317
- /**
318
- * @example [
319
- * "authorization_code",
320
- * "refresh_token"
321
- * ]
322
- */
323
- grant_types: string[];
324
- /**
325
- * @example [
326
- * "code"
327
- * ]
328
- */
329
- response_types: string[];
330
- /** @example openid profile email */
331
- scope: string;
332
- /** @example client_secret_basic */
333
- token_endpoint_auth_method: string;
334
- };
335
- GoogleLoginDto: {
336
- /** @description The authorization code returned by Google */
337
- code: string;
338
- /** @description The redirect URI used in the initial authorization request */
339
- redirect_uri: string;
340
- /** @description The state parameter returned by Google (contains client_id) */
341
- state: string;
342
- };
343
- GithubLoginDto: {
344
- /** @description The authorization code returned by GitHub */
345
- code: string;
346
- /** @description The redirect URI used in the initial authorization request */
347
- redirect_uri: string;
348
- /** @description The state parameter returned by GitHub (contains client_id) */
349
- state: string;
350
- };
351
- CreateOAuthClientDto: Record<string, never>;
352
- UpdateOAuthClientDto: Record<string, never>;
353
94
  Plan: {
354
95
  /**
355
96
  * Plan type exposed in SDK
356
97
  * @example recurring
357
98
  * @enum {string}
358
99
  */
359
- type: "recurring" | "one-time";
100
+ type: "recurring" | "one-time" | "usage-based";
360
101
  /**
361
102
  * Plan ID
362
103
  * @example 507f1f77bcf86cd799439011
@@ -367,6 +108,16 @@ interface components {
367
108
  * @example pln_1A2B3C4D
368
109
  */
369
110
  reference: string;
111
+ /**
112
+ * Plan name
113
+ * @example Starter
114
+ */
115
+ name?: string;
116
+ /**
117
+ * Plan description
118
+ * @example Best for teams getting started
119
+ */
120
+ description?: string;
370
121
  /**
371
122
  * Plan price in cents
372
123
  * @example 2999
@@ -409,8 +160,8 @@ interface components {
409
160
  */
410
161
  billingModel?: "pre-paid" | "post-paid";
411
162
  /**
412
- * Price per usage unit
413
- * @example 0.01
163
+ * Price per usage unit in cents (supports decimals, e.g. 0.1 = 1/10 cent)
164
+ * @example 0.1
414
165
  */
415
166
  pricePerUnit?: number;
416
167
  /**
@@ -436,11 +187,6 @@ interface components {
436
187
  features?: {
437
188
  [key: string]: unknown;
438
189
  };
439
- /**
440
- * Whether this is a free tier plan
441
- * @example false
442
- */
443
- isFreeTier: boolean;
444
190
  /**
445
191
  * Whether payment is required
446
192
  * @example true
@@ -466,176 +212,76 @@ interface components {
466
212
  updatedAt: string;
467
213
  };
468
214
  CreatePlanRequest: {
469
- /**
470
- * Plan type exposed in SDK
471
- * @example recurring
472
- * @enum {string}
473
- */
474
- type?: "recurring" | "one-time";
475
- /**
476
- * Billing cycle (required for recurring/hybrid, optional for post-paid usage-based)
477
- * @example monthly
478
- * @enum {string}
479
- */
215
+ name?: string;
216
+ description?: string;
217
+ /** @enum {string} */
218
+ type?: "recurring" | "usage-based" | "hybrid" | "one-time";
219
+ /** @enum {string} */
480
220
  billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
481
- /**
482
- * Plan price in cents
483
- * @example 2999
484
- */
485
221
  price?: number;
486
- /**
487
- * Currency code (ISO 4217)
488
- * @example USD
489
- * @enum {string}
490
- */
491
- currency?: "USD" | "EUR" | "GBP" | "SEK" | "NOK" | "DKK" | "CAD" | "AUD" | "JPY" | "CHF" | "PLN" | "CZK" | "HUF" | "RON" | "BGN" | "HRK" | "RSD" | "MKD" | "BAM" | "ALL" | "ISK" | "TRY" | "RUB" | "UAH" | "BYN" | "MDL" | "GEL" | "AMD" | "AZN" | "KZT" | "KGS" | "TJS" | "TMT" | "UZS" | "MNT" | "CNY" | "KRW" | "THB" | "VND" | "IDR" | "MYR" | "SGD" | "PHP" | "INR" | "PKR" | "BDT" | "LKR" | "NPR" | "AFN" | "IRR" | "IQD" | "JOD" | "KWD" | "LBP" | "OMR" | "QAR" | "SAR" | "SYP" | "AED" | "YER" | "ILS" | "EGP" | "MAD" | "TND" | "DZD" | "LYD" | "SDG" | "ETB" | "KES" | "TZS" | "UGX" | "RWF" | "BIF" | "DJF" | "SOS" | "ERN" | "SLL" | "GMD" | "GNF" | "CVE" | "STN" | "AOA" | "ZAR" | "BWP" | "SZL" | "LSL" | "NAD" | "ZMW" | "ZWL" | "MZN" | "MWK" | "MGA" | "MUR" | "SCR" | "KMF" | "MVR";
492
- /**
493
- * Number of free units included
494
- * @example 100
495
- */
222
+ pricePerUnit?: number;
223
+ currency?: string;
224
+ /** @enum {string} */
225
+ billingModel?: "pre-paid" | "post-paid";
496
226
  freeUnits?: number;
497
- /**
498
- * Usage limit for the meter
499
- * @example 10000
500
- */
501
227
  limit?: number;
502
- /**
503
- * Usage limits (shape varies by plan type)
504
- * @example {
505
- * "maxTransactions": 1000
506
- * }
507
- */
508
- limits?: {
228
+ limits: {
509
229
  [key: string]: unknown;
510
230
  };
511
- /**
512
- * Plan features (generic key/value, shape is provider-defined)
513
- * @example {
514
- * "apiAccess": true,
515
- * "prioritySupport": false
516
- * }
517
- */
518
- features?: {
231
+ metadata: {
519
232
  [key: string]: unknown;
520
233
  };
521
- /**
522
- * Whether this is a free tier plan
523
- * @example false
524
- */
525
- isFreeTier?: boolean;
526
- /**
527
- * Whether payment is required
528
- * @example true
529
- */
530
- requiresPayment?: boolean;
531
- /**
532
- * Plan status
533
- * @example active
534
- * @enum {string}
535
- */
234
+ features: {
235
+ [key: string]: unknown;
236
+ };
237
+ /** @enum {string} */
536
238
  status?: "active" | "inactive" | "archived";
537
- /**
538
- * Maximum number of active users
539
- * @example 10
540
- */
541
239
  maxActiveUsers?: number;
542
- /**
543
- * Access expiry in days
544
- * @example 30
545
- */
546
240
  accessExpiryDays?: number;
547
- /** @description Additional metadata */
548
- metadata?: {
549
- [key: string]: unknown;
550
- };
551
- /**
552
- * Whether this is the default plan
553
- * @example false
554
- */
555
241
  default?: boolean;
556
242
  };
557
243
  UpdatePlanRequest: {
558
- /**
559
- * Billing cycle
560
- * @example monthly
561
- * @enum {string}
562
- */
244
+ name?: string;
245
+ description?: string;
246
+ /** @enum {string} */
563
247
  billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
564
- /**
565
- * Plan price in cents
566
- * @example 2999
567
- */
568
248
  price?: number;
569
- /**
570
- * Currency code (ISO 4217)
571
- * @example USD
572
- */
249
+ pricePerUnit?: number;
573
250
  currency?: string;
574
- /**
575
- * Number of free units included
576
- * @example 100
577
- */
251
+ /** @enum {string} */
252
+ billingModel?: "pre-paid" | "post-paid";
578
253
  freeUnits?: number;
579
- /**
580
- * Usage limit for the meter
581
- * @example 10000
582
- */
583
254
  limit?: number;
584
- /**
585
- * Usage limits (shape varies by plan type)
586
- * @example {
587
- * "maxTransactions": 1000
588
- * }
589
- */
590
- limits?: {
255
+ limits: {
591
256
  [key: string]: unknown;
592
257
  };
593
- /**
594
- * Plan features (generic key/value, shape is provider-defined)
595
- * @example {
596
- * "apiAccess": true,
597
- * "prioritySupport": false
598
- * }
599
- */
600
- features?: {
258
+ features: {
601
259
  [key: string]: unknown;
602
260
  };
603
- /**
604
- * Whether this is a free tier plan
605
- * @example false
606
- */
607
- isFreeTier?: boolean;
608
- /**
609
- * Whether payment is required
610
- * @example true
611
- */
612
- requiresPayment?: boolean;
613
- /**
614
- * Plan status
615
- * @example active
616
- * @enum {string}
617
- */
261
+ /** @enum {string} */
618
262
  status?: "active" | "inactive" | "archived";
619
- /**
620
- * Maximum number of active users
621
- * @example 10
622
- */
623
263
  maxActiveUsers?: number;
624
- /**
625
- * Access expiry in days
626
- * @example 30
627
- */
628
264
  accessExpiryDays?: number;
629
- /** @description Additional metadata */
630
- metadata?: {
265
+ metadata: {
631
266
  [key: string]: unknown;
632
267
  };
633
- /**
634
- * Whether this is the default plan
635
- * @example false
636
- */
637
268
  default?: boolean;
638
269
  };
270
+ CreateProductRequest: {
271
+ name: string;
272
+ description?: string;
273
+ imageUrl?: string;
274
+ productType?: string;
275
+ isMcpPay?: boolean;
276
+ config: {
277
+ fulfillmentType?: string;
278
+ validityPeriod?: number;
279
+ deliveryMethod?: string;
280
+ };
281
+ metadata: {
282
+ [key: string]: unknown;
283
+ };
284
+ };
639
285
  ProductConfigDto: {
640
286
  /**
641
287
  * Fulfillment type
@@ -653,36 +299,6 @@ interface components {
653
299
  */
654
300
  deliveryMethod?: string;
655
301
  };
656
- CreateProductRequest: {
657
- /**
658
- * Product name
659
- * @example AI Writing Assistant
660
- */
661
- name: string;
662
- /**
663
- * Product description
664
- * @example AI-powered writing tool
665
- */
666
- description?: string;
667
- /** @description URL to the product image */
668
- imageUrl?: string;
669
- /**
670
- * Free-form product type defined by the provider
671
- * @example Coding Assistant
672
- */
673
- productType?: string;
674
- /**
675
- * Whether this product uses MCP Pay proxy
676
- * @default false
677
- */
678
- isMcpPay: boolean;
679
- /** @description Product-specific configuration */
680
- config?: components["schemas"]["ProductConfigDto"];
681
- /** @description Arbitrary key-value metadata */
682
- metadata?: {
683
- [key: string]: unknown;
684
- };
685
- };
686
302
  SdkPlanResponse: {
687
303
  /**
688
304
  * Plan ID
@@ -730,8 +346,8 @@ interface components {
730
346
  */
731
347
  billingModel?: string;
732
348
  /**
733
- * Price per unit in cents
734
- * @example 10
349
+ * Price per usage unit in cents (supports decimals, e.g. 0.1 = 1/10 cent)
350
+ * @example 0.1
735
351
  */
736
352
  pricePerUnit?: number;
737
353
  /**
@@ -762,11 +378,6 @@ interface components {
762
378
  features?: {
763
379
  [key: string]: unknown;
764
380
  };
765
- /**
766
- * Whether this is a free tier plan
767
- * @example false
768
- */
769
- isFreeTier: boolean;
770
381
  /**
771
382
  * Whether payment is required
772
383
  * @example true
@@ -848,184 +459,68 @@ interface components {
848
459
  * "mcpServerReference": "mcp_ABC123",
849
460
  * "mcpSubdomain": "acme-docs",
850
461
  * "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
851
- * "originUrl": "https://origin.example.com/mcp",
852
- * "defaultPlanId": "67f90f1f1b1c9c0b8df0f001"
853
- * }
854
- */
855
- mcp?: {
856
- [key: string]: unknown;
857
- };
858
- };
859
- UpdateProductRequest: {
860
- /** @description Product name */
861
- name?: string;
862
- /** @description Product description */
863
- description?: string;
864
- /** @description URL to the product image */
865
- imageUrl?: string;
866
- /** @description Free-form product type defined by the provider */
867
- productType?: string;
868
- /**
869
- * Product status
870
- * @enum {string}
871
- */
872
- status?: "active" | "inactive" | "suspended";
873
- /** @description Product-specific configuration */
874
- config?: components["schemas"]["ProductConfigDto"];
875
- /** @description Arbitrary key-value metadata */
876
- metadata?: {
877
- [key: string]: unknown;
878
- };
879
- };
880
- McpBootstrapFreePlanConfig: {
881
- /**
882
- * Free plan display name override
883
- * @example Starter
884
- */
885
- name?: string;
886
- /**
887
- * Included free units (default 1000)
888
- * @example 500
889
- */
890
- freeUnits?: number;
891
- };
892
- McpBootstrapPaidPlanInput: {
893
- /**
894
- * Logical plan key (must not be "free")
895
- * @example pro
896
- */
897
- key: string;
898
- /**
899
- * Plan display name
900
- * @example Pro
901
- */
902
- name: string;
903
- /**
904
- * Plan price in cents (must be > 0)
905
- * @example 2000
906
- */
907
- price: number;
908
- /**
909
- * Currency code (ISO 4217)
910
- * @example USD
911
- */
912
- currency: string;
913
- /**
914
- * Billing cycle for recurring plans
915
- * @example monthly
916
- * @enum {string}
917
- */
918
- billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
919
- /**
920
- * Plan type
921
- * @example recurring
922
- * @enum {string}
923
- */
924
- type?: "recurring" | "one-time";
925
- /**
926
- * Included free units
927
- * @example 1000
928
- */
929
- freeUnits?: number;
930
- /**
931
- * Meter id for usage tracking
932
- * @example 67f90f1f1b1c9c0b8df0f001
933
- */
934
- meterId?: string;
935
- /**
936
- * Plan usage limit
937
- * @example 10000
462
+ * "originUrl": "https://origin.example.com/mcp",
463
+ * "defaultPlanId": "67f90f1f1b1c9c0b8df0f001"
464
+ * }
938
465
  */
939
- limit?: number;
940
- /** @description Plan features */
941
- features?: {
466
+ mcp?: {
942
467
  [key: string]: unknown;
943
468
  };
944
469
  };
945
- McpBootstrapToolInput: {
946
- /**
947
- * Tool name
948
- * @example search_docs
949
- */
950
- name: string;
951
- /**
952
- * Tool description
953
- * @example Search indexed documents
954
- */
470
+ UpdateProductRequest: {
471
+ name?: string;
955
472
  description?: string;
956
- /**
957
- * If true, tool is publicly available without a plan
958
- * @example false
959
- */
960
- noPlan?: boolean;
961
- /**
962
- * Direct plan IDs allowed for this tool
963
- * @example [
964
- * "67f90f1f1b1c9c0b8df0f001"
965
- * ]
966
- */
967
- planIds?: string[];
968
- /**
969
- * Plan references allowed for this tool
970
- * @example [
971
- * "pln_ABC123"
972
- * ]
973
- */
974
- planRefs?: string[];
975
- /**
976
- * Bootstrap plan keys allowed for this tool (for example free or starter_paid)
977
- * @example [
978
- * "free"
979
- * ]
980
- */
981
- planKeys?: string[];
473
+ imageUrl?: string;
474
+ productType?: string;
475
+ /** @enum {string} */
476
+ status?: "active" | "inactive" | "suspended";
477
+ config: {
478
+ fulfillmentType?: string;
479
+ validityPeriod?: number;
480
+ deliveryMethod?: string;
481
+ };
482
+ metadata: {
483
+ [key: string]: unknown;
484
+ };
982
485
  };
983
- McpBootstrapRequest: {
984
- /**
985
- * Product name (optional when derivable from origin MCP metadata)
986
- * @example Acme MCP Toolkit
987
- */
486
+ McpBootstrapDto: {
988
487
  name?: string;
989
- /**
990
- * Product description
991
- * @example MCP toolkit with tiered access
992
- */
993
488
  description?: string;
994
- /** @description Product image URL */
995
489
  imageUrl?: string;
996
- /**
997
- * Free-form product type
998
- * @example MCP Server
999
- */
1000
490
  productType?: string;
1001
- /**
1002
- * Origin MCP server URL (must be https)
1003
- * @example https://origin.example.com/mcp
1004
- */
491
+ /** Format: uri */
1005
492
  originUrl: string;
1006
- /**
1007
- * Optional final MCP subdomain override (for example, value returned by bootstrap-subdomain-checks)
1008
- * @example acme-docs
1009
- */
1010
493
  mcpDomain?: string;
1011
- /**
1012
- * Optional auth header name forwarded to origin server
1013
- * @example X-API-Key
1014
- */
1015
494
  authHeaderName?: string;
1016
- /**
1017
- * Optional auth API key forwarded to origin server
1018
- * @example sk-origin-123
1019
- */
1020
495
  authApiKey?: string;
1021
- /** @description Free plan config overrides. A free plan is always created; this just customizes name/freeUnits. */
1022
- freePlan?: components["schemas"]["McpBootstrapFreePlanConfig"];
1023
- /** @description Paid plan definitions requiring price + currency */
1024
- paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1025
- /** @description Tool to plan mapping configuration */
1026
- tools?: components["schemas"]["McpBootstrapToolInput"][];
1027
- /** @description Arbitrary product metadata */
1028
- metadata?: {
496
+ plans?: {
497
+ key: string;
498
+ name: string;
499
+ price: number;
500
+ currency: string;
501
+ /** @enum {string} */
502
+ billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
503
+ /** @enum {string} */
504
+ type?: "recurring" | "one-time" | "usage-based";
505
+ pricePerUnit?: number;
506
+ /** @enum {string} */
507
+ billingModel?: "pre-paid" | "post-paid";
508
+ freeUnits?: number;
509
+ meterId?: string;
510
+ limit?: number;
511
+ features?: {
512
+ [key: string]: unknown;
513
+ };
514
+ }[];
515
+ tools?: {
516
+ name: string;
517
+ description?: string;
518
+ noPlan?: boolean;
519
+ planIds?: string[];
520
+ planRefs?: string[];
521
+ planKeys?: string[];
522
+ }[];
523
+ metadata: {
1029
524
  [key: string]: unknown;
1030
525
  };
1031
526
  };
@@ -1070,130 +565,138 @@ interface components {
1070
565
  description?: string;
1071
566
  }[];
1072
567
  };
1073
- McpBootstrapPreviewResult: {
1074
- /** @description Discovered tools from the origin MCP server */
1075
- discoveredTools: {
1076
- name?: string;
1077
- description?: string;
568
+ ConfigureMcpPlansDto: {
569
+ plans?: {
570
+ key: string;
571
+ name: string;
572
+ price: number;
573
+ currency: string;
574
+ /** @enum {string} */
575
+ billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
576
+ /** @enum {string} */
577
+ type?: "recurring" | "one-time" | "usage-based";
578
+ pricePerUnit?: number;
579
+ /** @enum {string} */
580
+ billingModel?: "pre-paid" | "post-paid";
581
+ freeUnits?: number;
582
+ meterId?: string;
583
+ limit?: number;
584
+ features?: {
585
+ [key: string]: unknown;
586
+ };
1078
587
  }[];
1079
- /** @description Validation status for the provided bootstrap payload */
1080
- validation: {
1081
- valid?: boolean;
1082
- errors?: components["schemas"]["McpBootstrapPreviewValidationError"][];
588
+ toolMapping?: {
589
+ name: string;
590
+ planKeys: string[];
591
+ }[];
592
+ };
593
+ ConfigureMcpPlansResult: {
594
+ /** @description Updated product */
595
+ product: components["schemas"]["SdkProductResponse"];
596
+ /** @description Updated MCP server identity */
597
+ mcpServer: {
598
+ [key: string]: unknown;
599
+ };
600
+ /** @description Resolved plan mapping by key (includes existing free plan) */
601
+ planMap: {
602
+ [key: string]: unknown;
1083
603
  };
604
+ };
605
+ CloneProductDto: {
606
+ name?: string;
607
+ };
608
+ CreateUsageRequest: {
609
+ customerId: string;
1084
610
  /**
1085
- * Product name derived from origin MCP metadata or hostname fallback
1086
- * @example acme-origin-mcp
611
+ * @default api_call
612
+ * @enum {string}
1087
613
  */
1088
- derivedName?: string;
614
+ actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
615
+ /** @default 1 */
616
+ units: number;
1089
617
  /**
1090
- * Product description derived from origin server instructions
1091
- * @example MCP toolkit for document retrieval and summarization.
618
+ * @default success
619
+ * @enum {string}
1092
620
  */
1093
- derivedDescription?: string;
1094
- /** @description Source of derived metadata */
1095
- metadataSource: {
1096
- /** @enum {string} */
1097
- name?: "request" | "origin" | "hostname";
1098
- /** @enum {string} */
1099
- description?: "request" | "instructions" | "none";
621
+ outcome: "success" | "paywall" | "fail";
622
+ productReference?: string;
623
+ purchaseReference?: string;
624
+ description?: string;
625
+ errorMessage?: string;
626
+ metadata: {
627
+ [key: string]: unknown;
1100
628
  };
1101
- /** @description Suggested default tool-to-plan mapping for UI review */
1102
- suggestedMapping: {
1103
- name?: string;
629
+ duration?: number;
630
+ /** Format: date-time */
631
+ timestamp: string;
632
+ idempotencyKey?: string;
633
+ };
634
+ BulkCreateUsageRequest: {
635
+ events: {
636
+ customerId: string;
637
+ /**
638
+ * @default api_call
639
+ * @enum {string}
640
+ */
641
+ actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
642
+ /** @default 1 */
643
+ units: number;
644
+ /**
645
+ * @default success
646
+ * @enum {string}
647
+ */
648
+ outcome: "success" | "paywall" | "fail";
649
+ productReference?: string;
650
+ purchaseReference?: string;
1104
651
  description?: string;
1105
- planKey?: string;
652
+ errorMessage?: string;
653
+ metadata?: {
654
+ [key: string]: unknown;
655
+ };
656
+ duration?: number;
657
+ /** Format: date-time */
658
+ timestamp: string;
659
+ idempotencyKey?: string;
1106
660
  }[];
1107
661
  };
1108
- RecordMeterEventDto: {
1109
- /**
1110
- * Meter name to record against
1111
- * @example requests
1112
- */
662
+ RecordMeterEventZodDto: {
1113
663
  meterName: string;
1114
- /**
1115
- * Customer reference
1116
- * @example cus_ABC123
1117
- */
1118
664
  customerId: string;
1119
- /**
1120
- * Numeric value (default 1)
1121
- * @default 1
1122
- * @example 1
1123
- */
1124
- value: number;
1125
- /**
1126
- * Arbitrary key-value tags
1127
- * @example {
1128
- * "endpoint": "/api/v1/search",
1129
- * "region": "us-east-1"
1130
- * }
1131
- */
1132
- properties?: {
665
+ value?: number;
666
+ properties: {
1133
667
  [key: string]: unknown;
1134
668
  };
1135
- /** @description Product ID to scope the usage event to */
1136
669
  productId?: string;
1137
- /** @description Product reference to scope the usage event to */
1138
670
  productReference?: string;
1139
- /** @description ISO 8601 timestamp (defaults to now) */
1140
671
  timestamp?: string;
1141
672
  };
1142
- RecordBulkMeterEventsDto: {
1143
- /** @description Array of events to record */
1144
- events: components["schemas"]["RecordMeterEventDto"][];
1145
- };
1146
- CreateCustomerSessionRequest: {
1147
- /**
1148
- * Customer reference identifier
1149
- * @example cus_3c4d5e6f7g8h
1150
- */
1151
- customerRef: string;
1152
- /**
1153
- * Optional product reference or ID to scope the customer manage page to a single product.
1154
- * @example prd_1a2b3c4d5e6f
1155
- */
1156
- productRef?: string;
1157
- };
1158
- CustomerSessionResponse: {
1159
- /**
1160
- * Customer session ID
1161
- * @example 507f1f77bcf86cd799439011
1162
- */
1163
- id: string;
1164
- /**
1165
- * Public session ID used in customer URL
1166
- * @example e3f1c2d4b6a89f001122334455667788
1167
- */
1168
- sessionId: string;
1169
- /**
1170
- * Session status
1171
- * @example active
1172
- */
1173
- status: string;
1174
- /**
1175
- * Customer URL to open the customer page
1176
- * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
1177
- */
1178
- customerUrl: string;
673
+ RecordBulkMeterEventsZodDto: {
674
+ events: {
675
+ meterName: string;
676
+ customerId: string;
677
+ value?: number;
678
+ properties?: {
679
+ [key: string]: unknown;
680
+ };
681
+ productId?: string;
682
+ productReference?: string;
683
+ timestamp?: string;
684
+ }[];
1179
685
  };
1180
686
  CreateCustomerRequest: {
1181
- /**
1182
- * Customer email address (required)
1183
- * @example customer@example.com
1184
- */
687
+ /** Format: email */
1185
688
  email: string;
1186
- /**
1187
- * Customer full name (optional)
1188
- * @example John Doe
1189
- */
1190
689
  name?: string;
1191
- /**
1192
- * External reference ID from your auth system to map this customer to an auth user (optional)
1193
- * @example auth_user_12345
1194
- */
690
+ telephone?: string;
691
+ metadata: {
692
+ [key: string]: unknown;
693
+ };
1195
694
  externalRef?: string;
1196
695
  };
696
+ CreateCustomerSessionRequest: {
697
+ customerRef: string;
698
+ productRef?: string;
699
+ };
1197
700
  PurchaseInfo: {
1198
701
  /**
1199
702
  * Purchase reference
@@ -1221,15 +724,25 @@ interface components {
1221
724
  */
1222
725
  startDate: string;
1223
726
  /**
1224
- * Amount paid in original currency (in cents)
727
+ * Amount in USD cents (normalised for aggregation)
1225
728
  * @example 9900
1226
729
  */
1227
730
  amount: number;
1228
731
  /**
1229
- * Currency code
1230
- * @example USD
732
+ * Original amount in the payment currency (minor units)
733
+ * @example 7500
734
+ */
735
+ originalAmount?: number;
736
+ /**
737
+ * ISO 4217 currency code of the customer-facing charge
738
+ * @example GBP
1231
739
  */
1232
740
  currency: string;
741
+ /**
742
+ * Exchange rate from original currency to USD
743
+ * @example 1.32
744
+ */
745
+ exchangeRate?: number;
1233
746
  /**
1234
747
  * End date of purchase
1235
748
  * @example 2025-11-27T10:00:00Z
@@ -1320,15 +833,7 @@ interface components {
1320
833
  updatedAt: string;
1321
834
  };
1322
835
  UserInfoRequest: {
1323
- /**
1324
- * Customer reference
1325
- * @example cus_3C4D5E6F
1326
- */
1327
836
  customerRef: string;
1328
- /**
1329
- * Product reference
1330
- * @example prd_1A2B3C4D
1331
- */
1332
837
  productRef: string;
1333
838
  };
1334
839
  UserInfoUserDto: {
@@ -1350,169 +855,60 @@ interface components {
1350
855
  remaining: number;
1351
856
  /**
1352
857
  * Meter ObjectId reference
1353
- * @example 507f1f77bcf86cd799439011
1354
- */
1355
- meterId?: string;
1356
- /** @example 25 */
1357
- percentUsed?: number | null;
1358
- };
1359
- UserInfoPlanDto: {
1360
- /** @example pln_2B3C4D5E */
1361
- reference: string;
1362
- /**
1363
- * Price in minor currency units (e.g. cents)
1364
- * @example 2999
1365
- */
1366
- price: number;
1367
- /** @example USD */
1368
- currency: string;
1369
- /** @example recurring */
1370
- type: string;
1371
- /** @example monthly */
1372
- billingCycle?: string | null;
1373
- features?: string[] | null;
1374
- limits?: {
1375
- [key: string]: unknown;
1376
- } | null;
1377
- };
1378
- UserInfoPurchaseDto: {
1379
- /** @example pur_1A2B3C4D */
1380
- reference: string;
1381
- /** @example active */
1382
- status: string;
1383
- /** @example My API Product */
1384
- productName: string;
1385
- /** @example recurring */
1386
- planType: string;
1387
- /** @example 2025-10-27T10:00:00Z */
1388
- startDate?: string | null;
1389
- /** @example 2025-11-27T10:00:00Z */
1390
- endDate?: string | null;
1391
- usage?: components["schemas"]["UserInfoUsageDto"];
1392
- plan?: components["schemas"]["UserInfoPlanDto"];
1393
- };
1394
- UserInfoResponse: {
1395
- /**
1396
- * Human-readable status summary
1397
- * @example Active subscription: My API Product (25% usage consumed)
1398
- */
1399
- status: string;
1400
- /**
1401
- * Customer portal session URL
1402
- * @example https://solvapay.com/customer/manage?id=abc123
1403
- */
1404
- verifyUrl?: string | null;
1405
- user?: components["schemas"]["UserInfoUserDto"];
1406
- purchase?: components["schemas"]["UserInfoPurchaseDto"];
1407
- };
1408
- McpToolDto: {
1409
- /**
1410
- * Tool name
1411
- * @example search_documents
1412
- */
1413
- name: string;
1414
- /**
1415
- * Plan IDs that grant access to this tool
1416
- * @example [
1417
- * "pln_abc123"
1418
- * ]
1419
- */
1420
- planIds?: string[];
1421
- /**
1422
- * If true, the tool is unprotected (no purchase check or usage tracking)
1423
- * @example false
1424
- */
1425
- noPlan?: boolean;
1426
- /**
1427
- * Human-readable tool description
1428
- * @example Search indexed documents
1429
- */
1430
- description?: string;
1431
- /**
1432
- * Whether this is a virtual platform tool handled by SolvaPay
1433
- * @example false
1434
- */
1435
- isVirtual?: boolean;
1436
- };
1437
- McpServerDto: {
1438
- /**
1439
- * Server ID
1440
- * @example 507f1f77bcf86cd799439011
1441
- */
1442
- id?: string;
1443
- /**
1444
- * Unique server reference
1445
- * @example mcp_abc123
1446
- */
1447
- reference?: string;
1448
- /**
1449
- * Domain slug used to derive the MCP endpoint subdomain
1450
- * @example my-mcp-server
1451
- */
1452
- name: string;
1453
- /**
1454
- * URL-safe subdomain derived from name
1455
- * @example my-mcp-server
1456
- */
1457
- subdomain: string;
1458
- /**
1459
- * SolvaPay proxy URL that MCP clients connect to
1460
- * @example https://mytelescope.mcp.solvapay.com/mcp
1461
- */
1462
- mcpProxyUrl?: string;
1463
- /**
1464
- * Origin URL of the actual MCP server
1465
- * @example https://origin.example.com/mcp
1466
- */
1467
- url: string;
1468
- /**
1469
- * Avatar image URL
1470
- * @example https://example.com/avatar.png
1471
- */
1472
- avatarUrl?: string;
1473
- /** @description Registered tools for this server */
1474
- tools?: components["schemas"]["McpToolDto"][];
1475
- /**
1476
- * Default plan ID for tool access gating. Must belong to the linked product and be a free-tier plan (isFreeTier=true or price=0).
1477
- * @example pln_default
1478
- */
1479
- defaultPlanId?: string;
1480
- /**
1481
- * Associated product ID
1482
- * @example 507f1f77bcf86cd799439011
1483
- */
1484
- productId?: string;
1485
- /**
1486
- * Server status
1487
- * @example active
1488
- * @enum {string}
1489
- */
1490
- status?: "active" | "inactive" | "suspended";
1491
- /**
1492
- * Provider ID that owns this server
1493
- * @example 507f1f77bcf86cd799439011
1494
- */
1495
- providerId: string;
1496
- /**
1497
- * Custom auth header name for origin requests
1498
- * @example X-API-Key
858
+ * @example 507f1f77bcf86cd799439011
1499
859
  */
1500
- authHeaderName?: string;
860
+ meterId?: string;
861
+ /** @example 25 */
862
+ percentUsed?: number | null;
863
+ };
864
+ UserInfoPlanDto: {
865
+ /** @example pln_2B3C4D5E */
866
+ reference: string;
1501
867
  /**
1502
- * Whether an auth API key is configured
1503
- * @example true
868
+ * Price in minor currency units (e.g. cents)
869
+ * @example 2999
1504
870
  */
1505
- hasAuthApiKey?: boolean;
871
+ price: number;
872
+ /** @example USD */
873
+ currency: string;
874
+ /** @example recurring */
875
+ type: string;
876
+ /** @example monthly */
877
+ billingCycle?: string | null;
878
+ features?: string[] | null;
879
+ limits?: {
880
+ [key: string]: unknown;
881
+ } | null;
882
+ };
883
+ UserInfoPurchaseDto: {
884
+ /** @example pur_1A2B3C4D */
885
+ reference: string;
886
+ /** @example active */
887
+ status: string;
888
+ /** @example My API Product */
889
+ productName: string;
890
+ /** @example recurring */
891
+ planType: string;
892
+ /** @example 2025-10-27T10:00:00Z */
893
+ startDate?: string | null;
894
+ /** @example 2025-11-27T10:00:00Z */
895
+ endDate?: string | null;
896
+ usage?: components["schemas"]["UserInfoUsageDto"];
897
+ plan?: components["schemas"]["UserInfoPlanDto"];
898
+ };
899
+ UserInfoResponse: {
1506
900
  /**
1507
- * Total number of tool-call transactions
1508
- * @example 42
901
+ * Human-readable status summary
902
+ * @example Active subscription: My API Product (25% usage consumed)
1509
903
  */
1510
- totalTransactions?: number;
904
+ status: string;
1511
905
  /**
1512
- * Current balance in cents
1513
- * @example 1500
906
+ * Customer portal session URL
907
+ * @example https://solvapay.com/customer/manage?id=abc123
1514
908
  */
1515
- balance?: number;
909
+ verifyUrl?: string | null;
910
+ user?: components["schemas"]["UserInfoUserDto"];
911
+ purchase?: components["schemas"]["UserInfoPurchaseDto"];
1516
912
  };
1517
913
  PlanSnapshotDto: {
1518
914
  /**
@@ -1564,8 +960,8 @@ interface components {
1564
960
  */
1565
961
  freeUnits?: number;
1566
962
  /**
1567
- * Price per usage unit in cents
1568
- * @example 10
963
+ * Price per usage unit in cents (supports decimals, e.g. 0.1 = 1/10 cent)
964
+ * @example 0.1
1569
965
  */
1570
966
  pricePerUnit?: number;
1571
967
  };
@@ -1632,23 +1028,33 @@ interface components {
1632
1028
  * @example API Gateway Manager
1633
1029
  */
1634
1030
  productName?: string;
1635
- /** @description Plan snapshot at time of purchase */
1636
- planSnapshot: components["schemas"]["PlanSnapshotDto"];
1031
+ /** @description Plan snapshot at time of purchase (null for credit topups) */
1032
+ planSnapshot?: components["schemas"]["PlanSnapshotDto"];
1637
1033
  /**
1638
1034
  * Purchase status
1639
1035
  * @example active
1640
1036
  */
1641
1037
  status: string;
1642
1038
  /**
1643
- * Amount in cents
1039
+ * Amount in USD cents (normalised for aggregation)
1644
1040
  * @example 9900
1645
1041
  */
1646
1042
  amount: number;
1647
1043
  /**
1648
- * Currency code
1649
- * @example USD
1044
+ * Original amount in the payment currency (cents/pence)
1045
+ * @example 10000
1046
+ */
1047
+ originalAmount?: number;
1048
+ /**
1049
+ * Original payment currency code
1050
+ * @example GBP
1650
1051
  */
1651
1052
  currency: string;
1053
+ /**
1054
+ * Exchange rate from original currency to USD
1055
+ * @example 1.3082
1056
+ */
1057
+ exchangeRate?: number;
1652
1058
  /** @description Start date */
1653
1059
  startDate: string;
1654
1060
  /** @description End date */
@@ -1671,46 +1077,52 @@ interface components {
1671
1077
  nextBillingDate?: string;
1672
1078
  /** @description Auto-renew enabled */
1673
1079
  autoRenew?: boolean;
1674
- /** @description Whether this is a free tier purchase */
1675
- isFreeTier?: boolean;
1676
1080
  /** @description Cancelled at */
1677
1081
  cancelledAt?: string;
1678
1082
  /** @description Cancellation reason */
1679
1083
  cancellationReason?: string;
1084
+ /** @description Arbitrary metadata attached to the purchase */
1085
+ metadata?: {
1086
+ [key: string]: unknown;
1087
+ };
1680
1088
  /** @description Created at */
1681
1089
  createdAt: string;
1682
1090
  };
1683
- CancelPurchaseRequest: {
1684
- /** @description Reason for cancellation */
1685
- reason?: string;
1686
- };
1687
1091
  CheckLimitRequest: {
1688
- /**
1689
- * Customer reference identifier
1690
- * @example cus_3C4D5E6F
1691
- */
1692
1092
  customerRef: string;
1693
- /**
1694
- * Product reference identifier
1695
- * @example prd_1A2B3C4D
1696
- */
1697
1093
  productRef: string;
1698
- /**
1699
- * Plan reference to pre-select when creating a checkout session. If provided and the customer needs to purchase, the checkout page skips plan selection and shows the payment form directly.
1700
- * @example pln_2B3C4D5E
1701
- */
1702
1094
  planRef?: string;
1703
- /**
1704
- * Canonical usage meter name used for limit checks (for example: requests, tokens).
1705
- * @example requests
1706
- */
1707
1095
  meterName?: string;
1708
- /**
1709
- * Usage type alias for meterName. If both are provided, meterName takes precedence.
1710
- * @example requests
1711
- */
1712
1096
  usageType?: string;
1713
1097
  };
1098
+ LimitPlanItemDto: {
1099
+ reference: string;
1100
+ name?: string;
1101
+ type: string;
1102
+ /** @description Price in smallest currency unit (e.g. cents) */
1103
+ price: number;
1104
+ currency: string;
1105
+ requiresPayment: boolean;
1106
+ freeUnits?: number;
1107
+ /** @description Price per usage unit in mils (usage-based plans) */
1108
+ pricePerUnit?: number;
1109
+ billingModel?: string;
1110
+ billingCycle?: string;
1111
+ };
1112
+ LimitBalanceDto: {
1113
+ /** @description Credit balance in mils */
1114
+ creditBalance: number;
1115
+ /** @description Price per usage unit in mils */
1116
+ pricePerUnit: number;
1117
+ currency: string;
1118
+ /** @description Estimated whole units remaining from prepaid balance at current pricePerUnit */
1119
+ remainingUnits?: number;
1120
+ };
1121
+ LimitProductBriefDto: {
1122
+ id?: string;
1123
+ reference: string;
1124
+ name?: string;
1125
+ };
1714
1126
  LimitResponse: {
1715
1127
  /**
1716
1128
  * Whether the customer is within their usage limits
@@ -1737,213 +1149,22 @@ interface components {
1737
1149
  * @example requests
1738
1150
  */
1739
1151
  meterName?: string;
1740
- };
1741
- ExecuteAnalyticsQuery: Record<string, never>;
1742
- ExecuteMultipleQueries: Record<string, never>;
1743
- CreateWebhookEndpointDto: {
1744
- /**
1745
- * Webhook endpoint URL
1746
- * @example https://example.com/webhook
1747
- */
1748
- url: string;
1749
- /**
1750
- * Webhook endpoint description
1751
- * @example Production webhook
1752
- */
1753
- description?: string;
1754
- };
1755
- UpdateWebhookEndpointDto: {
1756
- /**
1757
- * Webhook endpoint URL
1758
- * @example https://example.com/webhook
1759
- */
1760
- url?: string;
1761
- /**
1762
- * Webhook endpoint description
1763
- * @example Updated webhook
1764
- */
1765
- description?: string;
1766
- };
1767
- UpdateThemePreferenceDto: {
1768
- /**
1769
- * Selected UI theme mode
1770
- * @example dark
1771
- * @enum {string}
1772
- */
1773
- mode: "light" | "dark";
1774
- };
1775
- ThemeModeColorsDto: {
1776
- /**
1777
- * Page background color
1778
- * @example #f7f7f8
1779
- */
1780
- background?: string;
1781
- /**
1782
- * Card/surface background color
1783
- * @example #ffffff
1784
- */
1785
- surface?: string;
1786
- /**
1787
- * Primary text color
1788
- * @example #181818
1789
- */
1790
- text?: string;
1791
- /**
1792
- * Secondary/muted text color
1793
- * @example #5c5c5c
1794
- */
1795
- secondary?: string;
1796
- };
1797
- ThemeOverridesDto: {
1798
- /** @description Light mode color overrides */
1799
- light?: components["schemas"]["ThemeModeColorsDto"];
1800
- /** @description Dark mode color overrides */
1801
- dark?: components["schemas"]["ThemeModeColorsDto"];
1802
- };
1803
- UpdateBrandThemeDto: {
1804
- /**
1805
- * Logo image URL displayed in hosted page headers
1806
- * @example /ui/files/download/provider-assets/provider-123/logos/logo.png
1807
- */
1808
- logo?: string;
1809
- /**
1810
- * Provider's brand name displayed on hosted pages
1811
- * @example Acme Corp
1812
- */
1813
- brandName: string;
1814
- /**
1815
- * Primary/accent color in hex format
1816
- * @example #3182ce
1817
- */
1818
- primaryColor: string;
1819
- /**
1820
- * Font family for hosted pages
1821
- * @default Inter
1822
- * @example Inter
1823
- */
1824
- fontFamily: string;
1825
- /**
1826
- * Base font size
1827
- * @default 16px
1828
- * @example 16px
1829
- */
1830
- fontSize: string;
1831
- /** @description Per-mode color overrides for light and dark themes */
1832
- themes?: components["schemas"]["ThemeOverridesDto"];
1833
- };
1834
- CreatePreregistrationDto: {
1835
- /** @example jane@company.com */
1836
- email: string;
1837
- /** @example Jane Smith */
1838
- fullName: string;
1839
- /** @example Acme Corp */
1840
- companyName: string;
1841
- /** @example SaaS */
1842
- businessType?: string;
1843
- /** @example Purchase billing for our platform */
1844
- useCase?: string;
1845
- customFields?: {
1846
- [key: string]: string;
1847
- };
1848
- };
1849
- RevenueDataDto: {
1850
- grossRevenue: number;
1851
- refunds: number;
1852
- platformFees: number;
1853
- netRevenue: number;
1854
- costOfRevenue: number;
1855
- grossProfit?: Record<string, never> | null;
1856
- grossMargin?: Record<string, never> | null;
1857
- recognisedRevenue: number;
1858
- deferredRevenue: number;
1859
- hasCostTransactions: boolean;
1860
- };
1861
- BalanceDataDto: {
1862
- openingBalance: number;
1863
- paymentsReceived: number;
1864
- refundsIssued: number;
1865
- platformFees: number;
1866
- costsPaid: number;
1867
- closingBalance: number;
1868
- netChange: number;
1869
- };
1870
- MonthlyFinancialsDto: {
1871
- month: string;
1872
- revenue: components["schemas"]["RevenueDataDto"];
1873
- balance: components["schemas"]["BalanceDataDto"];
1874
- };
1875
- RevenueResponseDto: {
1876
- current: components["schemas"]["RevenueDataDto"];
1877
- prior: components["schemas"]["RevenueDataDto"];
1878
- monthly: components["schemas"]["MonthlyFinancialsDto"][];
1879
- periodLabel: string;
1880
- /**
1881
- * ISO 4217 currency code
1882
- * @example SEK
1883
- */
1884
- currency: string;
1885
- };
1886
- BalanceResponseDto: {
1887
- current: components["schemas"]["BalanceDataDto"];
1888
- monthly: components["schemas"]["MonthlyFinancialsDto"][];
1889
- periodLabel: string;
1890
- /**
1891
- * ISO 4217 currency code
1892
- * @example SEK
1893
- */
1894
- currency: string;
1895
- };
1896
- ProductRevenueRowDto: {
1897
- productRef: string;
1898
- productName: string;
1899
- productType: string;
1900
- revenue: number;
1901
- costs: number;
1902
- grossProfit?: Record<string, never> | null;
1903
- share: number;
1904
- estimatedARR: number;
1905
- transactionCount: number;
1906
- };
1907
- TopProductDto: {
1908
- name: string;
1909
- revenue: number;
1910
- };
1911
- RevenueByProductResponseDto: {
1912
- products: components["schemas"]["ProductRevenueRowDto"][];
1913
- activeProductCount: number;
1914
- totalMRR: number;
1915
- topProduct?: components["schemas"]["TopProductDto"] | null;
1916
- /**
1917
- * ISO 4217 currency code
1918
- * @example SEK
1919
- */
1920
- currency: string;
1921
- };
1922
- LedgerEntryDto: {
1923
- date: string;
1924
- reference: string;
1925
- description: string;
1926
- type: string;
1927
- direction: string;
1928
- account: string;
1929
- debit: number;
1930
- credit: number;
1931
- status: string;
1932
- };
1933
- LedgerResponseDto: {
1934
- entries: components["schemas"]["LedgerEntryDto"][];
1935
- total: number;
1936
- totalCredit: number;
1937
- totalDebit: number;
1938
- /**
1939
- * ISO 4217 currency code
1940
- * @example SEK
1941
- */
1942
- currency: string;
1943
- };
1944
- /** @description Auto-generated fallback schema for unresolved reference: McpBootstrapPreviewValidationError */
1945
- McpBootstrapPreviewValidationError: {
1946
- [key: string]: unknown;
1152
+ /** @description Credit balance in mils (for pre-paid usage-based plans) */
1153
+ creditBalance?: number;
1154
+ /** @description Price per usage unit in mils (for pre-paid usage-based plans) */
1155
+ pricePerUnit?: number;
1156
+ /** @description ISO 4217 currency code for credit fields */
1157
+ currency?: string;
1158
+ /** @description True when the customer must activate a priced default plan before usage is allowed */
1159
+ activationRequired?: boolean;
1160
+ /** @description Active plans on the product available for activation or checkout */
1161
+ plans?: components["schemas"]["LimitPlanItemDto"][];
1162
+ /** @description Prepaid usage balance context when the default plan is usage-based */
1163
+ balance?: components["schemas"]["LimitBalanceDto"];
1164
+ /** @description Product the limit check applies to */
1165
+ product?: components["schemas"]["LimitProductBriefDto"];
1166
+ /** @description Customer portal confirmation URL when activation is required (fallback when not starting checkout) */
1167
+ confirmationUrl?: string;
1947
1168
  };
1948
1169
  };
1949
1170
  responses: never;
@@ -1991,28 +1212,7 @@ interface operations {
1991
1212
  /** @description Payment intent creation data */
1992
1213
  requestBody: {
1993
1214
  content: {
1994
- "application/json": {
1995
- /**
1996
- * Plan reference to purchase
1997
- * @example pln_2b3c4d5e6f7g
1998
- */
1999
- planRef: string;
2000
- /**
2001
- * Product reference that owns the plan
2002
- * @example prd_1A2B3C4D
2003
- */
2004
- productRef: string;
2005
- /**
2006
- * Customer reference identifier
2007
- * @example cus_3c4d5e6f7g8h
2008
- */
2009
- customerReference: string;
2010
- /**
2011
- * Name of the pricing tier to purchase (for plans with pricingTiers). If not specified, uses the plan base price.
2012
- * @example Pro
2013
- */
2014
- pricingTier?: string;
2015
- };
1215
+ "application/json": components["schemas"]["CreatePaymentIntentDto"];
2016
1216
  };
2017
1217
  };
2018
1218
  responses: {
@@ -2081,23 +1281,7 @@ interface operations {
2081
1281
  /** @description Payment processing data */
2082
1282
  requestBody: {
2083
1283
  content: {
2084
- "application/json": {
2085
- /**
2086
- * Product reference that owns the plan
2087
- * @example prd_123
2088
- */
2089
- productRef: string;
2090
- /**
2091
- * Customer reference identifier
2092
- * @example cus_456
2093
- */
2094
- customerRef: string;
2095
- /**
2096
- * Plan reference - helps determine if payment is for purchase
2097
- * @example pln_789
2098
- */
2099
- planRef?: string;
2100
- };
1284
+ "application/json": components["schemas"]["ProcessPaymentIntentDto"];
2101
1285
  };
2102
1286
  };
2103
1287
  responses: {
@@ -2496,7 +1680,7 @@ interface operations {
2496
1680
  };
2497
1681
  requestBody: {
2498
1682
  content: {
2499
- "application/json": components["schemas"]["McpBootstrapRequest"];
1683
+ "application/json": components["schemas"]["McpBootstrapDto"];
2500
1684
  };
2501
1685
  };
2502
1686
  responses: {
@@ -2518,6 +1702,47 @@ interface operations {
2518
1702
  };
2519
1703
  };
2520
1704
  };
1705
+ ProductSdkController_configureMcpPlans: {
1706
+ parameters: {
1707
+ query?: never;
1708
+ header?: never;
1709
+ path: {
1710
+ /** @description Product reference or ID */
1711
+ productRef: string;
1712
+ };
1713
+ cookie?: never;
1714
+ };
1715
+ requestBody: {
1716
+ content: {
1717
+ "application/json": components["schemas"]["ConfigureMcpPlansDto"];
1718
+ };
1719
+ };
1720
+ responses: {
1721
+ /** @description MCP plans configured successfully */
1722
+ 200: {
1723
+ headers: {
1724
+ [name: string]: unknown;
1725
+ };
1726
+ content: {
1727
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
1728
+ };
1729
+ };
1730
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
1731
+ 400: {
1732
+ headers: {
1733
+ [name: string]: unknown;
1734
+ };
1735
+ content?: never;
1736
+ };
1737
+ /** @description Product not found */
1738
+ 404: {
1739
+ headers: {
1740
+ [name: string]: unknown;
1741
+ };
1742
+ content?: never;
1743
+ };
1744
+ };
1745
+ };
2521
1746
  ProductSdkController_cloneProduct: {
2522
1747
  parameters: {
2523
1748
  query?: never;
@@ -2528,7 +1753,11 @@ interface operations {
2528
1753
  };
2529
1754
  cookie?: never;
2530
1755
  };
2531
- requestBody?: never;
1756
+ requestBody: {
1757
+ content: {
1758
+ "application/json": components["schemas"]["CloneProductDto"];
1759
+ };
1760
+ };
2532
1761
  responses: {
2533
1762
  /** @description Product cloned successfully */
2534
1763
  201: {
@@ -2557,44 +1786,7 @@ interface operations {
2557
1786
  };
2558
1787
  requestBody: {
2559
1788
  content: {
2560
- "application/json": {
2561
- /**
2562
- * Customer identifier
2563
- * @example cus_3C4D5E6F
2564
- */
2565
- customerId: string;
2566
- /**
2567
- * Action type (default: api_call)
2568
- * @example api_call
2569
- * @enum {string}
2570
- */
2571
- actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2572
- /**
2573
- * Number of usage units (default: 1)
2574
- * @example 1
2575
- */
2576
- units?: number;
2577
- /** @description Product reference */
2578
- productReference?: string;
2579
- /** @description Purchase reference */
2580
- purchaseReference?: string;
2581
- /**
2582
- * Outcome (default: success)
2583
- * @enum {string}
2584
- */
2585
- outcome?: "success" | "paywall" | "fail";
2586
- /** @description Arbitrary event properties */
2587
- metadata?: {
2588
- [key: string]: unknown;
2589
- };
2590
- /**
2591
- * Format: date-time
2592
- * @description ISO 8601 timestamp (defaults to now)
2593
- */
2594
- timestamp?: string;
2595
- /** @description Unique key to prevent duplicate recording (max 256 chars) */
2596
- idempotencyKey?: string;
2597
- };
1789
+ "application/json": components["schemas"]["CreateUsageRequest"];
2598
1790
  };
2599
1791
  };
2600
1792
  responses: {
@@ -2630,24 +1822,7 @@ interface operations {
2630
1822
  };
2631
1823
  requestBody: {
2632
1824
  content: {
2633
- "application/json": {
2634
- events: {
2635
- customerId: string;
2636
- /** @enum {string} */
2637
- actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2638
- units?: number;
2639
- productReference?: string;
2640
- purchaseReference?: string;
2641
- /** @enum {string} */
2642
- outcome?: "success" | "paywall" | "fail";
2643
- metadata?: {
2644
- [key: string]: unknown;
2645
- };
2646
- /** Format: date-time */
2647
- timestamp?: string;
2648
- idempotencyKey?: string;
2649
- }[];
2650
- };
1825
+ "application/json": components["schemas"]["BulkCreateUsageRequest"];
2651
1826
  };
2652
1827
  };
2653
1828
  responses: {
@@ -2676,7 +1851,7 @@ interface operations {
2676
1851
  };
2677
1852
  requestBody: {
2678
1853
  content: {
2679
- "application/json": components["schemas"]["RecordMeterEventDto"];
1854
+ "application/json": components["schemas"]["RecordMeterEventZodDto"];
2680
1855
  };
2681
1856
  };
2682
1857
  responses: {
@@ -2710,7 +1885,7 @@ interface operations {
2710
1885
  };
2711
1886
  requestBody: {
2712
1887
  content: {
2713
- "application/json": components["schemas"]["RecordBulkMeterEventsDto"];
1888
+ "application/json": components["schemas"]["RecordBulkMeterEventsZodDto"];
2714
1889
  };
2715
1890
  };
2716
1891
  responses: {
@@ -3167,17 +2342,12 @@ interface operations {
3167
2342
  * Types related to the SolvaPay API client and backend communication.
3168
2343
  */
3169
2344
 
3170
- type UsageMeterType = 'requests' | 'tokens';
3171
- type CheckLimitsRequest = components['schemas']['CheckLimitRequest'] & {
3172
- meterName?: string;
3173
- usageType?: UsageMeterType;
3174
- };
2345
+ type CheckLimitsRequest = components['schemas']['CheckLimitRequest'];
3175
2346
  /**
3176
- * Extended LimitResponse with plan field
2347
+ * Extended LimitResponse with SDK-added plan field
3177
2348
  */
3178
2349
  type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3179
2350
  plan: string;
3180
- meterName?: string;
3181
2351
  };
3182
2352
  /**
3183
2353
  * Extended CustomerResponse with proper field mapping
@@ -3216,46 +2386,10 @@ interface ProcessPaymentResult {
3216
2386
  oneTimePurchase?: OneTimePurchaseInfo;
3217
2387
  status: 'completed';
3218
2388
  }
3219
- interface McpBootstrapFreePlanConfig {
3220
- name?: string;
3221
- freeUnits?: number;
3222
- }
3223
- interface McpBootstrapPaidPlanInput {
3224
- key: string;
3225
- name: string;
3226
- /** Price in cents (e.g. 2000 = $20.00) */
3227
- price: number;
3228
- currency: string;
3229
- billingCycle?: 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'custom';
3230
- type?: 'recurring' | 'one-time';
3231
- freeUnits?: number;
3232
- meterId?: string;
3233
- limit?: number;
3234
- features?: Record<string, unknown>;
3235
- }
3236
- interface ToolPlanMappingInput {
3237
- name: string;
3238
- description?: string;
3239
- noPlan?: boolean;
3240
- planIds?: string[];
3241
- planRefs?: string[];
3242
- planKeys?: string[];
3243
- }
3244
- interface McpBootstrapRequest {
3245
- name?: string;
3246
- description?: string;
3247
- imageUrl?: string;
3248
- productType?: string;
3249
- originUrl: string;
3250
- /** Optional token combined with provider name to derive the final MCP subdomain. */
3251
- mcpDomain?: string;
3252
- authHeaderName?: string;
3253
- authApiKey?: string;
3254
- freePlan?: McpBootstrapFreePlanConfig;
3255
- paidPlans?: McpBootstrapPaidPlanInput[];
3256
- tools?: ToolPlanMappingInput[];
3257
- metadata?: Record<string, unknown>;
3258
- }
2389
+ type McpBootstrapPlanInput = NonNullable<components['schemas']['McpBootstrapDto']['plans']>[number];
2390
+ type ToolPlanMappingInput = NonNullable<components['schemas']['McpBootstrapDto']['tools']>[number];
2391
+ type McpBootstrapRequest = components['schemas']['McpBootstrapDto'];
2392
+ type McpToolPlanMappingInput = NonNullable<components['schemas']['ConfigureMcpPlansDto']['toolMapping']>[number];
3259
2393
  interface McpBootstrapResponse {
3260
2394
  product: components['schemas']['SdkProductResponse'];
3261
2395
  mcpServer: {
@@ -3277,6 +2411,23 @@ interface McpBootstrapResponse {
3277
2411
  description?: string;
3278
2412
  }>;
3279
2413
  }
2414
+ type ConfigureMcpPlansRequest = components['schemas']['ConfigureMcpPlansDto'];
2415
+ interface ConfigureMcpPlansResponse {
2416
+ product: components['schemas']['SdkProductResponse'];
2417
+ mcpServer: {
2418
+ id?: string;
2419
+ reference?: string;
2420
+ subdomain?: string;
2421
+ mcpProxyUrl?: string;
2422
+ url: string;
2423
+ defaultPlanId?: string;
2424
+ };
2425
+ planMap: Record<string, {
2426
+ id: string;
2427
+ reference: string;
2428
+ name?: string;
2429
+ }>;
2430
+ }
3280
2431
  /**
3281
2432
  * SolvaPay API Client Interface
3282
2433
  *
@@ -3318,6 +2469,7 @@ interface SolvaPayClient {
3318
2469
  name: string;
3319
2470
  }>;
3320
2471
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
2472
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
3321
2473
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
3322
2474
  deleteProduct?(productRef: string): Promise<void>;
3323
2475
  cloneProduct?(productRef: string, overrides?: {
@@ -3326,29 +2478,11 @@ interface SolvaPayClient {
3326
2478
  reference: string;
3327
2479
  name: string;
3328
2480
  }>;
3329
- listPlans?(productRef: string): Promise<Array<{
3330
- reference: string;
3331
- price?: number;
3332
- currency?: string;
3333
- interval?: string;
3334
- isFreeTier?: boolean;
3335
- freeUnits?: number;
3336
- measures?: string;
3337
- limit?: number;
3338
- pricePerUnit?: number;
3339
- billingModel?: string;
3340
- metadata?: Record<string, unknown>;
3341
- [key: string]: unknown;
3342
- }>>;
2481
+ listPlans?(productRef: string): Promise<components['schemas']['Plan'][]>;
3343
2482
  createPlan?(params: components['schemas']['CreatePlanRequest'] & {
3344
2483
  productRef: string;
3345
- }): Promise<{
3346
- reference: string;
3347
- }>;
3348
- updatePlan?(productRef: string, planRef: string, params: Partial<components['schemas']['CreatePlanRequest']>): Promise<{
3349
- reference: string;
3350
- [key: string]: unknown;
3351
- }>;
2484
+ }): Promise<components['schemas']['Plan']>;
2485
+ updatePlan?(productRef: string, planRef: string, params: components['schemas']['UpdatePlanRequest']): Promise<components['schemas']['Plan']>;
3352
2486
  deletePlan?(productRef: string, planRef: string): Promise<void>;
3353
2487
  createPaymentIntent?(params: {
3354
2488
  productRef: string;
@@ -3375,7 +2509,7 @@ interface SolvaPayClient {
3375
2509
  customerRef: string;
3376
2510
  productRef: string;
3377
2511
  }): Promise<components['schemas']['UserInfoResponse']>;
3378
- createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CheckoutSessionResponse']>;
2512
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
3379
2513
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
3380
2514
  }
3381
2515
 
@@ -3384,6 +2518,10 @@ interface SolvaPayClient {
3384
2518
  *
3385
2519
  * Types related to paywall protection, limits, and gating functionality.
3386
2520
  */
2521
+
2522
+ type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
2523
+ type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
2524
+ type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
3387
2525
  /**
3388
2526
  * Arguments passed to protected handlers
3389
2527
  */
@@ -3402,14 +2540,29 @@ interface PaywallMetadata {
3402
2540
  usageType?: 'requests' | 'tokens';
3403
2541
  }
3404
2542
  /**
3405
- * Structured content for paywall errors
2543
+ * Structured content for paywall errors (MCP structuredContent and manual handling).
3406
2544
  */
3407
- interface PaywallStructuredContent {
2545
+ type PaywallStructuredContent = {
3408
2546
  kind: 'payment_required';
2547
+ /** Product ref from paywall metadata (or env default) */
3409
2548
  product: string;
3410
2549
  checkoutUrl: string;
3411
2550
  message: string;
3412
- }
2551
+ } | {
2552
+ kind: 'activation_required';
2553
+ /** Product ref from paywall metadata (or env default) */
2554
+ product: string;
2555
+ message: string;
2556
+ /**
2557
+ * Best URL for completing purchase or confirmation; mirrors confirmationUrl when present.
2558
+ */
2559
+ checkoutUrl: string;
2560
+ confirmationUrl?: string;
2561
+ plans?: LimitPlanSummary[];
2562
+ balance?: LimitActivationBalance;
2563
+ /** Rich product context from checkLimits (name, ref, provider slug/id) */
2564
+ productDetails?: LimitActivationProduct;
2565
+ };
3413
2566
  /**
3414
2567
  * MCP tool result with optional paywall information
3415
2568
  */
@@ -3930,14 +3083,17 @@ interface SolvaPay {
3930
3083
  customerRef: string;
3931
3084
  productRef: string;
3932
3085
  planRef?: string;
3933
- meterName?: 'requests' | 'tokens';
3934
- usageType?: 'requests' | 'tokens';
3086
+ meterName?: string;
3087
+ usageType?: string;
3935
3088
  }): Promise<{
3936
3089
  withinLimits: boolean;
3937
3090
  remaining: number;
3938
3091
  plan: string;
3939
3092
  checkoutUrl?: string;
3940
3093
  meterName?: string;
3094
+ creditBalance?: number;
3095
+ pricePerUnit?: number;
3096
+ currency?: string;
3941
3097
  }>;
3942
3098
  /**
3943
3099
  * Track usage for a customer action.
@@ -4001,6 +3157,7 @@ interface SolvaPay {
4001
3157
  createCustomer(params: {
4002
3158
  email: string;
4003
3159
  name?: string;
3160
+ metadata?: Record<string, unknown>;
4004
3161
  }): Promise<{
4005
3162
  customerRef: string;
4006
3163
  }>;
@@ -4102,6 +3259,13 @@ interface SolvaPay {
4102
3259
  * fast setup flows where you want one call for product + plans + MCP config.
4103
3260
  */
4104
3261
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3262
+ /**
3263
+ * Configure MCP plans and tool mappings for an existing MCP product.
3264
+ *
3265
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
3266
+ * paid plans as well as remapping tool access.
3267
+ */
3268
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
4105
3269
  /**
4106
3270
  * Get virtual tool definitions with bound handlers for MCP server integration.
4107
3271
  *
@@ -4309,6 +3473,8 @@ declare class PaywallError extends Error {
4309
3473
  */
4310
3474
  constructor(message: string, structuredContent: PaywallStructuredContent);
4311
3475
  }
3476
+ /** JSON body shape for HTTP adapters and MCP text content (stable fields for clients). */
3477
+ declare function paywallErrorToClientPayload(error: PaywallError): Record<string, unknown>;
4312
3478
 
4313
3479
  /**
4314
3480
  * MCP OAuth helper utilities.
@@ -4730,11 +3896,12 @@ declare function cancelPurchaseCore(request: Request, body: {
4730
3896
  * This is a public route - no authentication required.
4731
3897
  */
4732
3898
 
3899
+ type Plan = components['schemas']['Plan'];
4733
3900
  /**
4734
3901
  * List plans - core implementation
4735
3902
  */
4736
3903
  declare function listPlansCore(request: Request): Promise<{
4737
- plans: Record<string, unknown>[];
3904
+ plans: Plan[];
4738
3905
  productRef: string;
4739
3906
  } | ErrorResult>;
4740
3907
 
@@ -4793,4 +3960,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
4793
3960
  secret: string;
4794
3961
  }): WebhookEvent;
4795
3962
 
4796
- export { type AuthenticatedUser, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, buildAuthInfoFromBearer, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
3963
+ export { type AuthenticatedUser, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CustomerResponseMapped, type CustomerWebhookObject, type ErrorResult, type HttpAdapterOptions, type LimitActivationBalance, type LimitActivationProduct, type LimitPlanSummary, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type McpToolPlanMappingInput, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventForType, type WebhookEventObjectMap, type WebhookEventType, type WebhookProduct, buildAuthInfoFromBearer, cancelPurchaseCore, type components, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, paywallErrorToClientPayload, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };