@iblai/iblai-api 4.175.1-core → 4.175.2-core

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.
Files changed (37) hide show
  1. package/dist/index.cjs.js +113 -7
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +113 -8
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +113 -7
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +5 -0
  8. package/dist/types/models/AutoRechargeTriggerRequest.d.ts +4 -0
  9. package/dist/types/models/CreditAccountAutoRechargeUpdate.d.ts +4 -0
  10. package/dist/types/models/CreditAccountInfo.d.ts +20 -0
  11. package/dist/types/models/CreditTransactionHistory.d.ts +17 -0
  12. package/dist/types/models/CreditTransactionHistoryStatusEnum.d.ts +12 -0
  13. package/dist/types/models/FlowTypeEnum.d.ts +10 -0
  14. package/dist/types/models/PatchedCreditAccountAutoRechargeUpdate.d.ts +4 -0
  15. package/dist/types/models/StripeCustomerPortalRequest.d.ts +16 -2
  16. package/dist/types/models/TransactionTypeEnum.d.ts +16 -0
  17. package/dist/types/services/AccountService.d.ts +1 -1
  18. package/dist/types/services/AutoRechargeService.d.ts +2 -2
  19. package/dist/types/services/BillingService.d.ts +35 -3
  20. package/dist/types/services/TransactionsService.d.ts +35 -0
  21. package/package.json +1 -1
  22. package/sdk_schema.yml +292 -18
  23. package/src/core/OpenAPI.ts +1 -1
  24. package/src/index.ts +5 -0
  25. package/src/models/AutoRechargeTriggerRequest.ts +4 -0
  26. package/src/models/CreditAccountAutoRechargeUpdate.ts +4 -0
  27. package/src/models/CreditAccountInfo.ts +20 -0
  28. package/src/models/CreditTransactionHistory.ts +22 -0
  29. package/src/models/CreditTransactionHistoryStatusEnum.ts +16 -0
  30. package/src/models/FlowTypeEnum.ts +14 -0
  31. package/src/models/PatchedCreditAccountAutoRechargeUpdate.ts +4 -0
  32. package/src/models/StripeCustomerPortalRequest.ts +16 -2
  33. package/src/models/TransactionTypeEnum.ts +20 -0
  34. package/src/services/AccountService.ts +1 -1
  35. package/src/services/AutoRechargeService.ts +2 -2
  36. package/src/services/BillingService.ts +51 -3
  37. package/src/services/TransactionsService.ts +57 -0
package/sdk_schema.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ibl-data-manager
4
- version: 4.175.1-core
4
+ version: 4.175.2-core
5
5
  description: API for iblai
6
6
  paths:
7
7
  /account/:
@@ -32,9 +32,12 @@ paths:
32
32
  description: ''
33
33
  put:
34
34
  operationId: account_update
35
- description: Update auto_recharge_threshold_usd, auto_recharge_amount_usd, and/or
36
- auto_recharge_enabled. Pass platform_key in the request body to update platform
37
- settings.
35
+ description: 'Update auto_recharge_threshold_usd, auto_recharge_amount_usd,
36
+ auto_recharge_enabled, and/or auto_recharge_spending_limit_usd. When enabling
37
+ auto-recharge, missing values are calculated: if only limit set, amount =
38
+ 20% of limit; if only amount set, limit = 5x amount; if neither set, defaults
39
+ are limit=20, amount=4. Pass platform_key in the request body to update platform
40
+ settings.'
38
41
  summary: Update auto-recharge preferences
39
42
  tags:
40
43
  - account
@@ -1883,9 +1886,12 @@ paths:
1883
1886
  description: ''
1884
1887
  put:
1885
1888
  operationId: billing_account_update
1886
- description: Update auto_recharge_threshold_usd, auto_recharge_amount_usd, and/or
1887
- auto_recharge_enabled. Pass platform_key in the request body to update platform
1888
- settings.
1889
+ description: 'Update auto_recharge_threshold_usd, auto_recharge_amount_usd,
1890
+ auto_recharge_enabled, and/or auto_recharge_spending_limit_usd. When enabling
1891
+ auto-recharge, missing values are calculated: if only limit set, amount =
1892
+ 20% of limit; if only amount set, limit = 5x amount; if neither set, defaults
1893
+ are limit=20, amount=4. Pass platform_key in the request body to update platform
1894
+ settings.'
1889
1895
  summary: Update auto-recharge preferences
1890
1896
  tags:
1891
1897
  - billing
@@ -1950,10 +1956,11 @@ paths:
1950
1956
  /api/billing/auto-recharge/trigger/:
1951
1957
  post:
1952
1958
  operationId: billing_auto_recharge_trigger_create
1953
- description: Run auto-recharge once if the account has it enabled and balance
1954
- is below threshold. Returns 400 if skipped or failed (e.g. no payment method,
1955
- cooldown). Pass platform_key in request body.
1956
- summary: Trigger auto-recharge
1959
+ description: 'With amount_usd: manual top-up (charge that amount, add credits;
1960
+ no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if
1961
+ enabled and balance below threshold. Returns 400 if skipped or failed (e.g.
1962
+ no payment method, cooldown). Pass platform_key in request body.'
1963
+ summary: Trigger auto-recharge or manual top-up
1957
1964
  tags:
1958
1965
  - billing
1959
1966
  requestBody:
@@ -1988,6 +1995,64 @@ paths:
1988
1995
  schema:
1989
1996
  $ref: '#/components/schemas/ErrorDetail'
1990
1997
  description: ''
1998
+ /api/billing/transactions/:
1999
+ get:
2000
+ operationId: billing_transactions_retrieve
2001
+ description: Paginated transaction history for the credit account. Use platform_key
2002
+ query param to list platform account transactions (if permitted). Filter by
2003
+ transaction_type, from_date (YYYY-MM-DD), to_date (YYYY-MM-DD).
2004
+ summary: List transaction history
2005
+ parameters:
2006
+ - in: query
2007
+ name: from_date
2008
+ schema:
2009
+ type: string
2010
+ format: date
2011
+ description: Filter from date (YYYY-MM-DD), inclusive.
2012
+ - in: query
2013
+ name: platform_key
2014
+ schema:
2015
+ type: string
2016
+ minLength: 1
2017
+ description: Platform key. Omit for user's own account.
2018
+ - in: query
2019
+ name: to_date
2020
+ schema:
2021
+ type: string
2022
+ format: date
2023
+ description: Filter to date (YYYY-MM-DD), inclusive.
2024
+ - in: query
2025
+ name: transaction_type
2026
+ schema:
2027
+ enum:
2028
+ - add
2029
+ - subtract
2030
+ - reserve
2031
+ - release
2032
+ - rollover
2033
+ - refund
2034
+ type: string
2035
+ minLength: 1
2036
+ description: |-
2037
+ Filter by transaction type.
2038
+
2039
+ * `add` - add
2040
+ * `subtract` - subtract
2041
+ * `reserve` - reserve
2042
+ * `release` - release
2043
+ * `rollover` - rollover
2044
+ * `refund` - refund
2045
+ tags:
2046
+ - billing
2047
+ security:
2048
+ - PlatformApiKeyAuthentication: []
2049
+ responses:
2050
+ '200':
2051
+ content:
2052
+ application/json:
2053
+ schema:
2054
+ $ref: '#/components/schemas/CreditTransactionHistory'
2055
+ description: ''
1991
2056
  /api/career/location/orgs/{org}/users/{username}/:
1992
2057
  get:
1993
2058
  operationId: career_location_orgs_users_retrieve
@@ -33286,10 +33351,11 @@ paths:
33286
33351
  /auto-recharge/trigger/:
33287
33352
  post:
33288
33353
  operationId: auto_recharge_trigger_create
33289
- description: Run auto-recharge once if the account has it enabled and balance
33290
- is below threshold. Returns 400 if skipped or failed (e.g. no payment method,
33291
- cooldown). Pass platform_key in request body.
33292
- summary: Trigger auto-recharge
33354
+ description: 'With amount_usd: manual top-up (charge that amount, add credits;
33355
+ no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if
33356
+ enabled and balance below threshold. Returns 400 if skipped or failed (e.g.
33357
+ no payment method, cooldown). Pass platform_key in request body.'
33358
+ summary: Trigger auto-recharge or manual top-up
33293
33359
  tags:
33294
33360
  - auto-recharge
33295
33361
  requestBody:
@@ -33339,6 +33405,64 @@ paths:
33339
33405
  responses:
33340
33406
  '200':
33341
33407
  description: No response body
33408
+ /transactions/:
33409
+ get:
33410
+ operationId: transactions_retrieve
33411
+ description: Paginated transaction history for the credit account. Use platform_key
33412
+ query param to list platform account transactions (if permitted). Filter by
33413
+ transaction_type, from_date (YYYY-MM-DD), to_date (YYYY-MM-DD).
33414
+ summary: List transaction history
33415
+ parameters:
33416
+ - in: query
33417
+ name: from_date
33418
+ schema:
33419
+ type: string
33420
+ format: date
33421
+ description: Filter from date (YYYY-MM-DD), inclusive.
33422
+ - in: query
33423
+ name: platform_key
33424
+ schema:
33425
+ type: string
33426
+ minLength: 1
33427
+ description: Platform key. Omit for user's own account.
33428
+ - in: query
33429
+ name: to_date
33430
+ schema:
33431
+ type: string
33432
+ format: date
33433
+ description: Filter to date (YYYY-MM-DD), inclusive.
33434
+ - in: query
33435
+ name: transaction_type
33436
+ schema:
33437
+ enum:
33438
+ - add
33439
+ - subtract
33440
+ - reserve
33441
+ - release
33442
+ - rollover
33443
+ - refund
33444
+ type: string
33445
+ minLength: 1
33446
+ description: |-
33447
+ Filter by transaction type.
33448
+
33449
+ * `add` - add
33450
+ * `subtract` - subtract
33451
+ * `reserve` - reserve
33452
+ * `release` - release
33453
+ * `rollover` - rollover
33454
+ * `refund` - refund
33455
+ tags:
33456
+ - transactions
33457
+ security:
33458
+ - PlatformApiKeyAuthentication: []
33459
+ responses:
33460
+ '200':
33461
+ content:
33462
+ application/json:
33463
+ schema:
33464
+ $ref: '#/components/schemas/CreditTransactionHistory'
33465
+ description: ''
33342
33466
  components:
33343
33467
  schemas:
33344
33468
  AWSTenantLaunchRequest:
@@ -33665,6 +33789,13 @@ components:
33665
33789
  platform_key:
33666
33790
  type: string
33667
33791
  description: The unique key of the platform. Defaults to 'main'.
33792
+ amount_usd:
33793
+ type: string
33794
+ format: decimal
33795
+ pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
33796
+ description: 'Optional. When set, perform manual top-up: charge this amount
33797
+ (user USD) and add credits. No threshold, spending limit, or cooldown.
33798
+ Omit to run normal auto-recharge once.'
33668
33799
  AutoRechargeTriggerResponse:
33669
33800
  type: object
33670
33801
  description: Response schema for POST auto-recharge/trigger/ (200).
@@ -36086,6 +36217,13 @@ components:
36086
36217
  auto_recharge_enabled:
36087
36218
  type: boolean
36088
36219
  description: Enable or disable auto-recharge.
36220
+ auto_recharge_spending_limit_usd:
36221
+ type: string
36222
+ format: decimal
36223
+ pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
36224
+ description: Cap on auto-recharge + manual top-up per 30-day period (user
36225
+ USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of
36226
+ limit (min $0.50).
36089
36227
  platform_key:
36090
36228
  type: string
36091
36229
  readOnly: true
@@ -36145,6 +36283,32 @@ components:
36145
36283
  pricing_table:
36146
36284
  readOnly: true
36147
36285
  description: Stripe pricing table details for topping up credits.
36286
+ free_trial:
36287
+ type: boolean
36288
+ readOnly: true
36289
+ description: True if the account is on the free trial plan (no paid plan
36290
+ purchased yet).
36291
+ current_plan:
36292
+ type: string
36293
+ readOnly: true
36294
+ nullable: true
36295
+ description: Current plan identifier, e.g. 'free_trial' or Stripe product
36296
+ SKU.
36297
+ previous_plan:
36298
+ type: string
36299
+ readOnly: true
36300
+ nullable: true
36301
+ description: Previous plan before the last purchase.
36302
+ can_use_auto_recharge:
36303
+ type: boolean
36304
+ readOnly: true
36305
+ description: True if the current plan is not free_trial (paid plans can
36306
+ use auto-recharge).
36307
+ has_payment_method:
36308
+ type: boolean
36309
+ readOnly: true
36310
+ description: True if the user has a payment method on file (can use manual
36311
+ top-up and auto-recharge).
36148
36312
  required:
36149
36313
  - account_id
36150
36314
  - auto_recharge_amount_usd
@@ -36152,9 +36316,68 @@ components:
36152
36316
  - auto_recharge_last_triggered_at
36153
36317
  - auto_recharge_threshold_usd
36154
36318
  - available_credits
36319
+ - can_use_auto_recharge
36320
+ - current_plan
36321
+ - free_trial
36155
36322
  - has_credits
36323
+ - has_payment_method
36156
36324
  - platform_key
36325
+ - previous_plan
36157
36326
  - pricing_table
36327
+ CreditTransactionHistory:
36328
+ type: object
36329
+ description: |-
36330
+ Serializer for user-facing transaction history.
36331
+ NEVER exposes internal USD amounts (amount_usd, usd_balance_*).
36332
+ properties:
36333
+ id:
36334
+ type: string
36335
+ format: uuid
36336
+ readOnly: true
36337
+ transaction_type:
36338
+ $ref: '#/components/schemas/TransactionTypeEnum'
36339
+ status:
36340
+ $ref: '#/components/schemas/CreditTransactionHistoryStatusEnum'
36341
+ payment_amount_usd:
36342
+ type: string
36343
+ readOnly: true
36344
+ credits_amount:
36345
+ type: string
36346
+ readOnly: true
36347
+ credits_balance_after:
36348
+ type: string
36349
+ readOnly: true
36350
+ description:
36351
+ type: string
36352
+ readOnly: true
36353
+ service_name:
36354
+ type: string
36355
+ nullable: true
36356
+ maxLength: 255
36357
+ created_at:
36358
+ type: string
36359
+ format: date-time
36360
+ readOnly: true
36361
+ required:
36362
+ - created_at
36363
+ - credits_amount
36364
+ - credits_balance_after
36365
+ - description
36366
+ - id
36367
+ - payment_amount_usd
36368
+ - transaction_type
36369
+ CreditTransactionHistoryStatusEnum:
36370
+ enum:
36371
+ - pending
36372
+ - completed
36373
+ - failed
36374
+ - cancelled
36375
+ type: string
36376
+ description: |-
36377
+ * `pending` - Pending
36378
+ * `completed` - Completed
36379
+ * `failed` - Failed
36380
+ * `cancelled` - Cancelled
36158
36381
  DesiredRole:
36159
36382
  type: object
36160
36383
  properties:
@@ -36641,6 +36864,16 @@ components:
36641
36864
  - provider_name
36642
36865
  - provider_name_display
36643
36866
  - updated
36867
+ FlowTypeEnum:
36868
+ enum:
36869
+ - payment_method_update
36870
+ - subscription_update
36871
+ - subscription_cancel
36872
+ type: string
36873
+ description: |-
36874
+ * `payment_method_update` - Payment Method Update
36875
+ * `subscription_update` - Subscription Update
36876
+ * `subscription_cancel` - Subscription Cancel
36644
36877
  GCPTenantLaunchRequest:
36645
36878
  type: object
36646
36879
  properties:
@@ -39354,6 +39587,13 @@ components:
39354
39587
  auto_recharge_enabled:
39355
39588
  type: boolean
39356
39589
  description: Enable or disable auto-recharge.
39590
+ auto_recharge_spending_limit_usd:
39591
+ type: string
39592
+ format: decimal
39593
+ pattern: ^-?\d{0,11}(?:\.\d{0,3})?$
39594
+ description: Cap on auto-recharge + manual top-up per 30-day period (user
39595
+ USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of
39596
+ limit (min $0.50).
39357
39597
  platform_key:
39358
39598
  type: string
39359
39599
  readOnly: true
@@ -44815,11 +45055,29 @@ components:
44815
45055
  return_url:
44816
45056
  type: string
44817
45057
  format: uri
44818
- description: URL to redirect to when the back button is clicked
45058
+ description: URL to redirect to when the customer exits the portal (back
45059
+ button)
44819
45060
  subscription_id:
44820
45061
  type: string
44821
- description: Provide a subscription id to set the default landing page to
44822
- subscription update
45062
+ description: Subscription ID required for subscription_update or subscription_cancel
45063
+ flows
45064
+ flow_type:
45065
+ nullable: true
45066
+ description: |-
45067
+ Type of flow to present: 'payment_method_update' for adding/updating payment method, 'subscription_update' for updating subscription, 'subscription_cancel' for cancellation. If not provided, shows the default portal homepage.
45068
+
45069
+ * `payment_method_update` - Payment Method Update
45070
+ * `subscription_update` - Subscription Update
45071
+ * `subscription_cancel` - Subscription Cancel
45072
+ oneOf:
45073
+ - $ref: '#/components/schemas/FlowTypeEnum'
45074
+ - $ref: '#/components/schemas/NullEnum'
45075
+ after_completion_url:
45076
+ type: string
45077
+ format: uri
45078
+ nullable: true
45079
+ description: URL to redirect after the flow is completed successfully. Only
45080
+ used when flow_type is set. Defaults to return_url if not provided.
44823
45081
  required:
44824
45082
  - return_url
44825
45083
  StripeCustomerPortalResponse:
@@ -45469,6 +45727,22 @@ components:
45469
45727
  - course_identifier
45470
45728
  - course_name
45471
45729
  - time_spent_seconds
45730
+ TransactionTypeEnum:
45731
+ enum:
45732
+ - add
45733
+ - subtract
45734
+ - reserve
45735
+ - release
45736
+ - rollover
45737
+ - refund
45738
+ type: string
45739
+ description: |-
45740
+ * `add` - Add Credits
45741
+ * `subtract` - Subtract Credits
45742
+ * `reserve` - Reserve Credits
45743
+ * `release` - Release Reserved Credits
45744
+ * `rollover` - Rollover Credits
45745
+ * `refund` - Refund Credits
45472
45746
  Type24aEnum:
45473
45747
  enum:
45474
45748
  - ADMIN_NOTIF_COURSE_ENROLLMENT
@@ -21,7 +21,7 @@ export type OpenAPIConfig = {
21
21
 
22
22
  export const OpenAPI: OpenAPIConfig = {
23
23
  BASE: 'https://base.manager.iblai.app',
24
- VERSION: '4.175.1-core',
24
+ VERSION: '4.175.2-core',
25
25
  WITH_CREDENTIALS: false,
26
26
  CREDENTIALS: 'include',
27
27
  TOKEN: undefined,
package/src/index.ts CHANGED
@@ -125,6 +125,8 @@ export type { Credential } from './models/Credential';
125
125
  export type { CredentialProviderConfig } from './models/CredentialProviderConfig';
126
126
  export type { CreditAccountAutoRechargeUpdate } from './models/CreditAccountAutoRechargeUpdate';
127
127
  export type { CreditAccountInfo } from './models/CreditAccountInfo';
128
+ export type { CreditTransactionHistory } from './models/CreditTransactionHistory';
129
+ export { CreditTransactionHistoryStatusEnum } from './models/CreditTransactionHistoryStatusEnum';
128
130
  export type { DesiredRole } from './models/DesiredRole';
129
131
  export type { DesiredRoleCreateUpdateRequest } from './models/DesiredRoleCreateUpdateRequest';
130
132
  export type { DesiredSkill } from './models/DesiredSkill';
@@ -145,6 +147,7 @@ export type { ErrorDetail } from './models/ErrorDetail';
145
147
  export type { ErrorResponse } from './models/ErrorResponse';
146
148
  export type { Experience } from './models/Experience';
147
149
  export type { ExternalCredentialMapping } from './models/ExternalCredentialMapping';
150
+ export { FlowTypeEnum } from './models/FlowTypeEnum';
148
151
  export type { GCPTenantLaunchRequest } from './models/GCPTenantLaunchRequest';
149
152
  export type { GlobalCatalogSearchResponse } from './models/GlobalCatalogSearchResponse';
150
153
  export type { GooglePayAccountResponse } from './models/GooglePayAccountResponse';
@@ -447,6 +450,7 @@ export type { TokenProxyOutput } from './models/TokenProxyOutput';
447
450
  export type { TokenProxyOutputSerializerData } from './models/TokenProxyOutputSerializerData';
448
451
  export type { TokenProxyUser } from './models/TokenProxyUser';
449
452
  export type { TopContent } from './models/TopContent';
453
+ export { TransactionTypeEnum } from './models/TransactionTypeEnum';
450
454
  export { Type24aEnum } from './models/Type24aEnum';
451
455
  export type { UploadedImage } from './models/UploadedImage';
452
456
  export type { UserApp } from './models/UserApp';
@@ -526,3 +530,4 @@ export { ReportsService } from './services/ReportsService';
526
530
  export { ScimService } from './services/ScimService';
527
531
  export { SearchService } from './services/SearchService';
528
532
  export { SkillsService } from './services/SkillsService';
533
+ export { TransactionsService } from './services/TransactionsService';
@@ -10,5 +10,9 @@ export type AutoRechargeTriggerRequest = {
10
10
  * The unique key of the platform. Defaults to 'main'.
11
11
  */
12
12
  platform_key?: string;
13
+ /**
14
+ * Optional. When set, perform manual top-up: charge this amount (user USD) and add credits. No threshold, spending limit, or cooldown. Omit to run normal auto-recharge once.
15
+ */
16
+ amount_usd?: string;
13
17
  };
14
18
 
@@ -18,6 +18,10 @@ export type CreditAccountAutoRechargeUpdate = {
18
18
  * Enable or disable auto-recharge.
19
19
  */
20
20
  auto_recharge_enabled?: boolean;
21
+ /**
22
+ * Cap on auto-recharge + manual top-up per 30-day period (user USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of limit (min $0.50).
23
+ */
24
+ auto_recharge_spending_limit_usd?: string;
21
25
  /**
22
26
  * The platform key to update settings for (read-only in update context).
23
27
  */
@@ -45,5 +45,25 @@ export type CreditAccountInfo = {
45
45
  * Stripe pricing table details for topping up credits.
46
46
  */
47
47
  readonly pricing_table: any;
48
+ /**
49
+ * True if the account is on the free trial plan (no paid plan purchased yet).
50
+ */
51
+ readonly free_trial: boolean;
52
+ /**
53
+ * Current plan identifier, e.g. 'free_trial' or Stripe product SKU.
54
+ */
55
+ readonly current_plan: string | null;
56
+ /**
57
+ * Previous plan before the last purchase.
58
+ */
59
+ readonly previous_plan: string | null;
60
+ /**
61
+ * True if the current plan is not free_trial (paid plans can use auto-recharge).
62
+ */
63
+ readonly can_use_auto_recharge: boolean;
64
+ /**
65
+ * True if the user has a payment method on file (can use manual top-up and auto-recharge).
66
+ */
67
+ readonly has_payment_method: boolean;
48
68
  };
49
69
 
@@ -0,0 +1,22 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import type { CreditTransactionHistoryStatusEnum } from './CreditTransactionHistoryStatusEnum';
6
+ import type { TransactionTypeEnum } from './TransactionTypeEnum';
7
+ /**
8
+ * Serializer for user-facing transaction history.
9
+ * NEVER exposes internal USD amounts (amount_usd, usd_balance_*).
10
+ */
11
+ export type CreditTransactionHistory = {
12
+ readonly id: string;
13
+ transaction_type: TransactionTypeEnum;
14
+ status?: CreditTransactionHistoryStatusEnum;
15
+ readonly payment_amount_usd: string;
16
+ readonly credits_amount: string;
17
+ readonly credits_balance_after: string;
18
+ readonly description: string;
19
+ service_name?: string | null;
20
+ readonly created_at: string;
21
+ };
22
+
@@ -0,0 +1,16 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * * `pending` - Pending
7
+ * * `completed` - Completed
8
+ * * `failed` - Failed
9
+ * * `cancelled` - Cancelled
10
+ */
11
+ export enum CreditTransactionHistoryStatusEnum {
12
+ PENDING = 'pending',
13
+ COMPLETED = 'completed',
14
+ FAILED = 'failed',
15
+ CANCELLED = 'cancelled',
16
+ }
@@ -0,0 +1,14 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * * `payment_method_update` - Payment Method Update
7
+ * * `subscription_update` - Subscription Update
8
+ * * `subscription_cancel` - Subscription Cancel
9
+ */
10
+ export enum FlowTypeEnum {
11
+ PAYMENT_METHOD_UPDATE = 'payment_method_update',
12
+ SUBSCRIPTION_UPDATE = 'subscription_update',
13
+ SUBSCRIPTION_CANCEL = 'subscription_cancel',
14
+ }
@@ -18,6 +18,10 @@ export type PatchedCreditAccountAutoRechargeUpdate = {
18
18
  * Enable or disable auto-recharge.
19
19
  */
20
20
  auto_recharge_enabled?: boolean;
21
+ /**
22
+ * Cap on auto-recharge + manual top-up per 30-day period (user USD). 0 = unlimited. When > 0, backend sets recharge amount to 20% of limit (min $0.50).
23
+ */
24
+ auto_recharge_spending_limit_usd?: string;
21
25
  /**
22
26
  * The platform key to update settings for (read-only in update context).
23
27
  */
@@ -2,14 +2,28 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
+ import type { FlowTypeEnum } from './FlowTypeEnum';
6
+ import type { NullEnum } from './NullEnum';
5
7
  export type StripeCustomerPortalRequest = {
6
8
  /**
7
- * URL to redirect to when the back button is clicked
9
+ * URL to redirect to when the customer exits the portal (back button)
8
10
  */
9
11
  return_url: string;
10
12
  /**
11
- * Provide a subscription id to set the default landing page to subscription update
13
+ * Subscription ID required for subscription_update or subscription_cancel flows
12
14
  */
13
15
  subscription_id?: string;
16
+ /**
17
+ * Type of flow to present: 'payment_method_update' for adding/updating payment method, 'subscription_update' for updating subscription, 'subscription_cancel' for cancellation. If not provided, shows the default portal homepage.
18
+ *
19
+ * * `payment_method_update` - Payment Method Update
20
+ * * `subscription_update` - Subscription Update
21
+ * * `subscription_cancel` - Subscription Cancel
22
+ */
23
+ flow_type?: (FlowTypeEnum | NullEnum) | null;
24
+ /**
25
+ * URL to redirect after the flow is completed successfully. Only used when flow_type is set. Defaults to return_url if not provided.
26
+ */
27
+ after_completion_url?: string | null;
14
28
  };
15
29
 
@@ -0,0 +1,20 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ /**
6
+ * * `add` - Add Credits
7
+ * * `subtract` - Subtract Credits
8
+ * * `reserve` - Reserve Credits
9
+ * * `release` - Release Reserved Credits
10
+ * * `rollover` - Rollover Credits
11
+ * * `refund` - Refund Credits
12
+ */
13
+ export enum TransactionTypeEnum {
14
+ ADD = 'add',
15
+ SUBTRACT = 'subtract',
16
+ RESERVE = 'reserve',
17
+ RELEASE = 'release',
18
+ ROLLOVER = 'rollover',
19
+ REFUND = 'refund',
20
+ }
@@ -33,7 +33,7 @@ export class AccountService {
33
33
  }
34
34
  /**
35
35
  * Update auto-recharge preferences
36
- * Update auto_recharge_threshold_usd, auto_recharge_amount_usd, and/or auto_recharge_enabled. Pass platform_key in the request body to update platform settings.
36
+ * Update auto_recharge_threshold_usd, auto_recharge_amount_usd, auto_recharge_enabled, and/or auto_recharge_spending_limit_usd. When enabling auto-recharge, missing values are calculated: if only limit set, amount = 20% of limit; if only amount set, limit = 5x amount; if neither set, defaults are limit=20, amount=4. Pass platform_key in the request body to update platform settings.
37
37
  * @returns CreditAccountInfo
38
38
  * @throws ApiError
39
39
  */
@@ -9,8 +9,8 @@ import { OpenAPI } from '../core/OpenAPI';
9
9
  import { request as __request } from '../core/request';
10
10
  export class AutoRechargeService {
11
11
  /**
12
- * Trigger auto-recharge
13
- * Run auto-recharge once if the account has it enabled and balance is below threshold. Returns 400 if skipped or failed (e.g. no payment method, cooldown). Pass platform_key in request body.
12
+ * Trigger auto-recharge or manual top-up
13
+ * With amount_usd: manual top-up (charge that amount, add credits; no threshold/limit/cooldown). Without amount_usd: run auto-recharge once if enabled and balance below threshold. Returns 400 if skipped or failed (e.g. no payment method, cooldown). Pass platform_key in request body.
14
14
  * @returns AutoRechargeTriggerResponse
15
15
  * @throws ApiError
16
16
  */