@solvapay/server 1.0.2 → 1.0.3

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/edge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
2
  interface WebhookEvent {
3
3
  id: string;
4
4
  type: WebhookEventType;
@@ -77,12 +77,12 @@ interface components {
77
77
  VerifyEmailChange: {
78
78
  code: string;
79
79
  };
80
- CreateCheckoutSessionRequest: {
80
+ CreateUiCheckoutSessionRequest: {
81
81
  /**
82
82
  * Customer reference
83
83
  * @example cus_3c4d5e6f7g8h
84
84
  */
85
- customerReference: string;
85
+ customerRef: string;
86
86
  /**
87
87
  * Plan reference (optional)
88
88
  * @example pln_2b3c4d5e6f7g
@@ -94,7 +94,7 @@ interface components {
94
94
  */
95
95
  productRef: string;
96
96
  };
97
- CheckoutSessionResponse: {
97
+ CreateUiCheckoutSessionResponse: {
98
98
  /**
99
99
  * Checkout session ID
100
100
  * @example 507f1f77bcf86cd799439011
@@ -188,6 +188,40 @@ interface components {
188
188
  /** @description Terms of Service acceptance */
189
189
  tosAcceptance?: components["schemas"]["TosAcceptance"];
190
190
  };
191
+ CreateCheckoutSessionRequest: {
192
+ /**
193
+ * Customer reference identifier
194
+ * @example cus_3c4d5e6f7g8h
195
+ */
196
+ customerRef: string;
197
+ /**
198
+ * Product reference identifier
199
+ * @example prd_1A2B3C4D
200
+ */
201
+ productRef: string;
202
+ /**
203
+ * Plan reference identifier (optional)
204
+ * @example pln_2b3c4d5e6f7g
205
+ */
206
+ planRef?: string;
207
+ /**
208
+ * URL to redirect to after successful payment (optional)
209
+ * @example https://example.com/payment-success
210
+ */
211
+ returnUrl?: string;
212
+ };
213
+ CreateCheckoutSessionResponse: {
214
+ /**
215
+ * Checkout session ID/token
216
+ * @example e3f1c2d4b6a89f001122334455667788
217
+ */
218
+ sessionId: string;
219
+ /**
220
+ * Full checkout URL based on backend configuration (ready to redirect customer)
221
+ * @example https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788
222
+ */
223
+ checkoutUrl: string;
224
+ };
191
225
  Signup: {
192
226
  name: string;
193
227
  email: string;
@@ -1036,6 +1070,40 @@ interface components {
1036
1070
  description?: string;
1037
1071
  }[];
1038
1072
  };
1073
+ McpToolPlanMapping: {
1074
+ /**
1075
+ * Tool name
1076
+ * @example deep_research
1077
+ */
1078
+ name: string;
1079
+ /**
1080
+ * Plan keys this tool should be gated to
1081
+ * @example [
1082
+ * "pro"
1083
+ * ]
1084
+ */
1085
+ planKeys: string[];
1086
+ };
1087
+ ConfigureMcpPlansRequest: {
1088
+ /** @description Required free plan configuration for updates. Applies to the existing default free plan only. */
1089
+ freePlan: components["schemas"]["McpBootstrapFreePlanConfig"];
1090
+ /** @description Optional paid plan definitions. [] reverts to free-only, omitted leaves existing paid plans unchanged. */
1091
+ paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1092
+ /** @description Optional tool-to-plan remapping. If paidPlans is omitted, only this remapping is applied. */
1093
+ toolMapping?: components["schemas"]["McpToolPlanMapping"][];
1094
+ };
1095
+ ConfigureMcpPlansResult: {
1096
+ /** @description Updated product */
1097
+ product: components["schemas"]["SdkProductResponse"];
1098
+ /** @description Updated MCP server identity */
1099
+ mcpServer: {
1100
+ [key: string]: unknown;
1101
+ };
1102
+ /** @description Resolved plan mapping by key (includes existing free plan) */
1103
+ planMap: {
1104
+ [key: string]: unknown;
1105
+ };
1106
+ };
1039
1107
  McpBootstrapPreviewResult: {
1040
1108
  /** @description Discovered tools from the origin MCP server */
1041
1109
  discoveredTools: {
@@ -1812,6 +1880,101 @@ interface components {
1812
1880
  [key: string]: string;
1813
1881
  };
1814
1882
  };
1883
+ RevenueDataDto: {
1884
+ grossRevenue: number;
1885
+ refunds: number;
1886
+ platformFees: number;
1887
+ netRevenue: number;
1888
+ costOfRevenue: number;
1889
+ grossProfit?: Record<string, never> | null;
1890
+ grossMargin?: Record<string, never> | null;
1891
+ recognisedRevenue: number;
1892
+ deferredRevenue: number;
1893
+ hasCostTransactions: boolean;
1894
+ };
1895
+ BalanceDataDto: {
1896
+ openingBalance: number;
1897
+ paymentsReceived: number;
1898
+ refundsIssued: number;
1899
+ platformFees: number;
1900
+ costsPaid: number;
1901
+ closingBalance: number;
1902
+ netChange: number;
1903
+ };
1904
+ MonthlyFinancialsDto: {
1905
+ month: string;
1906
+ revenue: components["schemas"]["RevenueDataDto"];
1907
+ balance: components["schemas"]["BalanceDataDto"];
1908
+ };
1909
+ RevenueResponseDto: {
1910
+ current: components["schemas"]["RevenueDataDto"];
1911
+ prior: components["schemas"]["RevenueDataDto"];
1912
+ monthly: components["schemas"]["MonthlyFinancialsDto"][];
1913
+ periodLabel: string;
1914
+ /**
1915
+ * ISO 4217 currency code
1916
+ * @example SEK
1917
+ */
1918
+ currency: string;
1919
+ };
1920
+ BalanceResponseDto: {
1921
+ current: components["schemas"]["BalanceDataDto"];
1922
+ monthly: components["schemas"]["MonthlyFinancialsDto"][];
1923
+ periodLabel: string;
1924
+ /**
1925
+ * ISO 4217 currency code
1926
+ * @example SEK
1927
+ */
1928
+ currency: string;
1929
+ };
1930
+ ProductRevenueRowDto: {
1931
+ productRef: string;
1932
+ productName: string;
1933
+ productType: string;
1934
+ revenue: number;
1935
+ costs: number;
1936
+ grossProfit?: Record<string, never> | null;
1937
+ share: number;
1938
+ estimatedARR: number;
1939
+ transactionCount: number;
1940
+ };
1941
+ TopProductDto: {
1942
+ name: string;
1943
+ revenue: number;
1944
+ };
1945
+ RevenueByProductResponseDto: {
1946
+ products: components["schemas"]["ProductRevenueRowDto"][];
1947
+ activeProductCount: number;
1948
+ totalMRR: number;
1949
+ topProduct?: components["schemas"]["TopProductDto"] | null;
1950
+ /**
1951
+ * ISO 4217 currency code
1952
+ * @example SEK
1953
+ */
1954
+ currency: string;
1955
+ };
1956
+ LedgerEntryDto: {
1957
+ date: string;
1958
+ reference: string;
1959
+ description: string;
1960
+ type: string;
1961
+ direction: string;
1962
+ account: string;
1963
+ debit: number;
1964
+ credit: number;
1965
+ status: string;
1966
+ };
1967
+ LedgerResponseDto: {
1968
+ entries: components["schemas"]["LedgerEntryDto"][];
1969
+ total: number;
1970
+ totalCredit: number;
1971
+ totalDebit: number;
1972
+ /**
1973
+ * ISO 4217 currency code
1974
+ * @example SEK
1975
+ */
1976
+ currency: string;
1977
+ };
1815
1978
  /** @description Auto-generated fallback schema for unresolved reference: McpBootstrapPreviewValidationError */
1816
1979
  McpBootstrapPreviewValidationError: {
1817
1980
  [key: string]: unknown;
@@ -1823,6 +1986,1255 @@ interface components {
1823
1986
  headers: never;
1824
1987
  pathItems: never;
1825
1988
  }
1989
+ interface operations {
1990
+ PaymentIntentSdkController_getPaymentIntents: {
1991
+ parameters: {
1992
+ query?: {
1993
+ /** @description Maximum number of results */
1994
+ limit?: number;
1995
+ /** @description Pagination offset */
1996
+ offset?: number;
1997
+ };
1998
+ header?: never;
1999
+ path?: never;
2000
+ cookie?: never;
2001
+ };
2002
+ requestBody?: never;
2003
+ responses: {
2004
+ /** @description Payment intents retrieved successfully */
2005
+ 200: {
2006
+ headers: {
2007
+ [name: string]: unknown;
2008
+ };
2009
+ content: {
2010
+ "application/json": unknown;
2011
+ };
2012
+ };
2013
+ };
2014
+ };
2015
+ PaymentIntentSdkController_createPaymentIntent: {
2016
+ parameters: {
2017
+ query?: never;
2018
+ header: {
2019
+ /** @description Unique idempotency key to prevent duplicate payments (required) */
2020
+ "idempotency-key": string;
2021
+ };
2022
+ path?: never;
2023
+ cookie?: never;
2024
+ };
2025
+ /** @description Payment intent creation data */
2026
+ requestBody: {
2027
+ content: {
2028
+ "application/json": {
2029
+ /**
2030
+ * Plan reference to purchase
2031
+ * @example pln_2b3c4d5e6f7g
2032
+ */
2033
+ planRef: string;
2034
+ /**
2035
+ * Product reference that owns the plan
2036
+ * @example prd_1A2B3C4D
2037
+ */
2038
+ productRef: string;
2039
+ /**
2040
+ * Customer reference identifier
2041
+ * @example cus_3c4d5e6f7g8h
2042
+ */
2043
+ customerReference: string;
2044
+ /**
2045
+ * Name of the pricing tier to purchase (for plans with pricingTiers). If not specified, uses the plan base price.
2046
+ * @example Pro
2047
+ */
2048
+ pricingTier?: string;
2049
+ };
2050
+ };
2051
+ };
2052
+ responses: {
2053
+ /** @description Payment intent created successfully */
2054
+ 201: {
2055
+ headers: {
2056
+ [name: string]: unknown;
2057
+ };
2058
+ content: {
2059
+ "application/json": unknown;
2060
+ };
2061
+ };
2062
+ /** @description Missing required fields or invalid data */
2063
+ 400: {
2064
+ headers: {
2065
+ [name: string]: unknown;
2066
+ };
2067
+ content: {
2068
+ "application/json": unknown;
2069
+ };
2070
+ };
2071
+ };
2072
+ };
2073
+ PaymentIntentSdkController_getPaymentIntent: {
2074
+ parameters: {
2075
+ query?: never;
2076
+ header?: never;
2077
+ path: {
2078
+ /** @description Payment intent MongoDB ID */
2079
+ id: string;
2080
+ };
2081
+ cookie?: never;
2082
+ };
2083
+ requestBody?: never;
2084
+ responses: {
2085
+ /** @description Payment intent retrieved successfully */
2086
+ 200: {
2087
+ headers: {
2088
+ [name: string]: unknown;
2089
+ };
2090
+ content: {
2091
+ "application/json": unknown;
2092
+ };
2093
+ };
2094
+ /** @description Payment intent not found */
2095
+ 404: {
2096
+ headers: {
2097
+ [name: string]: unknown;
2098
+ };
2099
+ content: {
2100
+ "application/json": unknown;
2101
+ };
2102
+ };
2103
+ };
2104
+ };
2105
+ PaymentIntentSdkController_processPaymentIntent: {
2106
+ parameters: {
2107
+ query?: never;
2108
+ header?: never;
2109
+ path: {
2110
+ /** @description Stripe payment intent ID (format: pi_xxx) */
2111
+ id: string;
2112
+ };
2113
+ cookie?: never;
2114
+ };
2115
+ /** @description Payment processing data */
2116
+ requestBody: {
2117
+ content: {
2118
+ "application/json": {
2119
+ /**
2120
+ * Product reference that owns the plan
2121
+ * @example prd_123
2122
+ */
2123
+ productRef: string;
2124
+ /**
2125
+ * Customer reference identifier
2126
+ * @example cus_456
2127
+ */
2128
+ customerRef: string;
2129
+ /**
2130
+ * Plan reference - helps determine if payment is for purchase
2131
+ * @example pln_789
2132
+ */
2133
+ planRef?: string;
2134
+ };
2135
+ };
2136
+ };
2137
+ responses: {
2138
+ /** @description Payment intent status */
2139
+ 200: {
2140
+ headers: {
2141
+ [name: string]: unknown;
2142
+ };
2143
+ content: {
2144
+ "application/json": {
2145
+ /**
2146
+ * Payment intent status
2147
+ * @example succeeded
2148
+ * @enum {string}
2149
+ */
2150
+ status?: "succeeded" | "timeout" | "failed" | "cancelled";
2151
+ /**
2152
+ * Optional message, only present for timeout status
2153
+ * @example Timeout while waiting for payment intent confirmation, try again later. This could be due to Stripe webhooks not being configured correctly.
2154
+ */
2155
+ message?: string;
2156
+ };
2157
+ };
2158
+ };
2159
+ /** @description Payment not succeeded, invalid request, or forbidden */
2160
+ 400: {
2161
+ headers: {
2162
+ [name: string]: unknown;
2163
+ };
2164
+ content: {
2165
+ "application/json": unknown;
2166
+ };
2167
+ };
2168
+ };
2169
+ };
2170
+ CheckoutSessionSdkController_createCheckoutSession: {
2171
+ parameters: {
2172
+ query?: never;
2173
+ header?: never;
2174
+ path?: never;
2175
+ cookie?: never;
2176
+ };
2177
+ requestBody: {
2178
+ content: {
2179
+ "application/json": components["schemas"]["CreateCheckoutSessionRequest"];
2180
+ };
2181
+ };
2182
+ responses: {
2183
+ /** @description Checkout session created */
2184
+ 201: {
2185
+ headers: {
2186
+ [name: string]: unknown;
2187
+ };
2188
+ content: {
2189
+ "application/json": components["schemas"]["CreateCheckoutSessionResponse"];
2190
+ };
2191
+ };
2192
+ /** @description Missing customerRef or productRef */
2193
+ 400: {
2194
+ headers: {
2195
+ [name: string]: unknown;
2196
+ };
2197
+ content?: never;
2198
+ };
2199
+ };
2200
+ };
2201
+ PlanSdkController_listPlans: {
2202
+ parameters: {
2203
+ query?: {
2204
+ limit?: number;
2205
+ offset?: number;
2206
+ };
2207
+ header?: never;
2208
+ path: {
2209
+ /** @description Product reference or ID */
2210
+ productRef: string;
2211
+ };
2212
+ cookie?: never;
2213
+ };
2214
+ requestBody?: never;
2215
+ responses: {
2216
+ /** @description Plans retrieved successfully */
2217
+ 200: {
2218
+ headers: {
2219
+ [name: string]: unknown;
2220
+ };
2221
+ content: {
2222
+ "application/json": {
2223
+ plans?: components["schemas"]["Plan"][];
2224
+ /** @description Total number of plans for the product */
2225
+ total?: number;
2226
+ limit?: number;
2227
+ offset?: number;
2228
+ };
2229
+ };
2230
+ };
2231
+ /** @description Product not found */
2232
+ 404: {
2233
+ headers: {
2234
+ [name: string]: unknown;
2235
+ };
2236
+ content?: never;
2237
+ };
2238
+ };
2239
+ };
2240
+ PlanSdkController_createPlan: {
2241
+ parameters: {
2242
+ query?: never;
2243
+ header?: never;
2244
+ path: {
2245
+ /** @description Product reference or ID */
2246
+ productRef: string;
2247
+ };
2248
+ cookie?: never;
2249
+ };
2250
+ requestBody: {
2251
+ content: {
2252
+ "application/json": components["schemas"]["CreatePlanRequest"];
2253
+ };
2254
+ };
2255
+ responses: {
2256
+ /** @description Plan created successfully */
2257
+ 201: {
2258
+ headers: {
2259
+ [name: string]: unknown;
2260
+ };
2261
+ content: {
2262
+ "application/json": components["schemas"]["Plan"];
2263
+ };
2264
+ };
2265
+ /** @description Product not found */
2266
+ 404: {
2267
+ headers: {
2268
+ [name: string]: unknown;
2269
+ };
2270
+ content?: never;
2271
+ };
2272
+ };
2273
+ };
2274
+ PlanSdkController_getPlan: {
2275
+ parameters: {
2276
+ query?: never;
2277
+ header?: never;
2278
+ path: {
2279
+ /** @description Product reference or ID */
2280
+ productRef: string;
2281
+ /** @description Plan reference or ID */
2282
+ planRef: string;
2283
+ };
2284
+ cookie?: never;
2285
+ };
2286
+ requestBody?: never;
2287
+ responses: {
2288
+ /** @description Plan retrieved successfully */
2289
+ 200: {
2290
+ headers: {
2291
+ [name: string]: unknown;
2292
+ };
2293
+ content: {
2294
+ "application/json": components["schemas"]["Plan"];
2295
+ };
2296
+ };
2297
+ /** @description Plan or product not found */
2298
+ 404: {
2299
+ headers: {
2300
+ [name: string]: unknown;
2301
+ };
2302
+ content?: never;
2303
+ };
2304
+ };
2305
+ };
2306
+ PlanSdkController_updatePlan: {
2307
+ parameters: {
2308
+ query?: never;
2309
+ header?: never;
2310
+ path: {
2311
+ /** @description Product reference or ID */
2312
+ productRef: string;
2313
+ /** @description Plan reference or ID */
2314
+ planRef: string;
2315
+ };
2316
+ cookie?: never;
2317
+ };
2318
+ requestBody: {
2319
+ content: {
2320
+ "application/json": components["schemas"]["UpdatePlanRequest"];
2321
+ };
2322
+ };
2323
+ responses: {
2324
+ /** @description Plan updated successfully */
2325
+ 200: {
2326
+ headers: {
2327
+ [name: string]: unknown;
2328
+ };
2329
+ content: {
2330
+ "application/json": components["schemas"]["Plan"];
2331
+ };
2332
+ };
2333
+ /** @description Plan or product not found */
2334
+ 404: {
2335
+ headers: {
2336
+ [name: string]: unknown;
2337
+ };
2338
+ content?: never;
2339
+ };
2340
+ };
2341
+ };
2342
+ PlanSdkController_deletePlan: {
2343
+ parameters: {
2344
+ query?: never;
2345
+ header?: never;
2346
+ path: {
2347
+ /** @description Product reference or ID */
2348
+ productRef: string;
2349
+ /** @description Plan reference or ID */
2350
+ planRef: string;
2351
+ };
2352
+ cookie?: never;
2353
+ };
2354
+ requestBody?: never;
2355
+ responses: {
2356
+ /** @description Plan deleted successfully */
2357
+ 200: {
2358
+ headers: {
2359
+ [name: string]: unknown;
2360
+ };
2361
+ content?: never;
2362
+ };
2363
+ /** @description Plan or product not found */
2364
+ 404: {
2365
+ headers: {
2366
+ [name: string]: unknown;
2367
+ };
2368
+ content?: never;
2369
+ };
2370
+ };
2371
+ };
2372
+ ProductSdkController_listProducts: {
2373
+ parameters: {
2374
+ query?: {
2375
+ /** @description Max results (1-100) */
2376
+ limit?: number;
2377
+ /** @description Pagination offset */
2378
+ offset?: number;
2379
+ /** @description Search by name or description */
2380
+ search?: string;
2381
+ /** @description Filter by status */
2382
+ status?: "active" | "inactive" | "suspended";
2383
+ /** @description Filter MCP Pay products */
2384
+ isMcpPay?: boolean;
2385
+ };
2386
+ header?: never;
2387
+ path?: never;
2388
+ cookie?: never;
2389
+ };
2390
+ requestBody?: never;
2391
+ responses: {
2392
+ /** @description Products retrieved successfully */
2393
+ 200: {
2394
+ headers: {
2395
+ [name: string]: unknown;
2396
+ };
2397
+ content?: never;
2398
+ };
2399
+ };
2400
+ };
2401
+ ProductSdkController_createProduct: {
2402
+ parameters: {
2403
+ query?: never;
2404
+ header?: never;
2405
+ path?: never;
2406
+ cookie?: never;
2407
+ };
2408
+ requestBody: {
2409
+ content: {
2410
+ "application/json": components["schemas"]["CreateProductRequest"];
2411
+ };
2412
+ };
2413
+ responses: {
2414
+ /** @description Product created successfully */
2415
+ 201: {
2416
+ headers: {
2417
+ [name: string]: unknown;
2418
+ };
2419
+ content: {
2420
+ "application/json": components["schemas"]["SdkProductResponse"];
2421
+ };
2422
+ };
2423
+ /** @description Missing required fields or validation error */
2424
+ 400: {
2425
+ headers: {
2426
+ [name: string]: unknown;
2427
+ };
2428
+ content?: never;
2429
+ };
2430
+ };
2431
+ };
2432
+ ProductSdkController_getProduct: {
2433
+ parameters: {
2434
+ query?: never;
2435
+ header?: never;
2436
+ path: {
2437
+ /** @description Product reference or ID */
2438
+ productRef: string;
2439
+ };
2440
+ cookie?: never;
2441
+ };
2442
+ requestBody?: never;
2443
+ responses: {
2444
+ /** @description Product retrieved successfully */
2445
+ 200: {
2446
+ headers: {
2447
+ [name: string]: unknown;
2448
+ };
2449
+ content: {
2450
+ "application/json": components["schemas"]["SdkProductResponse"];
2451
+ };
2452
+ };
2453
+ /** @description Product not found */
2454
+ 404: {
2455
+ headers: {
2456
+ [name: string]: unknown;
2457
+ };
2458
+ content?: never;
2459
+ };
2460
+ };
2461
+ };
2462
+ ProductSdkController_updateProduct: {
2463
+ parameters: {
2464
+ query?: never;
2465
+ header?: never;
2466
+ path: {
2467
+ /** @description Product reference or ID */
2468
+ productRef: string;
2469
+ };
2470
+ cookie?: never;
2471
+ };
2472
+ requestBody: {
2473
+ content: {
2474
+ "application/json": components["schemas"]["UpdateProductRequest"];
2475
+ };
2476
+ };
2477
+ responses: {
2478
+ /** @description Product updated successfully */
2479
+ 200: {
2480
+ headers: {
2481
+ [name: string]: unknown;
2482
+ };
2483
+ content: {
2484
+ "application/json": components["schemas"]["SdkProductResponse"];
2485
+ };
2486
+ };
2487
+ /** @description Product not found */
2488
+ 404: {
2489
+ headers: {
2490
+ [name: string]: unknown;
2491
+ };
2492
+ content?: never;
2493
+ };
2494
+ };
2495
+ };
2496
+ ProductSdkController_deleteProduct: {
2497
+ parameters: {
2498
+ query?: never;
2499
+ header?: never;
2500
+ path: {
2501
+ /** @description Product reference or ID */
2502
+ productRef: string;
2503
+ };
2504
+ cookie?: never;
2505
+ };
2506
+ requestBody?: never;
2507
+ responses: {
2508
+ /** @description Product deleted or deactivated successfully */
2509
+ 200: {
2510
+ headers: {
2511
+ [name: string]: unknown;
2512
+ };
2513
+ content?: never;
2514
+ };
2515
+ /** @description Product not found */
2516
+ 404: {
2517
+ headers: {
2518
+ [name: string]: unknown;
2519
+ };
2520
+ content?: never;
2521
+ };
2522
+ };
2523
+ };
2524
+ ProductSdkController_bootstrapMcpProduct: {
2525
+ parameters: {
2526
+ query?: never;
2527
+ header?: never;
2528
+ path?: never;
2529
+ cookie?: never;
2530
+ };
2531
+ requestBody: {
2532
+ content: {
2533
+ "application/json": components["schemas"]["McpBootstrapRequest"];
2534
+ };
2535
+ };
2536
+ responses: {
2537
+ /** @description MCP product bootstrapped successfully */
2538
+ 201: {
2539
+ headers: {
2540
+ [name: string]: unknown;
2541
+ };
2542
+ content: {
2543
+ "application/json": components["schemas"]["McpBootstrapResult"];
2544
+ };
2545
+ };
2546
+ /** @description Invalid bootstrap request */
2547
+ 400: {
2548
+ headers: {
2549
+ [name: string]: unknown;
2550
+ };
2551
+ content?: never;
2552
+ };
2553
+ };
2554
+ };
2555
+ ProductSdkController_configureMcpPlans: {
2556
+ parameters: {
2557
+ query?: never;
2558
+ header?: never;
2559
+ path: {
2560
+ /** @description Product reference or ID */
2561
+ productRef: string;
2562
+ };
2563
+ cookie?: never;
2564
+ };
2565
+ requestBody: {
2566
+ content: {
2567
+ "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
2568
+ };
2569
+ };
2570
+ responses: {
2571
+ /** @description MCP plans configured successfully */
2572
+ 200: {
2573
+ headers: {
2574
+ [name: string]: unknown;
2575
+ };
2576
+ content: {
2577
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
2578
+ };
2579
+ };
2580
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
2581
+ 400: {
2582
+ headers: {
2583
+ [name: string]: unknown;
2584
+ };
2585
+ content?: never;
2586
+ };
2587
+ /** @description Product not found */
2588
+ 404: {
2589
+ headers: {
2590
+ [name: string]: unknown;
2591
+ };
2592
+ content?: never;
2593
+ };
2594
+ };
2595
+ };
2596
+ ProductSdkController_cloneProduct: {
2597
+ parameters: {
2598
+ query?: never;
2599
+ header?: never;
2600
+ path: {
2601
+ /** @description Product reference or ID to clone */
2602
+ productRef: string;
2603
+ };
2604
+ cookie?: never;
2605
+ };
2606
+ requestBody?: never;
2607
+ responses: {
2608
+ /** @description Product cloned successfully */
2609
+ 201: {
2610
+ headers: {
2611
+ [name: string]: unknown;
2612
+ };
2613
+ content: {
2614
+ "application/json": components["schemas"]["SdkProductResponse"];
2615
+ };
2616
+ };
2617
+ /** @description Product not found */
2618
+ 404: {
2619
+ headers: {
2620
+ [name: string]: unknown;
2621
+ };
2622
+ content?: never;
2623
+ };
2624
+ };
2625
+ };
2626
+ UsageSdkController_recordUsage: {
2627
+ parameters: {
2628
+ query?: never;
2629
+ header?: never;
2630
+ path?: never;
2631
+ cookie?: never;
2632
+ };
2633
+ requestBody: {
2634
+ content: {
2635
+ "application/json": {
2636
+ /**
2637
+ * Customer identifier
2638
+ * @example cus_3C4D5E6F
2639
+ */
2640
+ customerId: string;
2641
+ /**
2642
+ * Action type (default: api_call)
2643
+ * @example api_call
2644
+ * @enum {string}
2645
+ */
2646
+ actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2647
+ /**
2648
+ * Number of usage units (default: 1)
2649
+ * @example 1
2650
+ */
2651
+ units?: number;
2652
+ /** @description Product reference */
2653
+ productReference?: string;
2654
+ /** @description Purchase reference */
2655
+ purchaseReference?: string;
2656
+ /**
2657
+ * Outcome (default: success)
2658
+ * @enum {string}
2659
+ */
2660
+ outcome?: "success" | "paywall" | "fail";
2661
+ /** @description Arbitrary event properties */
2662
+ metadata?: {
2663
+ [key: string]: unknown;
2664
+ };
2665
+ /**
2666
+ * Format: date-time
2667
+ * @description ISO 8601 timestamp (defaults to now)
2668
+ */
2669
+ timestamp?: string;
2670
+ /** @description Unique key to prevent duplicate recording (max 256 chars) */
2671
+ idempotencyKey?: string;
2672
+ };
2673
+ };
2674
+ };
2675
+ responses: {
2676
+ /** @description Usage recorded successfully */
2677
+ 200: {
2678
+ headers: {
2679
+ [name: string]: unknown;
2680
+ };
2681
+ content: {
2682
+ "application/json": {
2683
+ /** @example true */
2684
+ success?: boolean;
2685
+ /** @example usage_A1B2C3D4 */
2686
+ reference?: string;
2687
+ };
2688
+ };
2689
+ };
2690
+ /** @description Validation failed */
2691
+ 400: {
2692
+ headers: {
2693
+ [name: string]: unknown;
2694
+ };
2695
+ content?: never;
2696
+ };
2697
+ };
2698
+ };
2699
+ UsageSdkController_recordBulkUsage: {
2700
+ parameters: {
2701
+ query?: never;
2702
+ header?: never;
2703
+ path?: never;
2704
+ cookie?: never;
2705
+ };
2706
+ requestBody: {
2707
+ content: {
2708
+ "application/json": {
2709
+ events: {
2710
+ customerId: string;
2711
+ /** @enum {string} */
2712
+ actionType?: "transaction" | "api_call" | "hour" | "email" | "storage" | "custom";
2713
+ units?: number;
2714
+ productReference?: string;
2715
+ purchaseReference?: string;
2716
+ /** @enum {string} */
2717
+ outcome?: "success" | "paywall" | "fail";
2718
+ metadata?: {
2719
+ [key: string]: unknown;
2720
+ };
2721
+ /** Format: date-time */
2722
+ timestamp?: string;
2723
+ idempotencyKey?: string;
2724
+ }[];
2725
+ };
2726
+ };
2727
+ };
2728
+ responses: {
2729
+ /** @description Bulk usage events processed */
2730
+ 200: {
2731
+ headers: {
2732
+ [name: string]: unknown;
2733
+ };
2734
+ content?: never;
2735
+ };
2736
+ /** @description Validation failed */
2737
+ 400: {
2738
+ headers: {
2739
+ [name: string]: unknown;
2740
+ };
2741
+ content?: never;
2742
+ };
2743
+ };
2744
+ };
2745
+ MeterEventsSdkController_recordEvent: {
2746
+ parameters: {
2747
+ query?: never;
2748
+ header?: never;
2749
+ path?: never;
2750
+ cookie?: never;
2751
+ };
2752
+ requestBody: {
2753
+ content: {
2754
+ "application/json": components["schemas"]["RecordMeterEventDto"];
2755
+ };
2756
+ };
2757
+ responses: {
2758
+ /** @description Event recorded */
2759
+ 200: {
2760
+ headers: {
2761
+ [name: string]: unknown;
2762
+ };
2763
+ content: {
2764
+ "application/json": {
2765
+ /** @example true */
2766
+ success?: boolean;
2767
+ };
2768
+ };
2769
+ };
2770
+ /** @description Invalid meter name or meter is archived */
2771
+ 400: {
2772
+ headers: {
2773
+ [name: string]: unknown;
2774
+ };
2775
+ content?: never;
2776
+ };
2777
+ };
2778
+ };
2779
+ MeterEventsSdkController_recordBulkEvents: {
2780
+ parameters: {
2781
+ query?: never;
2782
+ header?: never;
2783
+ path?: never;
2784
+ cookie?: never;
2785
+ };
2786
+ requestBody: {
2787
+ content: {
2788
+ "application/json": components["schemas"]["RecordBulkMeterEventsDto"];
2789
+ };
2790
+ };
2791
+ responses: {
2792
+ /** @description Events recorded */
2793
+ 200: {
2794
+ headers: {
2795
+ [name: string]: unknown;
2796
+ };
2797
+ content: {
2798
+ "application/json": {
2799
+ /** @example true */
2800
+ success?: boolean;
2801
+ /** @example 50 */
2802
+ inserted?: number;
2803
+ };
2804
+ };
2805
+ };
2806
+ /** @description Invalid meter name or meter is archived */
2807
+ 400: {
2808
+ headers: {
2809
+ [name: string]: unknown;
2810
+ };
2811
+ content?: never;
2812
+ };
2813
+ };
2814
+ };
2815
+ CustomerSdkController_getCustomerByQuery: {
2816
+ parameters: {
2817
+ query?: {
2818
+ /** @description Customer reference identifier (use exactly one query parameter) */
2819
+ reference?: string;
2820
+ /** @description External reference ID from your auth system (use exactly one query parameter) */
2821
+ externalRef?: string;
2822
+ /** @description Customer email address (use exactly one query parameter) */
2823
+ email?: string;
2824
+ };
2825
+ header?: never;
2826
+ path?: never;
2827
+ cookie?: never;
2828
+ };
2829
+ requestBody?: never;
2830
+ responses: {
2831
+ /** @description Customer retrieved successfully */
2832
+ 200: {
2833
+ headers: {
2834
+ [name: string]: unknown;
2835
+ };
2836
+ content: {
2837
+ "application/json": components["schemas"]["CustomerResponse"];
2838
+ };
2839
+ };
2840
+ /** @description Invalid request - must provide exactly one of reference, externalRef, or email */
2841
+ 400: {
2842
+ headers: {
2843
+ [name: string]: unknown;
2844
+ };
2845
+ content: {
2846
+ "application/json": unknown;
2847
+ };
2848
+ };
2849
+ /** @description Customer not found */
2850
+ 404: {
2851
+ headers: {
2852
+ [name: string]: unknown;
2853
+ };
2854
+ content: {
2855
+ "application/json": unknown;
2856
+ };
2857
+ };
2858
+ };
2859
+ };
2860
+ CustomerSdkController_createCustomer: {
2861
+ parameters: {
2862
+ query?: never;
2863
+ header?: never;
2864
+ path?: never;
2865
+ cookie?: never;
2866
+ };
2867
+ /** @description Customer creation data */
2868
+ requestBody: {
2869
+ content: {
2870
+ "application/json": components["schemas"]["CreateCustomerRequest"];
2871
+ };
2872
+ };
2873
+ responses: {
2874
+ /** @description Customer created successfully */
2875
+ 201: {
2876
+ headers: {
2877
+ [name: string]: unknown;
2878
+ };
2879
+ content: {
2880
+ "application/json": components["schemas"]["CustomerResponse"];
2881
+ };
2882
+ };
2883
+ /** @description Invalid email or missing required fields */
2884
+ 400: {
2885
+ headers: {
2886
+ [name: string]: unknown;
2887
+ };
2888
+ content: {
2889
+ "application/json": unknown;
2890
+ };
2891
+ };
2892
+ };
2893
+ };
2894
+ CustomerSdkController_getCustomer: {
2895
+ parameters: {
2896
+ query?: never;
2897
+ header?: never;
2898
+ path: {
2899
+ /** @description Customer reference identifier */
2900
+ reference: string;
2901
+ };
2902
+ cookie?: never;
2903
+ };
2904
+ requestBody?: never;
2905
+ responses: {
2906
+ /** @description Customer retrieved successfully */
2907
+ 200: {
2908
+ headers: {
2909
+ [name: string]: unknown;
2910
+ };
2911
+ content: {
2912
+ "application/json": components["schemas"]["CustomerResponse"];
2913
+ };
2914
+ };
2915
+ /** @description Customer not found */
2916
+ 404: {
2917
+ headers: {
2918
+ [name: string]: unknown;
2919
+ };
2920
+ content: {
2921
+ "application/json": unknown;
2922
+ };
2923
+ };
2924
+ };
2925
+ };
2926
+ CustomerSdkController_createCustomerSession: {
2927
+ parameters: {
2928
+ query?: never;
2929
+ header?: never;
2930
+ path?: never;
2931
+ cookie?: never;
2932
+ };
2933
+ /** @description Customer session creation request data */
2934
+ requestBody: {
2935
+ content: {
2936
+ "application/json": components["schemas"]["CreateCustomerSessionRequest"];
2937
+ };
2938
+ };
2939
+ responses: {
2940
+ /** @description Customer session created successfully */
2941
+ 201: {
2942
+ headers: {
2943
+ [name: string]: unknown;
2944
+ };
2945
+ content: {
2946
+ "application/json": components["schemas"]["CreateCustomerSessionResponse"];
2947
+ };
2948
+ };
2949
+ /** @description Invalid request data or customer not found */
2950
+ 400: {
2951
+ headers: {
2952
+ [name: string]: unknown;
2953
+ };
2954
+ content: {
2955
+ "application/json": unknown;
2956
+ };
2957
+ };
2958
+ /** @description Customer not found */
2959
+ 404: {
2960
+ headers: {
2961
+ [name: string]: unknown;
2962
+ };
2963
+ content: {
2964
+ "application/json": unknown;
2965
+ };
2966
+ };
2967
+ };
2968
+ };
2969
+ CustomerSdkController_getCustomerSession: {
2970
+ parameters: {
2971
+ query?: never;
2972
+ header?: never;
2973
+ path: {
2974
+ /** @description Customer session ID/token */
2975
+ sessionId: string;
2976
+ };
2977
+ cookie?: never;
2978
+ };
2979
+ requestBody?: never;
2980
+ responses: {
2981
+ /** @description Customer session retrieved successfully */
2982
+ 200: {
2983
+ headers: {
2984
+ [name: string]: unknown;
2985
+ };
2986
+ content: {
2987
+ "application/json": components["schemas"]["GetCustomerSessionResponse"];
2988
+ };
2989
+ };
2990
+ /** @description Customer session not found */
2991
+ 404: {
2992
+ headers: {
2993
+ [name: string]: unknown;
2994
+ };
2995
+ content: {
2996
+ "application/json": unknown;
2997
+ };
2998
+ };
2999
+ };
3000
+ };
3001
+ UserInfoSdkController_getUserInfo: {
3002
+ parameters: {
3003
+ query?: never;
3004
+ header?: never;
3005
+ path?: never;
3006
+ cookie?: never;
3007
+ };
3008
+ requestBody: {
3009
+ content: {
3010
+ "application/json": components["schemas"]["UserInfoRequest"];
3011
+ };
3012
+ };
3013
+ responses: {
3014
+ /** @description User info with purchase status */
3015
+ 200: {
3016
+ headers: {
3017
+ [name: string]: unknown;
3018
+ };
3019
+ content: {
3020
+ "application/json": components["schemas"]["UserInfoResponse"];
3021
+ };
3022
+ };
3023
+ /** @description Missing customerRef or productRef */
3024
+ 400: {
3025
+ headers: {
3026
+ [name: string]: unknown;
3027
+ };
3028
+ content?: never;
3029
+ };
3030
+ /** @description Customer or product not found */
3031
+ 404: {
3032
+ headers: {
3033
+ [name: string]: unknown;
3034
+ };
3035
+ content?: never;
3036
+ };
3037
+ };
3038
+ };
3039
+ PurchaseSdkController_listPurchases: {
3040
+ parameters: {
3041
+ query?: {
3042
+ /** @description Filter by purchase status */
3043
+ status?: "pending" | "active" | "trialing" | "past_due" | "cancelled" | "expired" | "suspended" | "refunded";
3044
+ /** @description Filter by product ID */
3045
+ productId?: string;
3046
+ /** @description Filter by customer ID */
3047
+ customerId?: string;
3048
+ };
3049
+ header?: never;
3050
+ path?: never;
3051
+ cookie?: never;
3052
+ };
3053
+ requestBody?: never;
3054
+ responses: {
3055
+ /** @description Purchases retrieved successfully */
3056
+ 200: {
3057
+ headers: {
3058
+ [name: string]: unknown;
3059
+ };
3060
+ content: {
3061
+ "application/json": {
3062
+ purchases?: components["schemas"]["PurchaseResponse"][];
3063
+ };
3064
+ };
3065
+ };
3066
+ };
3067
+ };
3068
+ PurchaseSdkController_getPurchasesForCustomer: {
3069
+ parameters: {
3070
+ query?: never;
3071
+ header?: never;
3072
+ path: {
3073
+ /** @description Customer reference or ID */
3074
+ customerRef: string;
3075
+ };
3076
+ cookie?: never;
3077
+ };
3078
+ requestBody?: never;
3079
+ responses: {
3080
+ /** @description Customer purchases retrieved successfully */
3081
+ 200: {
3082
+ headers: {
3083
+ [name: string]: unknown;
3084
+ };
3085
+ content: {
3086
+ "application/json": {
3087
+ purchases?: components["schemas"]["PurchaseResponse"][];
3088
+ };
3089
+ };
3090
+ };
3091
+ /** @description Customer not found */
3092
+ 404: {
3093
+ headers: {
3094
+ [name: string]: unknown;
3095
+ };
3096
+ content?: never;
3097
+ };
3098
+ };
3099
+ };
3100
+ PurchaseSdkController_getPurchasesForProduct: {
3101
+ parameters: {
3102
+ query?: never;
3103
+ header?: never;
3104
+ path: {
3105
+ /** @description Product reference or ID */
3106
+ productRef: string;
3107
+ };
3108
+ cookie?: never;
3109
+ };
3110
+ requestBody?: never;
3111
+ responses: {
3112
+ /** @description Product purchases retrieved successfully */
3113
+ 200: {
3114
+ headers: {
3115
+ [name: string]: unknown;
3116
+ };
3117
+ content: {
3118
+ "application/json": {
3119
+ purchases?: components["schemas"]["PurchaseResponse"][];
3120
+ };
3121
+ };
3122
+ };
3123
+ /** @description Product not found */
3124
+ 404: {
3125
+ headers: {
3126
+ [name: string]: unknown;
3127
+ };
3128
+ content?: never;
3129
+ };
3130
+ };
3131
+ };
3132
+ PurchaseSdkController_getPurchase: {
3133
+ parameters: {
3134
+ query?: never;
3135
+ header?: never;
3136
+ path: {
3137
+ /** @description Purchase ID or reference */
3138
+ id: string;
3139
+ };
3140
+ cookie?: never;
3141
+ };
3142
+ requestBody?: never;
3143
+ responses: {
3144
+ /** @description Purchase retrieved successfully */
3145
+ 200: {
3146
+ headers: {
3147
+ [name: string]: unknown;
3148
+ };
3149
+ content: {
3150
+ "application/json": components["schemas"]["PurchaseResponse"];
3151
+ };
3152
+ };
3153
+ /** @description Purchase not found */
3154
+ 404: {
3155
+ headers: {
3156
+ [name: string]: unknown;
3157
+ };
3158
+ content?: never;
3159
+ };
3160
+ };
3161
+ };
3162
+ PurchaseSdkController_cancelPurchase: {
3163
+ parameters: {
3164
+ query?: never;
3165
+ header?: never;
3166
+ path: {
3167
+ /** @description Purchase reference or ID */
3168
+ purchaseRef: string;
3169
+ };
3170
+ cookie?: never;
3171
+ };
3172
+ requestBody: {
3173
+ content: {
3174
+ "application/json": components["schemas"]["CancelPurchaseRequest"];
3175
+ };
3176
+ };
3177
+ responses: {
3178
+ /** @description Purchase cancelled successfully */
3179
+ 200: {
3180
+ headers: {
3181
+ [name: string]: unknown;
3182
+ };
3183
+ content: {
3184
+ "application/json": {
3185
+ success?: boolean;
3186
+ purchase?: components["schemas"]["PurchaseResponse"];
3187
+ };
3188
+ };
3189
+ };
3190
+ /** @description Purchase not found */
3191
+ 404: {
3192
+ headers: {
3193
+ [name: string]: unknown;
3194
+ };
3195
+ content?: never;
3196
+ };
3197
+ };
3198
+ };
3199
+ LimitsSdkController_checkLimits: {
3200
+ parameters: {
3201
+ query?: never;
3202
+ header?: never;
3203
+ path?: never;
3204
+ cookie?: never;
3205
+ };
3206
+ requestBody: {
3207
+ content: {
3208
+ "application/json": components["schemas"]["CheckLimitRequest"];
3209
+ };
3210
+ };
3211
+ responses: {
3212
+ /** @description Limit check result */
3213
+ 200: {
3214
+ headers: {
3215
+ [name: string]: unknown;
3216
+ };
3217
+ content: {
3218
+ "application/json": components["schemas"]["LimitResponse"];
3219
+ };
3220
+ };
3221
+ /** @description Missing customerRef or productRef */
3222
+ 400: {
3223
+ headers: {
3224
+ [name: string]: unknown;
3225
+ };
3226
+ content?: never;
3227
+ };
3228
+ /** @description Customer or product not found */
3229
+ 404: {
3230
+ headers: {
3231
+ [name: string]: unknown;
3232
+ };
3233
+ content?: never;
3234
+ };
3235
+ };
3236
+ };
3237
+ }
1826
3238
 
1827
3239
  /**
1828
3240
  * SolvaPay API Client Type Definitions
@@ -1904,6 +3316,10 @@ interface ToolPlanMappingInput {
1904
3316
  planRefs?: string[];
1905
3317
  planKeys?: string[];
1906
3318
  }
3319
+ interface McpToolPlanMappingInput {
3320
+ name: string;
3321
+ planKeys: string[];
3322
+ }
1907
3323
  interface McpBootstrapRequest {
1908
3324
  name?: string;
1909
3325
  description?: string;
@@ -1940,6 +3356,26 @@ interface McpBootstrapResponse {
1940
3356
  description?: string;
1941
3357
  }>;
1942
3358
  }
3359
+ interface ConfigureMcpPlansRequest {
3360
+ paidPlans?: McpBootstrapPaidPlanInput[];
3361
+ toolMapping?: McpToolPlanMappingInput[];
3362
+ }
3363
+ interface ConfigureMcpPlansResponse {
3364
+ product: components['schemas']['SdkProductResponse'];
3365
+ mcpServer: {
3366
+ id?: string;
3367
+ reference?: string;
3368
+ subdomain?: string;
3369
+ mcpProxyUrl?: string;
3370
+ url: string;
3371
+ defaultPlanId?: string;
3372
+ };
3373
+ planMap: Record<string, {
3374
+ id: string;
3375
+ reference: string;
3376
+ name?: string;
3377
+ }>;
3378
+ }
1943
3379
  /**
1944
3380
  * SolvaPay API Client Interface
1945
3381
  *
@@ -1981,6 +3417,7 @@ interface SolvaPayClient {
1981
3417
  name: string;
1982
3418
  }>;
1983
3419
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3420
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
1984
3421
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
1985
3422
  deleteProduct?(productRef: string): Promise<void>;
1986
3423
  cloneProduct?(productRef: string, overrides?: {
@@ -2038,7 +3475,7 @@ interface SolvaPayClient {
2038
3475
  customerRef: string;
2039
3476
  productRef: string;
2040
3477
  }): Promise<components['schemas']['UserInfoResponse']>;
2041
- createCheckoutSession(params: components['schemas']['CreateCheckoutSessionRequest']): Promise<components['schemas']['CheckoutSessionResponse']>;
3478
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
2042
3479
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
2043
3480
  }
2044
3481
 
@@ -2084,7 +3521,7 @@ interface PaywallToolResult {
2084
3521
  mimeType?: string;
2085
3522
  }>;
2086
3523
  isError?: boolean;
2087
- structuredContent?: PaywallStructuredContent;
3524
+ structuredContent?: PaywallStructuredContent | Record<string, unknown>;
2088
3525
  }
2089
3526
 
2090
3527
  /**
@@ -2126,6 +3563,16 @@ interface RetryOptions {
2126
3563
  */
2127
3564
  onRetry?: (error: Error, attempt: number) => void;
2128
3565
  }
3566
+ interface McpToolExtra {
3567
+ authInfo?: {
3568
+ token: string;
3569
+ clientId: string;
3570
+ scopes: string[];
3571
+ expiresAt?: number;
3572
+ extra?: Record<string, unknown>;
3573
+ };
3574
+ [key: string]: unknown;
3575
+ }
2129
3576
  /**
2130
3577
  * Options for configuring payable protection
2131
3578
  */
@@ -2196,7 +3643,7 @@ interface McpAdapterOptions {
2196
3643
  /**
2197
3644
  * Extract customer reference from MCP args
2198
3645
  */
2199
- getCustomerRef?: (args: any) => string | Promise<string>;
3646
+ getCustomerRef?: (args: any, extra?: McpToolExtra) => string | Promise<string>;
2200
3647
  /**
2201
3648
  * Transform the response before wrapping in MCP format
2202
3649
  */
@@ -2273,7 +3720,7 @@ interface VirtualToolsOptions {
2273
3720
  /** Product reference (required) */
2274
3721
  product: string;
2275
3722
  /** Extract customer reference from MCP tool args */
2276
- getCustomerRef: (args: Record<string, unknown>) => string;
3723
+ getCustomerRef: (args: Record<string, unknown>, extra?: McpToolExtra) => string;
2277
3724
  /** Tool names to exclude from registration (optional) */
2278
3725
  exclude?: string[];
2279
3726
  }
@@ -2285,7 +3732,7 @@ interface VirtualToolDefinition {
2285
3732
  properties: Record<string, object>;
2286
3733
  required: string[];
2287
3734
  };
2288
- handler: (args: Record<string, unknown>) => Promise<{
3735
+ handler: (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<{
2289
3736
  content: Array<{
2290
3737
  type: string;
2291
3738
  text: string;
@@ -2294,6 +3741,16 @@ interface VirtualToolDefinition {
2294
3741
  }>;
2295
3742
  }
2296
3743
 
3744
+ interface McpServerLike {
3745
+ registerTool: (name: string, config: Record<string, unknown>, handler: (args: Record<string, unknown>, extra?: McpToolExtra) => unknown) => unknown;
3746
+ }
3747
+ interface RegisterVirtualToolsMcpOptions extends Omit<VirtualToolsOptions, 'getCustomerRef'> {
3748
+ getCustomerRef?: VirtualToolsOptions['getCustomerRef'];
3749
+ filter?: (definition: VirtualToolDefinition) => boolean;
3750
+ mapDefinition?: (definition: VirtualToolDefinition) => VirtualToolDefinition;
3751
+ wrapHandler?: (handler: VirtualToolDefinition['handler'], definition: VirtualToolDefinition) => (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<unknown> | unknown;
3752
+ }
3753
+
2297
3754
  /**
2298
3755
  * Configuration for creating a SolvaPay instance.
2299
3756
  *
@@ -2411,7 +3868,7 @@ interface PayableFunction {
2411
3868
  * });
2412
3869
  * ```
2413
3870
  */
2414
- mcp<T = any>(businessLogic: (args: any) => Promise<T>, options?: McpAdapterOptions): (args: Record<string, unknown>) => Promise<unknown>;
3871
+ mcp<T = any>(businessLogic: (args: any) => Promise<T>, options?: McpAdapterOptions): (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<unknown>;
2415
3872
  /**
2416
3873
  * Pure function adapter for direct function protection.
2417
3874
  *
@@ -2784,6 +4241,13 @@ interface SolvaPay {
2784
4241
  * fast setup flows where you want one call for product + plans + MCP config.
2785
4242
  */
2786
4243
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
4244
+ /**
4245
+ * Configure MCP plans and tool mappings for an existing MCP product.
4246
+ *
4247
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
4248
+ * paid plans as well as remapping tool access.
4249
+ */
4250
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
2787
4251
  /**
2788
4252
  * Get virtual tool definitions with bound handlers for MCP server integration.
2789
4253
  *
@@ -2803,7 +4267,7 @@ interface SolvaPay {
2803
4267
  * ```typescript
2804
4268
  * const virtualTools = solvaPay.getVirtualTools({
2805
4269
  * product: 'prd_myapi',
2806
- * getCustomerRef: args => args._auth?.customer_ref || 'anonymous',
4270
+ * getCustomerRef: (_args, extra) => String(extra?.authInfo?.extra?.customer_ref || 'anonymous'),
2807
4271
  * });
2808
4272
  *
2809
4273
  * // Register on your MCP server
@@ -2813,6 +4277,13 @@ interface SolvaPay {
2813
4277
  * ```
2814
4278
  */
2815
4279
  getVirtualTools(options: VirtualToolsOptions): VirtualToolDefinition[];
4280
+ /**
4281
+ * Register virtual tools directly on an MCP server with one call.
4282
+ *
4283
+ * This helper converts virtual tool JSON schemas to Zod schemas and registers
4284
+ * each tool on an MCP server that supports `registerTool()`.
4285
+ */
4286
+ registerVirtualToolsMcp(server: McpServerLike, options: RegisterVirtualToolsMcpOptions): Promise<void>;
2816
4287
  /**
2817
4288
  * Direct access to the API client for advanced operations.
2818
4289
  *