@aimee.shop/sdk 0.19.0 → 0.20.0-dev.157

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.
@@ -1459,7 +1459,7 @@ export interface paths {
1459
1459
  head?: never;
1460
1460
  /**
1461
1461
  * Update a tenant
1462
- * @description Update an existing tenant with new data. Tenant owners can update their own tenant settings.
1462
+ * @description Update an existing tenant with new data. Tenant owners can update their own tenant settings. billingType, isSandbox, sandboxTenantId and productionTenantId are staff-only and rejected here.
1463
1463
  */
1464
1464
  patch: operations['TenantsController_update'];
1465
1465
  trace?: never;
@@ -1495,7 +1495,7 @@ export interface paths {
1495
1495
  put?: never;
1496
1496
  /**
1497
1497
  * Suspend a tenant
1498
- * @description Suspend a tenant by setting its status to suspended. This prevents access to the tenant while preserving data. Platform admin only; audited.
1498
+ * @description Suspend a tenant by setting its status to suspended. This prevents access to the tenant while preserving data. The cause (default manual), reason, time and actor are kept on the tenant until it is activated. Platform admin only; audited.
1499
1499
  */
1500
1500
  post: operations['TenantsController_suspend'];
1501
1501
  delete?: never;
@@ -1504,6 +1504,46 @@ export interface paths {
1504
1504
  patch?: never;
1505
1505
  trace?: never;
1506
1506
  };
1507
+ '/v1/tenants/{id}/billing-type': {
1508
+ parameters: {
1509
+ query?: never;
1510
+ header?: never;
1511
+ path?: never;
1512
+ cookie?: never;
1513
+ };
1514
+ get?: never;
1515
+ put?: never;
1516
+ /**
1517
+ * Set a tenant billing type
1518
+ * @description Change how Aimee collects the platform fee from this tenant. Platform admin only; audited.
1519
+ */
1520
+ post: operations['TenantsController_setBillingType'];
1521
+ delete?: never;
1522
+ options?: never;
1523
+ head?: never;
1524
+ patch?: never;
1525
+ trace?: never;
1526
+ };
1527
+ '/v1/tenants/{id}/sandbox': {
1528
+ parameters: {
1529
+ query?: never;
1530
+ header?: never;
1531
+ path?: never;
1532
+ cookie?: never;
1533
+ };
1534
+ get?: never;
1535
+ put?: never;
1536
+ /**
1537
+ * Set whether a tenant is a sandbox
1538
+ * @description Sandbox tenants skip billing usage and cannot use live payment credentials. Platform admin only; audited.
1539
+ */
1540
+ post: operations['TenantsController_setSandbox'];
1541
+ delete?: never;
1542
+ options?: never;
1543
+ head?: never;
1544
+ patch?: never;
1545
+ trace?: never;
1546
+ };
1507
1547
  '/v1/tenants/{id}/activate': {
1508
1548
  parameters: {
1509
1549
  query?: never;
@@ -7892,7 +7932,7 @@ export interface paths {
7892
7932
  };
7893
7933
  /**
7894
7934
  * Get platform billing usage for a UTC calendar month
7895
- * @description Returns billable order GMV (discounted merchandise + shipping, excluding tax) aggregated per currency and per store for the organization (tenant). Fee is 2% of net GMV computed at read time. Sandbox store orders are excluded. This is a mutable event-backed read model; do not charge from it directly (#63).
7935
+ * @description Returns billable order GMV (discounted merchandise + shipping, excluding tax) aggregated per currency and per store for the organization (tenant). Fee is the rate card's graduated GMV line, estimated at read time. Sandbox store orders are excluded. This is a mutable event-backed read model; do not charge from it directly (#63).
7896
7936
  */
7897
7937
  get: operations['BillingUsageController_getUsage'];
7898
7938
  put?: never;
@@ -7950,7 +7990,10 @@ export interface paths {
7950
7990
  path?: never;
7951
7991
  cookie?: never;
7952
7992
  };
7953
- /** Get a finalized platform invoice by id */
7993
+ /**
7994
+ * Get a finalized platform invoice by id
7995
+ * @description Includes the rated lines with their tier breakdown (core-api#71).
7996
+ */
7954
7997
  get: operations['PlatformInvoicesController_getOne'];
7955
7998
  put?: never;
7956
7999
  post?: never;
@@ -7978,6 +8021,149 @@ export interface paths {
7978
8021
  patch?: never;
7979
8022
  trace?: never;
7980
8023
  };
8024
+ '/v1/billing/rate-card': {
8025
+ parameters: {
8026
+ query?: never;
8027
+ header?: never;
8028
+ path?: never;
8029
+ cookie?: never;
8030
+ };
8031
+ /**
8032
+ * Get the rate card version that rates the organization
8033
+ * @description The organization's own negotiated card when it has one in effect, else the platform default.
8034
+ */
8035
+ get: operations['PlatformBillingRatesController_getRateCard'];
8036
+ put?: never;
8037
+ post?: never;
8038
+ delete?: never;
8039
+ options?: never;
8040
+ head?: never;
8041
+ patch?: never;
8042
+ trace?: never;
8043
+ };
8044
+ '/v1/billing/estimate': {
8045
+ parameters: {
8046
+ query?: never;
8047
+ header?: never;
8048
+ path?: never;
8049
+ cookie?: never;
8050
+ };
8051
+ /**
8052
+ * Get the provisional platform fee for an open period
8053
+ * @description Rates the period so far with the same code as invoice finalization: one estimate per open currency, with lines and tier breakdown.
8054
+ */
8055
+ get: operations['PlatformBillingRatesController_getEstimate'];
8056
+ put?: never;
8057
+ post?: never;
8058
+ delete?: never;
8059
+ options?: never;
8060
+ head?: never;
8061
+ patch?: never;
8062
+ trace?: never;
8063
+ };
8064
+ '/v1/billing/metered-usage': {
8065
+ parameters: {
8066
+ query?: never;
8067
+ header?: never;
8068
+ path?: never;
8069
+ cookie?: never;
8070
+ };
8071
+ /**
8072
+ * Get metered AimeeBot token usage for a period
8073
+ * @description Input and output tokens, with whether the rate card charges for each (billed = false is shown as not charged).
8074
+ */
8075
+ get: operations['PlatformBillingRatesController_getMeteredUsage'];
8076
+ put?: never;
8077
+ post?: never;
8078
+ delete?: never;
8079
+ options?: never;
8080
+ head?: never;
8081
+ patch?: never;
8082
+ trace?: never;
8083
+ };
8084
+ '/v1/billing/admin/rate-cards': {
8085
+ parameters: {
8086
+ query?: never;
8087
+ header?: never;
8088
+ path?: never;
8089
+ cookie?: never;
8090
+ };
8091
+ /**
8092
+ * List rate card versions (system admin)
8093
+ * @description A tenant's versions with tenantId, else the platform default's. Newest version first per currency.
8094
+ */
8095
+ get: operations['RateCardsAdminController_list'];
8096
+ put?: never;
8097
+ /**
8098
+ * Create a rate card version (system admin)
8099
+ * @description Adds the next version for a tenant (or the platform default when tenantId is omitted), effective from a period boundary no earlier than the current period. Versions are immutable.
8100
+ */
8101
+ post: operations['RateCardsAdminController_create'];
8102
+ delete?: never;
8103
+ options?: never;
8104
+ head?: never;
8105
+ patch?: never;
8106
+ trace?: never;
8107
+ };
8108
+ '/v1/billing/admin/rate-cards/{id}': {
8109
+ parameters: {
8110
+ query?: never;
8111
+ header?: never;
8112
+ path?: never;
8113
+ cookie?: never;
8114
+ };
8115
+ /** Get a rate card version (system admin) */
8116
+ get: operations['RateCardsAdminController_getOne'];
8117
+ put?: never;
8118
+ post?: never;
8119
+ /**
8120
+ * Delete an unused rate card version (system admin)
8121
+ * @description Only a version no invoice used. A platform default version already in effect cannot be deleted.
8122
+ */
8123
+ delete: operations['RateCardsAdminController_remove'];
8124
+ options?: never;
8125
+ head?: never;
8126
+ patch?: never;
8127
+ trace?: never;
8128
+ };
8129
+ '/v1/billing/admin/charges': {
8130
+ parameters: {
8131
+ query?: never;
8132
+ header?: never;
8133
+ path?: never;
8134
+ cookie?: never;
8135
+ };
8136
+ /** List a tenant's one-off charges (system admin) */
8137
+ get: operations['BillingChargesAdminController_list'];
8138
+ put?: never;
8139
+ /**
8140
+ * Add a one-off charge or credit (system admin)
8141
+ * @description Lands on the period's invoice as a one_off line. The period must be the current one or later and not finalized. A credit (category credit) has a negative unitPriceCents.
8142
+ */
8143
+ post: operations['BillingChargesAdminController_create'];
8144
+ delete?: never;
8145
+ options?: never;
8146
+ head?: never;
8147
+ patch?: never;
8148
+ trace?: never;
8149
+ };
8150
+ '/v1/billing/admin/charges/{id}': {
8151
+ parameters: {
8152
+ query?: never;
8153
+ header?: never;
8154
+ path?: never;
8155
+ cookie?: never;
8156
+ };
8157
+ get?: never;
8158
+ put?: never;
8159
+ post?: never;
8160
+ /** Remove a one-off charge from an open period (system admin) */
8161
+ delete: operations['BillingChargesAdminController_remove'];
8162
+ options?: never;
8163
+ head?: never;
8164
+ patch?: never;
8165
+ trace?: never;
8166
+ };
7981
8167
  '/v1/returns': {
7982
8168
  parameters: {
7983
8169
  query?: never;
@@ -16067,6 +16253,15 @@ export interface components {
16067
16253
  * @enum {string|null}
16068
16254
  */
16069
16255
  suspensionCause?: 'manual' | 'non_payment' | null;
16256
+ /** @description Reason given for the current suspension; null unless status is suspended. */
16257
+ suspensionReason?: string | null;
16258
+ /**
16259
+ * Format: date-time
16260
+ * @description When the current suspension started; null unless status is suspended.
16261
+ */
16262
+ suspendedAt?: string | null;
16263
+ /** @description Staff user who suspended the tenant; null for a system (non_payment) suspension or when not suspended. */
16264
+ suspendedBy?: string | null;
16070
16265
  /**
16071
16266
  * @description Platform fee collection path. SELF_SERVICE_CARD for public signup; ENTERPRISE_INVOICE for hand-onboarded orgs. Null when not set.
16072
16267
  * @example SELF_SERVICE_CARD
@@ -16275,28 +16470,6 @@ export interface components {
16275
16470
  * @example ACME
16276
16471
  */
16277
16472
  orderNumberPrefix?: string;
16278
- /**
16279
- * @description Whether this tenant is a sandbox environment
16280
- * @default false
16281
- * @example false
16282
- */
16283
- isSandbox?: boolean;
16284
- /**
16285
- * @description Platform fee collection path. SELF_SERVICE_CARD for public signup; ENTERPRISE_INVOICE for hand-onboarded orgs.
16286
- * @example SELF_SERVICE_CARD
16287
- * @enum {string}
16288
- */
16289
- billingType?: 'SELF_SERVICE_CARD' | 'ENTERPRISE_INVOICE';
16290
- /**
16291
- * @description UUID of the sandbox tenant (for production tenants)
16292
- * @example 550e8400-e29b-41d4-a716-446655440000
16293
- */
16294
- sandboxTenantId?: string;
16295
- /**
16296
- * @description UUID of the production tenant (for sandbox tenants)
16297
- * @example 550e8400-e29b-41d4-a716-446655440000
16298
- */
16299
- productionTenantId?: string;
16300
16473
  /**
16301
16474
  * @description CMS type (strapi, contentful, sanity, etc.)
16302
16475
  * @example strapi
@@ -16400,6 +16573,27 @@ export interface components {
16400
16573
  * @example Suspended after repeated charge failures
16401
16574
  */
16402
16575
  notes?: string;
16576
+ /**
16577
+ * @description Why the tenant is suspended. non_payment is lifted automatically when the unpaid platform invoice is paid.
16578
+ * @default manual
16579
+ * @enum {string}
16580
+ */
16581
+ cause?: 'manual' | 'non_payment';
16582
+ };
16583
+ SetTenantBillingTypeDto: {
16584
+ /**
16585
+ * @description Platform fee collection path. SELF_SERVICE_CARD charges the vaulted card; ENTERPRISE_INVOICE is invoiced manually.
16586
+ * @example ENTERPRISE_INVOICE
16587
+ * @enum {string}
16588
+ */
16589
+ billingType: 'SELF_SERVICE_CARD' | 'ENTERPRISE_INVOICE';
16590
+ };
16591
+ SetTenantSandboxDto: {
16592
+ /**
16593
+ * @description Whether the tenant is a sandbox. Sandbox tenants skip billing usage and cannot use live payment credentials.
16594
+ * @example false
16595
+ */
16596
+ isSandbox: boolean;
16403
16597
  };
16404
16598
  ActivateTenantDto: {
16405
16599
  /**
@@ -16449,6 +16643,12 @@ export interface components {
16449
16643
  * @example en-US
16450
16644
  */
16451
16645
  defaultLocale?: string;
16646
+ /**
16647
+ * @description Platform fee collection path. Defaults to ENTERPRISE_INVOICE when omitted.
16648
+ * @example ENTERPRISE_INVOICE
16649
+ * @enum {string}
16650
+ */
16651
+ billingType?: 'SELF_SERVICE_CARD' | 'ENTERPRISE_INVOICE';
16452
16652
  /**
16453
16653
  * @description Store name
16454
16654
  * @example Acme Store
@@ -31236,7 +31436,7 @@ export interface components {
31236
31436
  */
31237
31437
  gmvCents: string;
31238
31438
  /**
31239
- * @description Platform fee (2% of gmvCents) in cents as string
31439
+ * @description Estimated GMV fee in cents (the rate card's GMV line; a store's share by GMV); negative is a credit
31240
31440
  * @example 3000
31241
31441
  */
31242
31442
  feeCents: string;
@@ -31265,8 +31465,8 @@ export interface components {
31265
31465
  /** @example 2026-07 */
31266
31466
  period: string;
31267
31467
  /**
31268
- * @description Platform fee rate as a fraction (0.02 = 2%)
31269
- * @example 0.02
31468
+ * @description Effective GMV rate of the estimate as a fraction (0.0085 = 0.85%)
31469
+ * @example 0.0085
31270
31470
  */
31271
31471
  rate: number;
31272
31472
  currencies: components['schemas']['BillingUsageCurrencyTotalDto'][];
@@ -31288,6 +31488,52 @@ export interface components {
31288
31488
  /** @example -2000 */
31289
31489
  adjustmentGmvCents: string;
31290
31490
  };
31491
+ TierBreakdownResponseDto: {
31492
+ /**
31493
+ * @description Bracket or tier lower bound (GMV brackets are on trailing-12-period net GMV, in cents)
31494
+ * @example 0
31495
+ */
31496
+ fromQuantity: string;
31497
+ /** @example 200000000 */
31498
+ toQuantity: string | null;
31499
+ /**
31500
+ * @description Part of the period quantity in this bracket (signed for GMV)
31501
+ * @example 1250000
31502
+ */
31503
+ quantity: string;
31504
+ /**
31505
+ * @description GMV brackets: rate in basis points
31506
+ * @example 100
31507
+ */
31508
+ basisPoints: number | null;
31509
+ /** @description Usage tiers: cents per unitSize */
31510
+ unitPriceCents: string | null;
31511
+ /** @example 12500 */
31512
+ amountCents: string;
31513
+ };
31514
+ PlatformInvoiceLineResponseDto: {
31515
+ /** @enum {string} */
31516
+ type: 'gmv_graduated' | 'usage_graduated' | 'recurring_flat' | 'minimum' | 'one_off';
31517
+ /** @example Platform fee on net GMV */
31518
+ description: string;
31519
+ /** @description gmv, ai_input_tokens, ai_output_tokens; null otherwise */
31520
+ metric: string | null;
31521
+ /**
31522
+ * @description Quantity rated (signed for GMV)
31523
+ * @example 1250000
31524
+ */
31525
+ quantity: string;
31526
+ /** @enum {string} */
31527
+ unit: 'cents' | 'tokens' | 'period' | 'each';
31528
+ /**
31529
+ * @description Signed amount in cents
31530
+ * @example 12500
31531
+ */
31532
+ amountCents: string;
31533
+ tierBreakdown: components['schemas']['TierBreakdownResponseDto'][] | null;
31534
+ rateCardLineId: string | null;
31535
+ billingChargeId: string | null;
31536
+ };
31291
31537
  PlatformInvoiceResponseDto: {
31292
31538
  id: string;
31293
31539
  /** @example 2026-07 */
@@ -31295,10 +31541,12 @@ export interface components {
31295
31541
  /** @example USD */
31296
31542
  currency: string;
31297
31543
  /**
31298
- * @description Fee rate snapshot at finalize (0.02 = 2%)
31299
- * @example 0.02
31544
+ * @description Effective GMV rate: the GMV line over net GMV (0.0085 = 0.85%). Invoices finalized before rate cards hold the flat 0.02.
31545
+ * @example 0.0085
31300
31546
  */
31301
31547
  rate: number;
31548
+ /** @description Rate card version that rated the invoice; null before rate cards */
31549
+ rateCardId: string | null;
31302
31550
  /**
31303
31551
  * @description Net billable GMV cents as string
31304
31552
  * @example 150000
@@ -31309,7 +31557,7 @@ export interface components {
31309
31557
  /** @example -10000 */
31310
31558
  adjustmentGmvCents: string;
31311
31559
  /**
31312
- * @description Raw platform fee cents (half-up 2% of max(gmv,0) at invoice total)
31560
+ * @description Platform fee cents: the sum of the lines, floored at 0 (a negative sum is creditGeneratedCents)
31313
31561
  * @example 3000
31314
31562
  */
31315
31563
  feeCents: string;
@@ -31345,6 +31593,8 @@ export interface components {
31345
31593
  collectionUpdatedAt?: string | null;
31346
31594
  finalizedAt: string;
31347
31595
  storeBreakdown?: components['schemas']['PlatformInvoiceStoreBreakdownDto'][];
31596
+ /** @description Rated lines with tier breakdown (detail only; empty before rate cards) */
31597
+ lines?: components['schemas']['PlatformInvoiceLineResponseDto'][];
31348
31598
  };
31349
31599
  PlatformInvoiceListResponseDto: {
31350
31600
  invoices: components['schemas']['PlatformInvoiceResponseDto'][];
@@ -31383,6 +31633,225 @@ export interface components {
31383
31633
  /** Format: date-time */
31384
31634
  createdAt: string;
31385
31635
  };
31636
+ GmvTierResponseDto: {
31637
+ /** @example 200000000 */
31638
+ upToCents: string | null;
31639
+ /** @example 100 */
31640
+ basisPoints: number;
31641
+ };
31642
+ UsageTierResponseDto: {
31643
+ /** @example 10000000 */
31644
+ upToQuantity: string | null;
31645
+ /** @example 300 */
31646
+ unitPriceCents: string;
31647
+ };
31648
+ RateCardLineResponseDto: {
31649
+ id: string;
31650
+ /** @enum {string} */
31651
+ type: 'gmv_graduated' | 'usage_graduated' | 'recurring_flat' | 'minimum';
31652
+ description: string;
31653
+ metric: string | null;
31654
+ unitSize: string | null;
31655
+ includedQuantity: string | null;
31656
+ gmvTiers: components['schemas']['GmvTierResponseDto'][] | null;
31657
+ usageTiers: components['schemas']['UsageTierResponseDto'][] | null;
31658
+ amountCents: string | null;
31659
+ startPeriod: string | null;
31660
+ endPeriod: string | null;
31661
+ };
31662
+ RateCardResponseDto: {
31663
+ id: string;
31664
+ tenantId: string | null;
31665
+ /** @description True for a platform default version */
31666
+ isPlatformDefault: boolean;
31667
+ /** @example USD */
31668
+ currency: string;
31669
+ /** @example 1 */
31670
+ version: number;
31671
+ /** @example 2026-11 */
31672
+ effectiveFromPeriod: string;
31673
+ name: string;
31674
+ createdAt: string;
31675
+ lines: components['schemas']['RateCardLineResponseDto'][];
31676
+ };
31677
+ PlatformFeeCurrencyEstimateDto: {
31678
+ /** @example USD */
31679
+ currency: string;
31680
+ rateCardId: string;
31681
+ /** @example 1 */
31682
+ rateCardVersion: number;
31683
+ rateCardName: string;
31684
+ isPlatformDefault: boolean;
31685
+ /** @description Period net GMV so far, in cents */
31686
+ gmvCents: string;
31687
+ /** @description Net GMV of the previous 11 periods: where this period starts on the bracket ladder */
31688
+ priorGmvCents: string;
31689
+ /** @description Signed sum of the lines before credits; a negative sum becomes credit */
31690
+ totalCents: string;
31691
+ lines: components['schemas']['PlatformInvoiceLineResponseDto'][];
31692
+ };
31693
+ PlatformFeeEstimateResponseDto: {
31694
+ /** @example 2026-11 */
31695
+ period: string;
31696
+ /** @description One estimate per currency still open for the period. Provisional: usage can still change; finalized periods are on the invoices. */
31697
+ currencies: components['schemas']['PlatformFeeCurrencyEstimateDto'][];
31698
+ };
31699
+ MeteredUsageMetricDto: {
31700
+ /** @enum {string} */
31701
+ metric: 'ai_input_tokens' | 'ai_output_tokens';
31702
+ /** @example 1250000 */
31703
+ quantity: string;
31704
+ /** @description Whether the tenant's rate card (default currency) charges for this metric; false = shown as not charged */
31705
+ billed: boolean;
31706
+ };
31707
+ MeteredUsageResponseDto: {
31708
+ /** @example 2026-11 */
31709
+ period: string;
31710
+ metrics: components['schemas']['MeteredUsageMetricDto'][];
31711
+ };
31712
+ AdminRateCardResponseDto: {
31713
+ id: string;
31714
+ tenantId: string | null;
31715
+ /** @description True for a platform default version */
31716
+ isPlatformDefault: boolean;
31717
+ /** @example USD */
31718
+ currency: string;
31719
+ /** @example 1 */
31720
+ version: number;
31721
+ /** @example 2026-11 */
31722
+ effectiveFromPeriod: string;
31723
+ name: string;
31724
+ createdAt: string;
31725
+ lines: components['schemas']['RateCardLineResponseDto'][];
31726
+ /** @description Finalized invoices rated by this version (0 = deletable) */
31727
+ invoiceCount: number;
31728
+ };
31729
+ AdminRateCardListResponseDto: {
31730
+ rateCards: components['schemas']['AdminRateCardResponseDto'][];
31731
+ };
31732
+ GmvTierInputDto: {
31733
+ /**
31734
+ * @description Upper bound of the bracket on trailing-12-period net GMV, in cents. Null on the last (open) bracket.
31735
+ * @example 200000000
31736
+ */
31737
+ upToCents: number | null;
31738
+ /**
31739
+ * @description Rate in basis points (100 = 1%)
31740
+ * @example 100
31741
+ */
31742
+ basisPoints: number;
31743
+ };
31744
+ UsageTierInputDto: {
31745
+ /**
31746
+ * @description Upper bound of the tier on the period quantity (included quantity counts). Null on the last (open) tier.
31747
+ * @example 10000000
31748
+ */
31749
+ upToQuantity: number | null;
31750
+ /**
31751
+ * @description Price in cents per unitSize of quantity in this tier
31752
+ * @example 300
31753
+ */
31754
+ unitPriceCents: number;
31755
+ };
31756
+ RateCardLineInputDto: {
31757
+ /** @enum {string} */
31758
+ type: 'gmv_graduated' | 'usage_graduated' | 'recurring_flat' | 'minimum';
31759
+ /** @example Platform fee on net GMV */
31760
+ description: string;
31761
+ /**
31762
+ * @description usage_graduated: metered metric
31763
+ * @enum {string}
31764
+ */
31765
+ metric?: 'ai_input_tokens' | 'ai_output_tokens';
31766
+ /**
31767
+ * @description usage_graduated: quantity one unitPriceCents buys
31768
+ * @example 1000000
31769
+ */
31770
+ unitSize?: number;
31771
+ /**
31772
+ * @description usage_graduated: quantity free each period
31773
+ * @example 0
31774
+ */
31775
+ includedQuantity?: number;
31776
+ /** @description gmv_graduated: brackets, lowest first; last is open */
31777
+ gmvTiers?: components['schemas']['GmvTierInputDto'][];
31778
+ /** @description usage_graduated: tiers, lowest first; last is open */
31779
+ usageTiers?: components['schemas']['UsageTierInputDto'][];
31780
+ /**
31781
+ * @description recurring_flat: amount per period; minimum: floor on the card lines, in cents
31782
+ * @example 50000
31783
+ */
31784
+ amountCents?: number;
31785
+ /**
31786
+ * @description recurring_flat: first period billed (YYYY-MM)
31787
+ * @example 2026-11
31788
+ */
31789
+ startPeriod?: string;
31790
+ /**
31791
+ * @description recurring_flat: last period billed (YYYY-MM); omit for open
31792
+ * @example 2027-10
31793
+ */
31794
+ endPeriod?: string;
31795
+ };
31796
+ CreateRateCardVersionDto: {
31797
+ /** @description Tenant the version belongs to. Omit for a new platform default version. */
31798
+ tenantId?: string;
31799
+ /** @example USD */
31800
+ currency: string;
31801
+ /**
31802
+ * @description First UTC period this version rates; the current period or later
31803
+ * @example 2026-11
31804
+ */
31805
+ effectiveFromPeriod: string;
31806
+ /** @example SoClean negotiated terms 2026 */
31807
+ name: string;
31808
+ lines: components['schemas']['RateCardLineInputDto'][];
31809
+ };
31810
+ BillingChargeResponseDto: {
31811
+ id: string;
31812
+ tenantId: string;
31813
+ /** @example 2026-11 */
31814
+ period: string;
31815
+ /** @example USD */
31816
+ currency: string;
31817
+ /** @enum {string} */
31818
+ category: 'consulting' | 'addon' | 'service' | 'credit';
31819
+ description: string;
31820
+ quantity: number;
31821
+ /** @example 15000 */
31822
+ unitPriceCents: string;
31823
+ /** @example 120000 */
31824
+ amountCents: string;
31825
+ reference: string | null;
31826
+ createdBy: string;
31827
+ createdAt: string;
31828
+ };
31829
+ BillingChargeListResponseDto: {
31830
+ charges: components['schemas']['BillingChargeResponseDto'][];
31831
+ };
31832
+ CreateBillingChargeDto: {
31833
+ tenantId: string;
31834
+ /**
31835
+ * @description Open UTC period YYYY-MM: the current period or later
31836
+ * @example 2026-11
31837
+ */
31838
+ period: string;
31839
+ /** @example USD */
31840
+ currency: string;
31841
+ /** @enum {string} */
31842
+ category: 'consulting' | 'addon' | 'service' | 'credit';
31843
+ /** @example Catalog migration consulting (8h) */
31844
+ description: string;
31845
+ /** @example 8 */
31846
+ quantity: number;
31847
+ /**
31848
+ * @description Cents per unit; negative for a credit, positive otherwise
31849
+ * @example 15000
31850
+ */
31851
+ unitPriceCents: number;
31852
+ /** @description Contract, ticket or PO reference */
31853
+ reference?: string;
31854
+ };
31386
31855
  ReturnItemDto: {
31387
31856
  /**
31388
31857
  * @description Order item ID to return
@@ -40254,6 +40723,88 @@ export interface operations {
40254
40723
  };
40255
40724
  };
40256
40725
  };
40726
+ TenantsController_setBillingType: {
40727
+ parameters: {
40728
+ query?: never;
40729
+ header?: never;
40730
+ path: {
40731
+ /** @description Tenant ID (UUID) */
40732
+ id: string;
40733
+ };
40734
+ cookie?: never;
40735
+ };
40736
+ requestBody: {
40737
+ content: {
40738
+ 'application/json': components['schemas']['SetTenantBillingTypeDto'];
40739
+ };
40740
+ };
40741
+ responses: {
40742
+ /** @description Billing type set */
40743
+ 200: {
40744
+ headers: {
40745
+ [name: string]: unknown;
40746
+ };
40747
+ content: {
40748
+ 'application/json': components['schemas']['TenantDto'];
40749
+ };
40750
+ };
40751
+ /** @description Unauthorized */
40752
+ 401: {
40753
+ headers: {
40754
+ [name: string]: unknown;
40755
+ };
40756
+ content?: never;
40757
+ };
40758
+ /** @description Tenant not found */
40759
+ 404: {
40760
+ headers: {
40761
+ [name: string]: unknown;
40762
+ };
40763
+ content?: never;
40764
+ };
40765
+ };
40766
+ };
40767
+ TenantsController_setSandbox: {
40768
+ parameters: {
40769
+ query?: never;
40770
+ header?: never;
40771
+ path: {
40772
+ /** @description Tenant ID (UUID) */
40773
+ id: string;
40774
+ };
40775
+ cookie?: never;
40776
+ };
40777
+ requestBody: {
40778
+ content: {
40779
+ 'application/json': components['schemas']['SetTenantSandboxDto'];
40780
+ };
40781
+ };
40782
+ responses: {
40783
+ /** @description Sandbox flag set */
40784
+ 200: {
40785
+ headers: {
40786
+ [name: string]: unknown;
40787
+ };
40788
+ content: {
40789
+ 'application/json': components['schemas']['TenantDto'];
40790
+ };
40791
+ };
40792
+ /** @description Unauthorized */
40793
+ 401: {
40794
+ headers: {
40795
+ [name: string]: unknown;
40796
+ };
40797
+ content?: never;
40798
+ };
40799
+ /** @description Tenant not found */
40800
+ 404: {
40801
+ headers: {
40802
+ [name: string]: unknown;
40803
+ };
40804
+ content?: never;
40805
+ };
40806
+ };
40807
+ };
40257
40808
  TenantsController_activate: {
40258
40809
  parameters: {
40259
40810
  query?: never;
@@ -55017,6 +55568,392 @@ export interface operations {
55017
55568
  };
55018
55569
  };
55019
55570
  };
55571
+ PlatformBillingRatesController_getRateCard: {
55572
+ parameters: {
55573
+ query?: {
55574
+ currency?: string;
55575
+ /** @description UTC period YYYY-MM (defaults to the current UTC month) */
55576
+ period?: string;
55577
+ };
55578
+ header?: never;
55579
+ path?: never;
55580
+ cookie?: never;
55581
+ };
55582
+ requestBody?: never;
55583
+ responses: {
55584
+ 200: {
55585
+ headers: {
55586
+ [name: string]: unknown;
55587
+ };
55588
+ content: {
55589
+ 'application/json': components['schemas']['RateCardResponseDto'];
55590
+ };
55591
+ };
55592
+ /** @description Missing platform-billing:read */
55593
+ 403: {
55594
+ headers: {
55595
+ [name: string]: unknown;
55596
+ };
55597
+ content?: never;
55598
+ };
55599
+ /** @description No card for the currency */
55600
+ 404: {
55601
+ headers: {
55602
+ [name: string]: unknown;
55603
+ };
55604
+ content?: never;
55605
+ };
55606
+ };
55607
+ };
55608
+ PlatformBillingRatesController_getEstimate: {
55609
+ parameters: {
55610
+ query?: {
55611
+ /** @description UTC period YYYY-MM (defaults to the current UTC month) */
55612
+ period?: string;
55613
+ };
55614
+ header?: never;
55615
+ path?: never;
55616
+ cookie?: never;
55617
+ };
55618
+ requestBody?: never;
55619
+ responses: {
55620
+ 200: {
55621
+ headers: {
55622
+ [name: string]: unknown;
55623
+ };
55624
+ content: {
55625
+ 'application/json': components['schemas']['PlatformFeeEstimateResponseDto'];
55626
+ };
55627
+ };
55628
+ /** @description Invalid period key */
55629
+ 400: {
55630
+ headers: {
55631
+ [name: string]: unknown;
55632
+ };
55633
+ content?: never;
55634
+ };
55635
+ /** @description Missing platform-billing:read */
55636
+ 403: {
55637
+ headers: {
55638
+ [name: string]: unknown;
55639
+ };
55640
+ content?: never;
55641
+ };
55642
+ };
55643
+ };
55644
+ PlatformBillingRatesController_getMeteredUsage: {
55645
+ parameters: {
55646
+ query?: {
55647
+ /** @description UTC period YYYY-MM (defaults to the current UTC month) */
55648
+ period?: string;
55649
+ };
55650
+ header?: never;
55651
+ path?: never;
55652
+ cookie?: never;
55653
+ };
55654
+ requestBody?: never;
55655
+ responses: {
55656
+ 200: {
55657
+ headers: {
55658
+ [name: string]: unknown;
55659
+ };
55660
+ content: {
55661
+ 'application/json': components['schemas']['MeteredUsageResponseDto'];
55662
+ };
55663
+ };
55664
+ /** @description Invalid period key */
55665
+ 400: {
55666
+ headers: {
55667
+ [name: string]: unknown;
55668
+ };
55669
+ content?: never;
55670
+ };
55671
+ /** @description Missing platform-billing:read */
55672
+ 403: {
55673
+ headers: {
55674
+ [name: string]: unknown;
55675
+ };
55676
+ content?: never;
55677
+ };
55678
+ };
55679
+ };
55680
+ RateCardsAdminController_list: {
55681
+ parameters: {
55682
+ query?: {
55683
+ /** @description Tenant whose versions to list. Omit for the platform default's versions. */
55684
+ tenantId?: string;
55685
+ };
55686
+ header?: never;
55687
+ path?: never;
55688
+ cookie?: never;
55689
+ };
55690
+ requestBody?: never;
55691
+ responses: {
55692
+ 200: {
55693
+ headers: {
55694
+ [name: string]: unknown;
55695
+ };
55696
+ content: {
55697
+ 'application/json': components['schemas']['AdminRateCardListResponseDto'];
55698
+ };
55699
+ };
55700
+ /** @description System admin required */
55701
+ 403: {
55702
+ headers: {
55703
+ [name: string]: unknown;
55704
+ };
55705
+ content?: never;
55706
+ };
55707
+ };
55708
+ };
55709
+ RateCardsAdminController_create: {
55710
+ parameters: {
55711
+ query?: never;
55712
+ header?: never;
55713
+ path?: never;
55714
+ cookie?: never;
55715
+ };
55716
+ requestBody: {
55717
+ content: {
55718
+ 'application/json': components['schemas']['CreateRateCardVersionDto'];
55719
+ };
55720
+ };
55721
+ responses: {
55722
+ 201: {
55723
+ headers: {
55724
+ [name: string]: unknown;
55725
+ };
55726
+ content: {
55727
+ 'application/json': components['schemas']['AdminRateCardResponseDto'];
55728
+ };
55729
+ };
55730
+ /** @description Invalid lines or period */
55731
+ 400: {
55732
+ headers: {
55733
+ [name: string]: unknown;
55734
+ };
55735
+ content?: never;
55736
+ };
55737
+ /** @description System admin required */
55738
+ 403: {
55739
+ headers: {
55740
+ [name: string]: unknown;
55741
+ };
55742
+ content?: never;
55743
+ };
55744
+ /** @description Tenant not found */
55745
+ 404: {
55746
+ headers: {
55747
+ [name: string]: unknown;
55748
+ };
55749
+ content?: never;
55750
+ };
55751
+ /** @description A version already starts in that period, or an invoice from it on is finalized */
55752
+ 409: {
55753
+ headers: {
55754
+ [name: string]: unknown;
55755
+ };
55756
+ content?: never;
55757
+ };
55758
+ };
55759
+ };
55760
+ RateCardsAdminController_getOne: {
55761
+ parameters: {
55762
+ query?: never;
55763
+ header?: never;
55764
+ path: {
55765
+ id: string;
55766
+ };
55767
+ cookie?: never;
55768
+ };
55769
+ requestBody?: never;
55770
+ responses: {
55771
+ 200: {
55772
+ headers: {
55773
+ [name: string]: unknown;
55774
+ };
55775
+ content: {
55776
+ 'application/json': components['schemas']['AdminRateCardResponseDto'];
55777
+ };
55778
+ };
55779
+ /** @description System admin required */
55780
+ 403: {
55781
+ headers: {
55782
+ [name: string]: unknown;
55783
+ };
55784
+ content?: never;
55785
+ };
55786
+ /** @description Not found */
55787
+ 404: {
55788
+ headers: {
55789
+ [name: string]: unknown;
55790
+ };
55791
+ content?: never;
55792
+ };
55793
+ };
55794
+ };
55795
+ RateCardsAdminController_remove: {
55796
+ parameters: {
55797
+ query?: never;
55798
+ header?: never;
55799
+ path: {
55800
+ id: string;
55801
+ };
55802
+ cookie?: never;
55803
+ };
55804
+ requestBody?: never;
55805
+ responses: {
55806
+ /** @description Deleted */
55807
+ 204: {
55808
+ headers: {
55809
+ [name: string]: unknown;
55810
+ };
55811
+ content?: never;
55812
+ };
55813
+ /** @description System admin required */
55814
+ 403: {
55815
+ headers: {
55816
+ [name: string]: unknown;
55817
+ };
55818
+ content?: never;
55819
+ };
55820
+ /** @description Not found */
55821
+ 404: {
55822
+ headers: {
55823
+ [name: string]: unknown;
55824
+ };
55825
+ content?: never;
55826
+ };
55827
+ /** @description Version in use */
55828
+ 409: {
55829
+ headers: {
55830
+ [name: string]: unknown;
55831
+ };
55832
+ content?: never;
55833
+ };
55834
+ };
55835
+ };
55836
+ BillingChargesAdminController_list: {
55837
+ parameters: {
55838
+ query: {
55839
+ tenantId: string;
55840
+ period?: string;
55841
+ };
55842
+ header?: never;
55843
+ path?: never;
55844
+ cookie?: never;
55845
+ };
55846
+ requestBody?: never;
55847
+ responses: {
55848
+ 200: {
55849
+ headers: {
55850
+ [name: string]: unknown;
55851
+ };
55852
+ content: {
55853
+ 'application/json': components['schemas']['BillingChargeListResponseDto'];
55854
+ };
55855
+ };
55856
+ /** @description System admin required */
55857
+ 403: {
55858
+ headers: {
55859
+ [name: string]: unknown;
55860
+ };
55861
+ content?: never;
55862
+ };
55863
+ };
55864
+ };
55865
+ BillingChargesAdminController_create: {
55866
+ parameters: {
55867
+ query?: never;
55868
+ header?: never;
55869
+ path?: never;
55870
+ cookie?: never;
55871
+ };
55872
+ requestBody: {
55873
+ content: {
55874
+ 'application/json': components['schemas']['CreateBillingChargeDto'];
55875
+ };
55876
+ };
55877
+ responses: {
55878
+ 201: {
55879
+ headers: {
55880
+ [name: string]: unknown;
55881
+ };
55882
+ content: {
55883
+ 'application/json': components['schemas']['BillingChargeResponseDto'];
55884
+ };
55885
+ };
55886
+ /** @description Invalid amount or period */
55887
+ 400: {
55888
+ headers: {
55889
+ [name: string]: unknown;
55890
+ };
55891
+ content?: never;
55892
+ };
55893
+ /** @description System admin required */
55894
+ 403: {
55895
+ headers: {
55896
+ [name: string]: unknown;
55897
+ };
55898
+ content?: never;
55899
+ };
55900
+ /** @description Tenant not found */
55901
+ 404: {
55902
+ headers: {
55903
+ [name: string]: unknown;
55904
+ };
55905
+ content?: never;
55906
+ };
55907
+ /** @description Period already finalized */
55908
+ 409: {
55909
+ headers: {
55910
+ [name: string]: unknown;
55911
+ };
55912
+ content?: never;
55913
+ };
55914
+ };
55915
+ };
55916
+ BillingChargesAdminController_remove: {
55917
+ parameters: {
55918
+ query?: never;
55919
+ header?: never;
55920
+ path: {
55921
+ id: string;
55922
+ };
55923
+ cookie?: never;
55924
+ };
55925
+ requestBody?: never;
55926
+ responses: {
55927
+ /** @description Removed */
55928
+ 204: {
55929
+ headers: {
55930
+ [name: string]: unknown;
55931
+ };
55932
+ content?: never;
55933
+ };
55934
+ /** @description System admin required */
55935
+ 403: {
55936
+ headers: {
55937
+ [name: string]: unknown;
55938
+ };
55939
+ content?: never;
55940
+ };
55941
+ /** @description Not found */
55942
+ 404: {
55943
+ headers: {
55944
+ [name: string]: unknown;
55945
+ };
55946
+ content?: never;
55947
+ };
55948
+ /** @description Period already finalized */
55949
+ 409: {
55950
+ headers: {
55951
+ [name: string]: unknown;
55952
+ };
55953
+ content?: never;
55954
+ };
55955
+ };
55956
+ };
55020
55957
  ReturnsController_listReturns: {
55021
55958
  parameters: {
55022
55959
  query?: {