@solvapay/server 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,19 +1,51 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
2
- interface WebhookEvent {
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
+ interface WebhookProduct {
3
+ reference: string;
4
+ }
5
+ interface CustomerWebhookObject {
3
6
  id: string;
4
- type: WebhookEventType;
7
+ created: number;
8
+ product: WebhookProduct | null;
9
+ reference?: string;
10
+ name?: string;
11
+ email?: string;
12
+ telephone?: string;
13
+ status?: string;
14
+ }
15
+ type WebhookPayloadObject = Record<string, unknown>;
16
+ type WebhookEventObjectMap = {
17
+ 'payment.succeeded': WebhookPayloadObject;
18
+ 'payment.failed': WebhookPayloadObject;
19
+ 'payment.refunded': WebhookPayloadObject;
20
+ 'payment.refund_failed': WebhookPayloadObject;
21
+ 'purchase.created': WebhookPayloadObject;
22
+ 'purchase.updated': WebhookPayloadObject;
23
+ 'purchase.cancelled': WebhookPayloadObject;
24
+ 'purchase.expired': WebhookPayloadObject;
25
+ 'purchase.suspended': WebhookPayloadObject;
26
+ 'customer.created': CustomerWebhookObject;
27
+ 'customer.updated': CustomerWebhookObject;
28
+ 'customer.deleted': CustomerWebhookObject;
29
+ 'checkout_session.created': WebhookPayloadObject;
30
+ };
31
+ type WebhookEventForType<TType extends WebhookEventType> = {
32
+ id: string;
33
+ type: TType;
5
34
  created: number;
6
35
  api_version: string;
7
36
  data: {
8
- object: Record<string, any>;
9
- previous_attributes: Record<string, any> | null;
37
+ object: WebhookEventObjectMap[TType];
38
+ previous_attributes: Record<string, unknown> | null;
10
39
  };
11
40
  livemode: boolean;
12
41
  request: {
13
42
  id: string | null;
14
43
  idempotency_key: string | null;
15
44
  };
16
- }
45
+ };
46
+ type WebhookEvent = {
47
+ [TType in WebhookEventType]: WebhookEventForType<TType>;
48
+ }[WebhookEventType];
17
49
 
18
50
  interface components {
19
51
  schemas: {
@@ -77,12 +109,12 @@ interface components {
77
109
  VerifyEmailChange: {
78
110
  code: string;
79
111
  };
80
- CreateCheckoutSessionRequest: {
112
+ CreateUiCheckoutSessionRequest: {
81
113
  /**
82
114
  * Customer reference
83
115
  * @example cus_3c4d5e6f7g8h
84
116
  */
85
- customerReference: string;
117
+ customerRef: string;
86
118
  /**
87
119
  * Plan reference (optional)
88
120
  * @example pln_2b3c4d5e6f7g
@@ -94,7 +126,7 @@ interface components {
94
126
  */
95
127
  productRef: string;
96
128
  };
97
- CheckoutSessionResponse: {
129
+ CreateUiCheckoutSessionResponse: {
98
130
  /**
99
131
  * Checkout session ID
100
132
  * @example 507f1f77bcf86cd799439011
@@ -188,6 +220,40 @@ interface components {
188
220
  /** @description Terms of Service acceptance */
189
221
  tosAcceptance?: components["schemas"]["TosAcceptance"];
190
222
  };
223
+ CreateCheckoutSessionRequest: {
224
+ /**
225
+ * Customer reference identifier
226
+ * @example cus_3c4d5e6f7g8h
227
+ */
228
+ 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
+ */
238
+ planRef?: string;
239
+ /**
240
+ * URL to redirect to after successful payment (optional)
241
+ * @example https://example.com/payment-success
242
+ */
243
+ returnUrl?: string;
244
+ };
245
+ CreateCheckoutSessionResponse: {
246
+ /**
247
+ * Checkout session ID/token
248
+ * @example e3f1c2d4b6a89f001122334455667788
249
+ */
250
+ sessionId: string;
251
+ /**
252
+ * Full checkout URL based on backend configuration (ready to redirect customer)
253
+ * @example https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788
254
+ */
255
+ checkoutUrl: string;
256
+ };
191
257
  Signup: {
192
258
  name: string;
193
259
  email: string;
@@ -1036,6 +1102,40 @@ interface components {
1036
1102
  description?: string;
1037
1103
  }[];
1038
1104
  };
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"][];
1126
+ };
1127
+ ConfigureMcpPlansResult: {
1128
+ /** @description Updated product */
1129
+ product: components["schemas"]["SdkProductResponse"];
1130
+ /** @description Updated MCP server identity */
1131
+ mcpServer: {
1132
+ [key: string]: unknown;
1133
+ };
1134
+ /** @description Resolved plan mapping by key (includes existing free plan) */
1135
+ planMap: {
1136
+ [key: string]: unknown;
1137
+ };
1138
+ };
1039
1139
  McpBootstrapPreviewResult: {
1040
1140
  /** @description Discovered tools from the origin MCP server */
1041
1141
  discoveredTools: {
@@ -1812,6 +1912,101 @@ interface components {
1812
1912
  [key: string]: string;
1813
1913
  };
1814
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;
1946
+ /**
1947
+ * ISO 4217 currency code
1948
+ * @example SEK
1949
+ */
1950
+ currency: string;
1951
+ };
1952
+ BalanceResponseDto: {
1953
+ current: components["schemas"]["BalanceDataDto"];
1954
+ monthly: components["schemas"]["MonthlyFinancialsDto"][];
1955
+ periodLabel: string;
1956
+ /**
1957
+ * ISO 4217 currency code
1958
+ * @example SEK
1959
+ */
1960
+ currency: string;
1961
+ };
1962
+ ProductRevenueRowDto: {
1963
+ productRef: string;
1964
+ 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;
1976
+ };
1977
+ RevenueByProductResponseDto: {
1978
+ products: components["schemas"]["ProductRevenueRowDto"][];
1979
+ activeProductCount: number;
1980
+ totalMRR: number;
1981
+ topProduct?: components["schemas"]["TopProductDto"] | null;
1982
+ /**
1983
+ * ISO 4217 currency code
1984
+ * @example SEK
1985
+ */
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
+ status: string;
1998
+ };
1999
+ LedgerResponseDto: {
2000
+ entries: components["schemas"]["LedgerEntryDto"][];
2001
+ total: number;
2002
+ totalCredit: number;
2003
+ totalDebit: number;
2004
+ /**
2005
+ * ISO 4217 currency code
2006
+ * @example SEK
2007
+ */
2008
+ currency: string;
2009
+ };
1815
2010
  /** @description Auto-generated fallback schema for unresolved reference: McpBootstrapPreviewValidationError */
1816
2011
  McpBootstrapPreviewValidationError: {
1817
2012
  [key: string]: unknown;
@@ -1823,6 +2018,1255 @@ interface components {
1823
2018
  headers: never;
1824
2019
  pathItems: never;
1825
2020
  }
2021
+ interface operations {
2022
+ PaymentIntentSdkController_getPaymentIntents: {
2023
+ parameters: {
2024
+ query?: {
2025
+ /** @description Maximum number of results */
2026
+ limit?: number;
2027
+ /** @description Pagination offset */
2028
+ offset?: number;
2029
+ };
2030
+ header?: never;
2031
+ path?: never;
2032
+ cookie?: never;
2033
+ };
2034
+ requestBody?: never;
2035
+ responses: {
2036
+ /** @description Payment intents retrieved successfully */
2037
+ 200: {
2038
+ headers: {
2039
+ [name: string]: unknown;
2040
+ };
2041
+ content: {
2042
+ "application/json": unknown;
2043
+ };
2044
+ };
2045
+ };
2046
+ };
2047
+ PaymentIntentSdkController_createPaymentIntent: {
2048
+ parameters: {
2049
+ query?: never;
2050
+ header: {
2051
+ /** @description Unique idempotency key to prevent duplicate payments (required) */
2052
+ "idempotency-key": string;
2053
+ };
2054
+ path?: never;
2055
+ cookie?: never;
2056
+ };
2057
+ /** @description Payment intent creation data */
2058
+ requestBody: {
2059
+ 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
+ };
2082
+ };
2083
+ };
2084
+ responses: {
2085
+ /** @description Payment intent created successfully */
2086
+ 201: {
2087
+ headers: {
2088
+ [name: string]: unknown;
2089
+ };
2090
+ content: {
2091
+ "application/json": unknown;
2092
+ };
2093
+ };
2094
+ /** @description Missing required fields or invalid data */
2095
+ 400: {
2096
+ headers: {
2097
+ [name: string]: unknown;
2098
+ };
2099
+ content: {
2100
+ "application/json": unknown;
2101
+ };
2102
+ };
2103
+ };
2104
+ };
2105
+ PaymentIntentSdkController_getPaymentIntent: {
2106
+ parameters: {
2107
+ query?: never;
2108
+ header?: never;
2109
+ path: {
2110
+ /** @description Payment intent MongoDB ID */
2111
+ id: string;
2112
+ };
2113
+ cookie?: never;
2114
+ };
2115
+ requestBody?: never;
2116
+ responses: {
2117
+ /** @description Payment intent retrieved successfully */
2118
+ 200: {
2119
+ headers: {
2120
+ [name: string]: unknown;
2121
+ };
2122
+ content: {
2123
+ "application/json": unknown;
2124
+ };
2125
+ };
2126
+ /** @description Payment intent not found */
2127
+ 404: {
2128
+ headers: {
2129
+ [name: string]: unknown;
2130
+ };
2131
+ content: {
2132
+ "application/json": unknown;
2133
+ };
2134
+ };
2135
+ };
2136
+ };
2137
+ PaymentIntentSdkController_processPaymentIntent: {
2138
+ parameters: {
2139
+ query?: never;
2140
+ header?: never;
2141
+ path: {
2142
+ /** @description Stripe payment intent ID (format: pi_xxx) */
2143
+ id: string;
2144
+ };
2145
+ cookie?: never;
2146
+ };
2147
+ /** @description Payment processing data */
2148
+ requestBody: {
2149
+ 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
+ };
2167
+ };
2168
+ };
2169
+ responses: {
2170
+ /** @description Payment intent status */
2171
+ 200: {
2172
+ headers: {
2173
+ [name: string]: unknown;
2174
+ };
2175
+ content: {
2176
+ "application/json": {
2177
+ /**
2178
+ * Payment intent status
2179
+ * @example succeeded
2180
+ * @enum {string}
2181
+ */
2182
+ status?: "succeeded" | "timeout" | "failed" | "cancelled";
2183
+ /**
2184
+ * 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.
2186
+ */
2187
+ message?: string;
2188
+ };
2189
+ };
2190
+ };
2191
+ /** @description Payment not succeeded, invalid request, or forbidden */
2192
+ 400: {
2193
+ headers: {
2194
+ [name: string]: unknown;
2195
+ };
2196
+ content: {
2197
+ "application/json": unknown;
2198
+ };
2199
+ };
2200
+ };
2201
+ };
2202
+ CheckoutSessionSdkController_createCheckoutSession: {
2203
+ parameters: {
2204
+ query?: never;
2205
+ header?: never;
2206
+ path?: never;
2207
+ cookie?: never;
2208
+ };
2209
+ requestBody: {
2210
+ content: {
2211
+ "application/json": components["schemas"]["CreateCheckoutSessionRequest"];
2212
+ };
2213
+ };
2214
+ responses: {
2215
+ /** @description Checkout session created */
2216
+ 201: {
2217
+ headers: {
2218
+ [name: string]: unknown;
2219
+ };
2220
+ content: {
2221
+ "application/json": components["schemas"]["CreateCheckoutSessionResponse"];
2222
+ };
2223
+ };
2224
+ /** @description Missing customerRef or productRef */
2225
+ 400: {
2226
+ headers: {
2227
+ [name: string]: unknown;
2228
+ };
2229
+ content?: never;
2230
+ };
2231
+ };
2232
+ };
2233
+ PlanSdkController_listPlans: {
2234
+ parameters: {
2235
+ query?: {
2236
+ limit?: number;
2237
+ offset?: number;
2238
+ };
2239
+ header?: never;
2240
+ path: {
2241
+ /** @description Product reference or ID */
2242
+ productRef: string;
2243
+ };
2244
+ cookie?: never;
2245
+ };
2246
+ requestBody?: never;
2247
+ responses: {
2248
+ /** @description Plans retrieved successfully */
2249
+ 200: {
2250
+ headers: {
2251
+ [name: string]: unknown;
2252
+ };
2253
+ content: {
2254
+ "application/json": {
2255
+ plans?: components["schemas"]["Plan"][];
2256
+ /** @description Total number of plans for the product */
2257
+ total?: number;
2258
+ limit?: number;
2259
+ offset?: number;
2260
+ };
2261
+ };
2262
+ };
2263
+ /** @description Product not found */
2264
+ 404: {
2265
+ headers: {
2266
+ [name: string]: unknown;
2267
+ };
2268
+ content?: never;
2269
+ };
2270
+ };
2271
+ };
2272
+ PlanSdkController_createPlan: {
2273
+ parameters: {
2274
+ query?: never;
2275
+ header?: never;
2276
+ path: {
2277
+ /** @description Product reference or ID */
2278
+ productRef: string;
2279
+ };
2280
+ cookie?: never;
2281
+ };
2282
+ requestBody: {
2283
+ content: {
2284
+ "application/json": components["schemas"]["CreatePlanRequest"];
2285
+ };
2286
+ };
2287
+ responses: {
2288
+ /** @description Plan created successfully */
2289
+ 201: {
2290
+ headers: {
2291
+ [name: string]: unknown;
2292
+ };
2293
+ content: {
2294
+ "application/json": components["schemas"]["Plan"];
2295
+ };
2296
+ };
2297
+ /** @description Product not found */
2298
+ 404: {
2299
+ headers: {
2300
+ [name: string]: unknown;
2301
+ };
2302
+ content?: never;
2303
+ };
2304
+ };
2305
+ };
2306
+ PlanSdkController_getPlan: {
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?: never;
2319
+ responses: {
2320
+ /** @description Plan retrieved successfully */
2321
+ 200: {
2322
+ headers: {
2323
+ [name: string]: unknown;
2324
+ };
2325
+ content: {
2326
+ "application/json": components["schemas"]["Plan"];
2327
+ };
2328
+ };
2329
+ /** @description Plan or product not found */
2330
+ 404: {
2331
+ headers: {
2332
+ [name: string]: unknown;
2333
+ };
2334
+ content?: never;
2335
+ };
2336
+ };
2337
+ };
2338
+ PlanSdkController_updatePlan: {
2339
+ parameters: {
2340
+ query?: never;
2341
+ header?: never;
2342
+ path: {
2343
+ /** @description Product reference or ID */
2344
+ productRef: string;
2345
+ /** @description Plan reference or ID */
2346
+ planRef: string;
2347
+ };
2348
+ cookie?: never;
2349
+ };
2350
+ requestBody: {
2351
+ content: {
2352
+ "application/json": components["schemas"]["UpdatePlanRequest"];
2353
+ };
2354
+ };
2355
+ responses: {
2356
+ /** @description Plan updated successfully */
2357
+ 200: {
2358
+ headers: {
2359
+ [name: string]: unknown;
2360
+ };
2361
+ content: {
2362
+ "application/json": components["schemas"]["Plan"];
2363
+ };
2364
+ };
2365
+ /** @description Plan or product not found */
2366
+ 404: {
2367
+ headers: {
2368
+ [name: string]: unknown;
2369
+ };
2370
+ content?: never;
2371
+ };
2372
+ };
2373
+ };
2374
+ PlanSdkController_deletePlan: {
2375
+ parameters: {
2376
+ query?: never;
2377
+ header?: never;
2378
+ path: {
2379
+ /** @description Product reference or ID */
2380
+ productRef: string;
2381
+ /** @description Plan reference or ID */
2382
+ planRef: string;
2383
+ };
2384
+ cookie?: never;
2385
+ };
2386
+ requestBody?: never;
2387
+ responses: {
2388
+ /** @description Plan deleted successfully */
2389
+ 200: {
2390
+ headers: {
2391
+ [name: string]: unknown;
2392
+ };
2393
+ content?: never;
2394
+ };
2395
+ /** @description Plan or product not found */
2396
+ 404: {
2397
+ headers: {
2398
+ [name: string]: unknown;
2399
+ };
2400
+ content?: never;
2401
+ };
2402
+ };
2403
+ };
2404
+ ProductSdkController_listProducts: {
2405
+ parameters: {
2406
+ query?: {
2407
+ /** @description Max results (1-100) */
2408
+ limit?: number;
2409
+ /** @description Pagination offset */
2410
+ offset?: number;
2411
+ /** @description Search by name or description */
2412
+ search?: string;
2413
+ /** @description Filter by status */
2414
+ status?: "active" | "inactive" | "suspended";
2415
+ /** @description Filter MCP Pay products */
2416
+ isMcpPay?: boolean;
2417
+ };
2418
+ header?: never;
2419
+ path?: never;
2420
+ cookie?: never;
2421
+ };
2422
+ requestBody?: never;
2423
+ responses: {
2424
+ /** @description Products retrieved successfully */
2425
+ 200: {
2426
+ headers: {
2427
+ [name: string]: unknown;
2428
+ };
2429
+ content?: never;
2430
+ };
2431
+ };
2432
+ };
2433
+ ProductSdkController_createProduct: {
2434
+ parameters: {
2435
+ query?: never;
2436
+ header?: never;
2437
+ path?: never;
2438
+ cookie?: never;
2439
+ };
2440
+ requestBody: {
2441
+ content: {
2442
+ "application/json": components["schemas"]["CreateProductRequest"];
2443
+ };
2444
+ };
2445
+ responses: {
2446
+ /** @description Product created successfully */
2447
+ 201: {
2448
+ headers: {
2449
+ [name: string]: unknown;
2450
+ };
2451
+ content: {
2452
+ "application/json": components["schemas"]["SdkProductResponse"];
2453
+ };
2454
+ };
2455
+ /** @description Missing required fields or validation error */
2456
+ 400: {
2457
+ headers: {
2458
+ [name: string]: unknown;
2459
+ };
2460
+ content?: never;
2461
+ };
2462
+ };
2463
+ };
2464
+ ProductSdkController_getProduct: {
2465
+ parameters: {
2466
+ query?: never;
2467
+ header?: never;
2468
+ path: {
2469
+ /** @description Product reference or ID */
2470
+ productRef: string;
2471
+ };
2472
+ cookie?: never;
2473
+ };
2474
+ requestBody?: never;
2475
+ responses: {
2476
+ /** @description Product retrieved successfully */
2477
+ 200: {
2478
+ headers: {
2479
+ [name: string]: unknown;
2480
+ };
2481
+ content: {
2482
+ "application/json": components["schemas"]["SdkProductResponse"];
2483
+ };
2484
+ };
2485
+ /** @description Product not found */
2486
+ 404: {
2487
+ headers: {
2488
+ [name: string]: unknown;
2489
+ };
2490
+ content?: never;
2491
+ };
2492
+ };
2493
+ };
2494
+ ProductSdkController_updateProduct: {
2495
+ parameters: {
2496
+ query?: never;
2497
+ header?: never;
2498
+ path: {
2499
+ /** @description Product reference or ID */
2500
+ productRef: string;
2501
+ };
2502
+ cookie?: never;
2503
+ };
2504
+ requestBody: {
2505
+ content: {
2506
+ "application/json": components["schemas"]["UpdateProductRequest"];
2507
+ };
2508
+ };
2509
+ responses: {
2510
+ /** @description Product updated successfully */
2511
+ 200: {
2512
+ headers: {
2513
+ [name: string]: unknown;
2514
+ };
2515
+ content: {
2516
+ "application/json": components["schemas"]["SdkProductResponse"];
2517
+ };
2518
+ };
2519
+ /** @description Product not found */
2520
+ 404: {
2521
+ headers: {
2522
+ [name: string]: unknown;
2523
+ };
2524
+ content?: never;
2525
+ };
2526
+ };
2527
+ };
2528
+ ProductSdkController_deleteProduct: {
2529
+ parameters: {
2530
+ query?: never;
2531
+ header?: never;
2532
+ path: {
2533
+ /** @description Product reference or ID */
2534
+ productRef: string;
2535
+ };
2536
+ cookie?: never;
2537
+ };
2538
+ requestBody?: never;
2539
+ responses: {
2540
+ /** @description Product deleted or deactivated successfully */
2541
+ 200: {
2542
+ headers: {
2543
+ [name: string]: unknown;
2544
+ };
2545
+ content?: never;
2546
+ };
2547
+ /** @description Product not found */
2548
+ 404: {
2549
+ headers: {
2550
+ [name: string]: unknown;
2551
+ };
2552
+ content?: never;
2553
+ };
2554
+ };
2555
+ };
2556
+ ProductSdkController_bootstrapMcpProduct: {
2557
+ parameters: {
2558
+ query?: never;
2559
+ header?: never;
2560
+ path?: never;
2561
+ cookie?: never;
2562
+ };
2563
+ requestBody: {
2564
+ content: {
2565
+ "application/json": components["schemas"]["McpBootstrapRequest"];
2566
+ };
2567
+ };
2568
+ responses: {
2569
+ /** @description MCP product bootstrapped successfully */
2570
+ 201: {
2571
+ headers: {
2572
+ [name: string]: unknown;
2573
+ };
2574
+ content: {
2575
+ "application/json": components["schemas"]["McpBootstrapResult"];
2576
+ };
2577
+ };
2578
+ /** @description Invalid bootstrap request */
2579
+ 400: {
2580
+ headers: {
2581
+ [name: string]: unknown;
2582
+ };
2583
+ content?: never;
2584
+ };
2585
+ };
2586
+ };
2587
+ ProductSdkController_configureMcpPlans: {
2588
+ parameters: {
2589
+ query?: never;
2590
+ header?: never;
2591
+ path: {
2592
+ /** @description Product reference or ID */
2593
+ productRef: string;
2594
+ };
2595
+ cookie?: never;
2596
+ };
2597
+ requestBody: {
2598
+ content: {
2599
+ "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
2600
+ };
2601
+ };
2602
+ responses: {
2603
+ /** @description MCP plans configured successfully */
2604
+ 200: {
2605
+ headers: {
2606
+ [name: string]: unknown;
2607
+ };
2608
+ content: {
2609
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
2610
+ };
2611
+ };
2612
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
2613
+ 400: {
2614
+ headers: {
2615
+ [name: string]: unknown;
2616
+ };
2617
+ content?: never;
2618
+ };
2619
+ /** @description Product not found */
2620
+ 404: {
2621
+ headers: {
2622
+ [name: string]: unknown;
2623
+ };
2624
+ content?: never;
2625
+ };
2626
+ };
2627
+ };
2628
+ ProductSdkController_cloneProduct: {
2629
+ parameters: {
2630
+ query?: never;
2631
+ header?: never;
2632
+ path: {
2633
+ /** @description Product reference or ID to clone */
2634
+ productRef: string;
2635
+ };
2636
+ cookie?: never;
2637
+ };
2638
+ requestBody?: never;
2639
+ responses: {
2640
+ /** @description Product cloned successfully */
2641
+ 201: {
2642
+ headers: {
2643
+ [name: string]: unknown;
2644
+ };
2645
+ content: {
2646
+ "application/json": components["schemas"]["SdkProductResponse"];
2647
+ };
2648
+ };
2649
+ /** @description Product not found */
2650
+ 404: {
2651
+ headers: {
2652
+ [name: string]: unknown;
2653
+ };
2654
+ content?: never;
2655
+ };
2656
+ };
2657
+ };
2658
+ UsageSdkController_recordUsage: {
2659
+ parameters: {
2660
+ query?: never;
2661
+ header?: never;
2662
+ path?: never;
2663
+ cookie?: never;
2664
+ };
2665
+ requestBody: {
2666
+ 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
+ };
2705
+ };
2706
+ };
2707
+ responses: {
2708
+ /** @description Usage recorded successfully */
2709
+ 200: {
2710
+ headers: {
2711
+ [name: string]: unknown;
2712
+ };
2713
+ content: {
2714
+ "application/json": {
2715
+ /** @example true */
2716
+ success?: boolean;
2717
+ /** @example usage_A1B2C3D4 */
2718
+ reference?: string;
2719
+ };
2720
+ };
2721
+ };
2722
+ /** @description Validation failed */
2723
+ 400: {
2724
+ headers: {
2725
+ [name: string]: unknown;
2726
+ };
2727
+ content?: never;
2728
+ };
2729
+ };
2730
+ };
2731
+ UsageSdkController_recordBulkUsage: {
2732
+ parameters: {
2733
+ query?: never;
2734
+ header?: never;
2735
+ path?: never;
2736
+ cookie?: never;
2737
+ };
2738
+ requestBody: {
2739
+ 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
+ };
2758
+ };
2759
+ };
2760
+ responses: {
2761
+ /** @description Bulk usage events processed */
2762
+ 200: {
2763
+ headers: {
2764
+ [name: string]: unknown;
2765
+ };
2766
+ content?: never;
2767
+ };
2768
+ /** @description Validation failed */
2769
+ 400: {
2770
+ headers: {
2771
+ [name: string]: unknown;
2772
+ };
2773
+ content?: never;
2774
+ };
2775
+ };
2776
+ };
2777
+ MeterEventsSdkController_recordEvent: {
2778
+ parameters: {
2779
+ query?: never;
2780
+ header?: never;
2781
+ path?: never;
2782
+ cookie?: never;
2783
+ };
2784
+ requestBody: {
2785
+ content: {
2786
+ "application/json": components["schemas"]["RecordMeterEventDto"];
2787
+ };
2788
+ };
2789
+ responses: {
2790
+ /** @description Event recorded */
2791
+ 200: {
2792
+ headers: {
2793
+ [name: string]: unknown;
2794
+ };
2795
+ content: {
2796
+ "application/json": {
2797
+ /** @example true */
2798
+ success?: boolean;
2799
+ };
2800
+ };
2801
+ };
2802
+ /** @description Invalid meter name or meter is archived */
2803
+ 400: {
2804
+ headers: {
2805
+ [name: string]: unknown;
2806
+ };
2807
+ content?: never;
2808
+ };
2809
+ };
2810
+ };
2811
+ MeterEventsSdkController_recordBulkEvents: {
2812
+ parameters: {
2813
+ query?: never;
2814
+ header?: never;
2815
+ path?: never;
2816
+ cookie?: never;
2817
+ };
2818
+ requestBody: {
2819
+ content: {
2820
+ "application/json": components["schemas"]["RecordBulkMeterEventsDto"];
2821
+ };
2822
+ };
2823
+ responses: {
2824
+ /** @description Events recorded */
2825
+ 200: {
2826
+ headers: {
2827
+ [name: string]: unknown;
2828
+ };
2829
+ content: {
2830
+ "application/json": {
2831
+ /** @example true */
2832
+ success?: boolean;
2833
+ /** @example 50 */
2834
+ inserted?: number;
2835
+ };
2836
+ };
2837
+ };
2838
+ /** @description Invalid meter name or meter is archived */
2839
+ 400: {
2840
+ headers: {
2841
+ [name: string]: unknown;
2842
+ };
2843
+ content?: never;
2844
+ };
2845
+ };
2846
+ };
2847
+ CustomerSdkController_getCustomerByQuery: {
2848
+ parameters: {
2849
+ 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;
2856
+ };
2857
+ header?: never;
2858
+ path?: never;
2859
+ cookie?: never;
2860
+ };
2861
+ requestBody?: never;
2862
+ responses: {
2863
+ /** @description Customer retrieved successfully */
2864
+ 200: {
2865
+ headers: {
2866
+ [name: string]: unknown;
2867
+ };
2868
+ content: {
2869
+ "application/json": components["schemas"]["CustomerResponse"];
2870
+ };
2871
+ };
2872
+ /** @description Invalid request - must provide exactly one of reference, externalRef, or email */
2873
+ 400: {
2874
+ headers: {
2875
+ [name: string]: unknown;
2876
+ };
2877
+ content: {
2878
+ "application/json": unknown;
2879
+ };
2880
+ };
2881
+ /** @description Customer not found */
2882
+ 404: {
2883
+ headers: {
2884
+ [name: string]: unknown;
2885
+ };
2886
+ content: {
2887
+ "application/json": unknown;
2888
+ };
2889
+ };
2890
+ };
2891
+ };
2892
+ CustomerSdkController_createCustomer: {
2893
+ parameters: {
2894
+ query?: never;
2895
+ header?: never;
2896
+ path?: never;
2897
+ cookie?: never;
2898
+ };
2899
+ /** @description Customer creation data */
2900
+ requestBody: {
2901
+ content: {
2902
+ "application/json": components["schemas"]["CreateCustomerRequest"];
2903
+ };
2904
+ };
2905
+ responses: {
2906
+ /** @description Customer created successfully */
2907
+ 201: {
2908
+ headers: {
2909
+ [name: string]: unknown;
2910
+ };
2911
+ content: {
2912
+ "application/json": components["schemas"]["CustomerResponse"];
2913
+ };
2914
+ };
2915
+ /** @description Invalid email or missing required fields */
2916
+ 400: {
2917
+ headers: {
2918
+ [name: string]: unknown;
2919
+ };
2920
+ content: {
2921
+ "application/json": unknown;
2922
+ };
2923
+ };
2924
+ };
2925
+ };
2926
+ CustomerSdkController_getCustomer: {
2927
+ parameters: {
2928
+ query?: never;
2929
+ header?: never;
2930
+ path: {
2931
+ /** @description Customer reference identifier */
2932
+ reference: string;
2933
+ };
2934
+ cookie?: never;
2935
+ };
2936
+ requestBody?: never;
2937
+ responses: {
2938
+ /** @description Customer retrieved successfully */
2939
+ 200: {
2940
+ headers: {
2941
+ [name: string]: unknown;
2942
+ };
2943
+ content: {
2944
+ "application/json": components["schemas"]["CustomerResponse"];
2945
+ };
2946
+ };
2947
+ /** @description Customer not found */
2948
+ 404: {
2949
+ headers: {
2950
+ [name: string]: unknown;
2951
+ };
2952
+ content: {
2953
+ "application/json": unknown;
2954
+ };
2955
+ };
2956
+ };
2957
+ };
2958
+ CustomerSdkController_createCustomerSession: {
2959
+ parameters: {
2960
+ query?: never;
2961
+ header?: never;
2962
+ path?: never;
2963
+ cookie?: never;
2964
+ };
2965
+ /** @description Customer session creation request data */
2966
+ requestBody: {
2967
+ content: {
2968
+ "application/json": components["schemas"]["CreateCustomerSessionRequest"];
2969
+ };
2970
+ };
2971
+ 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: {
2983
+ headers: {
2984
+ [name: string]: unknown;
2985
+ };
2986
+ content: {
2987
+ "application/json": unknown;
2988
+ };
2989
+ };
2990
+ /** @description Customer not found */
2991
+ 404: {
2992
+ headers: {
2993
+ [name: string]: unknown;
2994
+ };
2995
+ content: {
2996
+ "application/json": unknown;
2997
+ };
2998
+ };
2999
+ };
3000
+ };
3001
+ CustomerSdkController_getCustomerSession: {
3002
+ parameters: {
3003
+ query?: never;
3004
+ header?: never;
3005
+ path: {
3006
+ /** @description Customer session ID/token */
3007
+ sessionId: string;
3008
+ };
3009
+ cookie?: never;
3010
+ };
3011
+ requestBody?: never;
3012
+ responses: {
3013
+ /** @description Customer session retrieved successfully */
3014
+ 200: {
3015
+ headers: {
3016
+ [name: string]: unknown;
3017
+ };
3018
+ content: {
3019
+ "application/json": components["schemas"]["GetCustomerSessionResponse"];
3020
+ };
3021
+ };
3022
+ /** @description Customer session not found */
3023
+ 404: {
3024
+ headers: {
3025
+ [name: string]: unknown;
3026
+ };
3027
+ content: {
3028
+ "application/json": unknown;
3029
+ };
3030
+ };
3031
+ };
3032
+ };
3033
+ UserInfoSdkController_getUserInfo: {
3034
+ parameters: {
3035
+ query?: never;
3036
+ header?: never;
3037
+ path?: never;
3038
+ cookie?: never;
3039
+ };
3040
+ requestBody: {
3041
+ content: {
3042
+ "application/json": components["schemas"]["UserInfoRequest"];
3043
+ };
3044
+ };
3045
+ responses: {
3046
+ /** @description User info with purchase status */
3047
+ 200: {
3048
+ headers: {
3049
+ [name: string]: unknown;
3050
+ };
3051
+ content: {
3052
+ "application/json": components["schemas"]["UserInfoResponse"];
3053
+ };
3054
+ };
3055
+ /** @description Missing customerRef or productRef */
3056
+ 400: {
3057
+ headers: {
3058
+ [name: string]: unknown;
3059
+ };
3060
+ content?: never;
3061
+ };
3062
+ /** @description Customer or product not found */
3063
+ 404: {
3064
+ headers: {
3065
+ [name: string]: unknown;
3066
+ };
3067
+ content?: never;
3068
+ };
3069
+ };
3070
+ };
3071
+ PurchaseSdkController_listPurchases: {
3072
+ parameters: {
3073
+ 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;
3080
+ };
3081
+ header?: never;
3082
+ path?: never;
3083
+ cookie?: never;
3084
+ };
3085
+ requestBody?: never;
3086
+ responses: {
3087
+ /** @description Purchases retrieved successfully */
3088
+ 200: {
3089
+ headers: {
3090
+ [name: string]: unknown;
3091
+ };
3092
+ content: {
3093
+ "application/json": {
3094
+ purchases?: components["schemas"]["PurchaseResponse"][];
3095
+ };
3096
+ };
3097
+ };
3098
+ };
3099
+ };
3100
+ PurchaseSdkController_getPurchasesForCustomer: {
3101
+ parameters: {
3102
+ query?: never;
3103
+ header?: never;
3104
+ path: {
3105
+ /** @description Customer reference or ID */
3106
+ customerRef: string;
3107
+ };
3108
+ cookie?: never;
3109
+ };
3110
+ requestBody?: never;
3111
+ responses: {
3112
+ /** @description Customer 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 Customer not found */
3124
+ 404: {
3125
+ headers: {
3126
+ [name: string]: unknown;
3127
+ };
3128
+ content?: never;
3129
+ };
3130
+ };
3131
+ };
3132
+ PurchaseSdkController_getPurchasesForProduct: {
3133
+ parameters: {
3134
+ query?: never;
3135
+ header?: never;
3136
+ path: {
3137
+ /** @description Product reference or ID */
3138
+ productRef: string;
3139
+ };
3140
+ cookie?: never;
3141
+ };
3142
+ requestBody?: never;
3143
+ responses: {
3144
+ /** @description Product purchases retrieved successfully */
3145
+ 200: {
3146
+ headers: {
3147
+ [name: string]: unknown;
3148
+ };
3149
+ content: {
3150
+ "application/json": {
3151
+ purchases?: components["schemas"]["PurchaseResponse"][];
3152
+ };
3153
+ };
3154
+ };
3155
+ /** @description Product not found */
3156
+ 404: {
3157
+ headers: {
3158
+ [name: string]: unknown;
3159
+ };
3160
+ content?: never;
3161
+ };
3162
+ };
3163
+ };
3164
+ PurchaseSdkController_getPurchase: {
3165
+ parameters: {
3166
+ query?: never;
3167
+ header?: never;
3168
+ path: {
3169
+ /** @description Purchase ID or reference */
3170
+ id: string;
3171
+ };
3172
+ cookie?: never;
3173
+ };
3174
+ requestBody?: never;
3175
+ responses: {
3176
+ /** @description Purchase retrieved successfully */
3177
+ 200: {
3178
+ headers: {
3179
+ [name: string]: unknown;
3180
+ };
3181
+ content: {
3182
+ "application/json": components["schemas"]["PurchaseResponse"];
3183
+ };
3184
+ };
3185
+ /** @description Purchase not found */
3186
+ 404: {
3187
+ headers: {
3188
+ [name: string]: unknown;
3189
+ };
3190
+ content?: never;
3191
+ };
3192
+ };
3193
+ };
3194
+ PurchaseSdkController_cancelPurchase: {
3195
+ parameters: {
3196
+ query?: never;
3197
+ header?: never;
3198
+ path: {
3199
+ /** @description Purchase reference or ID */
3200
+ purchaseRef: string;
3201
+ };
3202
+ cookie?: never;
3203
+ };
3204
+ requestBody: {
3205
+ content: {
3206
+ "application/json": components["schemas"]["CancelPurchaseRequest"];
3207
+ };
3208
+ };
3209
+ responses: {
3210
+ /** @description Purchase cancelled successfully */
3211
+ 200: {
3212
+ headers: {
3213
+ [name: string]: unknown;
3214
+ };
3215
+ content: {
3216
+ "application/json": {
3217
+ success?: boolean;
3218
+ purchase?: components["schemas"]["PurchaseResponse"];
3219
+ };
3220
+ };
3221
+ };
3222
+ /** @description Purchase not found */
3223
+ 404: {
3224
+ headers: {
3225
+ [name: string]: unknown;
3226
+ };
3227
+ content?: never;
3228
+ };
3229
+ };
3230
+ };
3231
+ LimitsSdkController_checkLimits: {
3232
+ parameters: {
3233
+ query?: never;
3234
+ header?: never;
3235
+ path?: never;
3236
+ cookie?: never;
3237
+ };
3238
+ requestBody: {
3239
+ content: {
3240
+ "application/json": components["schemas"]["CheckLimitRequest"];
3241
+ };
3242
+ };
3243
+ responses: {
3244
+ /** @description Limit check result */
3245
+ 200: {
3246
+ headers: {
3247
+ [name: string]: unknown;
3248
+ };
3249
+ content: {
3250
+ "application/json": components["schemas"]["LimitResponse"];
3251
+ };
3252
+ };
3253
+ /** @description Missing customerRef or productRef */
3254
+ 400: {
3255
+ headers: {
3256
+ [name: string]: unknown;
3257
+ };
3258
+ content?: never;
3259
+ };
3260
+ /** @description Customer or product not found */
3261
+ 404: {
3262
+ headers: {
3263
+ [name: string]: unknown;
3264
+ };
3265
+ content?: never;
3266
+ };
3267
+ };
3268
+ };
3269
+ }
1826
3270
 
1827
3271
  /**
1828
3272
  * SolvaPay API Client Type Definitions
@@ -1904,6 +3348,10 @@ interface ToolPlanMappingInput {
1904
3348
  planRefs?: string[];
1905
3349
  planKeys?: string[];
1906
3350
  }
3351
+ interface McpToolPlanMappingInput {
3352
+ name: string;
3353
+ planKeys: string[];
3354
+ }
1907
3355
  interface McpBootstrapRequest {
1908
3356
  name?: string;
1909
3357
  description?: string;
@@ -1940,6 +3388,26 @@ interface McpBootstrapResponse {
1940
3388
  description?: string;
1941
3389
  }>;
1942
3390
  }
3391
+ interface ConfigureMcpPlansRequest {
3392
+ paidPlans?: McpBootstrapPaidPlanInput[];
3393
+ toolMapping?: McpToolPlanMappingInput[];
3394
+ }
3395
+ interface ConfigureMcpPlansResponse {
3396
+ product: components['schemas']['SdkProductResponse'];
3397
+ mcpServer: {
3398
+ id?: string;
3399
+ reference?: string;
3400
+ subdomain?: string;
3401
+ mcpProxyUrl?: string;
3402
+ url: string;
3403
+ defaultPlanId?: string;
3404
+ };
3405
+ planMap: Record<string, {
3406
+ id: string;
3407
+ reference: string;
3408
+ name?: string;
3409
+ }>;
3410
+ }
1943
3411
  /**
1944
3412
  * SolvaPay API Client Interface
1945
3413
  *
@@ -1981,6 +3449,7 @@ interface SolvaPayClient {
1981
3449
  name: string;
1982
3450
  }>;
1983
3451
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3452
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
1984
3453
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
1985
3454
  deleteProduct?(productRef: string): Promise<void>;
1986
3455
  cloneProduct?(productRef: string, overrides?: {
@@ -2038,7 +3507,7 @@ interface SolvaPayClient {
2038
3507
  customerRef: string;
2039
3508
  productRef: string;
2040
3509
  }): Promise<components['schemas']['UserInfoResponse']>;
2041
- createCheckoutSession(params: components['schemas']['CreateCheckoutSessionRequest']): Promise<components['schemas']['CheckoutSessionResponse']>;
3510
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
2042
3511
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
2043
3512
  }
2044
3513
 
@@ -2084,7 +3553,7 @@ interface PaywallToolResult {
2084
3553
  mimeType?: string;
2085
3554
  }>;
2086
3555
  isError?: boolean;
2087
- structuredContent?: PaywallStructuredContent;
3556
+ structuredContent?: PaywallStructuredContent | Record<string, unknown>;
2088
3557
  }
2089
3558
 
2090
3559
  /**
@@ -2126,6 +3595,16 @@ interface RetryOptions {
2126
3595
  */
2127
3596
  onRetry?: (error: Error, attempt: number) => void;
2128
3597
  }
3598
+ interface McpToolExtra {
3599
+ authInfo?: {
3600
+ token: string;
3601
+ clientId: string;
3602
+ scopes: string[];
3603
+ expiresAt?: number;
3604
+ extra?: Record<string, unknown>;
3605
+ };
3606
+ [key: string]: unknown;
3607
+ }
2129
3608
  /**
2130
3609
  * Options for configuring payable protection
2131
3610
  */
@@ -2196,7 +3675,7 @@ interface McpAdapterOptions {
2196
3675
  /**
2197
3676
  * Extract customer reference from MCP args
2198
3677
  */
2199
- getCustomerRef?: (args: any) => string | Promise<string>;
3678
+ getCustomerRef?: (args: any, extra?: McpToolExtra) => string | Promise<string>;
2200
3679
  /**
2201
3680
  * Transform the response before wrapping in MCP format
2202
3681
  */
@@ -2215,7 +3694,7 @@ interface VirtualToolsOptions {
2215
3694
  /** Product reference (required) */
2216
3695
  product: string;
2217
3696
  /** Extract customer reference from MCP tool args */
2218
- getCustomerRef: (args: Record<string, unknown>) => string;
3697
+ getCustomerRef: (args: Record<string, unknown>, extra?: McpToolExtra) => string;
2219
3698
  /** Tool names to exclude from registration (optional) */
2220
3699
  exclude?: string[];
2221
3700
  }
@@ -2227,7 +3706,7 @@ interface VirtualToolDefinition {
2227
3706
  properties: Record<string, object>;
2228
3707
  required: string[];
2229
3708
  };
2230
- handler: (args: Record<string, unknown>) => Promise<{
3709
+ handler: (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<{
2231
3710
  content: Array<{
2232
3711
  type: string;
2233
3712
  text: string;
@@ -2246,6 +3725,25 @@ declare const VIRTUAL_TOOL_DEFINITIONS: {
2246
3725
  }[];
2247
3726
  declare function createVirtualTools(apiClient: SolvaPayClient, options: VirtualToolsOptions): VirtualToolDefinition[];
2248
3727
 
3728
+ type ZodRawShape = Record<string, unknown>;
3729
+ type JsonSchemaProperty = {
3730
+ type?: string;
3731
+ enum?: unknown[];
3732
+ items?: JsonSchemaProperty;
3733
+ properties?: Record<string, JsonSchemaProperty>;
3734
+ };
3735
+ interface McpServerLike {
3736
+ registerTool: (name: string, config: Record<string, unknown>, handler: (args: Record<string, unknown>, extra?: McpToolExtra) => unknown) => unknown;
3737
+ }
3738
+ interface RegisterVirtualToolsMcpOptions extends Omit<VirtualToolsOptions, 'getCustomerRef'> {
3739
+ getCustomerRef?: VirtualToolsOptions['getCustomerRef'];
3740
+ filter?: (definition: VirtualToolDefinition) => boolean;
3741
+ mapDefinition?: (definition: VirtualToolDefinition) => VirtualToolDefinition;
3742
+ wrapHandler?: (handler: VirtualToolDefinition['handler'], definition: VirtualToolDefinition) => (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<unknown> | unknown;
3743
+ }
3744
+ declare function jsonSchemaToZodRawShape(properties: Record<string, JsonSchemaProperty>, required?: string[]): ZodRawShape;
3745
+ declare function registerVirtualToolsMcpImpl(server: McpServerLike, apiClient: SolvaPayClient, options: RegisterVirtualToolsMcpOptions): void;
3746
+
2249
3747
  /**
2250
3748
  * Configuration for creating a SolvaPay instance.
2251
3749
  *
@@ -2363,7 +3861,7 @@ interface PayableFunction {
2363
3861
  * });
2364
3862
  * ```
2365
3863
  */
2366
- mcp<T = any>(businessLogic: (args: any) => Promise<T>, options?: McpAdapterOptions): (args: Record<string, unknown>) => Promise<unknown>;
3864
+ mcp<T = any>(businessLogic: (args: any) => Promise<T>, options?: McpAdapterOptions): (args: Record<string, unknown>, extra?: McpToolExtra) => Promise<unknown>;
2367
3865
  /**
2368
3866
  * Pure function adapter for direct function protection.
2369
3867
  *
@@ -2736,6 +4234,13 @@ interface SolvaPay {
2736
4234
  * fast setup flows where you want one call for product + plans + MCP config.
2737
4235
  */
2738
4236
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
4237
+ /**
4238
+ * Configure MCP plans and tool mappings for an existing MCP product.
4239
+ *
4240
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
4241
+ * paid plans as well as remapping tool access.
4242
+ */
4243
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
2739
4244
  /**
2740
4245
  * Get virtual tool definitions with bound handlers for MCP server integration.
2741
4246
  *
@@ -2755,7 +4260,7 @@ interface SolvaPay {
2755
4260
  * ```typescript
2756
4261
  * const virtualTools = solvaPay.getVirtualTools({
2757
4262
  * product: 'prd_myapi',
2758
- * getCustomerRef: args => args._auth?.customer_ref || 'anonymous',
4263
+ * getCustomerRef: (_args, extra) => String(extra?.authInfo?.extra?.customer_ref || 'anonymous'),
2759
4264
  * });
2760
4265
  *
2761
4266
  * // Register on your MCP server
@@ -2765,6 +4270,13 @@ interface SolvaPay {
2765
4270
  * ```
2766
4271
  */
2767
4272
  getVirtualTools(options: VirtualToolsOptions): VirtualToolDefinition[];
4273
+ /**
4274
+ * Register virtual tools directly on an MCP server with one call.
4275
+ *
4276
+ * This helper converts virtual tool JSON schemas to Zod schemas and registers
4277
+ * each tool on an MCP server that supports `registerTool()`.
4278
+ */
4279
+ registerVirtualToolsMcp(server: McpServerLike, options: RegisterVirtualToolsMcpOptions): Promise<void>;
2768
4280
  /**
2769
4281
  * Direct access to the API client for advanced operations.
2770
4282
  *
@@ -2937,6 +4449,76 @@ declare class PaywallError extends Error {
2937
4449
  constructor(message: string, structuredContent: PaywallStructuredContent);
2938
4450
  }
2939
4451
 
4452
+ /**
4453
+ * MCP OAuth helper utilities.
4454
+ *
4455
+ * These helpers are intentionally lightweight and do not verify JWT signatures.
4456
+ * Use them after token validation (for example via /v1/customer/auth/userinfo).
4457
+ */
4458
+ declare class McpBearerAuthError extends Error {
4459
+ constructor(message: string);
4460
+ }
4461
+ type McpBearerCustomerRefOptions = {
4462
+ claimPriority?: string[];
4463
+ };
4464
+ declare function extractBearerToken(authorization?: string | null): string | null;
4465
+ declare function decodeJwtPayload(token: string): Record<string, unknown>;
4466
+ declare function getCustomerRefFromJwtPayload(payload: Record<string, unknown>, options?: McpBearerCustomerRefOptions): string;
4467
+ declare function getCustomerRefFromBearerAuthHeader(authorization?: string | null, options?: McpBearerCustomerRefOptions): string;
4468
+
4469
+ interface BuildAuthInfoFromBearerOptions extends McpBearerCustomerRefOptions {
4470
+ clientId?: string;
4471
+ defaultScopes?: string[];
4472
+ includePayload?: boolean;
4473
+ }
4474
+ declare function buildAuthInfoFromBearer(authorization?: string | null, options?: BuildAuthInfoFromBearerOptions): McpToolExtra['authInfo'] | null;
4475
+
4476
+ type RequestLike = {
4477
+ method?: string;
4478
+ path?: string;
4479
+ headers?: Record<string, string | string[] | undefined>;
4480
+ body?: unknown;
4481
+ auth?: unknown;
4482
+ };
4483
+ type ResponseLike = {
4484
+ status: (code: number) => ResponseLike;
4485
+ json: (payload: unknown) => void;
4486
+ setHeader: (name: string, value: string) => void;
4487
+ };
4488
+ type NextLike = () => void;
4489
+ type Middleware = (req: RequestLike, res: ResponseLike, next: NextLike) => void;
4490
+ interface OAuthAuthorizationServerOptions {
4491
+ apiBaseUrl: string;
4492
+ productRef: string;
4493
+ }
4494
+ interface McpOAuthBridgeOptions {
4495
+ publicBaseUrl: string;
4496
+ apiBaseUrl: string;
4497
+ productRef: string;
4498
+ mcpPath?: string;
4499
+ requireAuth?: boolean;
4500
+ authInfo?: BuildAuthInfoFromBearerOptions;
4501
+ protectedResourcePath?: string;
4502
+ authorizationServerPath?: string;
4503
+ }
4504
+ declare function getOAuthProtectedResourceResponse(publicBaseUrl: string): {
4505
+ resource: string;
4506
+ authorization_servers: string[];
4507
+ scopes_supported: string[];
4508
+ };
4509
+ declare function getOAuthAuthorizationServerResponse({ apiBaseUrl, productRef, }: OAuthAuthorizationServerOptions): {
4510
+ issuer: string;
4511
+ authorization_endpoint: string;
4512
+ token_endpoint: string;
4513
+ registration_endpoint: string;
4514
+ token_endpoint_auth_methods_supported: string[];
4515
+ response_types_supported: string[];
4516
+ grant_types_supported: string[];
4517
+ scopes_supported: string[];
4518
+ code_challenge_methods_supported: string[];
4519
+ };
4520
+ declare function createMcpOAuthBridge(options: McpOAuthBridgeOptions): Middleware[];
4521
+
2940
4522
  /**
2941
4523
  * Utility functions for the SolvaPay Server SDK
2942
4524
  */
@@ -2980,23 +4562,6 @@ declare class PaywallError extends Error {
2980
4562
  */
2981
4563
  declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
2982
4564
 
2983
- /**
2984
- * MCP OAuth helper utilities.
2985
- *
2986
- * These helpers are intentionally lightweight and do not verify JWT signatures.
2987
- * Use them after token validation (for example via /v1/customer/auth/userinfo).
2988
- */
2989
- declare class McpBearerAuthError extends Error {
2990
- constructor(message: string);
2991
- }
2992
- type McpBearerCustomerRefOptions = {
2993
- claimPriority?: string[];
2994
- };
2995
- declare function extractBearerToken(authorization?: string | null): string | null;
2996
- declare function decodeJwtPayload(token: string): Record<string, unknown>;
2997
- declare function getCustomerRefFromJwtPayload(payload: Record<string, unknown>, options?: McpBearerCustomerRefOptions): string;
2998
- declare function getCustomerRefFromBearerAuthHeader(authorization?: string | null, options?: McpBearerCustomerRefOptions): string;
2999
-
3000
4565
  /**
3001
4566
  * Helper Types
3002
4567
  *
@@ -3367,4 +4932,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
3367
4932
  secret: string;
3368
4933
  }): WebhookEvent;
3369
4934
 
3370
- export { type AuthenticatedUser, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, handleRouteError, isErrorResult, listPlansCore, processPaymentIntentCore, syncCustomerCore, verifyWebhook, withRetry };
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 };