@solvapay/server 1.0.6 → 1.0.9-preview.1

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
@@ -49,198 +49,35 @@ type WebhookEvent = {
49
49
 
50
50
  interface components {
51
51
  schemas: {
52
- UpdateProviderDto: {
53
- /** @description Legal entity information */
54
- legalEntity?: Record<string, never>;
55
- /**
56
- * Provider description
57
- * @example My business
58
- */
59
- description?: string;
60
- /**
61
- * Business website URL
62
- * @example https://example.com
63
- */
64
- website?: string;
65
- /**
66
- * Business type
67
- * @example individual
68
- * @enum {string}
69
- */
70
- businessType?: "individual" | "company";
71
- /**
72
- * Business email address
73
- * @example business@example.com
74
- */
75
- businessEmail?: string;
76
- /**
77
- * Support email address
78
- * @example support@example.com
79
- */
80
- supportEmail?: string;
81
- /**
82
- * Business telephone number
83
- * @example +1234567890
84
- */
85
- telephone?: string;
86
- /**
87
- * Support telephone number
88
- * @example +1234567890
89
- */
90
- supportTelephone?: string;
91
- /**
92
- * Default currency code
93
- * @example usd
94
- */
95
- defaultCurrency?: string;
96
- /** @description Arbitrary metadata */
97
- metadata?: Record<string, never>;
98
- /** @description Terms of Service acceptance */
99
- tosAcceptance?: Record<string, never>;
100
- };
101
- CreateSecretKey: Record<string, never>;
102
- CreateUser: Record<string, never>;
103
- UpdateUser: Record<string, never>;
104
- UpdateProfile: Record<string, never>;
105
- UpdatePreferences: Record<string, never>;
106
- RequestEmailChange: {
107
- newEmail: string;
108
- };
109
- VerifyEmailChange: {
110
- code: string;
111
- };
112
- CreateUiCheckoutSessionRequest: {
113
- /**
114
- * Customer reference
115
- * @example cus_3c4d5e6f7g8h
116
- */
52
+ CreatePaymentIntentDto: {
53
+ productRef?: string;
117
54
  customerRef: string;
118
- /**
119
- * Plan reference (optional)
120
- * @example pln_2b3c4d5e6f7g
121
- */
122
55
  planRef?: string;
56
+ pricingTier?: string;
123
57
  /**
124
- * Product reference (required)
125
- * @example prd_1a2b3c4d5e6f
126
- */
127
- productRef: string;
128
- };
129
- CreateUiCheckoutSessionResponse: {
130
- /**
131
- * Checkout session ID
132
- * @example 507f1f77bcf86cd799439011
133
- */
134
- id: string;
135
- /**
136
- * Public session ID used in checkout URL
137
- * @example a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
138
- */
139
- sessionId: string;
140
- /**
141
- * Amount in cents
142
- * @example 2999
143
- */
144
- amount: number;
145
- /**
146
- * Currency code
147
- * @example USD
148
- */
149
- currency: string;
150
- /**
151
- * Session status
152
- * @example active
153
- */
154
- status: string;
155
- /**
156
- * Checkout URL to open the checkout page
157
- * @example https://solvapay.com/customer/checkout?id=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6
158
- */
159
- checkoutUrl: string;
160
- };
161
- SelectCustomerSessionProductRequest: {
162
- /**
163
- * Product reference or ID to scope the customer manage session
164
- * @example prd_1a2b3c4d5e6f
165
- */
166
- productRef: string;
167
- };
168
- CancelRenewalRequest: {
169
- /** @description Reason for cancelling renewal */
170
- reason?: string;
171
- };
172
- ExternalAccount: {
173
- /**
174
- * Country code
175
- * @example US
176
- */
177
- country: string;
178
- /**
179
- * Currency code
180
- * @example usd
181
- */
182
- currency: string;
183
- /**
184
- * Account holder name
185
- * @example John Doe
186
- */
187
- accountHolderName: string;
188
- /**
189
- * Account holder type
190
- * @example individual
58
+ * @default product
191
59
  * @enum {string}
192
60
  */
193
- accountHolderType: "individual" | "company";
194
- /**
195
- * Routing number
196
- * @example 110000000
197
- */
198
- routingNumber: string;
199
- /**
200
- * Account number
201
- * @example 000123456789
202
- */
203
- accountNumber: string;
204
- };
205
- TosAcceptance: {
206
- /**
207
- * IP address of user accepting ToS
208
- * @example 192.168.1.1
209
- */
210
- ip: string;
211
- };
212
- UpdateConnectedAccount: {
213
- /**
214
- * Business website URL
215
- * @example https://example.com
216
- */
217
- website?: string;
218
- /** @description External bank account */
219
- externalAccount?: components["schemas"]["ExternalAccount"];
220
- /** @description Terms of Service acceptance */
221
- tosAcceptance?: components["schemas"]["TosAcceptance"];
61
+ purpose: "product" | "credit_topup" | "usage_billing";
62
+ amount?: number;
63
+ currency?: string;
64
+ description?: string;
222
65
  };
223
66
  CreateCheckoutSessionRequest: {
224
- /**
225
- * Customer reference identifier
226
- * @example cus_3c4d5e6f7g8h
227
- */
228
67
  customerRef: string;
229
- /**
230
- * Product reference identifier
231
- * @example prd_1A2B3C4D
232
- */
233
- productRef: string;
234
- /**
235
- * Plan reference identifier (optional)
236
- * @example pln_2b3c4d5e6f7g
237
- */
68
+ productRef?: string;
238
69
  planRef?: string;
239
- /**
240
- * URL to redirect to after successful payment (optional)
241
- * @example https://example.com/payment-success
242
- */
243
70
  returnUrl?: string;
71
+ /** @enum {string} */
72
+ purpose?: "credit_topup";
73
+ };
74
+ CancelPurchaseRequest: {
75
+ reason?: string;
76
+ };
77
+ ProcessPaymentIntentDto: {
78
+ productRef: string;
79
+ customerRef: string;
80
+ planRef?: string;
244
81
  };
245
82
  CreateCheckoutSessionResponse: {
246
83
  /**
@@ -254,151 +91,33 @@ interface components {
254
91
  */
255
92
  checkoutUrl: string;
256
93
  };
257
- Signup: {
258
- name: string;
259
- email: string;
260
- /** @enum {string} */
261
- type?: "provider" | "admin" | "super_admin";
262
- };
263
- AuthUserDto: {
264
- id: string;
265
- name: string;
266
- email: string;
267
- /** @enum {string} */
268
- type: "provider" | "admin" | "super_admin";
269
- emailVerified: boolean;
270
- /** @enum {string} */
271
- authProvider: "local" | "google" | "github" | "facebook";
272
- providerId?: string;
273
- providerRole?: string;
274
- preferences?: Record<string, never>;
275
- };
276
- AuthResponse: {
277
- user: components["schemas"]["AuthUserDto"];
278
- accessToken?: string;
279
- refreshToken?: string;
280
- expiresIn?: number;
281
- message?: string;
282
- requiresMfa?: boolean;
283
- requiresMfaSetup?: boolean;
284
- };
285
- Login: {
286
- /** @description Email to send a 6-digit login code to */
287
- email: string;
288
- };
289
- VerifyLoginCode: {
290
- email: string;
291
- /** @description 6-digit login code sent to email */
292
- code: string;
293
- };
294
- VerifyEmail: {
295
- emailVerificationCode: string;
296
- };
297
- DynamicClientRegistrationDto: {
298
- /** @example My AI Agent */
299
- client_name: string;
300
- /**
301
- * @example [
302
- * "https://agent.example.com/callback"
303
- * ]
304
- */
305
- redirect_uris: string[];
306
- /**
307
- * @example [
308
- * "authorization_code",
309
- * "refresh_token"
310
- * ]
311
- */
312
- grant_types?: string[];
313
- /**
314
- * @example [
315
- * "code"
316
- * ]
317
- */
318
- response_types?: string[];
319
- /** @example agent-123 */
320
- software_id?: string;
321
- /** @example 1.0.0 */
322
- software_version?: string;
323
- /** @example https://example.com/logo.png */
324
- logo_uri?: string;
325
- /** @example https://example.com/tos */
326
- tos_uri?: string;
327
- /** @example https://example.com/policy */
328
- policy_uri?: string;
329
- /** @example https://example.com */
330
- client_uri?: string;
331
- };
332
- DynamicClientRegistrationResponseDto: {
333
- /** @example client-id-123 */
334
- client_id: string;
335
- /** @example client-secret-456 */
336
- client_secret: string;
337
- /** @example 1734567890 */
338
- client_id_issued_at: number;
339
- /** @example 0 */
340
- client_secret_expires_at: number;
341
- /** @example My AI Agent */
342
- client_name: string;
343
- /**
344
- * @example [
345
- * "https://agent.example.com/callback"
346
- * ]
347
- */
348
- redirect_uris: string[];
349
- /**
350
- * @example [
351
- * "authorization_code",
352
- * "refresh_token"
353
- * ]
354
- */
355
- grant_types: string[];
356
- /**
357
- * @example [
358
- * "code"
359
- * ]
360
- */
361
- response_types: string[];
362
- /** @example openid profile email */
363
- scope: string;
364
- /** @example client_secret_basic */
365
- token_endpoint_auth_method: string;
366
- };
367
- GoogleLoginDto: {
368
- /** @description The authorization code returned by Google */
369
- code: string;
370
- /** @description The redirect URI used in the initial authorization request */
371
- redirect_uri: string;
372
- /** @description The state parameter returned by Google (contains client_id) */
373
- state: string;
374
- };
375
- GithubLoginDto: {
376
- /** @description The authorization code returned by GitHub */
377
- code: string;
378
- /** @description The redirect URI used in the initial authorization request */
379
- redirect_uri: string;
380
- /** @description The state parameter returned by GitHub (contains client_id) */
381
- state: string;
382
- };
383
- CreateOAuthClientDto: Record<string, never>;
384
- UpdateOAuthClientDto: Record<string, never>;
385
94
  Plan: {
386
95
  /**
387
96
  * Plan type exposed in SDK
388
97
  * @example recurring
389
98
  * @enum {string}
390
99
  */
391
- type: "recurring" | "one-time";
392
- /**
393
- * Plan ID
394
- * @example 507f1f77bcf86cd799439011
395
- */
396
- id: string;
100
+ type: "recurring" | "one-time" | "usage-based" | "hybrid";
397
101
  /**
398
102
  * Plan reference
399
103
  * @example pln_1A2B3C4D
400
104
  */
401
105
  reference: string;
106
+ /**
107
+ * Meter reference for usage-based plans
108
+ * @example mtr_1A2B3C4D
109
+ */
110
+ meterRef?: 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;
402
121
  /**
403
122
  * Plan price in cents
404
123
  * @example 2999
@@ -441,10 +160,10 @@ interface components {
441
160
  */
442
161
  billingModel?: "pre-paid" | "post-paid";
443
162
  /**
444
- * Price per usage unit
445
- * @example 0.01
163
+ * Credits per usage unit (integer, >= 1)
164
+ * @example 1
446
165
  */
447
- pricePerUnit?: number;
166
+ creditsPerUnit?: number;
448
167
  /**
449
168
  * What the plan measures for usage tracking
450
169
  * @example requests
@@ -468,11 +187,6 @@ interface components {
468
187
  features?: {
469
188
  [key: string]: unknown;
470
189
  };
471
- /**
472
- * Whether this is a free tier plan
473
- * @example false
474
- */
475
- isFreeTier: boolean;
476
190
  /**
477
191
  * Whether payment is required
478
192
  * @example true
@@ -498,176 +212,87 @@ interface components {
498
212
  updatedAt: string;
499
213
  };
500
214
  CreatePlanRequest: {
501
- /**
502
- * Plan type exposed in SDK
503
- * @example recurring
504
- * @enum {string}
505
- */
506
- type?: "recurring" | "one-time";
507
- /**
508
- * Billing cycle (required for recurring/hybrid, optional for post-paid usage-based)
509
- * @example monthly
510
- * @enum {string}
511
- */
215
+ name?: string;
216
+ description?: string;
217
+ /** @enum {string} */
218
+ type?: "recurring" | "usage-based" | "one-time" | "hybrid";
219
+ /** @enum {string} */
512
220
  billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
513
- /**
514
- * Plan price in cents
515
- * @example 2999
516
- */
517
221
  price?: number;
518
- /**
519
- * Currency code (ISO 4217)
520
- * @example USD
521
- * @enum {string}
522
- */
523
- 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";
524
- /**
525
- * Number of free units included
526
- * @example 100
527
- */
222
+ creditsPerUnit?: number;
223
+ currency?: string;
224
+ /** @enum {string} */
225
+ billingModel?: "pre-paid" | "post-paid";
528
226
  freeUnits?: number;
529
- /**
530
- * Usage limit for the meter
531
- * @example 10000
532
- */
533
227
  limit?: number;
534
- /**
535
- * Usage limits (shape varies by plan type)
536
- * @example {
537
- * "maxTransactions": 1000
538
- * }
539
- */
540
- limits?: {
228
+ basePrice?: number;
229
+ setupFee?: number;
230
+ trialDays?: number;
231
+ rolloverUnusedUnits?: boolean;
232
+ autoRenew?: boolean;
233
+ usageTracking: {
234
+ /** @enum {string} */
235
+ method?: "automatic" | "manual" | "hybrid";
236
+ /** @enum {string} */
237
+ granularity?: "hourly" | "daily" | "weekly" | "monthly";
238
+ };
239
+ limits: {
541
240
  [key: string]: unknown;
542
241
  };
543
- /**
544
- * Plan features (generic key/value, shape is provider-defined)
545
- * @example {
546
- * "apiAccess": true,
547
- * "prioritySupport": false
548
- * }
549
- */
550
- features?: {
242
+ metadata: {
551
243
  [key: string]: unknown;
552
244
  };
553
- /**
554
- * Whether this is a free tier plan
555
- * @example false
556
- */
557
- isFreeTier?: boolean;
558
- /**
559
- * Whether payment is required
560
- * @example true
561
- */
562
- requiresPayment?: boolean;
563
- /**
564
- * Plan status
565
- * @example active
566
- * @enum {string}
567
- */
245
+ features: {
246
+ [key: string]: unknown;
247
+ };
248
+ /** @enum {string} */
568
249
  status?: "active" | "inactive" | "archived";
569
- /**
570
- * Maximum number of active users
571
- * @example 10
572
- */
573
250
  maxActiveUsers?: number;
574
- /**
575
- * Access expiry in days
576
- * @example 30
577
- */
578
251
  accessExpiryDays?: number;
579
- /** @description Additional metadata */
580
- metadata?: {
581
- [key: string]: unknown;
582
- };
583
- /**
584
- * Whether this is the default plan
585
- * @example false
586
- */
587
252
  default?: boolean;
588
253
  };
589
254
  UpdatePlanRequest: {
590
- /**
591
- * Billing cycle
592
- * @example monthly
593
- * @enum {string}
594
- */
255
+ name?: string;
256
+ description?: string;
257
+ /** @enum {string} */
595
258
  billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
596
- /**
597
- * Plan price in cents
598
- * @example 2999
599
- */
600
259
  price?: number;
601
- /**
602
- * Currency code (ISO 4217)
603
- * @example USD
604
- */
260
+ creditsPerUnit?: number;
605
261
  currency?: string;
606
- /**
607
- * Number of free units included
608
- * @example 100
609
- */
262
+ /** @enum {string} */
263
+ billingModel?: "pre-paid" | "post-paid";
610
264
  freeUnits?: number;
611
- /**
612
- * Usage limit for the meter
613
- * @example 10000
614
- */
615
265
  limit?: number;
616
- /**
617
- * Usage limits (shape varies by plan type)
618
- * @example {
619
- * "maxTransactions": 1000
620
- * }
621
- */
622
- limits?: {
266
+ limits: {
623
267
  [key: string]: unknown;
624
268
  };
625
- /**
626
- * Plan features (generic key/value, shape is provider-defined)
627
- * @example {
628
- * "apiAccess": true,
629
- * "prioritySupport": false
630
- * }
631
- */
632
- features?: {
269
+ features: {
633
270
  [key: string]: unknown;
634
271
  };
635
- /**
636
- * Whether this is a free tier plan
637
- * @example false
638
- */
639
- isFreeTier?: boolean;
640
- /**
641
- * Whether payment is required
642
- * @example true
643
- */
644
- requiresPayment?: boolean;
645
- /**
646
- * Plan status
647
- * @example active
648
- * @enum {string}
649
- */
272
+ /** @enum {string} */
650
273
  status?: "active" | "inactive" | "archived";
651
- /**
652
- * Maximum number of active users
653
- * @example 10
654
- */
655
274
  maxActiveUsers?: number;
656
- /**
657
- * Access expiry in days
658
- * @example 30
659
- */
660
275
  accessExpiryDays?: number;
661
- /** @description Additional metadata */
662
- metadata?: {
276
+ metadata: {
663
277
  [key: string]: unknown;
664
278
  };
665
- /**
666
- * Whether this is the default plan
667
- * @example false
668
- */
669
279
  default?: boolean;
670
280
  };
281
+ CreateProductRequest: {
282
+ name: string;
283
+ description?: string;
284
+ imageUrl?: string;
285
+ productType?: string;
286
+ isMcpPay?: boolean;
287
+ config: {
288
+ fulfillmentType?: string;
289
+ validityPeriod?: number;
290
+ deliveryMethod?: string;
291
+ };
292
+ metadata: {
293
+ [key: string]: unknown;
294
+ };
295
+ };
671
296
  ProductConfigDto: {
672
297
  /**
673
298
  * Fulfillment type
@@ -685,42 +310,7 @@ interface components {
685
310
  */
686
311
  deliveryMethod?: string;
687
312
  };
688
- CreateProductRequest: {
689
- /**
690
- * Product name
691
- * @example AI Writing Assistant
692
- */
693
- name: string;
694
- /**
695
- * Product description
696
- * @example AI-powered writing tool
697
- */
698
- description?: string;
699
- /** @description URL to the product image */
700
- imageUrl?: string;
701
- /**
702
- * Free-form product type defined by the provider
703
- * @example Coding Assistant
704
- */
705
- productType?: string;
706
- /**
707
- * Whether this product uses MCP Pay proxy
708
- * @default false
709
- */
710
- isMcpPay: boolean;
711
- /** @description Product-specific configuration */
712
- config?: components["schemas"]["ProductConfigDto"];
713
- /** @description Arbitrary key-value metadata */
714
- metadata?: {
715
- [key: string]: unknown;
716
- };
717
- };
718
313
  SdkPlanResponse: {
719
- /**
720
- * Plan ID
721
- * @example 507f1f77bcf86cd799439011
722
- */
723
- id: string;
724
314
  /**
725
315
  * Plan reference
726
316
  * @example pln_1A2B3C4D
@@ -762,15 +352,20 @@ interface components {
762
352
  */
763
353
  billingModel?: string;
764
354
  /**
765
- * Price per unit in cents
766
- * @example 10
355
+ * Credits per usage unit (integer, >= 1)
356
+ * @example 1
767
357
  */
768
- pricePerUnit?: number;
358
+ creditsPerUnit?: number;
769
359
  /**
770
360
  * What the plan measures for usage tracking
771
361
  * @example requests
772
362
  */
773
363
  measures?: string;
364
+ /**
365
+ * Meter reference for usage-based limits
366
+ * @example mtr_1A2B3C4D
367
+ */
368
+ meterRef?: string;
774
369
  /**
775
370
  * Usage limit for the meter
776
371
  * @example 10000
@@ -794,11 +389,6 @@ interface components {
794
389
  features?: {
795
390
  [key: string]: unknown;
796
391
  };
797
- /**
798
- * Whether this is a free tier plan
799
- * @example false
800
- */
801
- isFreeTier: boolean;
802
392
  /**
803
393
  * Whether payment is required
804
394
  * @example true
@@ -820,11 +410,6 @@ interface components {
820
410
  updatedAt: string;
821
411
  };
822
412
  SdkProductResponse: {
823
- /**
824
- * Product ID
825
- * @example 507f1f77bcf86cd799439011
826
- */
827
- id: string;
828
413
  /**
829
414
  * Product reference
830
415
  * @example prd_1A2B3C4D
@@ -876,12 +461,11 @@ interface components {
876
461
  /**
877
462
  * MCP linkage details for MCP-enabled products
878
463
  * @example {
879
- * "mcpServerId": "67f90f1f1b1c9c0b8df0f111",
880
- * "mcpServerReference": "mcp_ABC123",
464
+ * "mcpServerRef": "mcp_ABC123",
881
465
  * "mcpSubdomain": "acme-docs",
882
466
  * "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
883
467
  * "originUrl": "https://origin.example.com/mcp",
884
- * "defaultPlanId": "67f90f1f1b1c9c0b8df0f001"
468
+ * "defaultPlanRef": "pln_FREE123"
885
469
  * }
886
470
  */
887
471
  mcp?: {
@@ -889,175 +473,56 @@ interface components {
889
473
  };
890
474
  };
891
475
  UpdateProductRequest: {
892
- /** @description Product name */
893
476
  name?: string;
894
- /** @description Product description */
895
477
  description?: string;
896
- /** @description URL to the product image */
897
478
  imageUrl?: string;
898
- /** @description Free-form product type defined by the provider */
899
479
  productType?: string;
900
- /**
901
- * Product status
902
- * @enum {string}
903
- */
480
+ /** @enum {string} */
904
481
  status?: "active" | "inactive" | "suspended";
905
- /** @description Product-specific configuration */
906
- config?: components["schemas"]["ProductConfigDto"];
907
- /** @description Arbitrary key-value metadata */
908
- metadata?: {
909
- [key: string]: unknown;
482
+ config: {
483
+ fulfillmentType?: string;
484
+ validityPeriod?: number;
485
+ deliveryMethod?: string;
910
486
  };
911
- };
912
- McpBootstrapFreePlanConfig: {
913
- /**
914
- * Free plan display name override
915
- * @example Starter
916
- */
917
- name?: string;
918
- /**
919
- * Included free units (default 1000)
920
- * @example 500
921
- */
922
- freeUnits?: number;
923
- };
924
- McpBootstrapPaidPlanInput: {
925
- /**
926
- * Logical plan key (must not be "free")
927
- * @example pro
928
- */
929
- key: string;
930
- /**
931
- * Plan display name
932
- * @example Pro
933
- */
934
- name: string;
935
- /**
936
- * Plan price in cents (must be > 0)
937
- * @example 2000
938
- */
939
- price: number;
940
- /**
941
- * Currency code (ISO 4217)
942
- * @example USD
943
- */
944
- currency: string;
945
- /**
946
- * Billing cycle for recurring plans
947
- * @example monthly
948
- * @enum {string}
949
- */
950
- billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
951
- /**
952
- * Plan type
953
- * @example recurring
954
- * @enum {string}
955
- */
956
- type?: "recurring" | "one-time";
957
- /**
958
- * Included free units
959
- * @example 1000
960
- */
961
- freeUnits?: number;
962
- /**
963
- * Meter id for usage tracking
964
- * @example 67f90f1f1b1c9c0b8df0f001
965
- */
966
- meterId?: string;
967
- /**
968
- * Plan usage limit
969
- * @example 10000
970
- */
971
- limit?: number;
972
- /** @description Plan features */
973
- features?: {
487
+ metadata: {
974
488
  [key: string]: unknown;
975
489
  };
976
490
  };
977
- McpBootstrapToolInput: {
978
- /**
979
- * Tool name
980
- * @example search_docs
981
- */
982
- name: string;
983
- /**
984
- * Tool description
985
- * @example Search indexed documents
986
- */
987
- description?: string;
988
- /**
989
- * If true, tool is publicly available without a plan
990
- * @example false
991
- */
992
- noPlan?: boolean;
993
- /**
994
- * Direct plan IDs allowed for this tool
995
- * @example [
996
- * "67f90f1f1b1c9c0b8df0f001"
997
- * ]
998
- */
999
- planIds?: string[];
1000
- /**
1001
- * Plan references allowed for this tool
1002
- * @example [
1003
- * "pln_ABC123"
1004
- * ]
1005
- */
1006
- planRefs?: string[];
1007
- /**
1008
- * Bootstrap plan keys allowed for this tool (for example free or starter_paid)
1009
- * @example [
1010
- * "free"
1011
- * ]
1012
- */
1013
- planKeys?: string[];
1014
- };
1015
- McpBootstrapRequest: {
1016
- /**
1017
- * Product name (optional when derivable from origin MCP metadata)
1018
- * @example Acme MCP Toolkit
1019
- */
491
+ McpBootstrapDto: {
1020
492
  name?: string;
1021
- /**
1022
- * Product description
1023
- * @example MCP toolkit with tiered access
1024
- */
1025
493
  description?: string;
1026
- /** @description Product image URL */
1027
494
  imageUrl?: string;
1028
- /**
1029
- * Free-form product type
1030
- * @example MCP Server
1031
- */
1032
495
  productType?: string;
1033
- /**
1034
- * Origin MCP server URL (must be https)
1035
- * @example https://origin.example.com/mcp
1036
- */
496
+ /** Format: uri */
1037
497
  originUrl: string;
1038
- /**
1039
- * Optional final MCP subdomain override (for example, value returned by bootstrap-subdomain-checks)
1040
- * @example acme-docs
1041
- */
1042
498
  mcpDomain?: string;
1043
- /**
1044
- * Optional auth header name forwarded to origin server
1045
- * @example X-API-Key
1046
- */
1047
499
  authHeaderName?: string;
1048
- /**
1049
- * Optional auth API key forwarded to origin server
1050
- * @example sk-origin-123
1051
- */
1052
500
  authApiKey?: string;
1053
- /** @description Free plan config overrides. A free plan is always created; this just customizes name/freeUnits. */
1054
- freePlan?: components["schemas"]["McpBootstrapFreePlanConfig"];
1055
- /** @description Paid plan definitions requiring price + currency */
1056
- paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1057
- /** @description Tool to plan mapping configuration */
1058
- tools?: components["schemas"]["McpBootstrapToolInput"][];
1059
- /** @description Arbitrary product metadata */
1060
- metadata?: {
501
+ plans?: {
502
+ key: string;
503
+ name: string;
504
+ price: number;
505
+ currency: string;
506
+ /** @enum {string} */
507
+ billingCycle?: "weekly" | "monthly" | "quarterly" | "yearly" | "custom";
508
+ /** @enum {string} */
509
+ type?: "recurring" | "one-time" | "usage-based";
510
+ creditsPerUnit?: number;
511
+ /** @enum {string} */
512
+ billingModel?: "pre-paid" | "post-paid";
513
+ freeUnits?: number;
514
+ limit?: number;
515
+ features?: {
516
+ [key: string]: unknown;
517
+ };
518
+ }[];
519
+ tools?: {
520
+ name: string;
521
+ description?: string;
522
+ noPlan?: boolean;
523
+ planKeys?: string[];
524
+ }[];
525
+ metadata: {
1061
526
  [key: string]: unknown;
1062
527
  };
1063
528
  };
@@ -1067,12 +532,11 @@ interface components {
1067
532
  /**
1068
533
  * Created or updated MCP server identity
1069
534
  * @example {
1070
- * "id": "67f90f1f1b1c9c0b8df0f111",
1071
535
  * "reference": "mcp_ABC123",
1072
536
  * "subdomain": "acme-docs",
1073
537
  * "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
1074
538
  * "url": "https://origin.example.com/mcp",
1075
- * "defaultPlanId": "67f90f1f1b1c9c0b8df0f001"
539
+ * "defaultPlanRef": "pln_FREE123"
1076
540
  * }
1077
541
  */
1078
542
  mcpServer: {
@@ -1082,7 +546,6 @@ interface components {
1082
546
  * Resolved plan mapping by bootstrap key
1083
547
  * @example {
1084
548
  * "free": {
1085
- * "id": "67f90f1f1b1c9c0b8df0f001",
1086
549
  * "reference": "pln_FREE123",
1087
550
  * "name": "Free"
1088
551
  * }
@@ -1102,27 +565,29 @@ interface components {
1102
565
  description?: string;
1103
566
  }[];
1104
567
  };
1105
- McpToolPlanMapping: {
1106
- /**
1107
- * Tool name
1108
- * @example deep_research
1109
- */
1110
- name: string;
1111
- /**
1112
- * Plan keys this tool should be gated to
1113
- * @example [
1114
- * "pro"
1115
- * ]
1116
- */
1117
- planKeys: string[];
1118
- };
1119
- ConfigureMcpPlansRequest: {
1120
- /** @description Required free plan configuration for updates. Applies to the existing default free plan only. */
1121
- freePlan: components["schemas"]["McpBootstrapFreePlanConfig"];
1122
- /** @description Optional paid plan definitions. [] reverts to free-only, omitted leaves existing paid plans unchanged. */
1123
- paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1124
- /** @description Optional tool-to-plan remapping. If paidPlans is omitted, only this remapping is applied. */
1125
- toolMapping?: components["schemas"]["McpToolPlanMapping"][];
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
+ creditsPerUnit?: number;
579
+ /** @enum {string} */
580
+ billingModel?: "pre-paid" | "post-paid";
581
+ freeUnits?: number;
582
+ limit?: number;
583
+ features?: {
584
+ [key: string]: unknown;
585
+ };
586
+ }[];
587
+ toolMapping?: {
588
+ name: string;
589
+ planKeys: string[];
590
+ }[];
1126
591
  };
1127
592
  ConfigureMcpPlansResult: {
1128
593
  /** @description Updated product */
@@ -1136,461 +601,123 @@ interface components {
1136
601
  [key: string]: unknown;
1137
602
  };
1138
603
  };
1139
- McpBootstrapPreviewResult: {
1140
- /** @description Discovered tools from the origin MCP server */
1141
- discoveredTools: {
1142
- name?: string;
1143
- description?: string;
1144
- }[];
1145
- /** @description Validation status for the provided bootstrap payload */
1146
- validation: {
1147
- valid?: boolean;
1148
- errors?: components["schemas"]["McpBootstrapPreviewValidationError"][];
1149
- };
604
+ CloneProductDto: {
605
+ name?: string;
606
+ };
607
+ CreateUsageRequest: {
608
+ customerRef: string;
1150
609
  /**
1151
- * Product name derived from origin MCP metadata or hostname fallback
1152
- * @example acme-origin-mcp
610
+ * @default api_call
611
+ * @enum {string}
1153
612
  */
1154
- derivedName?: string;
613
+ actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
614
+ /** @default 1 */
615
+ units: number;
1155
616
  /**
1156
- * Product description derived from origin server instructions
1157
- * @example MCP toolkit for document retrieval and summarization.
617
+ * @default success
618
+ * @enum {string}
1158
619
  */
1159
- derivedDescription?: string;
1160
- /** @description Source of derived metadata */
1161
- metadataSource: {
1162
- /** @enum {string} */
1163
- name?: "request" | "origin" | "hostname";
1164
- /** @enum {string} */
1165
- description?: "request" | "instructions" | "none";
620
+ outcome: "success" | "paywall" | "fail";
621
+ productRef?: string;
622
+ purchaseRef?: string;
623
+ description?: string;
624
+ errorMessage?: string;
625
+ metadata: {
626
+ [key: string]: unknown;
1166
627
  };
1167
- /** @description Suggested default tool-to-plan mapping for UI review */
1168
- suggestedMapping: {
1169
- name?: string;
628
+ duration?: number;
629
+ /** Format: date-time */
630
+ timestamp: string;
631
+ idempotencyKey?: string;
632
+ };
633
+ BulkCreateUsageRequest: {
634
+ events: {
635
+ customerRef: string;
636
+ /**
637
+ * @default api_call
638
+ * @enum {string}
639
+ */
640
+ actionType: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
641
+ /** @default 1 */
642
+ units: number;
643
+ /**
644
+ * @default success
645
+ * @enum {string}
646
+ */
647
+ outcome: "success" | "paywall" | "fail";
648
+ productRef?: string;
649
+ purchaseRef?: string;
1170
650
  description?: string;
1171
- planKey?: string;
651
+ errorMessage?: string;
652
+ metadata?: {
653
+ [key: string]: unknown;
654
+ };
655
+ duration?: number;
656
+ /** Format: date-time */
657
+ timestamp: string;
658
+ idempotencyKey?: string;
1172
659
  }[];
1173
660
  };
1174
- RecordMeterEventDto: {
1175
- /**
1176
- * Meter name to record against
1177
- * @example requests
1178
- */
661
+ RecordMeterEventZodDto: {
1179
662
  meterName: string;
1180
- /**
1181
- * Customer reference
1182
- * @example cus_ABC123
1183
- */
1184
- customerId: string;
1185
- /**
1186
- * Numeric value (default 1)
1187
- * @default 1
1188
- * @example 1
1189
- */
1190
- value: number;
1191
- /**
1192
- * Arbitrary key-value tags
1193
- * @example {
1194
- * "endpoint": "/api/v1/search",
1195
- * "region": "us-east-1"
1196
- * }
1197
- */
1198
- properties?: {
663
+ customerRef: string;
664
+ value?: number;
665
+ properties: {
1199
666
  [key: string]: unknown;
1200
667
  };
1201
- /** @description Product ID to scope the usage event to */
1202
- productId?: string;
1203
- /** @description Product reference to scope the usage event to */
1204
- productReference?: string;
1205
- /** @description ISO 8601 timestamp (defaults to now) */
668
+ productRef?: string;
1206
669
  timestamp?: string;
1207
670
  };
1208
- RecordBulkMeterEventsDto: {
1209
- /** @description Array of events to record */
1210
- events: components["schemas"]["RecordMeterEventDto"][];
671
+ RecordBulkMeterEventsZodDto: {
672
+ events: {
673
+ meterName: string;
674
+ customerRef: string;
675
+ value?: number;
676
+ properties?: {
677
+ [key: string]: unknown;
678
+ };
679
+ productRef?: string;
680
+ timestamp?: string;
681
+ }[];
1211
682
  };
1212
- CreateCustomerSessionRequest: {
1213
- /**
1214
- * Customer reference identifier
1215
- * @example cus_3c4d5e6f7g8h
1216
- */
1217
- customerRef: string;
683
+ UsageBillingDto: {
1218
684
  /**
1219
- * Optional product reference or ID to scope the customer manage page to a single product.
1220
- * @example prd_1a2b3c4d5e6f
685
+ * Units consumed in current period
686
+ * @example 150
1221
687
  */
1222
- productRef?: string;
1223
- };
1224
- CustomerSessionResponse: {
688
+ used: number;
1225
689
  /**
1226
- * Customer session ID
1227
- * @example 507f1f77bcf86cd799439011
690
+ * Units exceeding the plan limit
691
+ * @example 0
1228
692
  */
1229
- id: string;
693
+ overageUnits: number;
1230
694
  /**
1231
- * Public session ID used in customer URL
1232
- * @example e3f1c2d4b6a89f001122334455667788
695
+ * Overage cost in cents
696
+ * @example 0
1233
697
  */
1234
- sessionId: string;
698
+ overageCost: number;
1235
699
  /**
1236
- * Session status
1237
- * @example active
700
+ * Period start date
701
+ * @example 2025-10-01T00:00:00Z
1238
702
  */
1239
- status: string;
703
+ periodStart?: string;
1240
704
  /**
1241
- * Customer URL to open the customer page
1242
- * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
705
+ * Period end date
706
+ * @example 2025-11-01T00:00:00Z
1243
707
  */
1244
- customerUrl: string;
708
+ periodEnd?: string;
1245
709
  };
1246
- CreateCustomerRequest: {
710
+ SdkPlanSnapshotDto: {
1247
711
  /**
1248
- * Customer email address (required)
1249
- * @example customer@example.com
712
+ * Plan reference
713
+ * @example pln_1A2B3C4D
1250
714
  */
1251
- email: string;
715
+ reference?: string;
1252
716
  /**
1253
- * Customer full name (optional)
1254
- * @example John Doe
717
+ * Plan price in cents
718
+ * @example 2999
1255
719
  */
1256
- name?: string;
1257
- /**
1258
- * External reference ID from your auth system to map this customer to an auth user (optional)
1259
- * @example auth_user_12345
1260
- */
1261
- externalRef?: string;
1262
- };
1263
- PurchaseInfo: {
1264
- /**
1265
- * Purchase reference
1266
- * @example pur_1A2B3C4D
1267
- */
1268
- reference: string;
1269
- /**
1270
- * Product name
1271
- * @example API Gateway Manager
1272
- */
1273
- productName: string;
1274
- /**
1275
- * Product reference
1276
- * @example prd_abc123
1277
- */
1278
- productReference?: string;
1279
- /**
1280
- * Purchase status
1281
- * @example active
1282
- */
1283
- status: string;
1284
- /**
1285
- * Start date
1286
- * @example 2025-10-27T10:00:00Z
1287
- */
1288
- startDate: string;
1289
- /**
1290
- * Amount paid in original currency (in cents)
1291
- * @example 9900
1292
- */
1293
- amount: number;
1294
- /**
1295
- * Currency code
1296
- * @example USD
1297
- */
1298
- currency: string;
1299
- /**
1300
- * End date of purchase
1301
- * @example 2025-11-27T10:00:00Z
1302
- */
1303
- endDate?: string;
1304
- /**
1305
- * When purchase was cancelled
1306
- * @example 2025-10-28T10:00:00Z
1307
- */
1308
- cancelledAt?: string;
1309
- /**
1310
- * Reason for cancellation
1311
- * @example Customer request
1312
- */
1313
- cancellationReason?: string;
1314
- /** @description Snapshot of the plan at time of purchase */
1315
- planSnapshot?: Record<string, never>;
1316
- };
1317
- CustomerResponse: {
1318
- /**
1319
- * Customer reference identifier
1320
- * @example cus_3c4d5e6f7g8h
1321
- */
1322
- reference: string;
1323
- /**
1324
- * Customer full name
1325
- * @example John Doe
1326
- */
1327
- name: string;
1328
- /**
1329
- * Customer email address
1330
- * @example customer@example.com
1331
- */
1332
- email: string;
1333
- /**
1334
- * External reference ID from your auth system (if set during creation or update)
1335
- * @example auth_user_12345
1336
- */
1337
- externalRef?: string;
1338
- /** @description Active purchases */
1339
- purchases?: components["schemas"]["PurchaseInfo"][];
1340
- };
1341
- CreateCustomerSessionResponse: {
1342
- /**
1343
- * Customer session ID/token
1344
- * @example e3f1c2d4b6a89f001122334455667788
1345
- */
1346
- sessionId: string;
1347
- /**
1348
- * Full customer URL based on backend configuration (ready to redirect customer)
1349
- * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
1350
- */
1351
- customerUrl: string;
1352
- };
1353
- GetCustomerSessionResponse: {
1354
- /**
1355
- * Customer session ID/token
1356
- * @example e3f1c2d4b6a89f001122334455667788
1357
- */
1358
- sessionId: string;
1359
- /**
1360
- * Session status
1361
- * @example active
1362
- * @enum {string}
1363
- */
1364
- status: "active" | "expired" | "used";
1365
- /**
1366
- * Full customer URL based on backend configuration (ready to redirect customer)
1367
- * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
1368
- */
1369
- customerUrl: string;
1370
- /**
1371
- * Session expiration date
1372
- * @example 2025-01-01T12:00:00.000Z
1373
- */
1374
- expiresAt: string;
1375
- /** @description Customer object from session data */
1376
- customer: components["schemas"]["CustomerResponse"];
1377
- /**
1378
- * Session creation date
1379
- * @example 2025-01-01T11:45:00.000Z
1380
- */
1381
- createdAt: string;
1382
- /**
1383
- * Session last update date
1384
- * @example 2025-01-01T11:45:00.000Z
1385
- */
1386
- updatedAt: string;
1387
- };
1388
- UserInfoRequest: {
1389
- /**
1390
- * Customer reference
1391
- * @example cus_3C4D5E6F
1392
- */
1393
- customerRef: string;
1394
- /**
1395
- * Product reference
1396
- * @example prd_1A2B3C4D
1397
- */
1398
- productRef: string;
1399
- };
1400
- UserInfoUserDto: {
1401
- /** @example cus_3C4D5E6F */
1402
- reference: string;
1403
- /** @example John Doe */
1404
- name?: string | null;
1405
- /** @example john@example.com */
1406
- email: string;
1407
- /** @example auth_user_12345 */
1408
- externalRef?: string | null;
1409
- };
1410
- UserInfoUsageDto: {
1411
- /** @example 1000 */
1412
- total: number;
1413
- /** @example 250 */
1414
- used: number;
1415
- /** @example 750 */
1416
- remaining: number;
1417
- /**
1418
- * Meter ObjectId reference
1419
- * @example 507f1f77bcf86cd799439011
1420
- */
1421
- meterId?: string;
1422
- /** @example 25 */
1423
- percentUsed?: number | null;
1424
- };
1425
- UserInfoPlanDto: {
1426
- /** @example pln_2B3C4D5E */
1427
- reference: string;
1428
- /**
1429
- * Price in minor currency units (e.g. cents)
1430
- * @example 2999
1431
- */
1432
- price: number;
1433
- /** @example USD */
1434
- currency: string;
1435
- /** @example recurring */
1436
- type: string;
1437
- /** @example monthly */
1438
- billingCycle?: string | null;
1439
- features?: string[] | null;
1440
- limits?: {
1441
- [key: string]: unknown;
1442
- } | null;
1443
- };
1444
- UserInfoPurchaseDto: {
1445
- /** @example pur_1A2B3C4D */
1446
- reference: string;
1447
- /** @example active */
1448
- status: string;
1449
- /** @example My API Product */
1450
- productName: string;
1451
- /** @example recurring */
1452
- planType: string;
1453
- /** @example 2025-10-27T10:00:00Z */
1454
- startDate?: string | null;
1455
- /** @example 2025-11-27T10:00:00Z */
1456
- endDate?: string | null;
1457
- usage?: components["schemas"]["UserInfoUsageDto"];
1458
- plan?: components["schemas"]["UserInfoPlanDto"];
1459
- };
1460
- UserInfoResponse: {
1461
- /**
1462
- * Human-readable status summary
1463
- * @example Active subscription: My API Product (25% usage consumed)
1464
- */
1465
- status: string;
1466
- /**
1467
- * Customer portal session URL
1468
- * @example https://solvapay.com/customer/manage?id=abc123
1469
- */
1470
- verifyUrl?: string | null;
1471
- user?: components["schemas"]["UserInfoUserDto"];
1472
- purchase?: components["schemas"]["UserInfoPurchaseDto"];
1473
- };
1474
- McpToolDto: {
1475
- /**
1476
- * Tool name
1477
- * @example search_documents
1478
- */
1479
- name: string;
1480
- /**
1481
- * Plan IDs that grant access to this tool
1482
- * @example [
1483
- * "pln_abc123"
1484
- * ]
1485
- */
1486
- planIds?: string[];
1487
- /**
1488
- * If true, the tool is unprotected (no purchase check or usage tracking)
1489
- * @example false
1490
- */
1491
- noPlan?: boolean;
1492
- /**
1493
- * Human-readable tool description
1494
- * @example Search indexed documents
1495
- */
1496
- description?: string;
1497
- /**
1498
- * Whether this is a virtual platform tool handled by SolvaPay
1499
- * @example false
1500
- */
1501
- isVirtual?: boolean;
1502
- };
1503
- McpServerDto: {
1504
- /**
1505
- * Server ID
1506
- * @example 507f1f77bcf86cd799439011
1507
- */
1508
- id?: string;
1509
- /**
1510
- * Unique server reference
1511
- * @example mcp_abc123
1512
- */
1513
- reference?: string;
1514
- /**
1515
- * Domain slug used to derive the MCP endpoint subdomain
1516
- * @example my-mcp-server
1517
- */
1518
- name: string;
1519
- /**
1520
- * URL-safe subdomain derived from name
1521
- * @example my-mcp-server
1522
- */
1523
- subdomain: string;
1524
- /**
1525
- * SolvaPay proxy URL that MCP clients connect to
1526
- * @example https://mytelescope.mcp.solvapay.com/mcp
1527
- */
1528
- mcpProxyUrl?: string;
1529
- /**
1530
- * Origin URL of the actual MCP server
1531
- * @example https://origin.example.com/mcp
1532
- */
1533
- url: string;
1534
- /**
1535
- * Avatar image URL
1536
- * @example https://example.com/avatar.png
1537
- */
1538
- avatarUrl?: string;
1539
- /** @description Registered tools for this server */
1540
- tools?: components["schemas"]["McpToolDto"][];
1541
- /**
1542
- * Default plan ID for tool access gating. Must belong to the linked product and be a free-tier plan (isFreeTier=true or price=0).
1543
- * @example pln_default
1544
- */
1545
- defaultPlanId?: string;
1546
- /**
1547
- * Associated product ID
1548
- * @example 507f1f77bcf86cd799439011
1549
- */
1550
- productId?: string;
1551
- /**
1552
- * Server status
1553
- * @example active
1554
- * @enum {string}
1555
- */
1556
- status?: "active" | "inactive" | "suspended";
1557
- /**
1558
- * Provider ID that owns this server
1559
- * @example 507f1f77bcf86cd799439011
1560
- */
1561
- providerId: string;
1562
- /**
1563
- * Custom auth header name for origin requests
1564
- * @example X-API-Key
1565
- */
1566
- authHeaderName?: string;
1567
- /**
1568
- * Whether an auth API key is configured
1569
- * @example true
1570
- */
1571
- hasAuthApiKey?: boolean;
1572
- /**
1573
- * Total number of tool-call transactions
1574
- * @example 42
1575
- */
1576
- totalTransactions?: number;
1577
- /**
1578
- * Current balance in cents
1579
- * @example 1500
1580
- */
1581
- balance?: number;
1582
- };
1583
- PlanSnapshotDto: {
1584
- /**
1585
- * Plan reference
1586
- * @example pln_1A2B3C4D
1587
- */
1588
- reference?: string;
1589
- /**
1590
- * Plan price in cents
1591
- * @example 2999
1592
- */
1593
- price: number;
720
+ price: number;
1594
721
  /**
1595
722
  * Currency code
1596
723
  * @example USD
@@ -1613,61 +740,29 @@ interface components {
1613
740
  /** @description Usage limits */
1614
741
  limits?: {
1615
742
  [key: string]: unknown;
1616
- } | null;
1617
- /**
1618
- * Meter ObjectId reference
1619
- * @example 507f1f77bcf86cd799439011
1620
- */
1621
- meterId?: string;
1622
- /**
1623
- * Usage limit for the meter
1624
- * @example 5000
1625
- */
1626
- limit?: number;
1627
- /**
1628
- * Number of free units included
1629
- * @example 100
1630
- */
1631
- freeUnits?: number;
1632
- /**
1633
- * Price per usage unit in cents
1634
- * @example 10
1635
- */
1636
- pricePerUnit?: number;
1637
- };
1638
- UsageBillingDto: {
1639
- /**
1640
- * Units consumed in current period
1641
- * @example 150
1642
- */
1643
- used: number;
1644
- /**
1645
- * Units exceeding the plan limit
1646
- * @example 0
1647
- */
1648
- overageUnits: number;
743
+ } | null;
1649
744
  /**
1650
- * Overage cost in cents
1651
- * @example 0
745
+ * Meter reference
746
+ * @example mtr_1A2B3C4D
1652
747
  */
1653
- overageCost: number;
748
+ meterRef?: string;
1654
749
  /**
1655
- * Period start date
1656
- * @example 2025-10-01T00:00:00Z
750
+ * Usage limit for the meter
751
+ * @example 5000
1657
752
  */
1658
- periodStart?: string;
753
+ limit?: number;
1659
754
  /**
1660
- * Period end date
1661
- * @example 2025-11-01T00:00:00Z
755
+ * Number of free units included
756
+ * @example 100
1662
757
  */
1663
- periodEnd?: string;
1664
- };
1665
- PurchaseResponse: {
758
+ freeUnits?: number;
1666
759
  /**
1667
- * Purchase ID
1668
- * @example 507f1f77bcf86cd799439011
760
+ * Credits per usage unit (integer, >= 1)
761
+ * @example 1
1669
762
  */
1670
- id: string;
763
+ creditsPerUnit?: number;
764
+ };
765
+ SdkPurchaseResponse: {
1671
766
  /**
1672
767
  * Purchase reference
1673
768
  * @example pur_1A2B3C4D
@@ -1688,33 +783,38 @@ interface components {
1688
783
  * @example prd_1A2B3C4D
1689
784
  */
1690
785
  productRef: string;
1691
- /**
1692
- * Product ID
1693
- * @example 507f1f77bcf86cd799439012
1694
- */
1695
- productId?: string;
1696
786
  /**
1697
787
  * Product name
1698
788
  * @example API Gateway Manager
1699
789
  */
1700
790
  productName?: string;
1701
- /** @description Plan snapshot at time of purchase */
1702
- planSnapshot: components["schemas"]["PlanSnapshotDto"];
791
+ /** @description Plan snapshot at time of purchase (null for credit topups) */
792
+ planSnapshot?: components["schemas"]["SdkPlanSnapshotDto"];
1703
793
  /**
1704
794
  * Purchase status
1705
795
  * @example active
1706
796
  */
1707
797
  status: string;
1708
798
  /**
1709
- * Amount in cents
799
+ * Amount in USD cents (normalised for aggregation)
1710
800
  * @example 9900
1711
801
  */
1712
802
  amount: number;
1713
803
  /**
1714
- * Currency code
1715
- * @example USD
804
+ * Original amount in the payment currency (cents/pence)
805
+ * @example 10000
806
+ */
807
+ originalAmount?: number;
808
+ /**
809
+ * Original payment currency code
810
+ * @example GBP
1716
811
  */
1717
812
  currency: string;
813
+ /**
814
+ * Exchange rate from original currency to USD
815
+ * @example 1.3082
816
+ */
817
+ exchangeRate?: number;
1718
818
  /** @description Start date */
1719
819
  startDate: string;
1720
820
  /** @description End date */
@@ -1737,46 +837,50 @@ interface components {
1737
837
  nextBillingDate?: string;
1738
838
  /** @description Auto-renew enabled */
1739
839
  autoRenew?: boolean;
1740
- /** @description Whether this is a free tier purchase */
1741
- isFreeTier?: boolean;
1742
840
  /** @description Cancelled at */
1743
841
  cancelledAt?: string;
1744
842
  /** @description Cancellation reason */
1745
843
  cancellationReason?: string;
844
+ /** @description Arbitrary metadata attached to the purchase */
845
+ metadata?: {
846
+ [key: string]: unknown;
847
+ };
1746
848
  /** @description Created at */
1747
849
  createdAt: string;
1748
850
  };
1749
- CancelPurchaseRequest: {
1750
- /** @description Reason for cancellation */
1751
- reason?: string;
1752
- };
1753
851
  CheckLimitRequest: {
1754
- /**
1755
- * Customer reference identifier
1756
- * @example cus_3C4D5E6F
1757
- */
1758
852
  customerRef: string;
1759
- /**
1760
- * Product reference identifier
1761
- * @example prd_1A2B3C4D
1762
- */
1763
853
  productRef: string;
1764
- /**
1765
- * 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.
1766
- * @example pln_2B3C4D5E
1767
- */
1768
- planRef?: string;
1769
- /**
1770
- * Canonical usage meter name used for limit checks (for example: requests, tokens).
1771
- * @example requests
1772
- */
1773
854
  meterName?: string;
1774
- /**
1775
- * Usage type alias for meterName. If both are provided, meterName takes precedence.
1776
- * @example requests
1777
- */
1778
855
  usageType?: string;
1779
856
  };
857
+ LimitPlanItemDto: {
858
+ reference: string;
859
+ name?: string;
860
+ type: string;
861
+ /** @description Price in smallest currency unit (e.g. cents) */
862
+ price: number;
863
+ currency: string;
864
+ requiresPayment: boolean;
865
+ freeUnits?: number;
866
+ /** @description Credits per usage unit (usage-based plans) */
867
+ creditsPerUnit?: number;
868
+ billingModel?: string;
869
+ billingCycle?: string;
870
+ };
871
+ LimitBalanceDto: {
872
+ /** @description Credit balance in mils */
873
+ creditBalance: number;
874
+ /** @description Credits per usage unit */
875
+ creditsPerUnit: number;
876
+ currency: string;
877
+ /** @description Estimated whole units remaining from prepaid credit balance */
878
+ remainingUnits?: number;
879
+ };
880
+ LimitProductBriefDto: {
881
+ reference: string;
882
+ name?: string;
883
+ };
1780
884
  LimitResponse: {
1781
885
  /**
1782
886
  * Whether the customer is within their usage limits
@@ -1803,213 +907,270 @@ interface components {
1803
907
  * @example requests
1804
908
  */
1805
909
  meterName?: string;
910
+ /** @description Credit balance in mils (for pre-paid usage-based plans) */
911
+ creditBalance?: number;
912
+ /** @description Credits per usage unit (for pre-paid usage-based plans) */
913
+ creditsPerUnit?: number;
914
+ /** @description ISO 4217 currency code for credit fields */
915
+ currency?: string;
916
+ /** @description True when the customer must activate a priced default plan before usage is allowed */
917
+ activationRequired?: boolean;
918
+ /** @description Active plans on the product available for activation or checkout */
919
+ plans?: components["schemas"]["LimitPlanItemDto"][];
920
+ /** @description Prepaid usage balance context when the default plan is usage-based */
921
+ balance?: components["schemas"]["LimitBalanceDto"];
922
+ /** @description Product the limit check applies to */
923
+ product?: components["schemas"]["LimitProductBriefDto"];
924
+ /** @description Customer portal confirmation URL when activation is required (fallback when not starting checkout) */
925
+ confirmationUrl?: string;
926
+ };
927
+ ActivatePlanDto: {
928
+ customerRef: string;
929
+ productRef: string;
930
+ planRef: string;
931
+ };
932
+ ActivatePlanResponseDto: {
933
+ /** @enum {string} */
934
+ status: "activated" | "already_active" | "topup_required" | "payment_required" | "invalid";
935
+ purchaseRef?: string;
936
+ message?: string;
937
+ creditBalance?: number;
938
+ creditsPerUnit?: number;
939
+ currency?: string;
940
+ checkoutUrl?: string;
941
+ checkoutSessionId?: string;
942
+ };
943
+ CreateCustomerRequest: {
944
+ /** Format: email */
945
+ email: string;
946
+ name?: string;
947
+ telephone?: string;
948
+ metadata: {
949
+ [key: string]: unknown;
950
+ };
951
+ externalRef?: string;
952
+ };
953
+ CreateCustomerSessionRequest: {
954
+ customerRef: string;
955
+ productRef?: string;
1806
956
  };
1807
- ExecuteAnalyticsQuery: Record<string, never>;
1808
- ExecuteMultipleQueries: Record<string, never>;
1809
- CreateWebhookEndpointDto: {
957
+ PurchaseInfo: {
1810
958
  /**
1811
- * Webhook endpoint URL
1812
- * @example https://example.com/webhook
959
+ * Purchase reference
960
+ * @example pur_1A2B3C4D
1813
961
  */
1814
- url: string;
962
+ reference: string;
1815
963
  /**
1816
- * Webhook endpoint description
1817
- * @example Production webhook
964
+ * Product name
965
+ * @example API Gateway Manager
1818
966
  */
1819
- description?: string;
1820
- };
1821
- UpdateWebhookEndpointDto: {
967
+ productName: string;
968
+ /**
969
+ * Product reference
970
+ * @example prd_abc123
971
+ */
972
+ productRef?: string;
1822
973
  /**
1823
- * Webhook endpoint URL
1824
- * @example https://example.com/webhook
974
+ * Purchase status
975
+ * @example active
1825
976
  */
1826
- url?: string;
977
+ status: string;
1827
978
  /**
1828
- * Webhook endpoint description
1829
- * @example Updated webhook
979
+ * Start date
980
+ * @example 2025-10-27T10:00:00Z
1830
981
  */
1831
- description?: string;
1832
- };
1833
- UpdateThemePreferenceDto: {
982
+ startDate: string;
1834
983
  /**
1835
- * Selected UI theme mode
1836
- * @example dark
1837
- * @enum {string}
984
+ * Amount in USD cents (normalised for aggregation)
985
+ * @example 9900
986
+ */
987
+ amount: number;
988
+ /**
989
+ * Original amount in the payment currency (minor units)
990
+ * @example 7500
991
+ */
992
+ originalAmount?: number;
993
+ /**
994
+ * ISO 4217 currency code of the customer-facing charge
995
+ * @example GBP
996
+ */
997
+ currency: string;
998
+ /**
999
+ * Exchange rate from original currency to USD
1000
+ * @example 1.32
1001
+ */
1002
+ exchangeRate?: number;
1003
+ /**
1004
+ * End date of purchase
1005
+ * @example 2025-11-27T10:00:00Z
1006
+ */
1007
+ endDate?: string;
1008
+ /**
1009
+ * When purchase was cancelled
1010
+ * @example 2025-10-28T10:00:00Z
1011
+ */
1012
+ cancelledAt?: string;
1013
+ /**
1014
+ * Reason for cancellation
1015
+ * @example Customer request
1838
1016
  */
1839
- mode: "light" | "dark";
1017
+ cancellationReason?: string;
1018
+ /**
1019
+ * Plan reference from the plan snapshot, for reliable plan matching
1020
+ * @example pln_abc123
1021
+ */
1022
+ planRef?: string;
1023
+ /** @description Snapshot of the plan at time of purchase */
1024
+ planSnapshot?: Record<string, never>;
1840
1025
  };
1841
- ThemeModeColorsDto: {
1026
+ CustomerResponse: {
1842
1027
  /**
1843
- * Page background color
1844
- * @example #f7f7f8
1028
+ * Customer reference identifier
1029
+ * @example cus_3c4d5e6f7g8h
1845
1030
  */
1846
- background?: string;
1031
+ reference: string;
1847
1032
  /**
1848
- * Card/surface background color
1849
- * @example #ffffff
1033
+ * Customer full name
1034
+ * @example John Doe
1850
1035
  */
1851
- surface?: string;
1036
+ name: string;
1852
1037
  /**
1853
- * Primary text color
1854
- * @example #181818
1038
+ * Customer email address
1039
+ * @example customer@example.com
1855
1040
  */
1856
- text?: string;
1041
+ email: string;
1857
1042
  /**
1858
- * Secondary/muted text color
1859
- * @example #5c5c5c
1043
+ * External reference ID from your auth system (if set during creation or update)
1044
+ * @example auth_user_12345
1860
1045
  */
1861
- secondary?: string;
1046
+ externalRef?: string;
1047
+ /** @description Active purchases */
1048
+ purchases?: components["schemas"]["PurchaseInfo"][];
1862
1049
  };
1863
- ThemeOverridesDto: {
1864
- /** @description Light mode color overrides */
1865
- light?: components["schemas"]["ThemeModeColorsDto"];
1866
- /** @description Dark mode color overrides */
1867
- dark?: components["schemas"]["ThemeModeColorsDto"];
1050
+ CreateCustomerSessionResponse: {
1051
+ /**
1052
+ * Customer session ID/token
1053
+ * @example e3f1c2d4b6a89f001122334455667788
1054
+ */
1055
+ sessionId: string;
1056
+ /**
1057
+ * Full customer URL based on backend configuration (ready to redirect customer)
1058
+ * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
1059
+ */
1060
+ customerUrl: string;
1868
1061
  };
1869
- UpdateBrandThemeDto: {
1062
+ GetCustomerSessionResponse: {
1063
+ /**
1064
+ * Customer session ID/token
1065
+ * @example e3f1c2d4b6a89f001122334455667788
1066
+ */
1067
+ sessionId: string;
1870
1068
  /**
1871
- * Logo image URL displayed in hosted page headers
1872
- * @example /ui/files/download/provider-assets/provider-123/logos/logo.png
1069
+ * Session status
1070
+ * @example active
1071
+ * @enum {string}
1873
1072
  */
1874
- logo?: string;
1073
+ status: "active" | "expired" | "used";
1875
1074
  /**
1876
- * Provider's brand name displayed on hosted pages
1877
- * @example Acme Corp
1075
+ * Full customer URL based on backend configuration (ready to redirect customer)
1076
+ * @example https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788
1878
1077
  */
1879
- brandName: string;
1078
+ customerUrl: string;
1880
1079
  /**
1881
- * Primary/accent color in hex format
1882
- * @example #3182ce
1080
+ * Session expiration date
1081
+ * @example 2025-01-01T12:00:00.000Z
1883
1082
  */
1884
- primaryColor: string;
1083
+ expiresAt: string;
1084
+ /** @description Customer object from session data */
1085
+ customer: components["schemas"]["CustomerResponse"];
1885
1086
  /**
1886
- * Font family for hosted pages
1887
- * @default Inter
1888
- * @example Inter
1087
+ * Session creation date
1088
+ * @example 2025-01-01T11:45:00.000Z
1889
1089
  */
1890
- fontFamily: string;
1090
+ createdAt: string;
1891
1091
  /**
1892
- * Base font size
1893
- * @default 16px
1894
- * @example 16px
1092
+ * Session last update date
1093
+ * @example 2025-01-01T11:45:00.000Z
1895
1094
  */
1896
- fontSize: string;
1897
- /** @description Per-mode color overrides for light and dark themes */
1898
- themes?: components["schemas"]["ThemeOverridesDto"];
1095
+ updatedAt: string;
1096
+ };
1097
+ UserInfoRequest: {
1098
+ customerRef: string;
1099
+ productRef: string;
1899
1100
  };
1900
- CreatePreregistrationDto: {
1901
- /** @example jane@company.com */
1101
+ UserInfoUserDto: {
1102
+ /** @example cus_3C4D5E6F */
1103
+ reference: string;
1104
+ /** @example John Doe */
1105
+ name?: string | null;
1106
+ /** @example john@example.com */
1902
1107
  email: string;
1903
- /** @example Jane Smith */
1904
- fullName: string;
1905
- /** @example Acme Corp */
1906
- companyName: string;
1907
- /** @example SaaS */
1908
- businessType?: string;
1909
- /** @example Purchase billing for our platform */
1910
- useCase?: string;
1911
- customFields?: {
1912
- [key: string]: string;
1913
- };
1914
- };
1915
- RevenueDataDto: {
1916
- grossRevenue: number;
1917
- refunds: number;
1918
- platformFees: number;
1919
- netRevenue: number;
1920
- costOfRevenue: number;
1921
- grossProfit?: Record<string, never> | null;
1922
- grossMargin?: Record<string, never> | null;
1923
- recognisedRevenue: number;
1924
- deferredRevenue: number;
1925
- hasCostTransactions: boolean;
1926
- };
1927
- BalanceDataDto: {
1928
- openingBalance: number;
1929
- paymentsReceived: number;
1930
- refundsIssued: number;
1931
- platformFees: number;
1932
- costsPaid: number;
1933
- closingBalance: number;
1934
- netChange: number;
1935
- };
1936
- MonthlyFinancialsDto: {
1937
- month: string;
1938
- revenue: components["schemas"]["RevenueDataDto"];
1939
- balance: components["schemas"]["BalanceDataDto"];
1940
- };
1941
- RevenueResponseDto: {
1942
- current: components["schemas"]["RevenueDataDto"];
1943
- prior: components["schemas"]["RevenueDataDto"];
1944
- monthly: components["schemas"]["MonthlyFinancialsDto"][];
1945
- periodLabel: string;
1108
+ /** @example auth_user_12345 */
1109
+ externalRef?: string | null;
1110
+ };
1111
+ UserInfoUsageDto: {
1112
+ /** @example 1000 */
1113
+ total: number;
1114
+ /** @example 250 */
1115
+ used: number;
1116
+ /** @example 750 */
1117
+ remaining: number;
1946
1118
  /**
1947
- * ISO 4217 currency code
1948
- * @example SEK
1119
+ * Meter reference
1120
+ * @example meter_ABC123
1949
1121
  */
1950
- currency: string;
1122
+ meterRef?: string | null;
1123
+ /** @example 25 */
1124
+ percentUsed?: number | null;
1951
1125
  };
1952
- BalanceResponseDto: {
1953
- current: components["schemas"]["BalanceDataDto"];
1954
- monthly: components["schemas"]["MonthlyFinancialsDto"][];
1955
- periodLabel: string;
1126
+ UserInfoPlanDto: {
1127
+ /** @example pln_2B3C4D5E */
1128
+ reference: string;
1956
1129
  /**
1957
- * ISO 4217 currency code
1958
- * @example SEK
1130
+ * Price in minor currency units (e.g. cents)
1131
+ * @example 2999
1959
1132
  */
1133
+ price: number;
1134
+ /** @example USD */
1960
1135
  currency: string;
1136
+ /** @example recurring */
1137
+ type: string;
1138
+ /** @example monthly */
1139
+ billingCycle?: string | null;
1140
+ features?: string[] | null;
1141
+ limits?: {
1142
+ [key: string]: unknown;
1143
+ } | null;
1961
1144
  };
1962
- ProductRevenueRowDto: {
1963
- productRef: string;
1145
+ UserInfoPurchaseDto: {
1146
+ /** @example pur_1A2B3C4D */
1147
+ reference: string;
1148
+ /** @example active */
1149
+ status: string;
1150
+ /** @example My API Product */
1964
1151
  productName: string;
1965
- productType: string;
1966
- revenue: number;
1967
- costs: number;
1968
- grossProfit?: Record<string, never> | null;
1969
- share: number;
1970
- estimatedARR: number;
1971
- transactionCount: number;
1972
- };
1973
- TopProductDto: {
1974
- name: string;
1975
- revenue: number;
1152
+ /** @example recurring */
1153
+ planType: string;
1154
+ /** @example 2025-10-27T10:00:00Z */
1155
+ startDate?: string | null;
1156
+ /** @example 2025-11-27T10:00:00Z */
1157
+ endDate?: string | null;
1158
+ usage?: components["schemas"]["UserInfoUsageDto"];
1159
+ plan?: components["schemas"]["UserInfoPlanDto"];
1976
1160
  };
1977
- RevenueByProductResponseDto: {
1978
- products: components["schemas"]["ProductRevenueRowDto"][];
1979
- activeProductCount: number;
1980
- totalMRR: number;
1981
- topProduct?: components["schemas"]["TopProductDto"] | null;
1161
+ UserInfoResponse: {
1982
1162
  /**
1983
- * ISO 4217 currency code
1984
- * @example SEK
1163
+ * Human-readable status summary
1164
+ * @example Active subscription: My API Product (25% usage consumed)
1985
1165
  */
1986
- currency: string;
1987
- };
1988
- LedgerEntryDto: {
1989
- date: string;
1990
- reference: string;
1991
- description: string;
1992
- type: string;
1993
- direction: string;
1994
- account: string;
1995
- debit: number;
1996
- credit: number;
1997
1166
  status: string;
1998
- };
1999
- LedgerResponseDto: {
2000
- entries: components["schemas"]["LedgerEntryDto"][];
2001
- total: number;
2002
- totalCredit: number;
2003
- totalDebit: number;
2004
1167
  /**
2005
- * ISO 4217 currency code
2006
- * @example SEK
1168
+ * Customer portal session URL
1169
+ * @example https://solvapay.com/customer/manage?id=abc123
2007
1170
  */
2008
- currency: string;
2009
- };
2010
- /** @description Auto-generated fallback schema for unresolved reference: McpBootstrapPreviewValidationError */
2011
- McpBootstrapPreviewValidationError: {
2012
- [key: string]: unknown;
1171
+ verifyUrl?: string | null;
1172
+ user?: components["schemas"]["UserInfoUserDto"];
1173
+ purchase?: components["schemas"]["UserInfoPurchaseDto"];
2013
1174
  };
2014
1175
  };
2015
1176
  responses: never;
@@ -2057,28 +1218,7 @@ interface operations {
2057
1218
  /** @description Payment intent creation data */
2058
1219
  requestBody: {
2059
1220
  content: {
2060
- "application/json": {
2061
- /**
2062
- * Plan reference to purchase
2063
- * @example pln_2b3c4d5e6f7g
2064
- */
2065
- planRef: string;
2066
- /**
2067
- * Product reference that owns the plan
2068
- * @example prd_1A2B3C4D
2069
- */
2070
- productRef: string;
2071
- /**
2072
- * Customer reference identifier
2073
- * @example cus_3c4d5e6f7g8h
2074
- */
2075
- customerReference: string;
2076
- /**
2077
- * Name of the pricing tier to purchase (for plans with pricingTiers). If not specified, uses the plan base price.
2078
- * @example Pro
2079
- */
2080
- pricingTier?: string;
2081
- };
1221
+ "application/json": components["schemas"]["CreatePaymentIntentDto"];
2082
1222
  };
2083
1223
  };
2084
1224
  responses: {
@@ -2107,8 +1247,8 @@ interface operations {
2107
1247
  query?: never;
2108
1248
  header?: never;
2109
1249
  path: {
2110
- /** @description Payment intent MongoDB ID */
2111
- id: string;
1250
+ /** @description Payment intent reference or processor payment ID */
1251
+ reference: string;
2112
1252
  };
2113
1253
  cookie?: never;
2114
1254
  };
@@ -2139,31 +1279,15 @@ interface operations {
2139
1279
  query?: never;
2140
1280
  header?: never;
2141
1281
  path: {
2142
- /** @description Stripe payment intent ID (format: pi_xxx) */
2143
- id: string;
1282
+ /** @description Payment processor ID returned from createPaymentIntent */
1283
+ processorPaymentId: string;
2144
1284
  };
2145
1285
  cookie?: never;
2146
1286
  };
2147
1287
  /** @description Payment processing data */
2148
1288
  requestBody: {
2149
1289
  content: {
2150
- "application/json": {
2151
- /**
2152
- * Product reference that owns the plan
2153
- * @example prd_123
2154
- */
2155
- productRef: string;
2156
- /**
2157
- * Customer reference identifier
2158
- * @example cus_456
2159
- */
2160
- customerRef: string;
2161
- /**
2162
- * Plan reference - helps determine if payment is for purchase
2163
- * @example pln_789
2164
- */
2165
- planRef?: string;
2166
- };
1290
+ "application/json": components["schemas"]["ProcessPaymentIntentDto"];
2167
1291
  };
2168
1292
  };
2169
1293
  responses: {
@@ -2182,7 +1306,7 @@ interface operations {
2182
1306
  status?: "succeeded" | "timeout" | "failed" | "cancelled";
2183
1307
  /**
2184
1308
  * Optional message, only present for timeout status
2185
- * @example Timeout while waiting for payment intent confirmation, try again later. This could be due to Stripe webhooks not being configured correctly.
1309
+ * @example Timeout while waiting for payment intent confirmation, try again later. This could be due to payment webhooks not being configured correctly.
2186
1310
  */
2187
1311
  message?: string;
2188
1312
  };
@@ -2562,7 +1686,7 @@ interface operations {
2562
1686
  };
2563
1687
  requestBody: {
2564
1688
  content: {
2565
- "application/json": components["schemas"]["McpBootstrapRequest"];
1689
+ "application/json": components["schemas"]["McpBootstrapDto"];
2566
1690
  };
2567
1691
  };
2568
1692
  responses: {
@@ -2596,7 +1720,7 @@ interface operations {
2596
1720
  };
2597
1721
  requestBody: {
2598
1722
  content: {
2599
- "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
1723
+ "application/json": components["schemas"]["ConfigureMcpPlansDto"];
2600
1724
  };
2601
1725
  };
2602
1726
  responses: {
@@ -2635,7 +1759,11 @@ interface operations {
2635
1759
  };
2636
1760
  cookie?: never;
2637
1761
  };
2638
- requestBody?: never;
1762
+ requestBody: {
1763
+ content: {
1764
+ "application/json": components["schemas"]["CloneProductDto"];
1765
+ };
1766
+ };
2639
1767
  responses: {
2640
1768
  /** @description Product cloned successfully */
2641
1769
  201: {
@@ -2664,44 +1792,7 @@ interface operations {
2664
1792
  };
2665
1793
  requestBody: {
2666
1794
  content: {
2667
- "application/json": {
2668
- /**
2669
- * Customer identifier
2670
- * @example cus_3C4D5E6F
2671
- */
2672
- customerId: string;
2673
- /**
2674
- * Action type (default: api_call)
2675
- * @example api_call
2676
- * @enum {string}
2677
- */
2678
- actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2679
- /**
2680
- * Number of usage units (default: 1)
2681
- * @example 1
2682
- */
2683
- units?: number;
2684
- /** @description Product reference */
2685
- productReference?: string;
2686
- /** @description Purchase reference */
2687
- purchaseReference?: string;
2688
- /**
2689
- * Outcome (default: success)
2690
- * @enum {string}
2691
- */
2692
- outcome?: "success" | "paywall" | "fail";
2693
- /** @description Arbitrary event properties */
2694
- metadata?: {
2695
- [key: string]: unknown;
2696
- };
2697
- /**
2698
- * Format: date-time
2699
- * @description ISO 8601 timestamp (defaults to now)
2700
- */
2701
- timestamp?: string;
2702
- /** @description Unique key to prevent duplicate recording (max 256 chars) */
2703
- idempotencyKey?: string;
2704
- };
1795
+ "application/json": components["schemas"]["CreateUsageRequest"];
2705
1796
  };
2706
1797
  };
2707
1798
  responses: {
@@ -2737,24 +1828,7 @@ interface operations {
2737
1828
  };
2738
1829
  requestBody: {
2739
1830
  content: {
2740
- "application/json": {
2741
- events: {
2742
- customerId: string;
2743
- /** @enum {string} */
2744
- actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2745
- units?: number;
2746
- productReference?: string;
2747
- purchaseReference?: string;
2748
- /** @enum {string} */
2749
- outcome?: "success" | "paywall" | "fail";
2750
- metadata?: {
2751
- [key: string]: unknown;
2752
- };
2753
- /** Format: date-time */
2754
- timestamp?: string;
2755
- idempotencyKey?: string;
2756
- }[];
2757
- };
1831
+ "application/json": components["schemas"]["BulkCreateUsageRequest"];
2758
1832
  };
2759
1833
  };
2760
1834
  responses: {
@@ -2783,7 +1857,7 @@ interface operations {
2783
1857
  };
2784
1858
  requestBody: {
2785
1859
  content: {
2786
- "application/json": components["schemas"]["RecordMeterEventDto"];
1860
+ "application/json": components["schemas"]["RecordMeterEventZodDto"];
2787
1861
  };
2788
1862
  };
2789
1863
  responses: {
@@ -2817,7 +1891,7 @@ interface operations {
2817
1891
  };
2818
1892
  requestBody: {
2819
1893
  content: {
2820
- "application/json": components["schemas"]["RecordBulkMeterEventsDto"];
1894
+ "application/json": components["schemas"]["RecordBulkMeterEventsZodDto"];
2821
1895
  };
2822
1896
  };
2823
1897
  responses: {
@@ -2844,15 +1918,15 @@ interface operations {
2844
1918
  };
2845
1919
  };
2846
1920
  };
2847
- CustomerSdkController_getCustomerByQuery: {
1921
+ PurchaseSdkController_listPurchases: {
2848
1922
  parameters: {
2849
1923
  query?: {
2850
- /** @description Customer reference identifier (use exactly one query parameter) */
2851
- reference?: string;
2852
- /** @description External reference ID from your auth system (use exactly one query parameter) */
2853
- externalRef?: string;
2854
- /** @description Customer email address (use exactly one query parameter) */
2855
- email?: string;
1924
+ /** @description Filter by purchase status */
1925
+ status?: "pending" | "active" | "trialing" | "past_due" | "cancelled" | "expired" | "suspended" | "refunded";
1926
+ /** @description Filter by product reference */
1927
+ productRef?: string;
1928
+ /** @description Filter by customer reference */
1929
+ customerRef?: string;
2856
1930
  };
2857
1931
  header?: never;
2858
1932
  path?: never;
@@ -2860,22 +1934,40 @@ interface operations {
2860
1934
  };
2861
1935
  requestBody?: never;
2862
1936
  responses: {
2863
- /** @description Customer retrieved successfully */
1937
+ /** @description Purchases retrieved successfully */
2864
1938
  200: {
2865
1939
  headers: {
2866
1940
  [name: string]: unknown;
2867
1941
  };
2868
1942
  content: {
2869
- "application/json": components["schemas"]["CustomerResponse"];
1943
+ "application/json": {
1944
+ purchases?: components["schemas"]["SdkPurchaseResponse"][];
1945
+ };
2870
1946
  };
2871
1947
  };
2872
- /** @description Invalid request - must provide exactly one of reference, externalRef, or email */
2873
- 400: {
1948
+ };
1949
+ };
1950
+ PurchaseSdkController_getPurchasesForCustomer: {
1951
+ parameters: {
1952
+ query?: never;
1953
+ header?: never;
1954
+ path: {
1955
+ /** @description Customer reference or ID */
1956
+ customerRef: string;
1957
+ };
1958
+ cookie?: never;
1959
+ };
1960
+ requestBody?: never;
1961
+ responses: {
1962
+ /** @description Customer purchases retrieved successfully */
1963
+ 200: {
2874
1964
  headers: {
2875
1965
  [name: string]: unknown;
2876
1966
  };
2877
1967
  content: {
2878
- "application/json": unknown;
1968
+ "application/json": {
1969
+ purchases?: components["schemas"]["SdkPurchaseResponse"][];
1970
+ };
2879
1971
  };
2880
1972
  };
2881
1973
  /** @description Customer not found */
@@ -2883,154 +1975,150 @@ interface operations {
2883
1975
  headers: {
2884
1976
  [name: string]: unknown;
2885
1977
  };
2886
- content: {
2887
- "application/json": unknown;
2888
- };
1978
+ content?: never;
2889
1979
  };
2890
1980
  };
2891
1981
  };
2892
- CustomerSdkController_createCustomer: {
1982
+ PurchaseSdkController_getPurchasesForProduct: {
2893
1983
  parameters: {
2894
1984
  query?: never;
2895
1985
  header?: never;
2896
- path?: never;
2897
- cookie?: never;
2898
- };
2899
- /** @description Customer creation data */
2900
- requestBody: {
2901
- content: {
2902
- "application/json": components["schemas"]["CreateCustomerRequest"];
1986
+ path: {
1987
+ /** @description Product reference or ID */
1988
+ productRef: string;
2903
1989
  };
1990
+ cookie?: never;
2904
1991
  };
1992
+ requestBody?: never;
2905
1993
  responses: {
2906
- /** @description Customer created successfully */
2907
- 201: {
1994
+ /** @description Product purchases retrieved successfully */
1995
+ 200: {
2908
1996
  headers: {
2909
1997
  [name: string]: unknown;
2910
1998
  };
2911
1999
  content: {
2912
- "application/json": components["schemas"]["CustomerResponse"];
2000
+ "application/json": {
2001
+ purchases?: components["schemas"]["SdkPurchaseResponse"][];
2002
+ };
2913
2003
  };
2914
2004
  };
2915
- /** @description Invalid email or missing required fields */
2916
- 400: {
2005
+ /** @description Product not found */
2006
+ 404: {
2917
2007
  headers: {
2918
2008
  [name: string]: unknown;
2919
2009
  };
2920
- content: {
2921
- "application/json": unknown;
2922
- };
2010
+ content?: never;
2923
2011
  };
2924
2012
  };
2925
2013
  };
2926
- CustomerSdkController_getCustomer: {
2014
+ PurchaseSdkController_getPurchase: {
2927
2015
  parameters: {
2928
2016
  query?: never;
2929
2017
  header?: never;
2930
2018
  path: {
2931
- /** @description Customer reference identifier */
2932
- reference: string;
2019
+ /** @description Purchase reference or ID */
2020
+ purchaseRef: string;
2933
2021
  };
2934
2022
  cookie?: never;
2935
2023
  };
2936
2024
  requestBody?: never;
2937
2025
  responses: {
2938
- /** @description Customer retrieved successfully */
2026
+ /** @description Purchase retrieved successfully */
2939
2027
  200: {
2940
2028
  headers: {
2941
2029
  [name: string]: unknown;
2942
2030
  };
2943
2031
  content: {
2944
- "application/json": components["schemas"]["CustomerResponse"];
2032
+ "application/json": components["schemas"]["SdkPurchaseResponse"];
2945
2033
  };
2946
2034
  };
2947
- /** @description Customer not found */
2035
+ /** @description Purchase not found */
2948
2036
  404: {
2949
2037
  headers: {
2950
2038
  [name: string]: unknown;
2951
2039
  };
2952
- content: {
2953
- "application/json": unknown;
2954
- };
2040
+ content?: never;
2955
2041
  };
2956
2042
  };
2957
2043
  };
2958
- CustomerSdkController_createCustomerSession: {
2044
+ PurchaseSdkController_cancelPurchase: {
2959
2045
  parameters: {
2960
2046
  query?: never;
2961
2047
  header?: never;
2962
- path?: never;
2048
+ path: {
2049
+ /** @description Purchase reference or ID */
2050
+ purchaseRef: string;
2051
+ };
2963
2052
  cookie?: never;
2964
2053
  };
2965
- /** @description Customer session creation request data */
2966
2054
  requestBody: {
2967
2055
  content: {
2968
- "application/json": components["schemas"]["CreateCustomerSessionRequest"];
2056
+ "application/json": components["schemas"]["CancelPurchaseRequest"];
2969
2057
  };
2970
2058
  };
2971
2059
  responses: {
2972
- /** @description Customer session created successfully */
2973
- 201: {
2974
- headers: {
2975
- [name: string]: unknown;
2976
- };
2977
- content: {
2978
- "application/json": components["schemas"]["CreateCustomerSessionResponse"];
2979
- };
2980
- };
2981
- /** @description Invalid request data or customer not found */
2982
- 400: {
2060
+ /** @description Purchase cancelled successfully */
2061
+ 200: {
2983
2062
  headers: {
2984
2063
  [name: string]: unknown;
2985
2064
  };
2986
2065
  content: {
2987
- "application/json": unknown;
2066
+ "application/json": {
2067
+ success?: boolean;
2068
+ purchase?: components["schemas"]["SdkPurchaseResponse"];
2069
+ };
2988
2070
  };
2989
2071
  };
2990
- /** @description Customer not found */
2072
+ /** @description Purchase not found */
2991
2073
  404: {
2992
2074
  headers: {
2993
2075
  [name: string]: unknown;
2994
2076
  };
2995
- content: {
2996
- "application/json": unknown;
2997
- };
2077
+ content?: never;
2998
2078
  };
2999
2079
  };
3000
2080
  };
3001
- CustomerSdkController_getCustomerSession: {
2081
+ PurchaseSdkController_reactivatePurchase: {
3002
2082
  parameters: {
3003
2083
  query?: never;
3004
2084
  header?: never;
3005
2085
  path: {
3006
- /** @description Customer session ID/token */
3007
- sessionId: string;
2086
+ /** @description Purchase reference or ID */
2087
+ purchaseRef: string;
3008
2088
  };
3009
2089
  cookie?: never;
3010
2090
  };
3011
2091
  requestBody?: never;
3012
2092
  responses: {
3013
- /** @description Customer session retrieved successfully */
2093
+ /** @description Purchase reactivated successfully */
3014
2094
  200: {
3015
2095
  headers: {
3016
2096
  [name: string]: unknown;
3017
2097
  };
3018
2098
  content: {
3019
- "application/json": components["schemas"]["GetCustomerSessionResponse"];
2099
+ "application/json": {
2100
+ success?: boolean;
2101
+ purchase?: components["schemas"]["SdkPurchaseResponse"];
2102
+ };
3020
2103
  };
3021
2104
  };
3022
- /** @description Customer session not found */
3023
- 404: {
2105
+ /** @description Purchase cannot be reactivated */
2106
+ 400: {
3024
2107
  headers: {
3025
2108
  [name: string]: unknown;
3026
2109
  };
3027
- content: {
3028
- "application/json": unknown;
2110
+ content?: never;
2111
+ };
2112
+ /** @description Purchase not found */
2113
+ 404: {
2114
+ headers: {
2115
+ [name: string]: unknown;
3029
2116
  };
2117
+ content?: never;
3030
2118
  };
3031
2119
  };
3032
2120
  };
3033
- UserInfoSdkController_getUserInfo: {
2121
+ LimitsSdkController_checkLimits: {
3034
2122
  parameters: {
3035
2123
  query?: never;
3036
2124
  header?: never;
@@ -3039,17 +2127,17 @@ interface operations {
3039
2127
  };
3040
2128
  requestBody: {
3041
2129
  content: {
3042
- "application/json": components["schemas"]["UserInfoRequest"];
2130
+ "application/json": components["schemas"]["CheckLimitRequest"];
3043
2131
  };
3044
2132
  };
3045
2133
  responses: {
3046
- /** @description User info with purchase status */
2134
+ /** @description Limit check result */
3047
2135
  200: {
3048
2136
  headers: {
3049
2137
  [name: string]: unknown;
3050
2138
  };
3051
2139
  content: {
3052
- "application/json": components["schemas"]["UserInfoResponse"];
2140
+ "application/json": components["schemas"]["LimitResponse"];
3053
2141
  };
3054
2142
  };
3055
2143
  /** @description Missing customerRef or productRef */
@@ -3068,15 +2156,38 @@ interface operations {
3068
2156
  };
3069
2157
  };
3070
2158
  };
3071
- PurchaseSdkController_listPurchases: {
2159
+ ActivateSdkController_activate: {
2160
+ parameters: {
2161
+ query?: never;
2162
+ header?: never;
2163
+ path?: never;
2164
+ cookie?: never;
2165
+ };
2166
+ requestBody: {
2167
+ content: {
2168
+ "application/json": components["schemas"]["ActivatePlanDto"];
2169
+ };
2170
+ };
2171
+ responses: {
2172
+ 200: {
2173
+ headers: {
2174
+ [name: string]: unknown;
2175
+ };
2176
+ content: {
2177
+ "application/json": components["schemas"]["ActivatePlanResponseDto"];
2178
+ };
2179
+ };
2180
+ };
2181
+ };
2182
+ CustomerSdkController_getCustomerByQuery: {
3072
2183
  parameters: {
3073
2184
  query?: {
3074
- /** @description Filter by purchase status */
3075
- status?: "pending" | "active" | "trialing" | "past_due" | "cancelled" | "expired" | "suspended" | "refunded";
3076
- /** @description Filter by product ID */
3077
- productId?: string;
3078
- /** @description Filter by customer ID */
3079
- customerId?: string;
2185
+ /** @description Customer reference identifier (use exactly one query parameter) */
2186
+ reference?: string;
2187
+ /** @description External reference ID from your auth system (use exactly one query parameter) */
2188
+ externalRef?: string;
2189
+ /** @description Customer email address (use exactly one query parameter) */
2190
+ email?: string;
3080
2191
  };
3081
2192
  header?: never;
3082
2193
  path?: never;
@@ -3084,40 +2195,88 @@ interface operations {
3084
2195
  };
3085
2196
  requestBody?: never;
3086
2197
  responses: {
3087
- /** @description Purchases retrieved successfully */
2198
+ /** @description Customer retrieved successfully */
3088
2199
  200: {
3089
2200
  headers: {
3090
2201
  [name: string]: unknown;
3091
2202
  };
3092
2203
  content: {
3093
- "application/json": {
3094
- purchases?: components["schemas"]["PurchaseResponse"][];
3095
- };
2204
+ "application/json": components["schemas"]["CustomerResponse"];
2205
+ };
2206
+ };
2207
+ /** @description Invalid request - must provide exactly one of reference, externalRef, or email */
2208
+ 400: {
2209
+ headers: {
2210
+ [name: string]: unknown;
2211
+ };
2212
+ content: {
2213
+ "application/json": unknown;
2214
+ };
2215
+ };
2216
+ /** @description Customer not found */
2217
+ 404: {
2218
+ headers: {
2219
+ [name: string]: unknown;
2220
+ };
2221
+ content: {
2222
+ "application/json": unknown;
3096
2223
  };
3097
2224
  };
3098
2225
  };
3099
2226
  };
3100
- PurchaseSdkController_getPurchasesForCustomer: {
2227
+ CustomerSdkController_createCustomer: {
2228
+ parameters: {
2229
+ query?: never;
2230
+ header?: never;
2231
+ path?: never;
2232
+ cookie?: never;
2233
+ };
2234
+ /** @description Customer creation data */
2235
+ requestBody: {
2236
+ content: {
2237
+ "application/json": components["schemas"]["CreateCustomerRequest"];
2238
+ };
2239
+ };
2240
+ responses: {
2241
+ /** @description Customer created successfully */
2242
+ 201: {
2243
+ headers: {
2244
+ [name: string]: unknown;
2245
+ };
2246
+ content: {
2247
+ "application/json": components["schemas"]["CustomerResponse"];
2248
+ };
2249
+ };
2250
+ /** @description Invalid email or missing required fields */
2251
+ 400: {
2252
+ headers: {
2253
+ [name: string]: unknown;
2254
+ };
2255
+ content: {
2256
+ "application/json": unknown;
2257
+ };
2258
+ };
2259
+ };
2260
+ };
2261
+ CustomerSdkController_getCustomerBalance: {
3101
2262
  parameters: {
3102
2263
  query?: never;
3103
2264
  header?: never;
3104
2265
  path: {
3105
- /** @description Customer reference or ID */
3106
- customerRef: string;
2266
+ /** @description Customer reference identifier */
2267
+ reference: string;
3107
2268
  };
3108
2269
  cookie?: never;
3109
2270
  };
3110
2271
  requestBody?: never;
3111
2272
  responses: {
3112
- /** @description Customer purchases retrieved successfully */
2273
+ /** @description Customer balance retrieved successfully */
3113
2274
  200: {
3114
2275
  headers: {
3115
2276
  [name: string]: unknown;
3116
2277
  };
3117
- content: {
3118
- "application/json": {
3119
- purchases?: components["schemas"]["PurchaseResponse"][];
3120
- };
2278
+ content: {
2279
+ "application/json": unknown;
3121
2280
  };
3122
2281
  };
3123
2282
  /** @description Customer not found */
@@ -3125,110 +2284,120 @@ interface operations {
3125
2284
  headers: {
3126
2285
  [name: string]: unknown;
3127
2286
  };
3128
- content?: never;
2287
+ content: {
2288
+ "application/json": unknown;
2289
+ };
3129
2290
  };
3130
2291
  };
3131
2292
  };
3132
- PurchaseSdkController_getPurchasesForProduct: {
2293
+ CustomerSdkController_getCustomer: {
3133
2294
  parameters: {
3134
2295
  query?: never;
3135
2296
  header?: never;
3136
2297
  path: {
3137
- /** @description Product reference or ID */
3138
- productRef: string;
2298
+ /** @description Customer reference identifier */
2299
+ reference: string;
3139
2300
  };
3140
2301
  cookie?: never;
3141
2302
  };
3142
2303
  requestBody?: never;
3143
2304
  responses: {
3144
- /** @description Product purchases retrieved successfully */
2305
+ /** @description Customer retrieved successfully */
3145
2306
  200: {
3146
2307
  headers: {
3147
2308
  [name: string]: unknown;
3148
2309
  };
3149
2310
  content: {
3150
- "application/json": {
3151
- purchases?: components["schemas"]["PurchaseResponse"][];
3152
- };
2311
+ "application/json": components["schemas"]["CustomerResponse"];
3153
2312
  };
3154
2313
  };
3155
- /** @description Product not found */
2314
+ /** @description Customer not found */
3156
2315
  404: {
3157
2316
  headers: {
3158
2317
  [name: string]: unknown;
3159
2318
  };
3160
- content?: never;
2319
+ content: {
2320
+ "application/json": unknown;
2321
+ };
3161
2322
  };
3162
2323
  };
3163
2324
  };
3164
- PurchaseSdkController_getPurchase: {
2325
+ CustomerSdkController_createCustomerSession: {
3165
2326
  parameters: {
3166
2327
  query?: never;
3167
2328
  header?: never;
3168
- path: {
3169
- /** @description Purchase ID or reference */
3170
- id: string;
3171
- };
2329
+ path?: never;
3172
2330
  cookie?: never;
3173
2331
  };
3174
- requestBody?: never;
2332
+ /** @description Customer session creation request data */
2333
+ requestBody: {
2334
+ content: {
2335
+ "application/json": components["schemas"]["CreateCustomerSessionRequest"];
2336
+ };
2337
+ };
3175
2338
  responses: {
3176
- /** @description Purchase retrieved successfully */
3177
- 200: {
2339
+ /** @description Customer session created successfully */
2340
+ 201: {
3178
2341
  headers: {
3179
2342
  [name: string]: unknown;
3180
2343
  };
3181
2344
  content: {
3182
- "application/json": components["schemas"]["PurchaseResponse"];
2345
+ "application/json": components["schemas"]["CreateCustomerSessionResponse"];
3183
2346
  };
3184
2347
  };
3185
- /** @description Purchase not found */
2348
+ /** @description Invalid request data or customer not found */
2349
+ 400: {
2350
+ headers: {
2351
+ [name: string]: unknown;
2352
+ };
2353
+ content: {
2354
+ "application/json": unknown;
2355
+ };
2356
+ };
2357
+ /** @description Customer not found */
3186
2358
  404: {
3187
2359
  headers: {
3188
2360
  [name: string]: unknown;
3189
2361
  };
3190
- content?: never;
2362
+ content: {
2363
+ "application/json": unknown;
2364
+ };
3191
2365
  };
3192
2366
  };
3193
2367
  };
3194
- PurchaseSdkController_cancelPurchase: {
2368
+ CustomerSdkController_getCustomerSession: {
3195
2369
  parameters: {
3196
2370
  query?: never;
3197
2371
  header?: never;
3198
2372
  path: {
3199
- /** @description Purchase reference or ID */
3200
- purchaseRef: string;
2373
+ /** @description Customer session ID/token */
2374
+ sessionId: string;
3201
2375
  };
3202
2376
  cookie?: never;
3203
2377
  };
3204
- requestBody: {
3205
- content: {
3206
- "application/json": components["schemas"]["CancelPurchaseRequest"];
3207
- };
3208
- };
2378
+ requestBody?: never;
3209
2379
  responses: {
3210
- /** @description Purchase cancelled successfully */
2380
+ /** @description Customer session retrieved successfully */
3211
2381
  200: {
3212
2382
  headers: {
3213
2383
  [name: string]: unknown;
3214
2384
  };
3215
2385
  content: {
3216
- "application/json": {
3217
- success?: boolean;
3218
- purchase?: components["schemas"]["PurchaseResponse"];
3219
- };
2386
+ "application/json": components["schemas"]["GetCustomerSessionResponse"];
3220
2387
  };
3221
2388
  };
3222
- /** @description Purchase not found */
2389
+ /** @description Customer session not found */
3223
2390
  404: {
3224
2391
  headers: {
3225
2392
  [name: string]: unknown;
3226
2393
  };
3227
- content?: never;
2394
+ content: {
2395
+ "application/json": unknown;
2396
+ };
3228
2397
  };
3229
2398
  };
3230
2399
  };
3231
- LimitsSdkController_checkLimits: {
2400
+ UserInfoSdkController_getUserInfo: {
3232
2401
  parameters: {
3233
2402
  query?: never;
3234
2403
  header?: never;
@@ -3237,17 +2406,17 @@ interface operations {
3237
2406
  };
3238
2407
  requestBody: {
3239
2408
  content: {
3240
- "application/json": components["schemas"]["CheckLimitRequest"];
2409
+ "application/json": components["schemas"]["UserInfoRequest"];
3241
2410
  };
3242
2411
  };
3243
2412
  responses: {
3244
- /** @description Limit check result */
2413
+ /** @description User info with purchase status */
3245
2414
  200: {
3246
2415
  headers: {
3247
2416
  [name: string]: unknown;
3248
2417
  };
3249
2418
  content: {
3250
- "application/json": components["schemas"]["LimitResponse"];
2419
+ "application/json": components["schemas"]["UserInfoResponse"];
3251
2420
  };
3252
2421
  };
3253
2422
  /** @description Missing customerRef or productRef */
@@ -3274,17 +2443,12 @@ interface operations {
3274
2443
  * Types related to the SolvaPay API client and backend communication.
3275
2444
  */
3276
2445
 
3277
- type UsageMeterType = 'requests' | 'tokens';
3278
- type CheckLimitsRequest = components['schemas']['CheckLimitRequest'] & {
3279
- meterName?: string;
3280
- usageType?: UsageMeterType;
3281
- };
2446
+ type CheckLimitsRequest = components['schemas']['CheckLimitRequest'];
3282
2447
  /**
3283
- * Extended LimitResponse with plan field
2448
+ * Extended LimitResponse with SDK-added plan field
3284
2449
  */
3285
2450
  type LimitResponseWithPlan = components['schemas']['LimitResponse'] & {
3286
2451
  plan: string;
3287
- meterName?: string;
3288
2452
  };
3289
2453
  /**
3290
2454
  * Extended CustomerResponse with proper field mapping
@@ -3323,62 +2487,21 @@ interface ProcessPaymentResult {
3323
2487
  oneTimePurchase?: OneTimePurchaseInfo;
3324
2488
  status: 'completed';
3325
2489
  }
3326
- interface McpBootstrapFreePlanConfig {
3327
- name?: string;
3328
- freeUnits?: number;
3329
- }
3330
- interface McpBootstrapPaidPlanInput {
3331
- key: string;
3332
- name: string;
3333
- /** Price in cents (e.g. 2000 = $20.00) */
3334
- price: number;
3335
- currency: string;
3336
- billingCycle?: 'weekly' | 'monthly' | 'quarterly' | 'yearly' | 'custom';
3337
- type?: 'recurring' | 'one-time';
3338
- freeUnits?: number;
3339
- meterId?: string;
3340
- limit?: number;
3341
- features?: Record<string, unknown>;
3342
- }
3343
- interface ToolPlanMappingInput {
3344
- name: string;
3345
- description?: string;
3346
- noPlan?: boolean;
3347
- planIds?: string[];
3348
- planRefs?: string[];
3349
- planKeys?: string[];
3350
- }
3351
- interface McpToolPlanMappingInput {
3352
- name: string;
3353
- planKeys: string[];
3354
- }
3355
- interface McpBootstrapRequest {
3356
- name?: string;
3357
- description?: string;
3358
- imageUrl?: string;
3359
- productType?: string;
3360
- originUrl: string;
3361
- /** Optional token combined with provider name to derive the final MCP subdomain. */
3362
- mcpDomain?: string;
3363
- authHeaderName?: string;
3364
- authApiKey?: string;
3365
- freePlan?: McpBootstrapFreePlanConfig;
3366
- paidPlans?: McpBootstrapPaidPlanInput[];
3367
- tools?: ToolPlanMappingInput[];
3368
- metadata?: Record<string, unknown>;
3369
- }
2490
+ type ActivatePlanResult = components['schemas']['ActivatePlanResponseDto'];
2491
+ type McpBootstrapPlanInput = NonNullable<components['schemas']['McpBootstrapDto']['plans']>[number];
2492
+ type ToolPlanMappingInput = NonNullable<components['schemas']['McpBootstrapDto']['tools']>[number];
2493
+ type McpBootstrapRequest = components['schemas']['McpBootstrapDto'];
2494
+ type McpToolPlanMappingInput = NonNullable<components['schemas']['ConfigureMcpPlansDto']['toolMapping']>[number];
3370
2495
  interface McpBootstrapResponse {
3371
2496
  product: components['schemas']['SdkProductResponse'];
3372
2497
  mcpServer: {
3373
- id?: string;
3374
2498
  reference?: string;
3375
2499
  subdomain?: string;
3376
2500
  mcpProxyUrl?: string;
3377
2501
  url: string;
3378
- defaultPlanId?: string;
2502
+ defaultPlanRef?: string;
3379
2503
  };
3380
2504
  planMap: Record<string, {
3381
- id: string;
3382
2505
  reference: string;
3383
2506
  name?: string;
3384
2507
  }>;
@@ -3388,22 +2511,17 @@ interface McpBootstrapResponse {
3388
2511
  description?: string;
3389
2512
  }>;
3390
2513
  }
3391
- interface ConfigureMcpPlansRequest {
3392
- paidPlans?: McpBootstrapPaidPlanInput[];
3393
- toolMapping?: McpToolPlanMappingInput[];
3394
- }
2514
+ type ConfigureMcpPlansRequest = components['schemas']['ConfigureMcpPlansDto'];
3395
2515
  interface ConfigureMcpPlansResponse {
3396
2516
  product: components['schemas']['SdkProductResponse'];
3397
2517
  mcpServer: {
3398
- id?: string;
3399
2518
  reference?: string;
3400
2519
  subdomain?: string;
3401
2520
  mcpProxyUrl?: string;
3402
2521
  url: string;
3403
- defaultPlanId?: string;
2522
+ defaultPlanRef?: string;
3404
2523
  };
3405
2524
  planMap: Record<string, {
3406
- id: string;
3407
2525
  reference: string;
3408
2526
  name?: string;
3409
2527
  }>;
@@ -3422,8 +2540,8 @@ interface SolvaPayClient {
3422
2540
  actionType?: 'transaction' | 'api_call' | 'hour' | 'email' | 'storage' | 'custom';
3423
2541
  units?: number;
3424
2542
  outcome?: 'success' | 'paywall' | 'fail';
3425
- productReference?: string;
3426
- purchaseReference?: string;
2543
+ productRef?: string;
2544
+ purchaseRef?: string;
3427
2545
  description?: string;
3428
2546
  metadata?: Record<string, unknown>;
3429
2547
  duration?: number;
@@ -3458,29 +2576,11 @@ interface SolvaPayClient {
3458
2576
  reference: string;
3459
2577
  name: string;
3460
2578
  }>;
3461
- listPlans?(productRef: string): Promise<Array<{
3462
- reference: string;
3463
- price?: number;
3464
- currency?: string;
3465
- interval?: string;
3466
- isFreeTier?: boolean;
3467
- freeUnits?: number;
3468
- measures?: string;
3469
- limit?: number;
3470
- pricePerUnit?: number;
3471
- billingModel?: string;
3472
- metadata?: Record<string, unknown>;
3473
- [key: string]: unknown;
3474
- }>>;
2579
+ listPlans?(productRef: string): Promise<components['schemas']['Plan'][]>;
3475
2580
  createPlan?(params: components['schemas']['CreatePlanRequest'] & {
3476
2581
  productRef: string;
3477
- }): Promise<{
3478
- reference: string;
3479
- }>;
3480
- updatePlan?(productRef: string, planRef: string, params: Partial<components['schemas']['CreatePlanRequest']>): Promise<{
3481
- reference: string;
3482
- [key: string]: unknown;
3483
- }>;
2582
+ }): Promise<components['schemas']['Plan']>;
2583
+ updatePlan?(productRef: string, planRef: string, params: components['schemas']['UpdatePlanRequest']): Promise<components['schemas']['Plan']>;
3484
2584
  deletePlan?(productRef: string, planRef: string): Promise<void>;
3485
2585
  createPaymentIntent?(params: {
3486
2586
  productRef: string;
@@ -3488,7 +2588,19 @@ interface SolvaPayClient {
3488
2588
  customerRef: string;
3489
2589
  idempotencyKey?: string;
3490
2590
  }): Promise<{
3491
- id: string;
2591
+ processorPaymentId: string;
2592
+ clientSecret: string;
2593
+ publishableKey: string;
2594
+ accountId?: string;
2595
+ }>;
2596
+ createTopupPaymentIntent?(params: {
2597
+ customerRef: string;
2598
+ amount: number;
2599
+ currency: string;
2600
+ description?: string;
2601
+ idempotencyKey?: string;
2602
+ }): Promise<{
2603
+ processorPaymentId: string;
3492
2604
  clientSecret: string;
3493
2605
  publishableKey: string;
3494
2606
  accountId?: string;
@@ -3497,6 +2609,9 @@ interface SolvaPayClient {
3497
2609
  purchaseRef: string;
3498
2610
  reason?: string;
3499
2611
  }): Promise<components['schemas']['PurchaseInfo']>;
2612
+ reactivatePurchase?(params: {
2613
+ purchaseRef: string;
2614
+ }): Promise<components['schemas']['PurchaseInfo']>;
3500
2615
  processPaymentIntent?(params: {
3501
2616
  paymentIntentId: string;
3502
2617
  productRef: string;
@@ -3507,8 +2622,18 @@ interface SolvaPayClient {
3507
2622
  customerRef: string;
3508
2623
  productRef: string;
3509
2624
  }): Promise<components['schemas']['UserInfoResponse']>;
2625
+ getCustomerBalance?(params: {
2626
+ customerRef: string;
2627
+ }): Promise<{
2628
+ customerRef: string;
2629
+ credits: number;
2630
+ displayCurrency: string;
2631
+ creditsPerMinorUnit: number;
2632
+ displayExchangeRate: number;
2633
+ }>;
3510
2634
  createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
3511
2635
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
2636
+ activatePlan?(params: components['schemas']['ActivatePlanDto']): Promise<ActivatePlanResult>;
3512
2637
  }
3513
2638
 
3514
2639
  /**
@@ -3516,6 +2641,10 @@ interface SolvaPayClient {
3516
2641
  *
3517
2642
  * Types related to paywall protection, limits, and gating functionality.
3518
2643
  */
2644
+
2645
+ type LimitPlanSummary = components['schemas']['LimitPlanItemDto'];
2646
+ type LimitActivationBalance = components['schemas']['LimitBalanceDto'];
2647
+ type LimitActivationProduct = components['schemas']['LimitProductBriefDto'];
3519
2648
  /**
3520
2649
  * Arguments passed to protected handlers
3521
2650
  */
@@ -3530,18 +2659,32 @@ interface PaywallArgs {
3530
2659
  */
3531
2660
  interface PaywallMetadata {
3532
2661
  product?: string;
3533
- plan?: string;
3534
2662
  usageType?: 'requests' | 'tokens';
3535
2663
  }
3536
2664
  /**
3537
- * Structured content for paywall errors
2665
+ * Structured content for paywall errors (MCP structuredContent and manual handling).
3538
2666
  */
3539
- interface PaywallStructuredContent {
2667
+ type PaywallStructuredContent = {
3540
2668
  kind: 'payment_required';
2669
+ /** Product ref from paywall metadata (or env default) */
3541
2670
  product: string;
3542
2671
  checkoutUrl: string;
3543
2672
  message: string;
3544
- }
2673
+ } | {
2674
+ kind: 'activation_required';
2675
+ /** Product ref from paywall metadata (or env default) */
2676
+ product: string;
2677
+ message: string;
2678
+ /**
2679
+ * Best URL for completing purchase or confirmation; mirrors confirmationUrl when present.
2680
+ */
2681
+ checkoutUrl: string;
2682
+ confirmationUrl?: string;
2683
+ plans?: LimitPlanSummary[];
2684
+ balance?: LimitActivationBalance;
2685
+ /** Rich product context from checkLimits (name, ref, provider slug/id) */
2686
+ productDetails?: LimitActivationProduct;
2687
+ };
3545
2688
  /**
3546
2689
  * MCP tool result with optional paywall information
3547
2690
  */
@@ -3617,14 +2760,6 @@ interface PayableOptions {
3617
2760
  * Product reference (alias for product, preferred for consistency with backend API)
3618
2761
  */
3619
2762
  productRef?: string;
3620
- /**
3621
- * Plan identifier (defaults to product name if not provided)
3622
- */
3623
- plan?: string;
3624
- /**
3625
- * Plan reference (alias for plan, preferred for consistency with backend API)
3626
- */
3627
- planRef?: string;
3628
2763
  /**
3629
2764
  * Usage meter type to charge against (defaults to 'requests')
3630
2765
  */
@@ -3798,7 +2933,7 @@ interface CreateSolvaPayConfig {
3798
2933
  *
3799
2934
  * @example
3800
2935
  * ```typescript
3801
- * const payable = solvaPay.payable({ product: 'prd_myapi', plan: 'pln_premium' });
2936
+ * const payable = solvaPay.payable({ product: 'prd_myapi' });
3802
2937
  *
3803
2938
  * // Express.js
3804
2939
  * app.post('/tasks', payable.http(createTask));
@@ -3896,34 +3031,24 @@ interface PayableFunction {
3896
3031
  * const solvaPay = createSolvaPay();
3897
3032
  *
3898
3033
  * // Create payable handlers
3899
- * const payable = solvaPay.payable({ product: 'prd_myapi', plan: 'pln_premium' });
3034
+ * const payable = solvaPay.payable({ product: 'prd_myapi' });
3900
3035
  *
3901
3036
  * // Manage customers
3902
3037
  * const customerRef = await solvaPay.ensureCustomer('user_123', 'user_123', {
3903
3038
  * email: 'user@example.com'
3904
3039
  * });
3905
- *
3906
- * // Create payment intents
3907
- * const intent = await solvaPay.createPaymentIntent({
3908
- * productRef: 'prd_myapi',
3909
- * planRef: 'pln_premium',
3910
- * customerRef: 'user_123'
3911
- * });
3912
3040
  * ```
3913
3041
  */
3914
3042
  interface SolvaPay {
3915
3043
  /**
3916
3044
  * Create a payable handler with explicit adapters for different frameworks.
3917
3045
  *
3918
- * @param options - Payable options including product and plan references
3046
+ * @param options - Payable options including product reference and usage type
3919
3047
  * @returns PayableFunction with framework-specific adapters
3920
3048
  *
3921
3049
  * @example
3922
3050
  * ```typescript
3923
- * const payable = solvaPay.payable({
3924
- * product: 'prd_myapi',
3925
- * plan: 'pln_premium'
3926
- * });
3051
+ * const payable = solvaPay.payable({ product: 'prd_myapi' });
3927
3052
  *
3928
3053
  * app.post('/tasks', payable.http(createTask));
3929
3054
  * ```
@@ -3963,11 +3088,10 @@ interface SolvaPay {
3963
3088
  name?: string;
3964
3089
  }): Promise<string>;
3965
3090
  /**
3966
- * Create a Stripe payment intent for a customer to purchase a plan.
3091
+ * Create a payment intent for a customer to purchase a plan.
3967
3092
  *
3968
- * This creates a payment intent that can be confirmed on the client side
3969
- * using Stripe.js. After confirmation, call `processPaymentIntent()` to complete
3970
- * the purchase.
3093
+ * This creates a payment intent that can be confirmed on the client side.
3094
+ * After confirmation, call `processPaymentIntent()` to complete the purchase.
3971
3095
  *
3972
3096
  * @param params - Payment intent parameters
3973
3097
  * @param params.productRef - Product reference
@@ -3985,7 +3109,7 @@ interface SolvaPay {
3985
3109
  * idempotencyKey: 'unique-key-123'
3986
3110
  * });
3987
3111
  *
3988
- * // Use intent.clientSecret with Stripe.js on client
3112
+ * // Use intent.clientSecret on the client to confirm payment
3989
3113
  * ```
3990
3114
  */
3991
3115
  createPaymentIntent(params: {
@@ -3994,19 +3118,38 @@ interface SolvaPay {
3994
3118
  customerRef: string;
3995
3119
  idempotencyKey?: string;
3996
3120
  }): Promise<{
3997
- id: string;
3121
+ processorPaymentId: string;
3122
+ clientSecret: string;
3123
+ publishableKey: string;
3124
+ accountId?: string;
3125
+ }>;
3126
+ /**
3127
+ * Create a payment intent for a credit top-up.
3128
+ *
3129
+ * Unlike `createPaymentIntent`, this does not require a product or plan.
3130
+ * Credits are recorded via webhook after payment confirmation — no
3131
+ * `processPaymentIntent` call is needed.
3132
+ */
3133
+ createTopupPaymentIntent(params: {
3134
+ customerRef: string;
3135
+ amount: number;
3136
+ currency: string;
3137
+ description?: string;
3138
+ idempotencyKey?: string;
3139
+ }): Promise<{
3140
+ processorPaymentId: string;
3998
3141
  clientSecret: string;
3999
3142
  publishableKey: string;
4000
3143
  accountId?: string;
4001
3144
  }>;
4002
3145
  /**
4003
- * Process a payment intent after client-side Stripe confirmation.
3146
+ * Process a payment intent after client-side payment confirmation.
4004
3147
  *
4005
3148
  * Creates the purchase immediately, eliminating webhook delay.
4006
- * Call this after the client has confirmed the payment intent with Stripe.js.
3149
+ * Call this after the client has confirmed the payment intent.
4007
3150
  *
4008
3151
  * @param params - Payment processing parameters
4009
- * @param params.paymentIntentId - Stripe payment intent ID from client confirmation
3152
+ * @param params.paymentIntentId - Processor payment ID from client confirmation
4010
3153
  * @param params.productRef - Product reference
4011
3154
  * @param params.customerRef - Customer reference
4012
3155
  * @param params.planRef - Optional plan reference (if not in payment intent)
@@ -4014,7 +3157,7 @@ interface SolvaPay {
4014
3157
  *
4015
3158
  * @example
4016
3159
  * ```typescript
4017
- * // After client confirms payment with Stripe.js
3160
+ * // After client confirms payment
4018
3161
  * const result = await solvaPay.processPaymentIntent({
4019
3162
  * paymentIntentId: 'pi_1234567890',
4020
3163
  * productRef: 'prd_myapi',
@@ -4049,7 +3192,6 @@ interface SolvaPay {
4049
3192
  * const limits = await solvaPay.checkLimits({
4050
3193
  * customerRef: 'user_123',
4051
3194
  * productRef: 'prd_myapi',
4052
- * planRef: 'pln_premium'
4053
3195
  * });
4054
3196
  *
4055
3197
  * if (!limits.withinLimits) {
@@ -4062,14 +3204,17 @@ interface SolvaPay {
4062
3204
  customerRef: string;
4063
3205
  productRef: string;
4064
3206
  planRef?: string;
4065
- meterName?: 'requests' | 'tokens';
4066
- usageType?: 'requests' | 'tokens';
3207
+ meterName?: string;
3208
+ usageType?: string;
4067
3209
  }): Promise<{
4068
3210
  withinLimits: boolean;
4069
3211
  remaining: number;
4070
3212
  plan: string;
4071
3213
  checkoutUrl?: string;
4072
3214
  meterName?: string;
3215
+ creditBalance?: number;
3216
+ creditsPerUnit?: number;
3217
+ currency?: string;
4073
3218
  }>;
4074
3219
  /**
4075
3220
  * Track usage for a customer action.
@@ -4079,12 +3224,12 @@ interface SolvaPay {
4079
3224
  *
4080
3225
  * @param params - Usage tracking parameters
4081
3226
  * @param params.customerRef - Customer reference
4082
- * @param params.productRef - Product reference
4083
- * @param params.planRef - Plan reference
3227
+ * @param params.actionType - Action type category
3228
+ * @param params.units - Number of units consumed (default 1)
4084
3229
  * @param params.outcome - Action outcome ('success', 'paywall', or 'fail')
4085
- * @param params.action - Optional action name for analytics
4086
- * @param params.requestId - Unique request ID
4087
- * @param params.actionDuration - Action duration in milliseconds
3230
+ * @param params.productRef - Product reference
3231
+ * @param params.metadata - Additional metadata (e.g. tool name, endpoint)
3232
+ * @param params.duration - Action duration in milliseconds
4088
3233
  * @param params.timestamp - ISO timestamp of the action
4089
3234
  *
4090
3235
  * @example
@@ -4103,8 +3248,8 @@ interface SolvaPay {
4103
3248
  actionType?: 'transaction' | 'api_call' | 'hour' | 'email' | 'storage' | 'custom';
4104
3249
  units?: number;
4105
3250
  outcome?: 'success' | 'paywall' | 'fail';
4106
- productReference?: string;
4107
- purchaseReference?: string;
3251
+ productRef?: string;
3252
+ purchaseRef?: string;
4108
3253
  description?: string;
4109
3254
  metadata?: Record<string, unknown>;
4110
3255
  duration?: number;
@@ -4133,6 +3278,7 @@ interface SolvaPay {
4133
3278
  createCustomer(params: {
4134
3279
  email: string;
4135
3280
  name?: string;
3281
+ metadata?: Record<string, unknown>;
4136
3282
  }): Promise<{
4137
3283
  customerRef: string;
4138
3284
  }>;
@@ -4164,11 +3310,27 @@ interface SolvaPay {
4164
3310
  customerRef?: string;
4165
3311
  externalRef?: string;
4166
3312
  }): Promise<CustomerResponseMapped>;
3313
+ /**
3314
+ * Get credits for a customer.
3315
+ *
3316
+ * @param params - Credits query parameters
3317
+ * @param params.customerRef - Customer reference
3318
+ * @returns Customer reference, credits, and display currency
3319
+ */
3320
+ getCustomerBalance(params: {
3321
+ customerRef: string;
3322
+ }): Promise<{
3323
+ customerRef: string;
3324
+ credits: number;
3325
+ displayCurrency: string;
3326
+ creditsPerMinorUnit: number;
3327
+ displayExchangeRate: number;
3328
+ }>;
4167
3329
  /**
4168
3330
  * Create a hosted checkout session for a customer.
4169
3331
  *
4170
- * This creates a Stripe Checkout session that redirects the customer
4171
- * to a hosted payment page. After payment, customer is redirected back.
3332
+ * This creates a checkout session that redirects the customer
3333
+ * to a hosted payment page. After payment, the customer is redirected back.
4172
3334
  *
4173
3335
  * @param params - Checkout session parameters
4174
3336
  * @param params.productRef - Product reference
@@ -4202,7 +3364,7 @@ interface SolvaPay {
4202
3364
  /**
4203
3365
  * Create a customer portal session for managing purchases.
4204
3366
  *
4205
- * This creates a Stripe Customer Portal session that allows customers
3367
+ * This creates a customer portal session that allows customers
4206
3368
  * to manage their purchases, update payment methods, and view invoices.
4207
3369
  *
4208
3370
  * @param params - Customer session parameters
@@ -4227,6 +3389,17 @@ interface SolvaPay {
4227
3389
  sessionId: string;
4228
3390
  customerUrl: string;
4229
3391
  }>;
3392
+ /**
3393
+ * Activate a plan for a customer (usage-based / free plans that don't require payment).
3394
+ *
3395
+ * Returns the activation result indicating whether the plan was activated,
3396
+ * is already active, requires a credit top-up, or requires payment.
3397
+ */
3398
+ activatePlan(params: {
3399
+ customerRef: string;
3400
+ productRef: string;
3401
+ planRef: string;
3402
+ }): Promise<ActivatePlanResult>;
4230
3403
  /**
4231
3404
  * Bootstrap an MCP-enabled product with plans and tool mappings.
4232
3405
  *
@@ -4320,10 +3493,7 @@ interface SolvaPay {
4320
3493
  * });
4321
3494
  *
4322
3495
  * // Create payable handlers for your product
4323
- * const payable = solvaPay.payable({
4324
- * product: 'prd_myapi',
4325
- * plan: 'pln_premium'
4326
- * });
3496
+ * const payable = solvaPay.payable({ product: 'prd_myapi' });
4327
3497
  *
4328
3498
  * // Protect endpoints with framework-specific adapters
4329
3499
  * app.post('/tasks', payable.http(createTask)); // Express/Fastify
@@ -4448,6 +3618,8 @@ declare class PaywallError extends Error {
4448
3618
  */
4449
3619
  constructor(message: string, structuredContent: PaywallStructuredContent);
4450
3620
  }
3621
+ /** JSON body shape for HTTP adapters and MCP text content (stable fields for clients). */
3622
+ declare function paywallErrorToClientPayload(error: PaywallError): Record<string, unknown>;
4451
3623
 
4452
3624
  /**
4453
3625
  * MCP OAuth helper utilities.
@@ -4653,6 +3825,13 @@ declare function getAuthenticatedUserCore(request: Request, options?: {
4653
3825
  * Works with standard Web API Request (works everywhere).
4654
3826
  */
4655
3827
 
3828
+ type CustomerBalanceResult = {
3829
+ customerRef: string;
3830
+ credits: number;
3831
+ displayCurrency: string;
3832
+ creditsPerMinorUnit: number;
3833
+ displayExchangeRate: number;
3834
+ };
4656
3835
  /**
4657
3836
  * Sync customer with SolvaPay backend (ensure customer exists).
4658
3837
  *
@@ -4695,16 +3874,28 @@ declare function syncCustomerCore(request: Request, options?: {
4695
3874
  includeEmail?: boolean;
4696
3875
  includeName?: boolean;
4697
3876
  }): Promise<string | ErrorResult>;
3877
+ /**
3878
+ * Get credits for the authenticated customer.
3879
+ *
3880
+ * Authenticates the request, syncs the customer, then fetches credits.
3881
+ *
3882
+ * @param request - Standard Web API Request object
3883
+ * @param options - Configuration options
3884
+ * @returns Customer credits result or error result
3885
+ */
3886
+ declare function getCustomerBalanceCore(request: Request, options?: {
3887
+ solvaPay?: SolvaPay;
3888
+ }): Promise<CustomerBalanceResult | ErrorResult>;
4698
3889
 
4699
3890
  /**
4700
- * Create a Stripe payment intent for a customer to purchase a plan.
3891
+ * Create a payment intent for a customer to purchase a plan.
4701
3892
  *
4702
3893
  * This is a framework-agnostic helper that:
4703
3894
  * 1. Extracts authenticated user from the request
4704
3895
  * 2. Syncs customer with SolvaPay backend
4705
3896
  * 3. Creates a payment intent for the specified plan
4706
3897
  *
4707
- * The payment intent can then be confirmed on the client side using Stripe.js.
3898
+ * The payment intent can then be confirmed on the client side.
4708
3899
  * After confirmation, use `processPaymentIntentCore()` to complete the purchase.
4709
3900
  *
4710
3901
  * @param request - Standard Web API Request object
@@ -4744,24 +3935,53 @@ declare function createPaymentIntentCore(request: Request, body: {
4744
3935
  includeEmail?: boolean;
4745
3936
  includeName?: boolean;
4746
3937
  }): Promise<{
4747
- id: string;
3938
+ processorPaymentId: string;
3939
+ clientSecret: string;
3940
+ publishableKey: string;
3941
+ accountId?: string;
3942
+ customerRef: string;
3943
+ } | ErrorResult>;
3944
+ /**
3945
+ * Create a payment intent for a credit top-up.
3946
+ *
3947
+ * Unlike `createPaymentIntentCore`, this does not require a product or plan.
3948
+ * After client-side payment confirmation, credits are recorded via webhook —
3949
+ * no `processPaymentIntentCore` call is needed.
3950
+ *
3951
+ * @param request - Standard Web API Request object
3952
+ * @param body - Top-up parameters
3953
+ * @param body.amount - Amount in smallest currency unit (e.g. cents). Must be > 0
3954
+ * @param body.currency - ISO 4217 currency code (e.g. 'usd')
3955
+ * @param body.description - Optional description for the payment intent
3956
+ * @param options - Configuration options
3957
+ * @returns Payment intent response with client secret and customer reference, or error result
3958
+ */
3959
+ declare function createTopupPaymentIntentCore(request: Request, body: {
3960
+ amount: number;
3961
+ currency: string;
3962
+ description?: string;
3963
+ }, options?: {
3964
+ solvaPay?: SolvaPay;
3965
+ includeEmail?: boolean;
3966
+ includeName?: boolean;
3967
+ }): Promise<{
3968
+ processorPaymentId: string;
4748
3969
  clientSecret: string;
4749
3970
  publishableKey: string;
4750
3971
  accountId?: string;
4751
3972
  customerRef: string;
4752
3973
  } | ErrorResult>;
4753
3974
  /**
4754
- * Process a payment intent after client-side Stripe confirmation.
3975
+ * Process a payment intent after client-side payment confirmation.
4755
3976
  *
4756
3977
  * This helper processes a payment intent that has been confirmed on the client
4757
- * side using Stripe.js. It creates the purchase immediately,
4758
- * eliminating webhook delay.
3978
+ * side. It creates the purchase immediately, eliminating webhook delay.
4759
3979
  *
4760
- * Call this after the client has confirmed the payment intent with Stripe.js.
3980
+ * Call this after the client has confirmed the payment intent.
4761
3981
  *
4762
3982
  * @param request - Standard Web API Request object
4763
3983
  * @param body - Payment processing parameters
4764
- * @param body.paymentIntentId - Stripe payment intent ID from client confirmation (required)
3984
+ * @param body.paymentIntentId - Processor payment ID from client confirmation (required)
4765
3985
  * @param body.productRef - Product reference (required)
4766
3986
  * @param body.planRef - Optional plan reference (if not in payment intent)
4767
3987
  * @param options - Configuration options
@@ -4840,9 +4060,9 @@ declare function createCustomerSessionCore(request: Request, options?: {
4840
4060
  } | ErrorResult>;
4841
4061
 
4842
4062
  /**
4843
- * Purchase Cancellation Helpers (Core)
4063
+ * Purchase Cancellation & Reactivation Helpers (Core)
4844
4064
  *
4845
- * Generic helpers for purchase cancellation operations.
4065
+ * Generic helpers for purchase cancellation and reactivation operations.
4846
4066
  * Works with standard Web API Request (works everywhere).
4847
4067
  */
4848
4068
 
@@ -4860,6 +4080,31 @@ declare function cancelPurchaseCore(request: Request, body: {
4860
4080
  }, options?: {
4861
4081
  solvaPay?: SolvaPay;
4862
4082
  }): Promise<Record<string, unknown> | ErrorResult>;
4083
+ /**
4084
+ * Reactivate purchase - core implementation
4085
+ *
4086
+ * Undoes a pending cancellation, restoring auto-renewal and clearing cancellation fields.
4087
+ * Only works while the purchase is still active and the end date hasn't passed.
4088
+ *
4089
+ * @param request - Standard Web API Request
4090
+ * @param body - Reactivation parameters
4091
+ * @param options - Configuration options
4092
+ * @returns Reactivated purchase response or error result
4093
+ */
4094
+ declare function reactivatePurchaseCore(request: Request, body: {
4095
+ purchaseRef: string;
4096
+ }, options?: {
4097
+ solvaPay?: SolvaPay;
4098
+ }): Promise<Record<string, unknown> | ErrorResult>;
4099
+
4100
+ declare function activatePlanCore(request: Request, body: {
4101
+ productRef: string;
4102
+ planRef: string;
4103
+ }, options?: {
4104
+ solvaPay?: SolvaPay;
4105
+ includeEmail?: boolean;
4106
+ includeName?: boolean;
4107
+ }): Promise<ActivatePlanResult | ErrorResult>;
4863
4108
 
4864
4109
  /**
4865
4110
  * Plans Helper (Core)
@@ -4869,14 +4114,58 @@ declare function cancelPurchaseCore(request: Request, body: {
4869
4114
  * This is a public route - no authentication required.
4870
4115
  */
4871
4116
 
4117
+ type Plan = components['schemas']['Plan'];
4872
4118
  /**
4873
4119
  * List plans - core implementation
4874
4120
  */
4875
4121
  declare function listPlansCore(request: Request): Promise<{
4876
- plans: Record<string, unknown>[];
4122
+ plans: Plan[];
4877
4123
  productRef: string;
4878
4124
  } | ErrorResult>;
4879
4125
 
4126
+ interface PurchaseCheckResult {
4127
+ customerRef: string;
4128
+ email?: string;
4129
+ name?: string;
4130
+ purchases: Array<{
4131
+ reference: string;
4132
+ productName?: string;
4133
+ productRef?: string;
4134
+ status?: string;
4135
+ startDate?: string;
4136
+ planSnapshot?: {
4137
+ meterId?: string;
4138
+ limit?: number;
4139
+ freeUnits?: number;
4140
+ };
4141
+ usage?: {
4142
+ used?: number;
4143
+ overageUnits?: number;
4144
+ overageCost?: number;
4145
+ periodStart?: string;
4146
+ periodEnd?: string;
4147
+ };
4148
+ [key: string]: unknown;
4149
+ }>;
4150
+ }
4151
+ declare function checkPurchaseCore(request: Request, options?: {
4152
+ solvaPay?: SolvaPay;
4153
+ includeEmail?: boolean;
4154
+ includeName?: boolean;
4155
+ }): Promise<PurchaseCheckResult | ErrorResult>;
4156
+
4157
+ declare function trackUsageCore(request: Request, body: {
4158
+ actionType?: 'transaction' | 'api_call' | 'hour' | 'email' | 'storage' | 'custom';
4159
+ units?: number;
4160
+ productRef?: string;
4161
+ description?: string;
4162
+ metadata?: Record<string, unknown>;
4163
+ }, options?: {
4164
+ solvaPay?: SolvaPay;
4165
+ }): Promise<{
4166
+ success: true;
4167
+ } | ErrorResult>;
4168
+
4880
4169
  /**
4881
4170
  * SolvaPay Server SDK
4882
4171
  *
@@ -4932,4 +4221,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
4932
4221
  secret: string;
4933
4222
  }): WebhookEvent;
4934
4223
 
4935
- export { type AuthenticatedUser, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CustomerResponseMapped, type CustomerWebhookObject, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, 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, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
4224
+ export { type ActivatePlanResult, type AuthenticatedUser, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CustomerBalanceResult, 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 PurchaseCheckResult, 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, activatePlanCore, buildAuthInfoFromBearer, cancelPurchaseCore, checkPurchaseCore, type components, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createTopupPaymentIntentCore, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerBalanceCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, paywallErrorToClientPayload, processPaymentIntentCore, reactivatePurchaseCore, registerVirtualToolsMcpImpl, syncCustomerCore, trackUsageCore, verifyWebhook, withRetry };