solvapay 0.1.0.dev4__py3-none-any.whl

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.
@@ -0,0 +1,3643 @@
1
+ """GENERATED by python/scripts/generate_client.py from openapi/sdk-v1.json. Do not edit."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Annotated, Any, Literal
6
+ from pydantic import BaseModel, ConfigDict, Field, RootModel
7
+
8
+
9
+ class ActivatePlanDto(BaseModel):
10
+ model_config = ConfigDict(
11
+ extra="allow",
12
+ populate_by_name=True,
13
+ )
14
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20)]
15
+ plan_ref: Annotated[str, Field(alias="planRef", max_length=20)]
16
+ product_ref: Annotated[str, Field(alias="productRef", max_length=20)]
17
+
18
+
19
+ class ActivatePlanResponseDto(BaseModel):
20
+ model_config = ConfigDict(
21
+ extra="allow",
22
+ populate_by_name=True,
23
+ )
24
+ checkout_session_id: Annotated[str | None, Field(alias="checkoutSessionId")] = None
25
+ checkout_url: Annotated[str | None, Field(alias="checkoutUrl")] = None
26
+ credit_balance: Annotated[int | float | None, Field(alias="creditBalance")] = None
27
+ credits_per_unit: Annotated[int | float | None, Field(alias="creditsPerUnit")] = None
28
+ currency: str | None = None
29
+ message: str | None = None
30
+ purchase_ref: Annotated[str | None, Field(alias="purchaseRef")] = None
31
+ status: Literal[
32
+ "activated",
33
+ "already_active",
34
+ "already_purchased",
35
+ "topup_required",
36
+ "payment_required",
37
+ "invalid",
38
+ ]
39
+
40
+
41
+ class ApiError(BaseModel):
42
+ """
43
+ Error response. Besides the fields listed, an error can carry fields specific to its `code`.
44
+ """
45
+
46
+ model_config = ConfigDict(
47
+ extra="allow",
48
+ populate_by_name=True,
49
+ )
50
+ code: Annotated[str | None, Field(examples=["KEY_ENV_MISMATCH"])] = None
51
+ """
52
+ A stable identifier to branch on, when the error has one.
53
+ """
54
+ error: Annotated[str | None, Field(examples=["Not Found"])] = None
55
+ """
56
+ The HTTP status text.
57
+ """
58
+ errors: list[dict[str, Any]] | None = None
59
+ """
60
+ On a validation failure, one entry per invalid field.
61
+ """
62
+ message: str | list[str] | None = None
63
+ """
64
+ What went wrong, for a person to read.
65
+ """
66
+ path: str
67
+ """
68
+ The request path.
69
+ """
70
+ status_code: Annotated[int, Field(alias="statusCode", examples=[404])]
71
+ """
72
+ The HTTP status code.
73
+ """
74
+ timestamp: str
75
+
76
+
77
+ class Estimate(BaseModel):
78
+ model_config = ConfigDict(
79
+ extra="allow",
80
+ populate_by_name=True,
81
+ )
82
+ amount: Annotated[str | None, Field(pattern="^\\d+(\\.\\d{1,8})?$")] = None
83
+ currency: Annotated[str | None, Field(pattern="^[A-Z]{3}$")] = None
84
+
85
+
86
+ class AuthorizeCallDto(BaseModel):
87
+ model_config = ConfigDict(
88
+ extra="allow",
89
+ populate_by_name=True,
90
+ )
91
+ agent_token: Annotated[str, Field(alias="agentToken", max_length=4096, min_length=1)]
92
+ estimate: Estimate
93
+ item: Annotated[str | None, Field(max_length=200, min_length=1)] = None
94
+ prompt_excerpt: Annotated[str | None, Field(alias="promptExcerpt", max_length=1500)] = None
95
+ prompt_hash: Annotated[
96
+ str | None, Field(alias="promptHash", pattern="^sha256:[0-9a-f]{64}$")
97
+ ] = None
98
+ request_id: Annotated[str, Field(alias="requestId", max_length=128, min_length=1)]
99
+ tool_error: Annotated[bool | None, Field(alias="toolError")] = None
100
+ wait: Annotated[int, Field(ge=0, le=55)] = 0
101
+
102
+
103
+ class Held(BaseModel):
104
+ model_config = ConfigDict(
105
+ extra="allow",
106
+ populate_by_name=True,
107
+ )
108
+ amount: Annotated[str, Field(pattern="^\\d+(\\.\\d{1,8})?$")]
109
+ currency: Annotated[str, Field(pattern="^[A-Z]{3}$")]
110
+
111
+
112
+ class Reservation(BaseModel):
113
+ model_config = ConfigDict(
114
+ extra="allow",
115
+ populate_by_name=True,
116
+ )
117
+ expires_at: Annotated[str, Field(alias="expiresAt")]
118
+ held: Held
119
+
120
+
121
+ class AuthorizeCallResponseDto1(BaseModel):
122
+ model_config = ConfigDict(
123
+ extra="allow",
124
+ populate_by_name=True,
125
+ )
126
+ call_ref: Annotated[str, Field(alias="callRef")]
127
+ reservation: Reservation
128
+ status: Literal["allowed"]
129
+
130
+
131
+ class AuthorizeCallResponseDto2(BaseModel):
132
+ model_config = ConfigDict(
133
+ extra="allow",
134
+ populate_by_name=True,
135
+ )
136
+ call_ref: Annotated[str, Field(alias="callRef")]
137
+ message: str
138
+ reason: Literal[
139
+ "customer_not_linked",
140
+ "ask",
141
+ "deny",
142
+ "topup_required",
143
+ "approval_declined",
144
+ "approval_expired",
145
+ ]
146
+ status: Literal["refused"]
147
+
148
+
149
+ class Approval(BaseModel):
150
+ model_config = ConfigDict(
151
+ extra="allow",
152
+ populate_by_name=True,
153
+ )
154
+ expires_at: Annotated[str, Field(alias="expiresAt")]
155
+ reference: str
156
+
157
+
158
+ class AuthorizeCallResponseDto3(BaseModel):
159
+ model_config = ConfigDict(
160
+ extra="allow",
161
+ populate_by_name=True,
162
+ )
163
+ approval: Approval
164
+ call_ref: Annotated[str, Field(alias="callRef")]
165
+ message: str
166
+ retry_after_seconds: Annotated[int, Field(alias="retryAfterSeconds")]
167
+ status: Literal["waiting"]
168
+
169
+
170
+ class AuthorizeCallResponseDto(
171
+ RootModel[AuthorizeCallResponseDto1 | AuthorizeCallResponseDto2 | AuthorizeCallResponseDto3]
172
+ ):
173
+ root: AuthorizeCallResponseDto1 | AuthorizeCallResponseDto2 | AuthorizeCallResponseDto3
174
+
175
+
176
+ class AutoRechargeDisplayFormattedDto(BaseModel):
177
+ model_config = ConfigDict(
178
+ extra="allow",
179
+ populate_by_name=True,
180
+ )
181
+ threshold: Annotated[str, Field(examples=["$5.00"])]
182
+ """
183
+ Formatted threshold amount
184
+ """
185
+ topup: Annotated[str, Field(examples=["$20.00"])]
186
+ """
187
+ Formatted top-up amount
188
+ """
189
+
190
+
191
+ class AutoRechargeTopupDto(BaseModel):
192
+ model_config = ConfigDict(
193
+ extra="allow",
194
+ populate_by_name=True,
195
+ )
196
+ amount_minor: Annotated[int | float, Field(alias="amountMinor", examples=[2000])]
197
+ """
198
+ Top-up amount in currency minor units
199
+ """
200
+ currency: Annotated[str, Field(examples=["USD"])]
201
+ """
202
+ ISO 4217 currency code
203
+ """
204
+ mode: Annotated[Literal["fixed"], Field(examples=["fixed"])]
205
+ """
206
+ Top-up mode
207
+ """
208
+
209
+
210
+ class AutoRechargeTriggerDto(BaseModel):
211
+ model_config = ConfigDict(
212
+ extra="allow",
213
+ populate_by_name=True,
214
+ )
215
+ threshold_amount_minor: Annotated[int | float, Field(alias="thresholdAmountMinor", examples=[500])]
216
+ """
217
+ Display-currency minor units for the balance threshold
218
+ """
219
+ type: Annotated[Literal["balance"], Field(examples=["balance"])]
220
+ """
221
+ Trigger kind
222
+ """
223
+
224
+
225
+ class AutoRechargeTriggeredResponse(BaseModel):
226
+ model_config = ConfigDict(
227
+ extra="allow",
228
+ populate_by_name=True,
229
+ )
230
+ triggered: Annotated[bool, Field(examples=[True])]
231
+ """
232
+ Whether the server initiated an auto-recharge charge after this debit (TOPUP credit lands via webhook)
233
+ """
234
+
235
+
236
+ class AutoRechargeValidationMetaResponse(BaseModel):
237
+ model_config = ConfigDict(
238
+ extra="allow",
239
+ populate_by_name=True,
240
+ )
241
+ max_amount_major: Annotated[int | float, Field(alias="maxAmountMajor", examples=[10000])]
242
+ """
243
+ Maximum display-currency major units accepted for threshold/top-up
244
+ """
245
+ stripe_minimum_minor_by_currency: Annotated[
246
+ dict[str, int | float],
247
+ Field(alias="stripeMinimumMinorByCurrency", examples=[{"GBP": 30, "USD": 50}]),
248
+ ]
249
+ """
250
+ Stripe minimum charge in minor units, keyed by ISO 4217 currency
251
+ """
252
+
253
+
254
+ class Cost(BaseModel):
255
+ model_config = ConfigDict(
256
+ extra="allow",
257
+ populate_by_name=True,
258
+ )
259
+ amount: Annotated[str, Field(pattern="^\\d+(\\.\\d{1,8})?$")]
260
+ currency: Literal["USD"]
261
+ source: Literal["reported", "provisional"]
262
+
263
+
264
+ class Event(BaseModel):
265
+ model_config = ConfigDict(
266
+ extra="allow",
267
+ populate_by_name=True,
268
+ )
269
+ action_type: Annotated[
270
+ Literal["transaction", "api_call", "hour", "email", "storage", "custom"],
271
+ Field(alias="actionType"),
272
+ ] = "api_call"
273
+ cost: Cost | None = None
274
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
275
+ description: str | None = None
276
+ duration: Annotated[int | float | None, Field(ge=0.0)] = None
277
+ error_message: Annotated[str | None, Field(alias="errorMessage")] = None
278
+ idempotency_key: Annotated[str | None, Field(alias="idempotencyKey", max_length=256)] = None
279
+ metadata: dict[str, Any] | None = None
280
+ outcome: Literal["success", "paywall", "fail"] = "success"
281
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20)] = None
282
+ purchase_ref: Annotated[str | None, Field(alias="purchaseRef", max_length=20)] = None
283
+ timestamp: str
284
+ units: Annotated[int, Field(ge=0, le=100000)] = 1
285
+
286
+
287
+ class BulkCreateUsageRequest(BaseModel):
288
+ model_config = ConfigDict(
289
+ extra="allow",
290
+ populate_by_name=True,
291
+ )
292
+ events: Annotated[list[Event], Field(max_length=1000, min_length=1)]
293
+
294
+
295
+ class BusinessDetailsDto(BaseModel):
296
+ model_config = ConfigDict(
297
+ extra="allow",
298
+ populate_by_name=True,
299
+ )
300
+ business_name: Annotated[str | None, Field(alias="businessName")] = None
301
+ """
302
+ Legal business name
303
+ """
304
+ country: str | None = None
305
+ """
306
+ ISO 3166-1 alpha-2 country code
307
+ """
308
+ customer_city: Annotated[str | None, Field(alias="customerCity")] = None
309
+ """
310
+ Billing city
311
+ """
312
+ customer_country: Annotated[str | None, Field(alias="customerCountry")] = None
313
+ """
314
+ ISO 3166-1 alpha-2 billing country (non-business consumers)
315
+ """
316
+ customer_line1: Annotated[str | None, Field(alias="customerLine1")] = None
317
+ """
318
+ Billing address line 1
319
+ """
320
+ customer_line2: Annotated[str | None, Field(alias="customerLine2")] = None
321
+ """
322
+ Billing address line 2
323
+ """
324
+ customer_name: Annotated[str | None, Field(alias="customerName", max_length=100)] = None
325
+ """
326
+ Customer full name
327
+ """
328
+ customer_postal_code: Annotated[str | None, Field(alias="customerPostalCode")] = None
329
+ """
330
+ Billing postal code (required by Stripe Tax for US)
331
+ """
332
+ customer_ref: Annotated[str | None, Field(alias="customerRef")] = None
333
+ """
334
+ Customer reference to persist business tax details on the customer record. Only honored by the payment-intent business-details endpoint; ignored on the checkout-session endpoint.
335
+ """
336
+ customer_state: Annotated[str | None, Field(alias="customerState")] = None
337
+ """
338
+ Billing state/region
339
+ """
340
+ is_business: Annotated[bool, Field(alias="isBusiness")]
341
+ """
342
+ Whether the purchase is on behalf of a business
343
+ """
344
+ tax_id: Annotated[str | None, Field(alias="taxId")] = None
345
+ """
346
+ Tax / VAT identification number
347
+ """
348
+ tax_id_type: Annotated[
349
+ Literal[
350
+ "ae_trn",
351
+ "al_tin",
352
+ "am_tin",
353
+ "ao_tin",
354
+ "au_abn",
355
+ "aw_tin",
356
+ "az_tin",
357
+ "ba_tin",
358
+ "bb_tin",
359
+ "bd_bin",
360
+ "bf_ifu",
361
+ "bh_vat",
362
+ "bj_ifu",
363
+ "bs_tin",
364
+ "by_tin",
365
+ "ca_gst_hst",
366
+ "cd_nif",
367
+ "ch_vat",
368
+ "cl_tin",
369
+ "cm_niu",
370
+ "co_nit",
371
+ "cr_tin",
372
+ "cv_nif",
373
+ "ec_ruc",
374
+ "eg_tin",
375
+ "et_tin",
376
+ "eu_vat",
377
+ "gb_vat",
378
+ "ge_vat",
379
+ "gn_nif",
380
+ "hk_br",
381
+ "id_npwp",
382
+ "in_gst",
383
+ "is_vat",
384
+ "jp_trn",
385
+ "ke_pin",
386
+ "kg_tin",
387
+ "kh_tin",
388
+ "kr_brn",
389
+ "kz_bin",
390
+ "la_tin",
391
+ "li_vat",
392
+ "lk_vat",
393
+ "ma_vat",
394
+ "md_vat",
395
+ "me_pib",
396
+ "mk_vat",
397
+ "mr_nif",
398
+ "mx_rfc",
399
+ "my_sst",
400
+ "ng_tin",
401
+ "no_vat",
402
+ "np_pan",
403
+ "nz_gst",
404
+ "om_vat",
405
+ "pe_ruc",
406
+ "ph_tin",
407
+ "rs_pib",
408
+ "ru_inn",
409
+ "sa_vat",
410
+ "sg_gst",
411
+ "sn_ninea",
412
+ "sr_fin",
413
+ "th_vat",
414
+ "tj_tin",
415
+ "tr_tin",
416
+ "tw_vat",
417
+ "tz_vat",
418
+ "ua_vat",
419
+ "ug_tin",
420
+ "us_ein",
421
+ "uy_ruc",
422
+ "uz_vat",
423
+ "vn_tin",
424
+ "za_vat",
425
+ "zm_tin",
426
+ "zw_tin",
427
+ ]
428
+ | None,
429
+ Field(alias="taxIdType"),
430
+ ] = None
431
+ """
432
+ Tax ID type
433
+ """
434
+
435
+
436
+ class CancelPurchaseRequest(BaseModel):
437
+ model_config = ConfigDict(
438
+ extra="allow",
439
+ populate_by_name=True,
440
+ )
441
+ reason: str | None = None
442
+
443
+
444
+ class FreeAllowance(BaseModel):
445
+ """
446
+ SDK-only free-tool allowance. Authenticated by the provider secret key, so `cap` is the provider's own declaration, not customer input.
447
+ """
448
+
449
+ model_config = ConfigDict(
450
+ extra="allow",
451
+ populate_by_name=True,
452
+ )
453
+ cap: Annotated[int | None, Field(gt=0)] = None
454
+ meter: Annotated[str | None, Field(min_length=1, pattern="^free-[a-z0-9-]+$")] = None
455
+ """
456
+ Free meter name. Must match `/^free-[a-z0-9-]+$/`.
457
+ """
458
+ scope: Literal["rolling_window", "lifetime"] | None = None
459
+ window_days: Annotated[int | None, Field(alias="windowDays", ge=1)] = None
460
+
461
+
462
+ class CheckLimitRequest(BaseModel):
463
+ model_config = ConfigDict(
464
+ extra="allow",
465
+ populate_by_name=True,
466
+ )
467
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
468
+ free_allowance: Annotated[FreeAllowance | None, Field(alias="freeAllowance")] = None
469
+ """
470
+ SDK-only free-tool allowance. Authenticated by the provider secret key, so `cap` is the provider's own declaration, not customer input.
471
+ """
472
+ include_checkout_session: Annotated[bool | None, Field(alias="includeCheckoutSession")] = None
473
+ meter_name: Annotated[str | None, Field(alias="meterName")] = None
474
+ product_ref: Annotated[str, Field(alias="productRef", max_length=20, min_length=1)]
475
+ usage_type: Annotated[str | None, Field(alias="usageType")] = None
476
+
477
+
478
+ class CloneProductDto(BaseModel):
479
+ model_config = ConfigDict(
480
+ extra="allow",
481
+ populate_by_name=True,
482
+ )
483
+ name: Annotated[
484
+ str | None, Field(min_length=1, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$")
485
+ ] = None
486
+
487
+
488
+ class Cost1(BaseModel):
489
+ model_config = ConfigDict(
490
+ extra="allow",
491
+ populate_by_name=True,
492
+ )
493
+ amount: Annotated[str | None, Field(pattern="^\\d+(\\.\\d{1,8})?$")] = None
494
+ currency: Annotated[str | None, Field(pattern="^[A-Z]{3}$")] = None
495
+
496
+
497
+ class CompleteCallDto(BaseModel):
498
+ model_config = ConfigDict(
499
+ extra="allow",
500
+ populate_by_name=True,
501
+ )
502
+ cost: Annotated[Cost1 | None, Field(...)]
503
+ interrupted: Annotated[str | None, Field(max_length=200, min_length=1)] = None
504
+ status: Annotated[int, Field(ge=100, le=599)]
505
+
506
+
507
+ class Amount(BaseModel):
508
+ model_config = ConfigDict(
509
+ extra="allow",
510
+ populate_by_name=True,
511
+ )
512
+ amount: Annotated[str | None, Field(pattern="^\\d+(\\.\\d{1,8})?$")] = None
513
+ currency: Annotated[str | None, Field(pattern="^[A-Z]{3}$")] = None
514
+
515
+
516
+ class CompleteCallResponseDto(BaseModel):
517
+ model_config = ConfigDict(
518
+ extra="allow",
519
+ populate_by_name=True,
520
+ )
521
+ amount: Amount
522
+ call_ref: Annotated[str, Field(alias="callRef")]
523
+ duplicate: bool
524
+ settled: bool
525
+ source: Literal["reported", "provisional", "none"]
526
+
527
+
528
+ class Options(BaseModel):
529
+ model_config = ConfigDict(
530
+ extra="allow",
531
+ populate_by_name=True,
532
+ )
533
+ amount_minor: Annotated[int, Field(alias="amountMinor", ge=0)]
534
+ currency: str
535
+ kind: Literal["charge"]
536
+ label: str | None = None
537
+ meter: Annotated[str | None, Field(min_length=1)] = None
538
+ one_time: Annotated[bool | None, Field(alias="oneTime")] = None
539
+ per: Literal["unit", "seat", "flat"]
540
+
541
+
542
+ class Options1(BaseModel):
543
+ model_config = ConfigDict(
544
+ extra="allow",
545
+ populate_by_name=True,
546
+ )
547
+ anchor: str | None = None
548
+ count: Annotated[int | None, Field(ge=1)] = None
549
+ interval: Literal["week", "month", "year"]
550
+ kind: Literal["billingCycle"]
551
+
552
+
553
+ class Charge(BaseModel):
554
+ model_config = ConfigDict(
555
+ extra="allow",
556
+ populate_by_name=True,
557
+ )
558
+ amount_minor: Annotated[int, Field(alias="amountMinor", ge=0)]
559
+ currency: str
560
+ label: str | None = None
561
+ meter: Annotated[str | None, Field(min_length=1)] = None
562
+ per: Literal["unit", "seat", "flat"]
563
+
564
+
565
+ class Options2(BaseModel):
566
+ model_config = ConfigDict(
567
+ extra="allow",
568
+ populate_by_name=True,
569
+ )
570
+ charge: Charge
571
+ from_: Annotated[int, Field(alias="from", ge=0)]
572
+ kind: Literal["tier"]
573
+ label: str | None = None
574
+ mode: Literal["graduated", "volume"]
575
+ to: Annotated[int | None, Field(ge=0)]
576
+
577
+
578
+ class Options3(BaseModel):
579
+ model_config = ConfigDict(
580
+ extra="allow",
581
+ populate_by_name=True,
582
+ )
583
+ cap: Annotated[int, Field(ge=0)]
584
+ kind: Literal["limit"]
585
+ label: str | None = None
586
+ meter: Annotated[str, Field(min_length=1)]
587
+ on_exceed: Annotated[Literal["block", "draw_credits"], Field(alias="onExceed")]
588
+ scope: Literal["billing_period", "lifetime", "rolling_window"]
589
+ window_days: Annotated[int | None, Field(alias="windowDays", ge=1)] = None
590
+
591
+
592
+ class Options4(BaseModel):
593
+ model_config = ConfigDict(
594
+ extra="allow",
595
+ populate_by_name=True,
596
+ )
597
+ feature: Annotated[str, Field(min_length=1)]
598
+ kind: Literal["entitlement"]
599
+ label: str | None = None
600
+ scope: str | None = None
601
+ value: bool | int | float | str
602
+
603
+
604
+ class Options5(BaseModel):
605
+ model_config = ConfigDict(
606
+ extra="allow",
607
+ populate_by_name=True,
608
+ )
609
+ days: Annotated[int, Field(ge=1)]
610
+ kind: Literal["trial"]
611
+ label: str | None = None
612
+ on_end: Annotated[Literal["convert", "cancel"], Field(alias="onEnd")]
613
+
614
+
615
+ class Options6(BaseModel):
616
+ model_config = ConfigDict(
617
+ extra="allow",
618
+ populate_by_name=True,
619
+ )
620
+ applies_to: Annotated[
621
+ Literal["recurring", "setup", "usage", "all"] | None, Field(alias="appliesTo")
622
+ ] = None
623
+ currency: str | None = None
624
+ cycles: Annotated[int | None, Field(ge=1)] = None
625
+ duration: Literal["once", "repeating", "forever"]
626
+ kind: Literal["discount"]
627
+ label: str | None = None
628
+ mode: Literal["percentage", "fixed"]
629
+ value: Annotated[int, Field(gt=0)]
630
+
631
+
632
+ class Options7(BaseModel):
633
+ model_config = ConfigDict(
634
+ extra="allow",
635
+ populate_by_name=True,
636
+ )
637
+ kind: Literal["autoAssigned"]
638
+ label: str | None = None
639
+
640
+
641
+ class Options8(BaseModel):
642
+ model_config = ConfigDict(
643
+ extra="allow",
644
+ populate_by_name=True,
645
+ )
646
+ kind: Literal["hidden"]
647
+ label: str | None = None
648
+
649
+
650
+ class Plan(BaseModel):
651
+ model_config = ConfigDict(
652
+ extra="allow",
653
+ populate_by_name=True,
654
+ )
655
+ currency: Annotated[str | None, Field(max_length=3, min_length=3)] = None
656
+ features: dict[str, Any] | None = None
657
+ key: Annotated[str, Field(min_length=1)]
658
+ name: Annotated[str, Field(min_length=1)]
659
+ options: list[
660
+ Options
661
+ | Options1
662
+ | Options2
663
+ | Options3
664
+ | Options4
665
+ | Options5
666
+ | Options6
667
+ | Options7
668
+ | Options8
669
+ ]
670
+
671
+
672
+ class ToolMappingItem(BaseModel):
673
+ model_config = ConfigDict(
674
+ extra="allow",
675
+ populate_by_name=True,
676
+ )
677
+ name: Annotated[str, Field(min_length=1)]
678
+ plan_keys: Annotated[list[str], Field(alias="planKeys")]
679
+
680
+
681
+ class ConfigureMcpPlansDto(BaseModel):
682
+ model_config = ConfigDict(
683
+ extra="allow",
684
+ populate_by_name=True,
685
+ )
686
+ plans: list[Plan] | None = None
687
+ tool_mapping: Annotated[list[ToolMappingItem] | None, Field(alias="toolMapping")] = None
688
+
689
+
690
+ class Debited(RootModel[Literal[False]]):
691
+ root: Literal[False]
692
+
693
+
694
+ class CostDebitSkippedResponse(BaseModel):
695
+ model_config = ConfigDict(
696
+ extra="allow",
697
+ populate_by_name=True,
698
+ )
699
+ debited: Debited
700
+ reason: Annotated[
701
+ Literal["duplicate", "customer_not_found", "record_failed"], Field(examples=["duplicate"])
702
+ ]
703
+
704
+
705
+ class Debited1(RootModel[Literal[True]]):
706
+ root: Literal[True]
707
+
708
+
709
+ class CostDebitSuccessResponse(BaseModel):
710
+ model_config = ConfigDict(
711
+ extra="allow",
712
+ populate_by_name=True,
713
+ )
714
+ amount: Annotated[int | float, Field(examples=[0])]
715
+ """
716
+ Whole credits the balance dropped by (0 for a cost below one credit; the exact amount is in amountUsd)
717
+ """
718
+ amount_usd: Annotated[str, Field(alias="amountUsd", examples=["0.000043"])]
719
+ """
720
+ Exact amount debited, USD decimal string
721
+ """
722
+ auto_recharge: Annotated[AutoRechargeTriggeredResponse | None, Field(alias="autoRecharge")] = (
723
+ None
724
+ )
725
+ balance_credits: Annotated[int | float, Field(alias="balanceCredits", examples=[30000])]
726
+ """
727
+ Balance in whole credits after the debit
728
+ """
729
+ balance_usd: Annotated[str, Field(alias="balanceUsd", examples=["2.999957"])]
730
+ """
731
+ Exact balance after the debit, USD decimal string
732
+ """
733
+ cost_source: Annotated[Literal["reported", "provisional"], Field(alias="costSource")]
734
+ """
735
+ Set on a debit by reported cost: whether the cost was reported or an estimate
736
+ """
737
+ debited: Debited1
738
+
739
+
740
+ class CreateCheckoutSessionRequest(BaseModel):
741
+ model_config = ConfigDict(
742
+ extra="allow",
743
+ populate_by_name=True,
744
+ )
745
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
746
+ plan_ref: Annotated[str | None, Field(alias="planRef", max_length=20)] = None
747
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20, min_length=1)] = (
748
+ None
749
+ )
750
+ purpose: Literal["credit_topup"] | None = None
751
+ return_url: Annotated[str | None, Field(alias="returnUrl")] = None
752
+
753
+
754
+ class CreateCheckoutSessionResponse(BaseModel):
755
+ model_config = ConfigDict(
756
+ extra="allow",
757
+ populate_by_name=True,
758
+ )
759
+ checkout_url: Annotated[
760
+ str,
761
+ Field(
762
+ alias="checkoutUrl",
763
+ examples=["https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788"],
764
+ ),
765
+ ]
766
+ """
767
+ Full checkout URL based on backend configuration (ready to redirect customer)
768
+ """
769
+ session_id: Annotated[
770
+ str, Field(alias="sessionId", examples=["e3f1c2d4b6a89f001122334455667788"])
771
+ ]
772
+ """
773
+ Checkout session ID/token
774
+ """
775
+
776
+
777
+ class Telephone(RootModel[str]):
778
+ root: Annotated[str, Field(pattern="^\\+[1-9]\\d{6,14}$")]
779
+
780
+
781
+ class CreateCustomerRequest(BaseModel):
782
+ model_config = ConfigDict(
783
+ extra="allow",
784
+ populate_by_name=True,
785
+ )
786
+ description: Annotated[str | None, Field(max_length=1000)] = None
787
+ email: str
788
+ external_ref: Annotated[str | None, Field(alias="externalRef", max_length=50)] = None
789
+ metadata: dict[str, Any] | None = None
790
+ name: Annotated[
791
+ str | None, Field(max_length=100, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$")
792
+ ] = None
793
+ telephone: Telephone | Literal[""] | None = None
794
+
795
+
796
+ class CreateCustomerSessionRequest(BaseModel):
797
+ model_config = ConfigDict(
798
+ extra="allow",
799
+ populate_by_name=True,
800
+ )
801
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
802
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20)] = None
803
+
804
+
805
+ class CreateCustomerSessionResponse(BaseModel):
806
+ model_config = ConfigDict(
807
+ extra="allow",
808
+ populate_by_name=True,
809
+ )
810
+ customer_url: Annotated[
811
+ str,
812
+ Field(
813
+ alias="customerUrl",
814
+ examples=["https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788"],
815
+ ),
816
+ ]
817
+ """
818
+ Full customer URL based on backend configuration (ready to redirect customer)
819
+ """
820
+ session_id: Annotated[
821
+ str, Field(alias="sessionId", examples=["e3f1c2d4b6a89f001122334455667788"])
822
+ ]
823
+ """
824
+ Customer session ID/token
825
+ """
826
+
827
+
828
+ class AutoRecharge(BaseModel):
829
+ model_config = ConfigDict(
830
+ extra="allow",
831
+ populate_by_name=True,
832
+ )
833
+ currency: str | None = None
834
+ enabled: bool | None = None
835
+ max_monthly_spend_major: Annotated[
836
+ int | float | None, Field(alias="maxMonthlySpendMajor", gt=0.0, le=10000.0)
837
+ ] = None
838
+ threshold_amount_major: Annotated[
839
+ int | float | None, Field(alias="thresholdAmountMajor", gt=0.0, le=10000.0)
840
+ ] = None
841
+ topup_amount_major: Annotated[
842
+ int | float | None, Field(alias="topupAmountMajor", gt=0.0, le=10000.0)
843
+ ] = None
844
+ trigger_type: Annotated[Literal["balance"] | None, Field(alias="triggerType")] = None
845
+
846
+
847
+ class CreatePaymentIntentDto(BaseModel):
848
+ model_config = ConfigDict(
849
+ extra="allow",
850
+ populate_by_name=True,
851
+ )
852
+ amount: Annotated[int | None, Field(ge=100, le=10000000)] = None
853
+ auto_recharge: Annotated[AutoRecharge | None, Field(alias="autoRecharge")] = None
854
+ currency: str | None = None
855
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
856
+ description: Annotated[str | None, Field(max_length=500)] = None
857
+ plan_ref: Annotated[str | None, Field(alias="planRef", max_length=20, min_length=1)] = None
858
+ pricing_tier: Annotated[str | None, Field(alias="pricingTier")] = None
859
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20, min_length=1)] = (
860
+ None
861
+ )
862
+ purpose: Literal["product", "credit_topup", "usage_billing"] = "product"
863
+
864
+
865
+ class Options9(BaseModel):
866
+ model_config = ConfigDict(
867
+ extra="allow",
868
+ populate_by_name=True,
869
+ )
870
+ amount_minor: Annotated[int, Field(alias="amountMinor", ge=0)]
871
+ currency: str
872
+ kind: Literal["charge"]
873
+ label: str | None = None
874
+ meter: Annotated[str | None, Field(min_length=1)] = None
875
+ one_time: Annotated[bool | None, Field(alias="oneTime")] = None
876
+ per: Literal["unit", "seat", "flat"]
877
+
878
+
879
+ class Options10(BaseModel):
880
+ model_config = ConfigDict(
881
+ extra="allow",
882
+ populate_by_name=True,
883
+ )
884
+ anchor: str | None = None
885
+ count: Annotated[int | None, Field(ge=1)] = None
886
+ interval: Literal["week", "month", "year"]
887
+ kind: Literal["billingCycle"]
888
+
889
+
890
+ class Options11(BaseModel):
891
+ model_config = ConfigDict(
892
+ extra="allow",
893
+ populate_by_name=True,
894
+ )
895
+ charge: Charge
896
+ from_: Annotated[int, Field(alias="from", ge=0)]
897
+ kind: Literal["tier"]
898
+ label: str | None = None
899
+ mode: Literal["graduated", "volume"]
900
+ to: Annotated[int | None, Field(ge=0)]
901
+
902
+
903
+ class Options12(BaseModel):
904
+ model_config = ConfigDict(
905
+ extra="allow",
906
+ populate_by_name=True,
907
+ )
908
+ cap: Annotated[int, Field(ge=0)]
909
+ kind: Literal["limit"]
910
+ label: str | None = None
911
+ meter: Annotated[str, Field(min_length=1)]
912
+ on_exceed: Annotated[Literal["block", "draw_credits"], Field(alias="onExceed")]
913
+ scope: Literal["billing_period", "lifetime", "rolling_window"]
914
+ window_days: Annotated[int | None, Field(alias="windowDays", ge=1)] = None
915
+
916
+
917
+ class Options13(BaseModel):
918
+ model_config = ConfigDict(
919
+ extra="allow",
920
+ populate_by_name=True,
921
+ )
922
+ feature: Annotated[str, Field(min_length=1)]
923
+ kind: Literal["entitlement"]
924
+ label: str | None = None
925
+ scope: str | None = None
926
+ value: bool | int | float | str
927
+
928
+
929
+ class Options14(BaseModel):
930
+ model_config = ConfigDict(
931
+ extra="allow",
932
+ populate_by_name=True,
933
+ )
934
+ days: Annotated[int, Field(ge=1)]
935
+ kind: Literal["trial"]
936
+ label: str | None = None
937
+ on_end: Annotated[Literal["convert", "cancel"], Field(alias="onEnd")]
938
+
939
+
940
+ class Options15(BaseModel):
941
+ model_config = ConfigDict(
942
+ extra="allow",
943
+ populate_by_name=True,
944
+ )
945
+ applies_to: Annotated[
946
+ Literal["recurring", "setup", "usage", "all"] | None, Field(alias="appliesTo")
947
+ ] = None
948
+ currency: str | None = None
949
+ cycles: Annotated[int | None, Field(ge=1)] = None
950
+ duration: Literal["once", "repeating", "forever"]
951
+ kind: Literal["discount"]
952
+ label: str | None = None
953
+ mode: Literal["percentage", "fixed"]
954
+ value: Annotated[int, Field(gt=0)]
955
+
956
+
957
+ class Options16(BaseModel):
958
+ model_config = ConfigDict(
959
+ extra="allow",
960
+ populate_by_name=True,
961
+ )
962
+ kind: Literal["autoAssigned"]
963
+ label: str | None = None
964
+
965
+
966
+ class Options17(BaseModel):
967
+ model_config = ConfigDict(
968
+ extra="allow",
969
+ populate_by_name=True,
970
+ )
971
+ kind: Literal["hidden"]
972
+ label: str | None = None
973
+
974
+
975
+ class CreatePlanRequest(BaseModel):
976
+ model_config = ConfigDict(
977
+ extra="allow",
978
+ populate_by_name=True,
979
+ )
980
+ access_expiry_days: Annotated[int | None, Field(alias="accessExpiryDays", ge=0)] = None
981
+ currency: Annotated[str | None, Field(max_length=3, min_length=3)] = None
982
+ description: Annotated[str | None, Field(max_length=500)] = None
983
+ features: dict[str, Any] | None = None
984
+ max_active_users: Annotated[int | None, Field(alias="maxActiveUsers", ge=0)] = None
985
+ metadata: dict[str, Any] | None = None
986
+ name: Annotated[
987
+ str, Field(max_length=200, min_length=2, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$")
988
+ ]
989
+ options: list[
990
+ Options9
991
+ | Options10
992
+ | Options11
993
+ | Options12
994
+ | Options13
995
+ | Options14
996
+ | Options15
997
+ | Options16
998
+ | Options17
999
+ ]
1000
+ status: Literal["active", "inactive", "archived"] | None = None
1001
+ tax_behavior: Annotated[
1002
+ Literal["auto", "inclusive", "exclusive"] | None, Field(alias="taxBehavior")
1003
+ ] = None
1004
+
1005
+
1006
+ class Config(BaseModel):
1007
+ model_config = ConfigDict(
1008
+ extra="allow",
1009
+ populate_by_name=True,
1010
+ )
1011
+ delivery_method: Annotated[str | None, Field(alias="deliveryMethod")] = None
1012
+ fulfillment_type: Annotated[str | None, Field(alias="fulfillmentType")] = None
1013
+ validity_period: Annotated[int | None, Field(alias="validityPeriod", gt=0)] = None
1014
+
1015
+
1016
+ class CreateProductRequest(BaseModel):
1017
+ model_config = ConfigDict(
1018
+ extra="allow",
1019
+ populate_by_name=True,
1020
+ )
1021
+ config: Config | None = None
1022
+ description: Annotated[str | None, Field(max_length=1000)] = None
1023
+ image_url: Annotated[str | None, Field(alias="imageUrl")] = None
1024
+ is_managed_mcp: Annotated[bool | None, Field(alias="isManagedMcp")] = None
1025
+ is_mcp_pay: Annotated[bool | None, Field(alias="isMcpPay")] = None
1026
+ metadata: dict[str, Any] | None = None
1027
+ name: Annotated[
1028
+ str, Field(max_length=100, min_length=2, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$")
1029
+ ]
1030
+ product_type: Annotated[str | None, Field(alias="productType", max_length=100)] = None
1031
+ tax_behavior: Annotated[
1032
+ Literal["auto", "inclusive", "exclusive"] | None, Field(alias="taxBehavior")
1033
+ ] = None
1034
+
1035
+
1036
+ class Cost2(BaseModel):
1037
+ model_config = ConfigDict(
1038
+ extra="allow",
1039
+ populate_by_name=True,
1040
+ )
1041
+ amount: Annotated[str | None, Field(pattern="^\\d+(\\.\\d{1,8})?$")] = None
1042
+ currency: Literal["USD"] | None = None
1043
+ source: Literal["reported", "provisional"] | None = None
1044
+
1045
+
1046
+ class CreateUsageRequest(BaseModel):
1047
+ model_config = ConfigDict(
1048
+ extra="allow",
1049
+ populate_by_name=True,
1050
+ )
1051
+ action_type: Annotated[
1052
+ Literal["transaction", "api_call", "hour", "email", "storage", "custom"],
1053
+ Field(alias="actionType"),
1054
+ ] = "api_call"
1055
+ cost: Cost2 | None = None
1056
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
1057
+ description: str | None = None
1058
+ duration: Annotated[int | float | None, Field(ge=0.0)] = None
1059
+ error_message: Annotated[str | None, Field(alias="errorMessage")] = None
1060
+ idempotency_key: Annotated[str | None, Field(alias="idempotencyKey", max_length=256)] = None
1061
+ metadata: dict[str, Any] | None = None
1062
+ outcome: Literal["success", "paywall", "fail"] = "success"
1063
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20)] = None
1064
+ purchase_ref: Annotated[str | None, Field(alias="purchaseRef", max_length=20)] = None
1065
+ timestamp: str
1066
+ units: Annotated[int, Field(ge=0, le=100000)] = 1
1067
+
1068
+
1069
+ class CreditActivityEntryDto(BaseModel):
1070
+ model_config = ConfigDict(
1071
+ extra="allow",
1072
+ populate_by_name=True,
1073
+ )
1074
+ amount: Annotated[int | float, Field(examples=[-200])]
1075
+ """
1076
+ Signed credit units on the USD peg (100 credits = 1 USD cent)
1077
+ """
1078
+ balance: Annotated[int | float, Field(examples=[599800])]
1079
+ """
1080
+ Running credit balance after this event
1081
+ """
1082
+ product_name: Annotated[str | None, Field(alias="productName")] = None
1083
+ """
1084
+ Product display name when the event is product-scoped
1085
+ """
1086
+ product_ref: Annotated[str | None, Field(alias="productRef")] = None
1087
+ """
1088
+ Product reference when the event is product-scoped
1089
+ """
1090
+ reason: str | None = None
1091
+ """
1092
+ Machine-readable reason when the ledger stored one
1093
+ """
1094
+ timestamp: Annotated[str, Field(examples=["2026-09-05T14:22:00.000Z"])]
1095
+ """
1096
+ ISO-8601 timestamp
1097
+ """
1098
+ type: Literal["USAGE", "TOPUP", "GRANT", "REFUND", "ADJUSTMENT"]
1099
+ """
1100
+ Ledger event type
1101
+ """
1102
+
1103
+
1104
+ class CreditActivityResponseDto(BaseModel):
1105
+ model_config = ConfigDict(
1106
+ extra="allow",
1107
+ populate_by_name=True,
1108
+ )
1109
+ entries: list[CreditActivityEntryDto]
1110
+ has_more: Annotated[bool, Field(alias="hasMore", examples=[False])]
1111
+ """
1112
+ True when more events exist beyond this page
1113
+ """
1114
+
1115
+
1116
+ class Debited2(RootModel[Literal[False]]):
1117
+ root: Literal[False]
1118
+
1119
+
1120
+ class CreditDebitSkippedResponse(BaseModel):
1121
+ model_config = ConfigDict(
1122
+ extra="allow",
1123
+ populate_by_name=True,
1124
+ )
1125
+ debited: Debited2
1126
+ reason: Annotated[
1127
+ Literal[
1128
+ "duplicate",
1129
+ "no_product_ref",
1130
+ "customer_not_found",
1131
+ "no_active_purchase",
1132
+ "plan_not_credit_based",
1133
+ "not_credit_drawn",
1134
+ "within_included",
1135
+ "free_meter",
1136
+ ],
1137
+ Field(examples=["duplicate"]),
1138
+ ]
1139
+ """
1140
+ Reason no credit debit was recorded
1141
+ """
1142
+
1143
+
1144
+ class Debited3(RootModel[Literal[True]]):
1145
+ root: Literal[True]
1146
+
1147
+
1148
+ class CreditDebitSuccessResponse(BaseModel):
1149
+ model_config = ConfigDict(
1150
+ extra="allow",
1151
+ populate_by_name=True,
1152
+ )
1153
+ amount: Annotated[int | float, Field(examples=[100])]
1154
+ """
1155
+ Credits debited for this usage event (credits are USD-pegged at 100 credits per minor unit, so a 1¢/unit charge debits 100 credits/unit)
1156
+ """
1157
+ auto_recharge: Annotated[AutoRechargeTriggeredResponse | None, Field(alias="autoRecharge")] = (
1158
+ None
1159
+ )
1160
+ debited: Debited3
1161
+ remaining_units: Annotated[int | float, Field(alias="remainingUnits", examples=[99])]
1162
+ """
1163
+ How many metered items the remaining credit balance still covers
1164
+ """
1165
+ units_remaining: Annotated[int | float, Field(alias="unitsRemaining", deprecated=True, examples=[99])]
1166
+ """
1167
+ Deprecated alias of remainingUnits. Prefer remainingUnits.
1168
+ """
1169
+
1170
+
1171
+ class CustomerBalanceDisplayDto(BaseModel):
1172
+ model_config = ConfigDict(
1173
+ extra="allow",
1174
+ populate_by_name=True,
1175
+ )
1176
+ amount_major: Annotated[int | float, Field(alias="amountMajor", examples=[42])]
1177
+ """
1178
+ Balance amount in the display currency major units (e.g. dollars)
1179
+ """
1180
+ currency: Annotated[str, Field(examples=["USD"])]
1181
+ """
1182
+ ISO 4217 display currency code
1183
+ """
1184
+ exchange_rate: Annotated[int | float, Field(alias="exchangeRate", examples=[1])]
1185
+ """
1186
+ Exchange rate applied from USD to the display currency
1187
+ """
1188
+ formatted: Annotated[str, Field(examples=["$42.00"])]
1189
+ """
1190
+ Human-readable formatted balance
1191
+ """
1192
+ rate_source: Annotated[
1193
+ Literal["parity", "db", "fallback", "funding"],
1194
+ Field(alias="rateSource", examples=["parity"]),
1195
+ ]
1196
+ """
1197
+ Source of the exchange rate used
1198
+ """
1199
+
1200
+
1201
+ class CustomerBalanceResponse(BaseModel):
1202
+ model_config = ConfigDict(
1203
+ extra="allow",
1204
+ populate_by_name=True,
1205
+ )
1206
+ credits: Annotated[int | float, Field(examples=[4200])]
1207
+ """
1208
+ Raw credit balance in credits (100 credits = 1 minor currency unit)
1209
+ """
1210
+ credits_per_minor_unit: Annotated[int | float, Field(alias="creditsPerMinorUnit", examples=[100])]
1211
+ """
1212
+ Number of credits per minor currency unit
1213
+ """
1214
+ customer_ref: Annotated[str, Field(alias="customerRef", examples=["cus_3c4d5e6f7g8h"])]
1215
+ """
1216
+ Customer reference identifier
1217
+ """
1218
+ display: CustomerBalanceDisplayDto
1219
+ """
1220
+ Formatted balance display block for the display currency
1221
+ """
1222
+ display_currency: Annotated[str, Field(alias="displayCurrency", examples=["USD"])]
1223
+ """
1224
+ ISO 4217 display currency code
1225
+ """
1226
+ display_exchange_rate: Annotated[int | float, Field(alias="displayExchangeRate", examples=[1])]
1227
+ """
1228
+ Exchange rate from USD to the display currency
1229
+ """
1230
+
1231
+
1232
+ class DisableAutoRechargeResponse(BaseModel):
1233
+ model_config = ConfigDict(
1234
+ extra="allow",
1235
+ populate_by_name=True,
1236
+ )
1237
+ success: Annotated[bool, Field(examples=[True])]
1238
+ """
1239
+ Whether auto-recharge was disabled
1240
+ """
1241
+
1242
+
1243
+ class GrantCustomerCreditsRequest(BaseModel):
1244
+ model_config = ConfigDict(
1245
+ extra="allow",
1246
+ populate_by_name=True,
1247
+ )
1248
+ credits: Annotated[int, Field(gt=0)]
1249
+ reason: Annotated[str | None, Field(max_length=256)] = None
1250
+
1251
+
1252
+ class GrantCustomerCreditsResponse(BaseModel):
1253
+ model_config = ConfigDict(
1254
+ extra="allow",
1255
+ populate_by_name=True,
1256
+ )
1257
+ balance: int | float
1258
+ """
1259
+ Customer credit balance after the grant
1260
+ """
1261
+ credits: int | float
1262
+ """
1263
+ Granted credit amount
1264
+ """
1265
+ customer_ref: Annotated[str, Field(alias="customerRef")]
1266
+ """
1267
+ Customer reference identifier
1268
+ """
1269
+ reason: str | None = None
1270
+ """
1271
+ Machine-readable grant reason
1272
+ """
1273
+ success: bool
1274
+ """
1275
+ Whether the grant was recorded
1276
+ """
1277
+
1278
+
1279
+ class LimitAutoRechargeDto(BaseModel):
1280
+ model_config = ConfigDict(
1281
+ extra="allow",
1282
+ populate_by_name=True,
1283
+ )
1284
+ enabled: bool
1285
+ """
1286
+ Whether auto-recharge is enabled for this provider
1287
+ """
1288
+ status: str | None = None
1289
+ """
1290
+ Stored auto-recharge status when a config exists
1291
+ """
1292
+
1293
+
1294
+ class LimitBalanceDto(BaseModel):
1295
+ model_config = ConfigDict(
1296
+ extra="allow",
1297
+ populate_by_name=True,
1298
+ )
1299
+ credit_balance: Annotated[int | float, Field(alias="creditBalance")]
1300
+ """
1301
+ Credit balance in credits (100 credits = 1 minor currency unit)
1302
+ """
1303
+ credits_per_minor_unit: Annotated[int | float | None, Field(alias="creditsPerMinorUnit")] = None
1304
+ """
1305
+ Credits per minor unit of `currency` (typically 100)
1306
+ """
1307
+ credits_per_unit: Annotated[int | float, Field(alias="creditsPerUnit")]
1308
+ """
1309
+ Credits deducted per metered item (wallet coverage: remainingUnits = balance / creditsPerUnit)
1310
+ """
1311
+ currency: str
1312
+ display_exchange_rate: Annotated[int | float | None, Field(alias="displayExchangeRate")] = None
1313
+ """
1314
+ USD → display-currency rate used with creditsPerMinorUnit
1315
+ """
1316
+ remaining_units: Annotated[int | float | None, Field(alias="remainingUnits")] = None
1317
+ """
1318
+ How many metered items the credit balance still covers (`balance / creditsPerUnit`)
1319
+ """
1320
+
1321
+
1322
+ class LimitPlanItemDto(BaseModel):
1323
+ model_config = ConfigDict(
1324
+ extra="allow",
1325
+ populate_by_name=True,
1326
+ )
1327
+ billing_cycle: Annotated[str | None, Field(alias="billingCycle")] = None
1328
+ """
1329
+ Derived billing cycle
1330
+ """
1331
+ checkout_url: Annotated[str | None, Field(alias="checkoutUrl")] = None
1332
+ """
1333
+ Deep link that opens hosted checkout with this plan preselected. Present only when a checkout session was minted for this response.
1334
+ """
1335
+ credits_per_unit: Annotated[int | float | None, Field(alias="creditsPerUnit", deprecated=True)] = None
1336
+ """
1337
+ Deprecated alias of perUnitChargeMinor. Same minor-units value — not credits. Prefer perUnitChargeMinor.
1338
+ """
1339
+ currency: str
1340
+ free_units: Annotated[int | float | None, Field(alias="freeUnits")] = None
1341
+ """
1342
+ Derived included allowance for the metered meter. `0` is the unlimited sentinel (`LimitOption.cap === 0`).
1343
+ """
1344
+ name: str | None = None
1345
+ options: list[dict[str, Any]] | None = None
1346
+ """
1347
+ Composable pricing options for this plan
1348
+ """
1349
+ per_unit_charge_minor: Annotated[int | float | None, Field(alias="perUnitChargeMinor")] = None
1350
+ """
1351
+ Per-request charge in minor currency units (usage-based plans)
1352
+ """
1353
+ price: int | float
1354
+ """
1355
+ Headline price in smallest currency unit (e.g. cents)
1356
+ """
1357
+ reference: str
1358
+ requires_payment: Annotated[bool, Field(alias="requiresPayment")]
1359
+ type: str
1360
+ """
1361
+ Derived plan type
1362
+ """
1363
+
1364
+
1365
+ class LimitProductBriefDto(BaseModel):
1366
+ model_config = ConfigDict(
1367
+ extra="allow",
1368
+ populate_by_name=True,
1369
+ )
1370
+ name: str | None = None
1371
+ reference: str
1372
+
1373
+
1374
+ class LimitResponse(BaseModel):
1375
+ model_config = ConfigDict(
1376
+ extra="allow",
1377
+ populate_by_name=True,
1378
+ )
1379
+ activation_required: Annotated[bool | None, Field(alias="activationRequired")] = None
1380
+ """
1381
+ True when the customer must activate a priced default plan before usage is allowed
1382
+ """
1383
+ auto_recharge: Annotated[LimitAutoRechargeDto | None, Field(alias="autoRecharge")] = None
1384
+ """
1385
+ Per-provider auto-recharge snapshot read off the customer document. Omitted when no config exists.
1386
+ """
1387
+ balance: LimitBalanceDto | None = None
1388
+ """
1389
+ Prepaid usage balance context when the default plan is usage-based
1390
+ """
1391
+ checkout_session_id: Annotated[
1392
+ str | None, Field(alias="checkoutSessionId", examples=["e3f1c2d4b6a89f001122334455667788"])
1393
+ ] = None
1394
+ """
1395
+ Checkout session ID if payment is required
1396
+ """
1397
+ checkout_url: Annotated[
1398
+ str | None,
1399
+ Field(
1400
+ alias="checkoutUrl",
1401
+ examples=["https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788"],
1402
+ ),
1403
+ ] = None
1404
+ """
1405
+ Checkout URL if payment is required
1406
+ """
1407
+ confirmation_url: Annotated[str | None, Field(alias="confirmationUrl")] = None
1408
+ """
1409
+ Customer portal confirmation URL when activation is required (fallback when not starting checkout)
1410
+ """
1411
+ credit_balance: Annotated[int | float | None, Field(alias="creditBalance")] = None
1412
+ """
1413
+ Credit balance in credits (100 credits = 1 minor currency unit), for pre-paid usage-based plans
1414
+ """
1415
+ credits_per_unit: Annotated[int | float | None, Field(alias="creditsPerUnit")] = None
1416
+ """
1417
+ Credits deducted per metered item (for prepaid usage-based plans)
1418
+ """
1419
+ currency: str | None = None
1420
+ """
1421
+ ISO 4217 currency code for credit fields
1422
+ """
1423
+ limit: int | float | None = None
1424
+ """
1425
+ The effective finite cap for this meter. Present only when the backend measured a finite cap.
1426
+ """
1427
+ meter_name: Annotated[str | None, Field(alias="meterName", examples=["requests"])] = None
1428
+ """
1429
+ The meter name to use when tracking usage events
1430
+ """
1431
+ needs_top_up: Annotated[bool | None, Field(alias="needsTopUp")] = None
1432
+ """
1433
+ Access is blocked until prepaid credits cover the next unit — past an included cap with `onExceed: draw_credits`, or from the first unit on a recurring meter with no limit.
1434
+ """
1435
+ overage: bool | None = None
1436
+ """
1437
+ Access is granted past the included cap and the usage is paid from prepaid credits — `onExceed: draw_credits`.
1438
+ """
1439
+ paywall_reason: Annotated[
1440
+ Literal["activation_required", "topup_required", "payment_required", "limit_reached"]
1441
+ | None,
1442
+ Field(alias="paywallReason"),
1443
+ ] = None
1444
+ """
1445
+ Authoritative paywall classification shared with Managed MCP. Present on denial responses only.
1446
+ """
1447
+ plan_name: Annotated[str | None, Field(alias="planName")] = None
1448
+ """
1449
+ Display name of the active or default plan
1450
+ """
1451
+ plan_ref: Annotated[str | None, Field(alias="planRef")] = None
1452
+ """
1453
+ Active plan reference when the customer already holds a purchase
1454
+ """
1455
+ plans: list[LimitPlanItemDto] | None = None
1456
+ """
1457
+ Active plans on the product available for activation or checkout
1458
+ """
1459
+ product: LimitProductBriefDto | None = None
1460
+ """
1461
+ Product the limit check applies to
1462
+ """
1463
+ purchase_ref: Annotated[str | None, Field(alias="purchaseRef")] = None
1464
+ """
1465
+ Active purchase reference when the customer already holds a purchase
1466
+ """
1467
+ remaining: Annotated[int | float, Field(examples=[997])]
1468
+ """
1469
+ Remaining usage units before hitting the limit. `-1` means unlimited (no finite cap).
1470
+ """
1471
+ used: int | float | None = None
1472
+ """
1473
+ Consumed usage units this period. Present only when the backend measured a finite cap.
1474
+ """
1475
+ within_limits: Annotated[bool, Field(alias="withinLimits", examples=[True])]
1476
+ """
1477
+ Whether the customer is within their usage limits
1478
+ """
1479
+
1480
+
1481
+ class Options18(BaseModel):
1482
+ model_config = ConfigDict(
1483
+ extra="allow",
1484
+ populate_by_name=True,
1485
+ )
1486
+ amount_minor: Annotated[int, Field(alias="amountMinor", ge=0)]
1487
+ currency: str
1488
+ kind: Literal["charge"]
1489
+ label: str | None = None
1490
+ meter: Annotated[str | None, Field(min_length=1)] = None
1491
+ one_time: Annotated[bool | None, Field(alias="oneTime")] = None
1492
+ per: Literal["unit", "seat", "flat"]
1493
+
1494
+
1495
+ class Options19(BaseModel):
1496
+ model_config = ConfigDict(
1497
+ extra="allow",
1498
+ populate_by_name=True,
1499
+ )
1500
+ anchor: str | None = None
1501
+ count: Annotated[int | None, Field(ge=1)] = None
1502
+ interval: Literal["week", "month", "year"]
1503
+ kind: Literal["billingCycle"]
1504
+
1505
+
1506
+ class Options20(BaseModel):
1507
+ model_config = ConfigDict(
1508
+ extra="allow",
1509
+ populate_by_name=True,
1510
+ )
1511
+ charge: Charge
1512
+ from_: Annotated[int, Field(alias="from", ge=0)]
1513
+ kind: Literal["tier"]
1514
+ label: str | None = None
1515
+ mode: Literal["graduated", "volume"]
1516
+ to: Annotated[int | None, Field(ge=0)]
1517
+
1518
+
1519
+ class Options21(BaseModel):
1520
+ model_config = ConfigDict(
1521
+ extra="allow",
1522
+ populate_by_name=True,
1523
+ )
1524
+ cap: Annotated[int, Field(ge=0)]
1525
+ kind: Literal["limit"]
1526
+ label: str | None = None
1527
+ meter: Annotated[str, Field(min_length=1)]
1528
+ on_exceed: Annotated[Literal["block", "draw_credits"], Field(alias="onExceed")]
1529
+ scope: Literal["billing_period", "lifetime", "rolling_window"]
1530
+ window_days: Annotated[int | None, Field(alias="windowDays", ge=1)] = None
1531
+
1532
+
1533
+ class Options22(BaseModel):
1534
+ model_config = ConfigDict(
1535
+ extra="allow",
1536
+ populate_by_name=True,
1537
+ )
1538
+ feature: Annotated[str, Field(min_length=1)]
1539
+ kind: Literal["entitlement"]
1540
+ label: str | None = None
1541
+ scope: str | None = None
1542
+ value: bool | int | float | str
1543
+
1544
+
1545
+ class Options23(BaseModel):
1546
+ model_config = ConfigDict(
1547
+ extra="allow",
1548
+ populate_by_name=True,
1549
+ )
1550
+ days: Annotated[int, Field(ge=1)]
1551
+ kind: Literal["trial"]
1552
+ label: str | None = None
1553
+ on_end: Annotated[Literal["convert", "cancel"], Field(alias="onEnd")]
1554
+
1555
+
1556
+ class Options24(BaseModel):
1557
+ model_config = ConfigDict(
1558
+ extra="allow",
1559
+ populate_by_name=True,
1560
+ )
1561
+ applies_to: Annotated[
1562
+ Literal["recurring", "setup", "usage", "all"] | None, Field(alias="appliesTo")
1563
+ ] = None
1564
+ currency: str | None = None
1565
+ cycles: Annotated[int | None, Field(ge=1)] = None
1566
+ duration: Literal["once", "repeating", "forever"]
1567
+ kind: Literal["discount"]
1568
+ label: str | None = None
1569
+ mode: Literal["percentage", "fixed"]
1570
+ value: Annotated[int, Field(gt=0)]
1571
+
1572
+
1573
+ class Options25(BaseModel):
1574
+ model_config = ConfigDict(
1575
+ extra="allow",
1576
+ populate_by_name=True,
1577
+ )
1578
+ kind: Literal["autoAssigned"]
1579
+ label: str | None = None
1580
+
1581
+
1582
+ class Options26(BaseModel):
1583
+ model_config = ConfigDict(
1584
+ extra="allow",
1585
+ populate_by_name=True,
1586
+ )
1587
+ kind: Literal["hidden"]
1588
+ label: str | None = None
1589
+
1590
+
1591
+ class Plan1(BaseModel):
1592
+ model_config = ConfigDict(
1593
+ extra="allow",
1594
+ populate_by_name=True,
1595
+ )
1596
+ currency: Annotated[str | None, Field(max_length=3, min_length=3)] = None
1597
+ features: dict[str, Any] | None = None
1598
+ key: Annotated[str, Field(min_length=1)]
1599
+ name: Annotated[str, Field(min_length=1)]
1600
+ options: list[
1601
+ Options18
1602
+ | Options19
1603
+ | Options20
1604
+ | Options21
1605
+ | Options22
1606
+ | Options23
1607
+ | Options24
1608
+ | Options25
1609
+ | Options26
1610
+ ]
1611
+
1612
+
1613
+ class Tool(BaseModel):
1614
+ model_config = ConfigDict(
1615
+ extra="allow",
1616
+ populate_by_name=True,
1617
+ )
1618
+ description: str | None = None
1619
+ name: Annotated[str, Field(min_length=1)]
1620
+ no_plan: Annotated[bool | None, Field(alias="noPlan")] = None
1621
+ plan_keys: Annotated[list[str] | None, Field(alias="planKeys")] = None
1622
+
1623
+
1624
+ class McpBootstrapDto(BaseModel):
1625
+ model_config = ConfigDict(
1626
+ extra="allow",
1627
+ populate_by_name=True,
1628
+ )
1629
+ auth_api_key: Annotated[str | None, Field(alias="authApiKey")] = None
1630
+ auth_header_name: Annotated[
1631
+ str | None,
1632
+ Field(
1633
+ alias="authHeaderName",
1634
+ max_length=64,
1635
+ min_length=1,
1636
+ pattern="^[A-Za-z0-9!#$%&'*+\\-.^_`|~]+$",
1637
+ ),
1638
+ ] = None
1639
+ description: str | None = None
1640
+ image_url: Annotated[str | None, Field(alias="imageUrl")] = None
1641
+ mcp_domain: Annotated[str | None, Field(alias="mcpDomain")] = None
1642
+ metadata: dict[str, Any] | None = None
1643
+ name: str | None = None
1644
+ origin_url: Annotated[str, Field(alias="originUrl")]
1645
+ plans: list[Plan1] | None = None
1646
+ product_type: Annotated[str | None, Field(alias="productType")] = None
1647
+ tools: list[Tool] | None = None
1648
+
1649
+
1650
+ class AutoMappedTool(BaseModel):
1651
+ model_config = ConfigDict(
1652
+ extra="allow",
1653
+ populate_by_name=True,
1654
+ )
1655
+ description: str | None = None
1656
+ name: str | None = None
1657
+
1658
+
1659
+ class OneTimePurchaseInfo(BaseModel):
1660
+ model_config = ConfigDict(
1661
+ extra="allow",
1662
+ populate_by_name=True,
1663
+ )
1664
+ amount: Annotated[int | float, Field(examples=[9900])]
1665
+ """
1666
+ Amount in USD cents (normalised for aggregation)
1667
+ """
1668
+ completed_at: Annotated[str, Field(alias="completedAt", examples=["2025-10-27T10:00:00Z"])]
1669
+ """
1670
+ When the one-time purchase was completed
1671
+ """
1672
+ created_at: Annotated[str, Field(alias="createdAt")]
1673
+ """
1674
+ Created at
1675
+ """
1676
+ currency: Annotated[str, Field(examples=["USD"])]
1677
+ """
1678
+ ISO 4217 currency code of the customer-facing charge
1679
+ """
1680
+ customer_ref: Annotated[str, Field(alias="customerRef", examples=["cus_3C4D5E6F"])]
1681
+ """
1682
+ Customer reference
1683
+ """
1684
+ product_ref: Annotated[str | None, Field(alias="productRef", examples=["prd_abc123"])] = None
1685
+ """
1686
+ Product reference
1687
+ """
1688
+ reference: Annotated[str, Field(examples=["pur_1A2B3C4D"])]
1689
+ """
1690
+ Purchase reference
1691
+ """
1692
+
1693
+
1694
+ class Plan2(BaseModel):
1695
+ model_config = ConfigDict(
1696
+ extra="allow",
1697
+ populate_by_name=True,
1698
+ )
1699
+ access_expiry_days: Annotated[int | float | None, Field(alias="accessExpiryDays")] = None
1700
+ """
1701
+ Access expiry in days
1702
+ """
1703
+ created_at: Annotated[str, Field(alias="createdAt")]
1704
+ """
1705
+ Creation timestamp
1706
+ """
1707
+ currency: Annotated[str | None, Field(examples=["USD"])] = None
1708
+ """
1709
+ Currency code (ISO 4217)
1710
+ """
1711
+ currency_symbol: Annotated[str | None, Field(alias="currencySymbol", examples=["$"])] = None
1712
+ """
1713
+ Currency symbol (derived from currency)
1714
+ """
1715
+ description: Annotated[str | None, Field(examples=["Best for teams getting started"])] = None
1716
+ """
1717
+ Plan description
1718
+ """
1719
+ features: dict[str, Any] | None = None
1720
+ """
1721
+ Plan features
1722
+ """
1723
+ is_active: Annotated[bool, Field(alias="isActive", examples=[True])]
1724
+ """
1725
+ Whether the plan is active (derived from status)
1726
+ """
1727
+ max_active_users: Annotated[int | float | None, Field(alias="maxActiveUsers")] = None
1728
+ """
1729
+ Maximum number of active users
1730
+ """
1731
+ name: Annotated[str | None, Field(examples=["Starter"])] = None
1732
+ """
1733
+ Plan name
1734
+ """
1735
+ options: list[dict[str, Any]]
1736
+ """
1737
+ Composable pricing options (money as integer minor units)
1738
+ """
1739
+ price: Annotated[int | float | None, Field(examples=[2999])] = None
1740
+ """
1741
+ Derived headline price in minor units (the base or one-time charge)
1742
+ """
1743
+ reference: Annotated[str, Field(examples=["pln_1A2B3C4D"])]
1744
+ """
1745
+ Plan reference
1746
+ """
1747
+ requires_payment: Annotated[bool | None, Field(alias="requiresPayment", examples=[True])] = None
1748
+ """
1749
+ Whether payment is required
1750
+ """
1751
+ status: Annotated[str, Field(examples=["active"])]
1752
+ """
1753
+ Plan status
1754
+ """
1755
+ type: Annotated[
1756
+ Literal["recurring", "one-time", "usage-based", "hybrid"], Field(examples=["recurring"])
1757
+ ]
1758
+ """
1759
+ Derived plan type (read from options)
1760
+ """
1761
+ updated_at: Annotated[str, Field(alias="updatedAt")]
1762
+ """
1763
+ Last update timestamp
1764
+ """
1765
+
1766
+
1767
+ class ProcessPaymentCancelled(BaseModel):
1768
+ model_config = ConfigDict(
1769
+ extra="allow",
1770
+ populate_by_name=True,
1771
+ )
1772
+ status: Annotated[Literal["cancelled"], Field(examples=["cancelled"])]
1773
+
1774
+
1775
+ class ProcessPaymentFailed(BaseModel):
1776
+ model_config = ConfigDict(
1777
+ extra="allow",
1778
+ populate_by_name=True,
1779
+ )
1780
+ status: Annotated[Literal["failed"], Field(examples=["failed"])]
1781
+
1782
+
1783
+ class ProcessPaymentIntentDto(BaseModel):
1784
+ model_config = ConfigDict(
1785
+ extra="allow",
1786
+ populate_by_name=True,
1787
+ )
1788
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
1789
+ plan_ref: Annotated[str | None, Field(alias="planRef", max_length=20)] = None
1790
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20, min_length=1)] = (
1791
+ None
1792
+ )
1793
+
1794
+
1795
+ class ProcessPaymentProcessing(BaseModel):
1796
+ model_config = ConfigDict(
1797
+ extra="allow",
1798
+ populate_by_name=True,
1799
+ )
1800
+ status: Annotated[Literal["processing"], Field(examples=["processing"])]
1801
+
1802
+
1803
+ class ProcessPaymentSucceededBare(BaseModel):
1804
+ model_config = ConfigDict(
1805
+ extra="allow",
1806
+ populate_by_name=True,
1807
+ )
1808
+ status: Annotated[Literal["succeeded"], Field(examples=["succeeded"])]
1809
+
1810
+
1811
+ class ProcessPaymentSucceededOneTime(BaseModel):
1812
+ model_config = ConfigDict(
1813
+ extra="allow",
1814
+ populate_by_name=True,
1815
+ )
1816
+ one_time_purchase: Annotated[OneTimePurchaseInfo, Field(alias="oneTimePurchase")]
1817
+ status: Annotated[Literal["succeeded"], Field(examples=["succeeded"])]
1818
+ type: Annotated[Literal["one-time"], Field(examples=["one-time"])]
1819
+
1820
+
1821
+ class ProcessPaymentTimeout(BaseModel):
1822
+ model_config = ConfigDict(
1823
+ extra="allow",
1824
+ populate_by_name=True,
1825
+ )
1826
+ message: str | None = None
1827
+ """
1828
+ Detail message describing the timeout
1829
+ """
1830
+ status: Annotated[Literal["timeout"], Field(examples=["timeout"])]
1831
+
1832
+
1833
+ class ProductConfigDto(BaseModel):
1834
+ model_config = ConfigDict(
1835
+ extra="allow",
1836
+ populate_by_name=True,
1837
+ )
1838
+ delivery_method: Annotated[str | None, Field(alias="deliveryMethod", examples=["api"])] = None
1839
+ """
1840
+ Delivery method
1841
+ """
1842
+ fulfillment_type: Annotated[
1843
+ str | None, Field(alias="fulfillmentType", examples=["digital"])
1844
+ ] = None
1845
+ """
1846
+ Fulfillment type
1847
+ """
1848
+ validity_period: Annotated[int | float | None, Field(alias="validityPeriod", examples=[30])] = None
1849
+ """
1850
+ Validity period in days
1851
+ """
1852
+
1853
+
1854
+ class PutAutoRechargeSdkDto(BaseModel):
1855
+ model_config = ConfigDict(
1856
+ extra="allow",
1857
+ populate_by_name=True,
1858
+ )
1859
+ currency: str
1860
+ customer_email: Annotated[str | None, Field(alias="customerEmail")] = None
1861
+ customer_name: Annotated[str | None, Field(alias="customerName")] = None
1862
+ customer_ref: Annotated[str, Field(alias="customerRef", min_length=1)]
1863
+ defer_setup_intent: Annotated[bool | None, Field(alias="deferSetupIntent")] = None
1864
+ enabled: bool
1865
+ max_monthly_spend_major: Annotated[
1866
+ int | float | None, Field(alias="maxMonthlySpendMajor", gt=0.0, le=10000.0)
1867
+ ] = None
1868
+ threshold_amount_major: Annotated[
1869
+ int | float | None, Field(alias="thresholdAmountMajor", gt=0.0, le=10000.0)
1870
+ ] = None
1871
+ topup_amount_major: Annotated[
1872
+ int | float | None, Field(alias="topupAmountMajor", gt=0.0, le=10000.0)
1873
+ ] = None
1874
+ trigger_type: Annotated[Literal["balance"], Field(alias="triggerType")]
1875
+
1876
+
1877
+ class Event1(BaseModel):
1878
+ model_config = ConfigDict(
1879
+ extra="allow",
1880
+ populate_by_name=True,
1881
+ )
1882
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
1883
+ meter_name: Annotated[str, Field(alias="meterName", min_length=1)]
1884
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20)] = None
1885
+ properties: dict[str, Any] | None = None
1886
+ timestamp: str | None = None
1887
+ value: int | float | None = None
1888
+
1889
+
1890
+ class RecordBulkMeterEventsZodDto(BaseModel):
1891
+ model_config = ConfigDict(
1892
+ extra="allow",
1893
+ populate_by_name=True,
1894
+ )
1895
+ events: Annotated[list[Event1], Field(min_length=1)]
1896
+
1897
+
1898
+ class RecordMeterEventZodDto(BaseModel):
1899
+ model_config = ConfigDict(
1900
+ extra="allow",
1901
+ populate_by_name=True,
1902
+ )
1903
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
1904
+ meter_name: Annotated[str, Field(alias="meterName", min_length=1)]
1905
+ product_ref: Annotated[str | None, Field(alias="productRef", max_length=20)] = None
1906
+ properties: dict[str, Any] | None = None
1907
+ timestamp: str | None = None
1908
+ value: int | float | None = None
1909
+
1910
+
1911
+ class SdkMerchantResponseDto(BaseModel):
1912
+ model_config = ConfigDict(
1913
+ extra="allow",
1914
+ populate_by_name=True,
1915
+ )
1916
+ city: Annotated[str | None, Field(examples=["London"])] = None
1917
+ """
1918
+ City from the legal entity address
1919
+ """
1920
+ company_number: Annotated[str | None, Field(alias="companyNumber", examples=["HRB12345"])] = (
1921
+ None
1922
+ )
1923
+ """
1924
+ Company registration number (EIN, Companies House No, Org No)
1925
+ """
1926
+ country: Annotated[str | None, Field(examples=["US"])] = None
1927
+ """
1928
+ ISO-3166 alpha-2 country code of the merchant
1929
+ """
1930
+ default_currency: Annotated[str | None, Field(alias="defaultCurrency", examples=["usd"])] = None
1931
+ """
1932
+ ISO-4217 default settlement currency
1933
+ """
1934
+ display_name: Annotated[str, Field(alias="displayName", examples=["Acme"])]
1935
+ """
1936
+ Brand name shown in UI
1937
+ """
1938
+ icon_url: Annotated[
1939
+ str | None, Field(alias="iconUrl", examples=["https://cdn.acme.com/icon.png"])
1940
+ ] = None
1941
+ """
1942
+ Absolute URL to the square app icon / logomark. Consumed by MCP host chromes, mobile avatar slots, and any surface where the landscape `logoUrl` would need letterboxing.
1943
+ """
1944
+ legal_name: Annotated[str, Field(alias="legalName", examples=["Acme Inc."])]
1945
+ """
1946
+ Legal entity name used in SCA mandate copy
1947
+ """
1948
+ logo_url: Annotated[
1949
+ str | None, Field(alias="logoUrl", examples=["https://cdn.acme.com/logo.png"])
1950
+ ] = None
1951
+ """
1952
+ Absolute URL to the merchant logo
1953
+ """
1954
+ privacy_url: Annotated[
1955
+ str | None, Field(alias="privacyUrl", examples=["https://acme.com/privacy"])
1956
+ ] = None
1957
+ state_or_county: Annotated[
1958
+ str | None, Field(alias="stateOrCounty", examples=["Greater London"])
1959
+ ] = None
1960
+ """
1961
+ State, county, or region from the legal entity address. Free text — values like "Greater London" are valid.
1962
+ """
1963
+ statement_descriptor: Annotated[
1964
+ str | None, Field(alias="statementDescriptor", examples=["ACME INC"])
1965
+ ] = None
1966
+ """
1967
+ Descriptor appearing on the customer card statement
1968
+ """
1969
+ support_email: Annotated[
1970
+ str | None, Field(alias="supportEmail", examples=["support@acme.com"])
1971
+ ] = None
1972
+ support_url: Annotated[
1973
+ str | None, Field(alias="supportUrl", examples=["https://acme.com/support"])
1974
+ ] = None
1975
+ supported_topup_currencies: Annotated[
1976
+ list[str] | None, Field(alias="supportedTopupCurrencies", examples=[["USD", "EUR", "GBP"]])
1977
+ ] = None
1978
+ """
1979
+ Full set of currencies a customer may pay credit topups in, including the default currency. Omitted/single-entry means single-currency behavior.
1980
+ """
1981
+ tax_id: Annotated[str | None, Field(alias="taxId", examples=["12-3456789"])] = None
1982
+ """
1983
+ Tax identification number (US: EIN)
1984
+ """
1985
+ terms_url: Annotated[
1986
+ str | None, Field(alias="termsUrl", examples=["https://acme.com/terms"])
1987
+ ] = None
1988
+ vat_number: Annotated[str | None, Field(alias="vatNumber", examples=["DE123456789"])] = None
1989
+ """
1990
+ VAT identification number (UK/EU)
1991
+ """
1992
+ website_url: Annotated[str | None, Field(alias="websiteUrl", examples=["https://acme.com"])] = (
1993
+ None
1994
+ )
1995
+ """
1996
+ Merchant public website. Distinct from supportUrl so the same URL is not emitted twice.
1997
+ """
1998
+
1999
+
2000
+ class SdkPaymentIntentListItem(BaseModel):
2001
+ model_config = ConfigDict(
2002
+ extra="allow",
2003
+ populate_by_name=True,
2004
+ )
2005
+ amount: Annotated[int | float, Field(examples=[4999])]
2006
+ """
2007
+ Amount in USD minor units (ledger/normalised); `currency` is the presentment currency
2008
+ """
2009
+ client_secret: Annotated[
2010
+ str | None, Field(alias="clientSecret", examples=["pi_1a2b3c4d5e6f7g8h_secret_xxx"])
2011
+ ] = None
2012
+ """
2013
+ Client secret used to confirm the payment on the client
2014
+ """
2015
+ created_at: Annotated[
2016
+ str | None, Field(alias="createdAt", examples=["2025-10-11T10:30:00.000Z"])
2017
+ ] = None
2018
+ """
2019
+ Creation timestamp
2020
+ """
2021
+ currency: Annotated[str, Field(examples=["usd"])]
2022
+ """
2023
+ ISO 4217 presentment (charge) currency code
2024
+ """
2025
+ plan_ref: Annotated[str | None, Field(alias="planRef", examples=["pln_2b3c4d5e6f7g"])] = None
2026
+ """
2027
+ Plan reference
2028
+ """
2029
+ processor_payment_id: Annotated[
2030
+ str, Field(alias="processorPaymentId", examples=["pi_1a2b3c4d5e6f7g8h"])
2031
+ ]
2032
+ """
2033
+ Payment processor payment intent ID
2034
+ """
2035
+ status: Annotated[
2036
+ Literal[
2037
+ "pending",
2038
+ "requires_payment_method",
2039
+ "requires_confirmation",
2040
+ "requires_action",
2041
+ "processing",
2042
+ "succeeded",
2043
+ "failed",
2044
+ "cancelled",
2045
+ ],
2046
+ Field(examples=["succeeded"]),
2047
+ ]
2048
+ """
2049
+ Payment intent status
2050
+ """
2051
+
2052
+
2053
+ class SdkPaymentIntentListResponse(BaseModel):
2054
+ model_config = ConfigDict(
2055
+ extra="allow",
2056
+ populate_by_name=True,
2057
+ )
2058
+ payment_intents: Annotated[list[SdkPaymentIntentListItem], Field(alias="paymentIntents")]
2059
+ total: Annotated[int | float, Field(examples=[1])]
2060
+ """
2061
+ Number of payment intents returned
2062
+ """
2063
+
2064
+
2065
+ class SdkPaymentIntentResponse(BaseModel):
2066
+ model_config = ConfigDict(
2067
+ extra="allow",
2068
+ populate_by_name=True,
2069
+ )
2070
+ account_id: Annotated[str | None, Field(alias="accountId", examples=["acct_1A2B3C4D"])] = None
2071
+ """
2072
+ Connected Stripe account ID (only present on create)
2073
+ """
2074
+ amount: Annotated[int | float, Field(examples=[4999])]
2075
+ """
2076
+ Amount in USD minor units (ledger/normalised). The charge-currency amount is `originalAmount` paired with `currency`.
2077
+ """
2078
+ client_secret: Annotated[
2079
+ str, Field(alias="clientSecret", examples=["pi_1a2b3c4d5e6f7g8h_secret_AbCdEf123456"])
2080
+ ]
2081
+ """
2082
+ Client secret used to confirm the payment on the client
2083
+ """
2084
+ created_at: Annotated[
2085
+ str | None, Field(alias="createdAt", examples=["2025-10-18T10:30:00.000Z"])
2086
+ ] = None
2087
+ """
2088
+ Creation timestamp
2089
+ """
2090
+ currency: Annotated[str, Field(examples=["usd"])]
2091
+ """
2092
+ ISO 4217 presentment (charge) currency code — pairs with `originalAmount`
2093
+ """
2094
+ customer_ref: Annotated[
2095
+ str | None, Field(alias="customerRef", examples=["cus_3c4d5e6f7g8h"])
2096
+ ] = None
2097
+ """
2098
+ Customer reference
2099
+ """
2100
+ exchange_rate: Annotated[int | float | None, Field(alias="exchangeRate", examples=[1])] = None
2101
+ """
2102
+ Exchange rate applied to convert to USD
2103
+ """
2104
+ expires_at: Annotated[
2105
+ str | None, Field(alias="expiresAt", examples=["2025-10-19T10:30:00.000Z"])
2106
+ ] = None
2107
+ """
2108
+ Expiry timestamp of the payment intent
2109
+ """
2110
+ original_amount: Annotated[int | float | None, Field(alias="originalAmount", examples=[4999])] = None
2111
+ """
2112
+ Charge-currency amount in minor units (the currency the customer is billed in)
2113
+ """
2114
+ plan_ref: Annotated[str | None, Field(alias="planRef", examples=["pln_2b3c4d5e6f7g"])] = None
2115
+ """
2116
+ Plan reference
2117
+ """
2118
+ processor_payment_id: Annotated[
2119
+ str, Field(alias="processorPaymentId", examples=["pi_1a2b3c4d5e6f7g8h"])
2120
+ ]
2121
+ """
2122
+ Payment processor payment intent ID
2123
+ """
2124
+ publishable_key: Annotated[str, Field(alias="publishableKey", examples=["pk_test_..."])]
2125
+ """
2126
+ Stripe publishable key for the environment
2127
+ """
2128
+ status: Annotated[
2129
+ Literal[
2130
+ "pending",
2131
+ "requires_payment_method",
2132
+ "requires_confirmation",
2133
+ "requires_action",
2134
+ "processing",
2135
+ "succeeded",
2136
+ "failed",
2137
+ "cancelled",
2138
+ ],
2139
+ Field(examples=["requires_payment_method"]),
2140
+ ]
2141
+ """
2142
+ Payment intent status
2143
+ """
2144
+ transaction_id: Annotated[
2145
+ str | None, Field(alias="transactionId", examples=["507f1f77bcf86cd799439011"])
2146
+ ] = None
2147
+ """
2148
+ Ledger transaction ID
2149
+ """
2150
+
2151
+
2152
+ class SdkPlanResponse(BaseModel):
2153
+ model_config = ConfigDict(
2154
+ extra="allow",
2155
+ populate_by_name=True,
2156
+ )
2157
+ created_at: Annotated[str, Field(alias="createdAt")]
2158
+ """
2159
+ Creation timestamp
2160
+ """
2161
+ currency: Annotated[str, Field(examples=["USD"])]
2162
+ """
2163
+ Currency code (ISO 4217)
2164
+ """
2165
+ currency_symbol: Annotated[str | None, Field(alias="currencySymbol", examples=["$"])] = None
2166
+ """
2167
+ Currency symbol
2168
+ """
2169
+ description: Annotated[str | None, Field(examples=["Best for teams getting started"])] = None
2170
+ """
2171
+ Plan description
2172
+ """
2173
+ features: dict[str, Any] | None = None
2174
+ """
2175
+ Plan features
2176
+ """
2177
+ is_active: Annotated[bool, Field(alias="isActive", examples=[True])]
2178
+ """
2179
+ Whether the plan is active
2180
+ """
2181
+ name: Annotated[str | None, Field(examples=["Starter"])] = None
2182
+ """
2183
+ Plan name
2184
+ """
2185
+ options: list[dict[str, Any]]
2186
+ """
2187
+ Composable pricing options (money as integer minor units)
2188
+ """
2189
+ price: Annotated[int | float | None, Field(examples=[2999])] = None
2190
+ """
2191
+ Derived headline price in minor units (base or one-time charge)
2192
+ """
2193
+ reference: Annotated[str, Field(examples=["pln_1A2B3C4D"])]
2194
+ """
2195
+ Plan reference
2196
+ """
2197
+ requires_payment: Annotated[bool, Field(alias="requiresPayment", examples=[True])]
2198
+ """
2199
+ Whether payment is required
2200
+ """
2201
+ status: Annotated[str, Field(examples=["active"])]
2202
+ """
2203
+ Plan status
2204
+ """
2205
+ type: Annotated[
2206
+ Literal["recurring", "one-time", "usage-based", "hybrid"], Field(examples=["recurring"])
2207
+ ]
2208
+ """
2209
+ Derived plan type (read from options)
2210
+ """
2211
+ updated_at: Annotated[str, Field(alias="updatedAt")]
2212
+ """
2213
+ Last update timestamp
2214
+ """
2215
+
2216
+
2217
+ class SdkPlanSnapshotDto(BaseModel):
2218
+ model_config = ConfigDict(
2219
+ extra="allow",
2220
+ populate_by_name=True,
2221
+ )
2222
+ currency: Annotated[str, Field(examples=["USD"])]
2223
+ """
2224
+ Currency code
2225
+ """
2226
+ features: dict[str, Any] | None = None
2227
+ """
2228
+ Plan features
2229
+ """
2230
+ is_metered: Annotated[bool | None, Field(alias="isMetered", examples=[True])] = None
2231
+ """
2232
+ Whether the frozen plan counts usage (prices per unit, or has a limit). Shipped clients read this to show an allowance.
2233
+ """
2234
+ name: Annotated[str | None, Field(examples=["Pro Monthly"])] = None
2235
+ """
2236
+ Plan name captured at purchase time
2237
+ """
2238
+ options: list[dict[str, Any]] | None = None
2239
+ """
2240
+ Frozen composable pricing options captured at purchase time
2241
+ """
2242
+ price: Annotated[int | float, Field(examples=[2999])]
2243
+ """
2244
+ Headline plan price in minor units (e.g. cents)
2245
+ """
2246
+ reference: Annotated[str | None, Field(examples=["pln_1A2B3C4D"])] = None
2247
+ """
2248
+ Plan reference
2249
+ """
2250
+
2251
+
2252
+ class SdkPlatformConfigResponseDto(BaseModel):
2253
+ model_config = ConfigDict(
2254
+ extra="allow",
2255
+ populate_by_name=True,
2256
+ )
2257
+ stripe_publishable_key: Annotated[
2258
+ str | None, Field(alias="stripePublishableKey", examples=["pk_test_..."])
2259
+ ] = None
2260
+ """
2261
+ SolvaPay's platform Stripe publishable key for the authenticated provider's environment. Safe to expose browser-side; paired with the connected `accountId` returned from `create-payment-intent` for Stripe Connect direct charges. Omitted when not configured so callers can fall back cleanly to a hosted flow.
2262
+ """
2263
+
2264
+
2265
+ class SdkProductResponse(BaseModel):
2266
+ model_config = ConfigDict(
2267
+ extra="allow",
2268
+ populate_by_name=True,
2269
+ )
2270
+ balance: Annotated[int | float, Field(examples=[0])]
2271
+ """
2272
+ Product balance in cents
2273
+ """
2274
+ config: ProductConfigDto | None = None
2275
+ """
2276
+ Product-specific configuration
2277
+ """
2278
+ created_at: Annotated[str, Field(alias="createdAt")]
2279
+ """
2280
+ Creation timestamp
2281
+ """
2282
+ description: str | None = None
2283
+ """
2284
+ Product description
2285
+ """
2286
+ image_url: Annotated[str | None, Field(alias="imageUrl")] = None
2287
+ """
2288
+ URL to the product image
2289
+ """
2290
+ is_managed_mcp: Annotated[bool, Field(alias="isManagedMcp", examples=[False])]
2291
+ """
2292
+ Whether this product uses the Managed MCP integration (SolvaPay reverse proxy)
2293
+ """
2294
+ is_mcp_pay: Annotated[bool, Field(alias="isMcpPay", deprecated=True, examples=[False])]
2295
+ """
2296
+ Deprecated alias of isManagedMcp. Prefer isManagedMcp; still emitted for wire compatibility.
2297
+ """
2298
+ mcp: Annotated[
2299
+ dict[str, Any] | None,
2300
+ Field(
2301
+ examples=[
2302
+ {
2303
+ "defaultPlanRef": "pln_FREE123",
2304
+ "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
2305
+ "mcpServerRef": "mcp_ABC123",
2306
+ "mcpSubdomain": "acme-docs",
2307
+ "originUrl": "https://origin.example.com/mcp",
2308
+ }
2309
+ ]
2310
+ ),
2311
+ ] = None
2312
+ """
2313
+ MCP linkage details for MCP-enabled products
2314
+ """
2315
+ metadata: dict[str, Any] | None = None
2316
+ """
2317
+ Arbitrary key-value metadata
2318
+ """
2319
+ name: Annotated[str, Field(examples=["AI Writing Assistant"])]
2320
+ """
2321
+ Product name
2322
+ """
2323
+ plans: list[SdkPlanResponse] | None = None
2324
+ """
2325
+ Plans associated with this product
2326
+ """
2327
+ product_type: Annotated[str | None, Field(alias="productType")] = None
2328
+ """
2329
+ Free-form product type
2330
+ """
2331
+ reference: Annotated[str, Field(examples=["prd_1A2B3C4D"])]
2332
+ """
2333
+ Product reference
2334
+ """
2335
+ status: Annotated[str, Field(examples=["active"])]
2336
+ """
2337
+ Product status
2338
+ """
2339
+ total_transactions: Annotated[int | float, Field(alias="totalTransactions", examples=[0])]
2340
+ """
2341
+ Total number of transactions
2342
+ """
2343
+ updated_at: Annotated[str, Field(alias="updatedAt")]
2344
+ """
2345
+ Last update timestamp
2346
+ """
2347
+
2348
+
2349
+ class SdkUsagePeriodDto(BaseModel):
2350
+ model_config = ConfigDict(
2351
+ extra="allow",
2352
+ populate_by_name=True,
2353
+ )
2354
+ period_end: Annotated[
2355
+ str | None, Field(alias="periodEnd", examples=["2025-11-01T00:00:00Z"])
2356
+ ] = None
2357
+ """
2358
+ Billing period of the active usage window; counts come from `/v1/sdk/limits`
2359
+ """
2360
+ period_start: Annotated[
2361
+ str | None, Field(alias="periodStart", examples=["2025-10-01T00:00:00Z"])
2362
+ ] = None
2363
+ """
2364
+ Billing period of the active usage window; counts come from `/v1/sdk/limits`
2365
+ """
2366
+
2367
+
2368
+ class TaxBreakdownDto(BaseModel):
2369
+ model_config = ConfigDict(
2370
+ extra="allow",
2371
+ populate_by_name=True,
2372
+ )
2373
+ currency: str
2374
+ """
2375
+ ISO 4217 currency code
2376
+ """
2377
+ inclusive: bool
2378
+ """
2379
+ Whether tax is included in the listed price
2380
+ """
2381
+ not_registered: Annotated[bool | None, Field(alias="notRegistered")] = None
2382
+ """
2383
+ True when Stripe reports taxability_reason not_collecting (no registration)
2384
+ """
2385
+ subtotal: int | float
2386
+ """
2387
+ Pre-tax amount in minor units
2388
+ """
2389
+ tax_amount: Annotated[int | float, Field(alias="taxAmount")]
2390
+ """
2391
+ Tax amount in minor units
2392
+ """
2393
+ tax_rate: Annotated[int | float, Field(alias="taxRate")]
2394
+ """
2395
+ Tax rate as a decimal (e.g. 0.25 for 25%)
2396
+ """
2397
+ tax_type: Annotated[
2398
+ Literal[
2399
+ "amusement_tax",
2400
+ "communications_tax",
2401
+ "gst",
2402
+ "hst",
2403
+ "igst",
2404
+ "jct",
2405
+ "lease_tax",
2406
+ "pst",
2407
+ "qst",
2408
+ "retail_delivery_fee",
2409
+ "rst",
2410
+ "sales_tax",
2411
+ "service_tax",
2412
+ "vat",
2413
+ ]
2414
+ | None,
2415
+ Field(alias="taxType"),
2416
+ ] = None
2417
+ """
2418
+ Stripe tax type (e.g. vat, sales_tax, gst)
2419
+ """
2420
+ total: int | float
2421
+ """
2422
+ Total amount in minor units
2423
+ """
2424
+ treatment: Literal["reverse_charge", "standard", "none", "not_collecting", "not_supported"]
2425
+
2426
+
2427
+ class UpdateCustomerRequest(BaseModel):
2428
+ model_config = ConfigDict(
2429
+ extra="allow",
2430
+ populate_by_name=True,
2431
+ )
2432
+ description: Annotated[str | None, Field(max_length=1000)] = None
2433
+ email: str | None = None
2434
+ external_ref: Annotated[str | None, Field(alias="externalRef", max_length=50)] = None
2435
+ metadata: Any | None = None
2436
+ name: Annotated[
2437
+ str | None, Field(max_length=100, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$")
2438
+ ] = None
2439
+ telephone: Telephone | Literal[""] | None = None
2440
+
2441
+
2442
+ class Options27(BaseModel):
2443
+ model_config = ConfigDict(
2444
+ extra="allow",
2445
+ populate_by_name=True,
2446
+ )
2447
+ amount_minor: Annotated[int, Field(alias="amountMinor", ge=0)]
2448
+ currency: str
2449
+ kind: Literal["charge"]
2450
+ label: str | None = None
2451
+ meter: Annotated[str | None, Field(min_length=1)] = None
2452
+ one_time: Annotated[bool | None, Field(alias="oneTime")] = None
2453
+ per: Literal["unit", "seat", "flat"]
2454
+
2455
+
2456
+ class Options28(BaseModel):
2457
+ model_config = ConfigDict(
2458
+ extra="allow",
2459
+ populate_by_name=True,
2460
+ )
2461
+ anchor: str | None = None
2462
+ count: Annotated[int | None, Field(ge=1)] = None
2463
+ interval: Literal["week", "month", "year"]
2464
+ kind: Literal["billingCycle"]
2465
+
2466
+
2467
+ class Options29(BaseModel):
2468
+ model_config = ConfigDict(
2469
+ extra="allow",
2470
+ populate_by_name=True,
2471
+ )
2472
+ charge: Charge
2473
+ from_: Annotated[int, Field(alias="from", ge=0)]
2474
+ kind: Literal["tier"]
2475
+ label: str | None = None
2476
+ mode: Literal["graduated", "volume"]
2477
+ to: Annotated[int | None, Field(ge=0)]
2478
+
2479
+
2480
+ class Options30(BaseModel):
2481
+ model_config = ConfigDict(
2482
+ extra="allow",
2483
+ populate_by_name=True,
2484
+ )
2485
+ cap: Annotated[int, Field(ge=0)]
2486
+ kind: Literal["limit"]
2487
+ label: str | None = None
2488
+ meter: Annotated[str, Field(min_length=1)]
2489
+ on_exceed: Annotated[Literal["block", "draw_credits"], Field(alias="onExceed")]
2490
+ scope: Literal["billing_period", "lifetime", "rolling_window"]
2491
+ window_days: Annotated[int | None, Field(alias="windowDays", ge=1)] = None
2492
+
2493
+
2494
+ class Options31(BaseModel):
2495
+ model_config = ConfigDict(
2496
+ extra="allow",
2497
+ populate_by_name=True,
2498
+ )
2499
+ feature: Annotated[str, Field(min_length=1)]
2500
+ kind: Literal["entitlement"]
2501
+ label: str | None = None
2502
+ scope: str | None = None
2503
+ value: bool | int | float | str
2504
+
2505
+
2506
+ class Options32(BaseModel):
2507
+ model_config = ConfigDict(
2508
+ extra="allow",
2509
+ populate_by_name=True,
2510
+ )
2511
+ days: Annotated[int, Field(ge=1)]
2512
+ kind: Literal["trial"]
2513
+ label: str | None = None
2514
+ on_end: Annotated[Literal["convert", "cancel"], Field(alias="onEnd")]
2515
+
2516
+
2517
+ class Options33(BaseModel):
2518
+ model_config = ConfigDict(
2519
+ extra="allow",
2520
+ populate_by_name=True,
2521
+ )
2522
+ applies_to: Annotated[
2523
+ Literal["recurring", "setup", "usage", "all"] | None, Field(alias="appliesTo")
2524
+ ] = None
2525
+ currency: str | None = None
2526
+ cycles: Annotated[int | None, Field(ge=1)] = None
2527
+ duration: Literal["once", "repeating", "forever"]
2528
+ kind: Literal["discount"]
2529
+ label: str | None = None
2530
+ mode: Literal["percentage", "fixed"]
2531
+ value: Annotated[int, Field(gt=0)]
2532
+
2533
+
2534
+ class Options34(BaseModel):
2535
+ model_config = ConfigDict(
2536
+ extra="allow",
2537
+ populate_by_name=True,
2538
+ )
2539
+ kind: Literal["autoAssigned"]
2540
+ label: str | None = None
2541
+
2542
+
2543
+ class Options35(BaseModel):
2544
+ model_config = ConfigDict(
2545
+ extra="allow",
2546
+ populate_by_name=True,
2547
+ )
2548
+ kind: Literal["hidden"]
2549
+ label: str | None = None
2550
+
2551
+
2552
+ class UpdatePlanRequest(BaseModel):
2553
+ model_config = ConfigDict(
2554
+ extra="allow",
2555
+ populate_by_name=True,
2556
+ )
2557
+ access_expiry_days: Annotated[int | None, Field(alias="accessExpiryDays", ge=0)] = None
2558
+ currency: Annotated[str | None, Field(max_length=3, min_length=3)] = None
2559
+ description: Annotated[str | None, Field(max_length=500)] = None
2560
+ features: dict[str, Any] | None = None
2561
+ max_active_users: Annotated[int | None, Field(alias="maxActiveUsers", ge=0)] = None
2562
+ metadata: dict[str, Any] | None = None
2563
+ name: Annotated[
2564
+ str | None,
2565
+ Field(max_length=200, min_length=2, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$"),
2566
+ ] = None
2567
+ options: (
2568
+ list[
2569
+ Options27
2570
+ | Options28
2571
+ | Options29
2572
+ | Options30
2573
+ | Options31
2574
+ | Options32
2575
+ | Options33
2576
+ | Options34
2577
+ | Options35
2578
+ ]
2579
+ | None
2580
+ ) = None
2581
+ status: Literal["active", "inactive", "archived"] | None = None
2582
+ tax_behavior: Annotated[
2583
+ Literal["auto", "inclusive", "exclusive"] | None, Field(alias="taxBehavior")
2584
+ ] = None
2585
+
2586
+
2587
+ class UpdateProductRequest(BaseModel):
2588
+ model_config = ConfigDict(
2589
+ extra="allow",
2590
+ populate_by_name=True,
2591
+ )
2592
+ config: Config | None = None
2593
+ description: Annotated[str | None, Field(max_length=1000)] = None
2594
+ image_url: Annotated[str | None, Field(alias="imageUrl")] = None
2595
+ metadata: dict[str, Any] | None = None
2596
+ name: Annotated[
2597
+ str | None,
2598
+ Field(max_length=100, min_length=2, pattern="^[\\p{L}\\p{N} .,'\"&\\/()+:\\-]*$"),
2599
+ ] = None
2600
+ product_type: Annotated[str | None, Field(alias="productType", max_length=100)] = None
2601
+ tax_behavior: Annotated[
2602
+ Literal["auto", "inclusive", "exclusive"] | None, Field(alias="taxBehavior")
2603
+ ] = None
2604
+
2605
+
2606
+ class UsageRecordResponse(BaseModel):
2607
+ model_config = ConfigDict(
2608
+ extra="allow",
2609
+ populate_by_name=True,
2610
+ )
2611
+ credit_debit: Annotated[
2612
+ CreditDebitSuccessResponse
2613
+ | CreditDebitSkippedResponse
2614
+ | CostDebitSuccessResponse
2615
+ | CostDebitSkippedResponse
2616
+ | None,
2617
+ Field(alias="creditDebit"),
2618
+ ] = None
2619
+ reference: Annotated[str, Field(examples=["usage_A1B2C3D4"])]
2620
+ success: Annotated[bool, Field(examples=[True])]
2621
+
2622
+
2623
+ class Call(BaseModel):
2624
+ model_config = ConfigDict(
2625
+ extra="allow",
2626
+ populate_by_name=True,
2627
+ )
2628
+ call_ref: Annotated[str, Field(alias="callRef", max_length=20, pattern="^call_[A-Z0-9]+$")]
2629
+ cost: Annotated[str, Field(pattern="^\\d+(\\.\\d{1,8})?$")]
2630
+
2631
+
2632
+ class UntaggedItem(BaseModel):
2633
+ model_config = ConfigDict(
2634
+ extra="allow",
2635
+ populate_by_name=True,
2636
+ )
2637
+ at: str
2638
+ cost: Annotated[str, Field(pattern="^\\d+(\\.\\d{1,8})?$")]
2639
+
2640
+
2641
+ class Window(BaseModel):
2642
+ model_config = ConfigDict(
2643
+ extra="allow",
2644
+ populate_by_name=True,
2645
+ )
2646
+ from_: Annotated[str | None, Field(alias="from")] = None
2647
+ to: str | None = None
2648
+
2649
+
2650
+ class UsageReportDto(BaseModel):
2651
+ model_config = ConfigDict(
2652
+ extra="allow",
2653
+ populate_by_name=True,
2654
+ )
2655
+ calls: Annotated[list[Call], Field(max_length=10000)]
2656
+ currency: Annotated[str, Field(pattern="^[A-Z]{3}$")]
2657
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20)]
2658
+ report_id: Annotated[
2659
+ str, Field(alias="reportId", max_length=128, min_length=1, pattern="^[A-Za-z0-9_:.-]+$")
2660
+ ]
2661
+ source: Annotated[str, Field(max_length=200, min_length=1)]
2662
+ untagged: Annotated[list[UntaggedItem], Field(max_length=2000)]
2663
+ window: Window
2664
+
2665
+
2666
+ class Result(BaseModel):
2667
+ model_config = ConfigDict(
2668
+ extra="allow",
2669
+ populate_by_name=True,
2670
+ )
2671
+ booked_credit: Annotated[str | None, Field(alias="bookedCredit")] = None
2672
+ booked_policy: Annotated[str | None, Field(alias="bookedPolicy")] = None
2673
+ call_ref: Annotated[str, Field(alias="callRef")]
2674
+ credit_delta: Annotated[str | None, Field(alias="creditDelta")] = None
2675
+ policy_delta: Annotated[str | None, Field(alias="policyDelta")] = None
2676
+ reason: Literal["provisional", "expired", "no_debit", "cost_differs"] | None = None
2677
+ reported: str | None = None
2678
+ result: Literal["matched", "adjusted", "pending", "already_reconciled", "ignored"]
2679
+
2680
+
2681
+ class Untagged(BaseModel):
2682
+ model_config = ConfigDict(
2683
+ extra="allow",
2684
+ populate_by_name=True,
2685
+ )
2686
+ before_policy: Annotated[str | None, Field(alias="beforePolicy")] = None
2687
+ flagged: bool | None = None
2688
+ total: str | None = None
2689
+
2690
+
2691
+ class UsageReportResponseDto(BaseModel):
2692
+ model_config = ConfigDict(
2693
+ extra="allow",
2694
+ populate_by_name=True,
2695
+ )
2696
+ currency: Literal["USD"]
2697
+ duplicate: bool
2698
+ reference: str
2699
+ results: list[Result]
2700
+ untagged: Untagged
2701
+
2702
+
2703
+ class UserInfoPlanDto(BaseModel):
2704
+ model_config = ConfigDict(
2705
+ extra="allow",
2706
+ populate_by_name=True,
2707
+ )
2708
+ billing_cycle: Annotated[str | None, Field(alias="billingCycle", examples=["monthly"])] = None
2709
+ currency: Annotated[str, Field(examples=["USD"])]
2710
+ features: dict[str, Any] | None = None
2711
+ limits: Annotated[dict[str, Any] | None, Field(deprecated=True)] = None
2712
+ """
2713
+ Deprecated: always null. Limit data now lives in the plan snapshot options (`kind: "limit"`).
2714
+ """
2715
+ price: Annotated[int | float | None, Field(examples=[2999])] = None
2716
+ """
2717
+ Price in minor currency units (e.g. cents)
2718
+ """
2719
+ reference: Annotated[str | None, Field(examples=["pln_2B3C4D5E"])] = None
2720
+ type: Annotated[str, Field(examples=["recurring"])]
2721
+
2722
+
2723
+ class UserInfoRequest(BaseModel):
2724
+ model_config = ConfigDict(
2725
+ extra="allow",
2726
+ populate_by_name=True,
2727
+ )
2728
+ customer_ref: Annotated[str, Field(alias="customerRef", max_length=20, min_length=1)]
2729
+ product_ref: Annotated[str, Field(alias="productRef", max_length=20, min_length=1)]
2730
+
2731
+
2732
+ class UserInfoUsageDto(BaseModel):
2733
+ model_config = ConfigDict(
2734
+ extra="allow",
2735
+ populate_by_name=True,
2736
+ )
2737
+ meter_ref: Annotated[str | None, Field(alias="meterRef", examples=["requests"])] = None
2738
+ """
2739
+ Meter key referenced by the plan options
2740
+ """
2741
+ percent_used: Annotated[int | float | None, Field(alias="percentUsed", examples=[25])] = None
2742
+ remaining: Annotated[int | float, Field(examples=[750])]
2743
+ total: Annotated[int | float, Field(examples=[1000])]
2744
+ """
2745
+ Included allowance for the period. `0` means unlimited / no finite cap.
2746
+ """
2747
+ used: Annotated[int | float, Field(examples=[250])]
2748
+
2749
+
2750
+ class UserInfoUserDto(BaseModel):
2751
+ model_config = ConfigDict(
2752
+ extra="allow",
2753
+ populate_by_name=True,
2754
+ )
2755
+ email: Annotated[str, Field(examples=["john@example.com"])]
2756
+ external_ref: Annotated[
2757
+ str | None, Field(alias="externalRef", examples=["auth_user_12345"])
2758
+ ] = None
2759
+ name: Annotated[str | None, Field(examples=["John Doe"])] = None
2760
+ reference: Annotated[str, Field(examples=["cus_3C4D5E6F"])]
2761
+
2762
+
2763
+ class VerifiedAgentKeyResponseDto(BaseModel):
2764
+ model_config = ConfigDict(
2765
+ extra="allow",
2766
+ populate_by_name=True,
2767
+ )
2768
+ agent_ref: Annotated[str, Field(alias="agentRef")]
2769
+ environment: Literal["sandbox", "live"]
2770
+ principal_ref: Annotated[str, Field(alias="principalRef")]
2771
+ prompt_excerpt: Annotated[bool, Field(alias="promptExcerpt")]
2772
+
2773
+
2774
+ class VerifyAgentKeyDto(BaseModel):
2775
+ model_config = ConfigDict(
2776
+ extra="allow",
2777
+ populate_by_name=True,
2778
+ )
2779
+ agent_key: Annotated[str, Field(alias="agentKey", max_length=200)]
2780
+
2781
+
2782
+ class WebhookEventDataDto(BaseModel):
2783
+ model_config = ConfigDict(
2784
+ extra="allow",
2785
+ populate_by_name=True,
2786
+ )
2787
+ object: dict[str, Any]
2788
+ """
2789
+ The resource that the event relates to.
2790
+ """
2791
+ previous_attributes: dict[str, Any] | None = None
2792
+ """
2793
+ For *.updated events, the previous values of changed attributes.
2794
+ """
2795
+
2796
+
2797
+ class WebhookEventRequestDto(BaseModel):
2798
+ model_config = ConfigDict(
2799
+ extra="allow",
2800
+ populate_by_name=True,
2801
+ )
2802
+ id: Annotated[dict[str, Any] | None, Field(...)]
2803
+ """
2804
+ ID of the API request that triggered the event.
2805
+ """
2806
+ idempotency_key: Annotated[dict[str, Any] | None, Field(...)]
2807
+ """
2808
+ Idempotency key of the triggering request.
2809
+ """
2810
+
2811
+
2812
+ class WebhookEventType(
2813
+ RootModel[
2814
+ Literal[
2815
+ "customer.created",
2816
+ "customer.updated",
2817
+ "customer.deleted",
2818
+ "purchase.created",
2819
+ "purchase.activated",
2820
+ "purchase.updated",
2821
+ "purchase.trial_ending",
2822
+ "purchase.trial_converted",
2823
+ "purchase.suspended",
2824
+ "purchase.past_due",
2825
+ "purchase.cancellation_scheduled",
2826
+ "purchase.cancelled",
2827
+ "purchase.reactivated",
2828
+ "purchase.expired",
2829
+ "purchase.renewed",
2830
+ "purchase.renewal_reminder",
2831
+ "purchase.refunded",
2832
+ "purchase.plan_changed",
2833
+ "payment.succeeded",
2834
+ "payment.failed",
2835
+ "payment.refunded",
2836
+ "payment.refund_failed",
2837
+ "payment.refund_pending",
2838
+ "payment.canceled",
2839
+ "payment.disputed",
2840
+ "payment.dispute_closed",
2841
+ "payout.paid",
2842
+ "payout.failed",
2843
+ "checkout_session.created",
2844
+ "checkout_session.completed",
2845
+ "checkout_session.expired",
2846
+ "customer.credit.topped_up",
2847
+ "customer.credit.low_balance",
2848
+ "customer.credit.exhausted",
2849
+ "customer.credit.debited",
2850
+ "customer.credit.granted",
2851
+ "customer.credit.adjusted",
2852
+ "customer.credit.auto_topup_failed",
2853
+ "usage.charged",
2854
+ "usage.recorded",
2855
+ "usage.reset",
2856
+ "product.created",
2857
+ "product.updated",
2858
+ "product.archived",
2859
+ "plan.created",
2860
+ "plan.updated",
2861
+ "plan.archived",
2862
+ ]
2863
+ ]
2864
+ ):
2865
+ root: Literal[
2866
+ "customer.created",
2867
+ "customer.updated",
2868
+ "customer.deleted",
2869
+ "purchase.created",
2870
+ "purchase.activated",
2871
+ "purchase.updated",
2872
+ "purchase.trial_ending",
2873
+ "purchase.trial_converted",
2874
+ "purchase.suspended",
2875
+ "purchase.past_due",
2876
+ "purchase.cancellation_scheduled",
2877
+ "purchase.cancelled",
2878
+ "purchase.reactivated",
2879
+ "purchase.expired",
2880
+ "purchase.renewed",
2881
+ "purchase.renewal_reminder",
2882
+ "purchase.refunded",
2883
+ "purchase.plan_changed",
2884
+ "payment.succeeded",
2885
+ "payment.failed",
2886
+ "payment.refunded",
2887
+ "payment.refund_failed",
2888
+ "payment.refund_pending",
2889
+ "payment.canceled",
2890
+ "payment.disputed",
2891
+ "payment.dispute_closed",
2892
+ "payout.paid",
2893
+ "payout.failed",
2894
+ "checkout_session.created",
2895
+ "checkout_session.completed",
2896
+ "checkout_session.expired",
2897
+ "customer.credit.topped_up",
2898
+ "customer.credit.low_balance",
2899
+ "customer.credit.exhausted",
2900
+ "customer.credit.debited",
2901
+ "customer.credit.granted",
2902
+ "customer.credit.adjusted",
2903
+ "customer.credit.auto_topup_failed",
2904
+ "usage.charged",
2905
+ "usage.recorded",
2906
+ "usage.reset",
2907
+ "product.created",
2908
+ "product.updated",
2909
+ "product.archived",
2910
+ "plan.created",
2911
+ "plan.updated",
2912
+ "plan.archived",
2913
+ ]
2914
+ """
2915
+ Event type.
2916
+ """
2917
+
2918
+
2919
+ class RecordMeterEventResponse(BaseModel):
2920
+ model_config = ConfigDict(
2921
+ extra="allow",
2922
+ populate_by_name=True,
2923
+ )
2924
+ success: Annotated[bool | None, Field(examples=[True])] = None
2925
+
2926
+
2927
+ class RecordMeterEventsBulkResponse(BaseModel):
2928
+ model_config = ConfigDict(
2929
+ extra="allow",
2930
+ populate_by_name=True,
2931
+ )
2932
+ inserted: Annotated[int | float | None, Field(examples=[50])] = None
2933
+ success: Annotated[bool | None, Field(examples=[True])] = None
2934
+
2935
+
2936
+ class GetPaymentMethodResponse1(BaseModel):
2937
+ model_config = ConfigDict(
2938
+ extra="allow",
2939
+ populate_by_name=True,
2940
+ )
2941
+ brand: Annotated[str, Field(examples=["visa"])]
2942
+ exp_month: Annotated[int, Field(alias="expMonth", examples=[12], ge=1, le=12)]
2943
+ exp_year: Annotated[int, Field(alias="expYear", examples=[2030])]
2944
+ kind: Literal["card"]
2945
+ last4: Annotated[str, Field(examples=["4242"])]
2946
+ reusable: Annotated[bool, Field(examples=[True])]
2947
+
2948
+
2949
+ class GetPaymentMethodResponse2(BaseModel):
2950
+ model_config = ConfigDict(
2951
+ extra="allow",
2952
+ populate_by_name=True,
2953
+ )
2954
+ kind: Literal["none"]
2955
+
2956
+
2957
+ class GetPaymentMethodResponse(RootModel[GetPaymentMethodResponse1 | GetPaymentMethodResponse2]):
2958
+ root: Annotated[
2959
+ GetPaymentMethodResponse1 | GetPaymentMethodResponse2, Field(discriminator="kind")
2960
+ ]
2961
+
2962
+
2963
+ class ListProductsResponse(BaseModel):
2964
+ model_config = ConfigDict(
2965
+ extra="allow",
2966
+ populate_by_name=True,
2967
+ )
2968
+ limit: int | float | None = None
2969
+ """
2970
+ Applied page size (clamped to 1-100)
2971
+ """
2972
+ offset: int | float | None = None
2973
+ """
2974
+ Applied pagination offset
2975
+ """
2976
+ products: list[SdkProductResponse] | None = None
2977
+ total: int | float | None = None
2978
+ """
2979
+ Total number of products matching the filters
2980
+ """
2981
+
2982
+
2983
+ class DeleteProductResponse(BaseModel):
2984
+ model_config = ConfigDict(
2985
+ extra="allow",
2986
+ populate_by_name=True,
2987
+ )
2988
+ action: Literal["deactivated", "soft_deleted"] | None = None
2989
+ """
2990
+ Outcome of the delete: deactivation when purchases exist, otherwise soft-delete. Same in sandbox and live.
2991
+ """
2992
+ success: bool | None = None
2993
+
2994
+
2995
+ class ListPlansResponse(BaseModel):
2996
+ model_config = ConfigDict(
2997
+ extra="allow",
2998
+ populate_by_name=True,
2999
+ )
3000
+ limit: int | float | None = None
3001
+ offset: int | float | None = None
3002
+ plans: list[Plan2] | None = None
3003
+ total: int | float | None = None
3004
+ """
3005
+ Total number of plans for the product
3006
+ """
3007
+
3008
+
3009
+ class DeletePlanResponse(BaseModel):
3010
+ model_config = ConfigDict(
3011
+ extra="allow",
3012
+ populate_by_name=True,
3013
+ )
3014
+ success: bool | None = None
3015
+
3016
+
3017
+ class AttachBusinessDetailsResponse(BaseModel):
3018
+ model_config = ConfigDict(
3019
+ extra="allow",
3020
+ populate_by_name=True,
3021
+ )
3022
+ tax_breakdown: Annotated[TaxBreakdownDto, Field(alias="taxBreakdown")]
3023
+ """
3024
+ Calculated tax breakdown
3025
+ """
3026
+
3027
+
3028
+ class AutoRechargeConfigDto(BaseModel):
3029
+ model_config = ConfigDict(
3030
+ extra="allow",
3031
+ populate_by_name=True,
3032
+ )
3033
+ enabled: Annotated[bool, Field(examples=[True])]
3034
+ """
3035
+ Whether auto-recharge is enabled
3036
+ """
3037
+ failure_count: Annotated[int | float, Field(alias="failureCount", examples=[0])]
3038
+ """
3039
+ Consecutive failure count
3040
+ """
3041
+ funding_source_type: Annotated[
3042
+ Literal["saved_card", "tokenized_card"], Field(alias="fundingSourceType")
3043
+ ]
3044
+ """
3045
+ Funding source type
3046
+ """
3047
+ in_flight_payment_intent_id: Annotated[str | None, Field(alias="inFlightPaymentIntentId")] = (
3048
+ None
3049
+ )
3050
+ """
3051
+ PaymentIntent ID of an in-flight recharge
3052
+ """
3053
+ last_charge_at: Annotated[str | None, Field(alias="lastChargeAt")] = None
3054
+ """
3055
+ Timestamp of the last successful charge
3056
+ """
3057
+ lock_acquired_at: Annotated[str | None, Field(alias="lockAcquiredAt")] = None
3058
+ """
3059
+ Timestamp the processing lock was acquired
3060
+ """
3061
+ max_monthly_spend_minor: Annotated[
3062
+ int | float | None, Field(alias="maxMonthlySpendMinor", examples=[10000])
3063
+ ] = None
3064
+ """
3065
+ Optional monthly spend cap in topup.currency minor units
3066
+ """
3067
+ monthly_spend_minor: Annotated[int | float, Field(alias="monthlySpendMinor", examples=[4500])]
3068
+ """
3069
+ Successful auto-recharge spend in the current UTC month
3070
+ """
3071
+ monthly_spend_period: Annotated[
3072
+ str | None, Field(alias="monthlySpendPeriod", examples=["2026-07"])
3073
+ ] = None
3074
+ """
3075
+ UTC YYYY-MM period key for monthlySpendMinor
3076
+ """
3077
+ payment_method_id: Annotated[str | None, Field(alias="paymentMethodId")] = None
3078
+ """
3079
+ Saved payment method ID backing the recharge
3080
+ """
3081
+ status: Literal["active", "disabled", "failed", "pending_setup"]
3082
+ """
3083
+ Current config status
3084
+ """
3085
+ topup: AutoRechargeTopupDto
3086
+ trigger: AutoRechargeTriggerDto
3087
+ updated_at: Annotated[str, Field(alias="updatedAt")]
3088
+ """
3089
+ Last update timestamp
3090
+ """
3091
+
3092
+
3093
+ class AutoRechargeDisplayDto(BaseModel):
3094
+ model_config = ConfigDict(
3095
+ extra="allow",
3096
+ populate_by_name=True,
3097
+ )
3098
+ currency: Annotated[str, Field(examples=["USD"])]
3099
+ """
3100
+ Display currency code
3101
+ """
3102
+ exchange_rate: Annotated[int | float, Field(alias="exchangeRate", examples=[1])]
3103
+ """
3104
+ Exchange rate used for display conversion
3105
+ """
3106
+ formatted: AutoRechargeDisplayFormattedDto
3107
+ rate_source: Annotated[
3108
+ Literal["parity", "db", "fallback"], Field(alias="rateSource", examples=["db"])
3109
+ ]
3110
+ """
3111
+ Source of the exchange rate
3112
+ """
3113
+ threshold_amount_major: Annotated[int | float, Field(alias="thresholdAmountMajor", examples=[5])]
3114
+ """
3115
+ Threshold amount in display-currency major units
3116
+ """
3117
+ topup_amount_major: Annotated[int | float, Field(alias="topupAmountMajor", examples=[20])]
3118
+ """
3119
+ Top-up amount in display-currency major units
3120
+ """
3121
+
3122
+
3123
+ class AutoRechargeGetResponse(BaseModel):
3124
+ model_config = ConfigDict(
3125
+ extra="allow",
3126
+ populate_by_name=True,
3127
+ )
3128
+ config: AutoRechargeConfigDto | None = None
3129
+ """
3130
+ Current auto-recharge config, or null when not configured
3131
+ """
3132
+ display: AutoRechargeDisplayDto | None = None
3133
+ validation: AutoRechargeValidationMetaResponse
3134
+ """
3135
+ Validation metadata for the auto-recharge form (always present)
3136
+ """
3137
+
3138
+
3139
+ class BulkUsageResultResponse(BaseModel):
3140
+ model_config = ConfigDict(
3141
+ extra="allow",
3142
+ populate_by_name=True,
3143
+ )
3144
+ credit_debit: Annotated[
3145
+ CreditDebitSuccessResponse
3146
+ | CreditDebitSkippedResponse
3147
+ | CostDebitSuccessResponse
3148
+ | CostDebitSkippedResponse
3149
+ | None,
3150
+ Field(alias="creditDebit"),
3151
+ ] = None
3152
+ reference: Annotated[str, Field(examples=["usage_A1B2C3D4"])]
3153
+
3154
+
3155
+ class ConfigureMcpPlansResult(BaseModel):
3156
+ model_config = ConfigDict(
3157
+ extra="allow",
3158
+ populate_by_name=True,
3159
+ )
3160
+ mcp_server: Annotated[dict[str, Any], Field(alias="mcpServer")]
3161
+ """
3162
+ Updated MCP server identity
3163
+ """
3164
+ plan_map: Annotated[dict[str, Any], Field(alias="planMap")]
3165
+ """
3166
+ Resolved plan mapping by key (includes existing free plan)
3167
+ """
3168
+ product: SdkProductResponse
3169
+ """
3170
+ Updated product
3171
+ """
3172
+
3173
+
3174
+ class McpBootstrapResult(BaseModel):
3175
+ model_config = ConfigDict(
3176
+ extra="allow",
3177
+ populate_by_name=True,
3178
+ )
3179
+ auto_mapped_tools: Annotated[list[AutoMappedTool] | None, Field(alias="autoMappedTools")] = None
3180
+ """
3181
+ Auto-discovered tools used during bootstrap
3182
+ """
3183
+ mcp_server: Annotated[
3184
+ dict[str, Any],
3185
+ Field(
3186
+ alias="mcpServer",
3187
+ examples=[
3188
+ {
3189
+ "defaultPlanRef": "pln_FREE123",
3190
+ "id": "507f1f77bcf86cd799439011",
3191
+ "mcpProxyUrl": "https://acme-docs.mcp.solvapay.com/mcp",
3192
+ "reference": "mcp_ABC123",
3193
+ "subdomain": "acme-docs",
3194
+ "url": "https://origin.example.com/mcp",
3195
+ }
3196
+ ],
3197
+ ),
3198
+ ]
3199
+ """
3200
+ Created or updated MCP server identity
3201
+ """
3202
+ plan_map: Annotated[
3203
+ dict[str, Any],
3204
+ Field(alias="planMap", examples=[{"free": {"name": "Free", "reference": "pln_FREE123"}}]),
3205
+ ]
3206
+ """
3207
+ Resolved plan mapping by bootstrap key
3208
+ """
3209
+ product: SdkProductResponse
3210
+ """
3211
+ Created product
3212
+ """
3213
+ tools_auto_mapped: Annotated[bool | None, Field(alias="toolsAutoMapped", examples=[True])] = (
3214
+ None
3215
+ )
3216
+ """
3217
+ True when tools were auto-discovered from origin because the request omitted tools
3218
+ """
3219
+
3220
+
3221
+ class SaveAutoRechargeResponse(BaseModel):
3222
+ model_config = ConfigDict(
3223
+ extra="allow",
3224
+ populate_by_name=True,
3225
+ )
3226
+ config: AutoRechargeConfigDto
3227
+ display: AutoRechargeDisplayDto | None = None
3228
+ publishable_key: Annotated[str | None, Field(alias="publishableKey")] = None
3229
+ """
3230
+ Stripe publishable key for the resolved environment
3231
+ """
3232
+ setup_client_secret: Annotated[str | None, Field(alias="setupClientSecret")] = None
3233
+ """
3234
+ Stripe SetupIntent client secret for card collection
3235
+ """
3236
+ stripe_account_id: Annotated[str | None, Field(alias="stripeAccountId")] = None
3237
+ """
3238
+ Connected Stripe account ID
3239
+ """
3240
+
3241
+
3242
+ class SdkPurchaseResponse(BaseModel):
3243
+ model_config = ConfigDict(
3244
+ extra="allow",
3245
+ populate_by_name=True,
3246
+ )
3247
+ amount: Annotated[int | float, Field(examples=[9900])]
3248
+ """
3249
+ Amount in USD cents (normalised for aggregation)
3250
+ """
3251
+ auto_renew: Annotated[bool | None, Field(alias="autoRenew")] = None
3252
+ """
3253
+ Auto-renew enabled
3254
+ """
3255
+ billing_cycle: Annotated[
3256
+ Literal["weekly", "monthly", "quarterly", "yearly"] | None, Field(alias="billingCycle")
3257
+ ] = None
3258
+ """
3259
+ Billing cycle
3260
+ """
3261
+ cancellation_reason: Annotated[
3262
+ str | None, Field(alias="cancellationReason", examples=["Customer request"])
3263
+ ] = None
3264
+ """
3265
+ Reason for cancellation
3266
+ """
3267
+ cancelled_at: Annotated[
3268
+ str | None, Field(alias="cancelledAt", examples=["2025-10-28T10:00:00Z"])
3269
+ ] = None
3270
+ """
3271
+ When purchase was cancelled
3272
+ """
3273
+ created_at: Annotated[str, Field(alias="createdAt")]
3274
+ """
3275
+ Created at
3276
+ """
3277
+ currency: Annotated[str, Field(examples=["GBP"])]
3278
+ """
3279
+ ISO 4217 currency code of the customer-facing charge
3280
+ """
3281
+ customer_email: Annotated[
3282
+ str | None, Field(alias="customerEmail", examples=["customer@example.com"])
3283
+ ] = None
3284
+ """
3285
+ Customer email
3286
+ """
3287
+ customer_ref: Annotated[str, Field(alias="customerRef", examples=["cus_3C4D5E6F"])]
3288
+ """
3289
+ Customer reference
3290
+ """
3291
+ end_date: Annotated[str | None, Field(alias="endDate", examples=["2025-11-27T10:00:00Z"])] = (
3292
+ None
3293
+ )
3294
+ """
3295
+ End date of purchase
3296
+ """
3297
+ exchange_rate: Annotated[int | float | None, Field(alias="exchangeRate", examples=[1.32])] = None
3298
+ """
3299
+ Exchange rate from original currency to USD
3300
+ """
3301
+ is_recurring: Annotated[bool, Field(alias="isRecurring", examples=[True])]
3302
+ """
3303
+ Whether the purchase is recurring
3304
+ """
3305
+ metadata: dict[str, Any] | None = None
3306
+ """
3307
+ Arbitrary metadata attached to the purchase
3308
+ """
3309
+ next_billing_date: Annotated[str | None, Field(alias="nextBillingDate")] = None
3310
+ """
3311
+ Next billing date
3312
+ """
3313
+ origin: Annotated[
3314
+ Literal["paid", "free_default", "manual", "one_time", "credit_topup", "admin_assignment"]
3315
+ | None,
3316
+ Field(examples=["paid"]),
3317
+ ] = None
3318
+ """
3319
+ How the purchase originated
3320
+ """
3321
+ original_amount: Annotated[int | float | None, Field(alias="originalAmount", examples=[7500])] = None
3322
+ """
3323
+ Original amount in the payment currency (minor units)
3324
+ """
3325
+ paid_at: Annotated[str | None, Field(alias="paidAt")] = None
3326
+ """
3327
+ Paid at timestamp
3328
+ """
3329
+ plan_ref: Annotated[str | None, Field(alias="planRef", examples=["pln_abc123"])] = None
3330
+ """
3331
+ Plan reference from the plan snapshot, for reliable plan matching
3332
+ """
3333
+ plan_snapshot: Annotated[SdkPlanSnapshotDto | None, Field(alias="planSnapshot")] = None
3334
+ """
3335
+ Snapshot of the plan at time of purchase
3336
+ """
3337
+ product_name: Annotated[
3338
+ str | None, Field(alias="productName", examples=["API Gateway Manager"])
3339
+ ] = None
3340
+ """
3341
+ Product name
3342
+ """
3343
+ product_ref: Annotated[str | None, Field(alias="productRef", examples=["prd_abc123"])] = None
3344
+ """
3345
+ Product reference
3346
+ """
3347
+ reference: Annotated[str, Field(examples=["pur_1A2B3C4D"])]
3348
+ """
3349
+ Purchase reference
3350
+ """
3351
+ requires_payment: Annotated[bool | None, Field(alias="requiresPayment", examples=[False])] = (
3352
+ None
3353
+ )
3354
+ """
3355
+ Whether the purchase requires payment
3356
+ """
3357
+ start_date: Annotated[str, Field(alias="startDate", examples=["2025-10-27T10:00:00Z"])]
3358
+ """
3359
+ Start date
3360
+ """
3361
+ status: Annotated[str, Field(examples=["active"])]
3362
+ """
3363
+ Purchase status
3364
+ """
3365
+ usage: SdkUsagePeriodDto | None = None
3366
+ """
3367
+ Billing period of the active usage window; counts come from `/v1/sdk/limits`
3368
+ """
3369
+
3370
+
3371
+ class UserInfoPurchaseDto(BaseModel):
3372
+ model_config = ConfigDict(
3373
+ extra="allow",
3374
+ populate_by_name=True,
3375
+ )
3376
+ end_date: Annotated[str | None, Field(alias="endDate", examples=["2025-11-27T10:00:00Z"])] = (
3377
+ None
3378
+ )
3379
+ plan: UserInfoPlanDto | None = None
3380
+ plan_type: Annotated[str | None, Field(alias="planType", examples=["recurring"])] = None
3381
+ product_name: Annotated[str, Field(alias="productName", examples=["My API Product"])]
3382
+ reference: Annotated[str, Field(examples=["pur_1A2B3C4D"])]
3383
+ start_date: Annotated[
3384
+ str | None, Field(alias="startDate", examples=["2025-10-27T10:00:00Z"])
3385
+ ] = None
3386
+ status: Annotated[str, Field(examples=["active"])]
3387
+ usage: UserInfoUsageDto | None = None
3388
+
3389
+
3390
+ class UserInfoResponse(BaseModel):
3391
+ model_config = ConfigDict(
3392
+ extra="allow",
3393
+ populate_by_name=True,
3394
+ )
3395
+ purchase: UserInfoPurchaseDto | None = None
3396
+ status: Annotated[
3397
+ str, Field(examples=["Active subscription: My API Product (25% usage consumed)"])
3398
+ ]
3399
+ """
3400
+ Human-readable status summary
3401
+ """
3402
+ user: UserInfoUserDto | None = None
3403
+ verify_url: Annotated[
3404
+ str | None,
3405
+ Field(alias="verifyUrl", examples=["https://solvapay.com/customer/manage?id=abc123"]),
3406
+ ] = None
3407
+ """
3408
+ Customer portal session URL
3409
+ """
3410
+
3411
+
3412
+ class WebhookEventDefinitionDto(BaseModel):
3413
+ model_config = ConfigDict(
3414
+ extra="allow",
3415
+ populate_by_name=True,
3416
+ )
3417
+ description: str
3418
+ """
3419
+ Human-readable description of the event.
3420
+ """
3421
+ status: Annotated[Literal["live", "planned"], Field(examples=["live"])]
3422
+ """
3423
+ Emission status.
3424
+ """
3425
+ type: Annotated[WebhookEventType, Field(examples=["purchase.created"])]
3426
+
3427
+
3428
+ class WebhookEventDto(BaseModel):
3429
+ model_config = ConfigDict(
3430
+ extra="allow",
3431
+ populate_by_name=True,
3432
+ )
3433
+ api_version: Annotated[str, Field(examples=["2025-10-01"])]
3434
+ """
3435
+ API version that produced the event payload.
3436
+ """
3437
+ created: Annotated[int | float, Field(examples=[1717000000])]
3438
+ """
3439
+ Unix timestamp (seconds) when the event was created.
3440
+ """
3441
+ data: WebhookEventDataDto
3442
+ """
3443
+ Event payload envelope.
3444
+ """
3445
+ id: Annotated[str, Field(examples=["evt_1A2B3C4D"])]
3446
+ """
3447
+ Unique event ID.
3448
+ """
3449
+ livemode: Annotated[bool, Field(examples=[True])]
3450
+ """
3451
+ True for live-mode events, false for sandbox.
3452
+ """
3453
+ request: WebhookEventRequestDto
3454
+ """
3455
+ Context about the triggering API request.
3456
+ """
3457
+ type: Annotated[WebhookEventType, Field(examples=["purchase.created"])]
3458
+
3459
+
3460
+ class ListPurchasesResponse(BaseModel):
3461
+ model_config = ConfigDict(
3462
+ extra="allow",
3463
+ populate_by_name=True,
3464
+ )
3465
+ purchases: list[SdkPurchaseResponse] | None = None
3466
+
3467
+
3468
+ class GetPurchasesForCustomerResponse(BaseModel):
3469
+ model_config = ConfigDict(
3470
+ extra="allow",
3471
+ populate_by_name=True,
3472
+ )
3473
+ purchases: list[SdkPurchaseResponse] | None = None
3474
+
3475
+
3476
+ class GetPurchasesForProductResponse(BaseModel):
3477
+ model_config = ConfigDict(
3478
+ extra="allow",
3479
+ populate_by_name=True,
3480
+ )
3481
+ purchases: list[SdkPurchaseResponse] | None = None
3482
+
3483
+
3484
+ class CancelPurchaseResponse(BaseModel):
3485
+ model_config = ConfigDict(
3486
+ extra="allow",
3487
+ populate_by_name=True,
3488
+ )
3489
+ purchase: SdkPurchaseResponse | None = None
3490
+ success: bool | None = None
3491
+
3492
+
3493
+ class ReactivatePurchaseResponse(BaseModel):
3494
+ model_config = ConfigDict(
3495
+ extra="allow",
3496
+ populate_by_name=True,
3497
+ )
3498
+ purchase: SdkPurchaseResponse | None = None
3499
+ success: bool | None = None
3500
+
3501
+
3502
+ class BulkUsageResponse(BaseModel):
3503
+ model_config = ConfigDict(
3504
+ extra="allow",
3505
+ populate_by_name=True,
3506
+ )
3507
+ inserted: Annotated[int | float, Field(examples=[2])]
3508
+ """
3509
+ Number of usage events inserted
3510
+ """
3511
+ results: list[BulkUsageResultResponse]
3512
+ success: Annotated[bool, Field(examples=[True])]
3513
+
3514
+
3515
+ class CustomerResponse(BaseModel):
3516
+ model_config = ConfigDict(
3517
+ extra="allow",
3518
+ populate_by_name=True,
3519
+ )
3520
+ email: Annotated[str, Field(examples=["customer@example.com"])]
3521
+ """
3522
+ Customer email address
3523
+ """
3524
+ external_ref: Annotated[
3525
+ str | None, Field(alias="externalRef", examples=["auth_user_12345"])
3526
+ ] = None
3527
+ """
3528
+ External reference ID from your auth system (if set during creation or update)
3529
+ """
3530
+ name: Annotated[str, Field(examples=["John Doe"])]
3531
+ """
3532
+ Customer full name
3533
+ """
3534
+ purchases: list[SdkPurchaseResponse] | None = None
3535
+ """
3536
+ Active purchases
3537
+ """
3538
+ reference: Annotated[str, Field(examples=["cus_3c4d5e6f7g8h"])]
3539
+ """
3540
+ Customer reference identifier
3541
+ """
3542
+
3543
+
3544
+ class GetCustomerSessionResponse(BaseModel):
3545
+ model_config = ConfigDict(
3546
+ extra="allow",
3547
+ populate_by_name=True,
3548
+ )
3549
+ created_at: Annotated[str, Field(alias="createdAt", examples=["2025-01-01T11:45:00.000Z"])]
3550
+ """
3551
+ Session creation date
3552
+ """
3553
+ customer: CustomerResponse
3554
+ """
3555
+ Customer object from session data
3556
+ """
3557
+ customer_url: Annotated[
3558
+ str,
3559
+ Field(
3560
+ alias="customerUrl",
3561
+ examples=["https://solvapay.com/customer/manage?id=e3f1c2d4b6a89f001122334455667788"],
3562
+ ),
3563
+ ]
3564
+ """
3565
+ Full customer URL based on backend configuration (ready to redirect customer)
3566
+ """
3567
+ expires_at: Annotated[str, Field(alias="expiresAt", examples=["2025-01-01T12:00:00.000Z"])]
3568
+ """
3569
+ Session expiration date
3570
+ """
3571
+ session_id: Annotated[
3572
+ str, Field(alias="sessionId", examples=["e3f1c2d4b6a89f001122334455667788"])
3573
+ ]
3574
+ """
3575
+ Customer session ID/token
3576
+ """
3577
+ status: Annotated[Literal["active", "expired", "used"], Field(examples=["active"])]
3578
+ """
3579
+ Session status
3580
+ """
3581
+ updated_at: Annotated[str, Field(alias="updatedAt", examples=["2025-01-01T11:45:00.000Z"])]
3582
+ """
3583
+ Session last update date
3584
+ """
3585
+
3586
+
3587
+ class ProcessPaymentSucceededRecurring(BaseModel):
3588
+ model_config = ConfigDict(
3589
+ extra="allow",
3590
+ populate_by_name=True,
3591
+ )
3592
+ purchase: SdkPurchaseResponse
3593
+ status: Annotated[Literal["succeeded"], Field(examples=["succeeded"])]
3594
+ type: Annotated[Literal["recurring"], Field(examples=["recurring"])]
3595
+
3596
+
3597
+ class WebhookEventCategoryDto(BaseModel):
3598
+ model_config = ConfigDict(
3599
+ extra="allow",
3600
+ populate_by_name=True,
3601
+ )
3602
+ category: Annotated[str, Field(examples=["purchase"])]
3603
+ """
3604
+ Category key.
3605
+ """
3606
+ description: str
3607
+ """
3608
+ Category description.
3609
+ """
3610
+ events: list[WebhookEventDefinitionDto]
3611
+ """
3612
+ Events in this category.
3613
+ """
3614
+ label: Annotated[str, Field(examples=["Purchases & subscriptions"])]
3615
+ """
3616
+ Human-readable category label.
3617
+ """
3618
+
3619
+
3620
+ class ProcessPaymentIntentResponse(
3621
+ RootModel[
3622
+ ProcessPaymentSucceededRecurring
3623
+ | ProcessPaymentSucceededOneTime
3624
+ | ProcessPaymentSucceededBare
3625
+ | ProcessPaymentProcessing
3626
+ | ProcessPaymentTimeout
3627
+ | ProcessPaymentFailed
3628
+ | ProcessPaymentCancelled
3629
+ ]
3630
+ ):
3631
+ root: (
3632
+ ProcessPaymentSucceededRecurring
3633
+ | ProcessPaymentSucceededOneTime
3634
+ | ProcessPaymentSucceededBare
3635
+ | ProcessPaymentProcessing
3636
+ | ProcessPaymentTimeout
3637
+ | ProcessPaymentFailed
3638
+ | ProcessPaymentCancelled
3639
+ )
3640
+
3641
+
3642
+ class ListWebhookEventTypesResponse(RootModel[list[WebhookEventCategoryDto]]):
3643
+ root: list[WebhookEventCategoryDto]