chargebee 3.30.1 → 3.32.0

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 (89) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/README.md +14 -0
  3. package/cjs/RequestWrapper.js +12 -1
  4. package/cjs/chargebee.cjs.js +1 -0
  5. package/cjs/createChargebee.js +5 -1
  6. package/cjs/environment.js +1 -1
  7. package/cjs/resources/api_endpoints.js +84 -2
  8. package/cjs/resources/webhook/eventType.js +4 -0
  9. package/cjs/schema/coupon.schema.js +1 -1
  10. package/cjs/schema/credit_note.schema.js +7 -2
  11. package/cjs/schema/credit_unit.schema.js +2 -2
  12. package/cjs/schema/entitlement.schema.js +4 -4
  13. package/cjs/schema/entitlement_override.schema.js +1 -1
  14. package/cjs/schema/estimate.schema.js +2 -2
  15. package/cjs/schema/event.schema.js +16 -0
  16. package/cjs/schema/export.schema.js +35 -3
  17. package/cjs/schema/hosted_page.schema.js +1 -0
  18. package/cjs/schema/index.js +1 -0
  19. package/cjs/schema/invoice.schema.js +11 -4
  20. package/cjs/schema/ledger_operation.schema.js +2 -2
  21. package/cjs/schema/meter.schema.js +1 -1
  22. package/cjs/schema/omnichannel_subscription.schema.js +6 -2
  23. package/cjs/schema/payment_intent.schema.js +4 -0
  24. package/cjs/schema/payment_source.schema.js +9 -2
  25. package/cjs/schema/pricing_page_session.schema.js +1 -1
  26. package/cjs/schema/quote.schema.js +60 -0
  27. package/cjs/schema/quote_entitlement.schema.js +25 -0
  28. package/cjs/schema/ramp.schema.js +2 -2
  29. package/cjs/schema/subscription.schema.js +2 -2
  30. package/cjs/schema/webhook_endpoint.schema.js +8 -0
  31. package/cjs/telemetry/index.js +13 -1
  32. package/cjs/telemetry/sdkTelemetryEmitter.js +64 -0
  33. package/cjs/telemetry/sdkTelemetryFeature.js +22 -0
  34. package/cjs/telemetry/sdkTelemetryHeader.js +15 -0
  35. package/cjs/telemetry/sdkTelemetryHeaderBuilder.js +34 -0
  36. package/cjs/telemetry/sdkTelemetryState.js +36 -0
  37. package/esm/RequestWrapper.js +13 -2
  38. package/esm/chargebee.esm.js +1 -1
  39. package/esm/createChargebee.js +5 -1
  40. package/esm/environment.js +1 -1
  41. package/esm/resources/api_endpoints.js +84 -2
  42. package/esm/resources/webhook/eventType.js +4 -0
  43. package/esm/schema/coupon.schema.js +1 -1
  44. package/esm/schema/credit_note.schema.js +6 -1
  45. package/esm/schema/credit_unit.schema.js +2 -2
  46. package/esm/schema/entitlement.schema.js +4 -4
  47. package/esm/schema/entitlement_override.schema.js +1 -1
  48. package/esm/schema/estimate.schema.js +2 -2
  49. package/esm/schema/event.schema.js +16 -0
  50. package/esm/schema/export.schema.js +34 -2
  51. package/esm/schema/hosted_page.schema.js +1 -0
  52. package/esm/schema/index.js +1 -0
  53. package/esm/schema/invoice.schema.js +10 -3
  54. package/esm/schema/ledger_operation.schema.js +2 -2
  55. package/esm/schema/meter.schema.js +1 -1
  56. package/esm/schema/omnichannel_subscription.schema.js +6 -2
  57. package/esm/schema/payment_intent.schema.js +4 -0
  58. package/esm/schema/payment_source.schema.js +8 -1
  59. package/esm/schema/pricing_page_session.schema.js +1 -1
  60. package/esm/schema/quote.schema.js +60 -0
  61. package/esm/schema/quote_entitlement.schema.js +22 -0
  62. package/esm/schema/ramp.schema.js +2 -2
  63. package/esm/schema/subscription.schema.js +2 -2
  64. package/esm/schema/webhook_endpoint.schema.js +8 -0
  65. package/esm/telemetry/index.js +5 -0
  66. package/esm/telemetry/sdkTelemetryEmitter.js +61 -0
  67. package/esm/telemetry/sdkTelemetryFeature.js +19 -0
  68. package/esm/telemetry/sdkTelemetryHeader.js +12 -0
  69. package/esm/telemetry/sdkTelemetryHeaderBuilder.js +31 -0
  70. package/esm/telemetry/sdkTelemetryState.js +32 -0
  71. package/package.json +5 -9
  72. package/types/core.d.ts +78 -3
  73. package/types/index.d.ts +15 -2
  74. package/types/resources/Content.d.ts +4 -0
  75. package/types/resources/CreditNote.d.ts +14 -0
  76. package/types/resources/Event.d.ts +4 -0
  77. package/types/resources/Export.d.ts +20 -0
  78. package/types/resources/GatewayPaymentMethodToken.d.ts +15 -0
  79. package/types/resources/HostedPage.d.ts +1 -0
  80. package/types/resources/Invoice.d.ts +17 -1
  81. package/types/resources/OmnichannelSubscriptionItemMetric.d.ts +18 -0
  82. package/types/resources/PaymentIntent.d.ts +14 -11
  83. package/types/resources/PaymentSource.d.ts +17 -0
  84. package/types/resources/PricingPageSession.d.ts +1 -1
  85. package/types/resources/Quote.d.ts +45 -0
  86. package/types/resources/QuoteEntitlement.d.ts +49 -0
  87. package/types/resources/QuotedRamp.d.ts +1 -0
  88. package/types/resources/VaultedPaymentMethod.d.ts +28 -0
  89. package/types/resources/WebhookEvent.d.ts +24 -0
@@ -7,6 +7,6 @@ export default Chargebee;
7
7
  export { WebhookEventType, WebhookContentType, } from './resources/webhook/handler.js';
8
8
  export { basicAuthValidator } from './resources/webhook/auth.js';
9
9
  export { WebhookError, WebhookAuthenticationError, WebhookPayloadValidationError, WebhookPayloadParseError, } from './resources/webhook/handler.js';
10
- export { TelemetryAttributeKeys } from './telemetry/index.js';
10
+ export { TelemetryAttributeKeys, SDK_TELEMETRY_HEADER_NAME, } from './telemetry/index.js';
11
11
  // Export validation error class
12
12
  export { ChargebeeZodValidationError } from './chargebeeZodValidationError.js';
@@ -15,14 +15,18 @@ import { Endpoints } from './resources/api_endpoints.js';
15
15
  import { extend, sleep } from './util.js';
16
16
  import { waitForProcessToComplete } from './asyncApiSupport.js';
17
17
  import { WebhookHandler, createDefaultHandler, } from './resources/webhook/handler.js';
18
+ import { SdkTelemetryState } from './telemetry/index.js';
18
19
  export const CreateChargebee = (httpClient) => {
19
20
  const Chargebee = function (conf) {
20
21
  this._env = Object.assign({}, Environment);
21
- const { telemetryAdapter, httpClient: configHttpClient } = conf, confToMerge = __rest(conf, ["telemetryAdapter", "httpClient"]);
22
+ const { telemetryAdapter, httpClient: configHttpClient, sdkTelemetryEnabled } = conf, confToMerge = __rest(conf, ["telemetryAdapter", "httpClient", "sdkTelemetryEnabled"]);
22
23
  extend(true, this._env, confToMerge);
23
24
  // @ts-ignore
24
25
  this._env.httpClient =
25
26
  configHttpClient != null ? configHttpClient : httpClient;
27
+ this._env.sdkTelemetryState = new SdkTelemetryState();
28
+ this._env.sdkTelemetryEnabled = sdkTelemetryEnabled !== false;
29
+ this._env.httpClientIsCustom = configHttpClient != null;
26
30
  if (telemetryAdapter !== undefined) {
27
31
  this._env.telemetryAdapter = telemetryAdapter;
28
32
  }
@@ -8,7 +8,7 @@ export const Environment = {
8
8
  hostSuffix: '.chargebee.com',
9
9
  apiPath: '/api/v2',
10
10
  timeout: DEFAULT_TIME_OUT,
11
- clientVersion: 'v3.30.1',
11
+ clientVersion: 'v3.32.0',
12
12
  port: DEFAULT_PORT,
13
13
  timemachineWaitInMillis: DEFAULT_TIME_MACHINE_WAIT,
14
14
  exportWaitInMillis: DEFAULT_EXPORT_WAIT,
@@ -944,6 +944,17 @@ export const Endpoints = {
944
944
  isIdempotent: true,
945
945
  },
946
946
  ],
947
+ [
948
+ 'listGatewayTokensForPaymentSource',
949
+ 'GET',
950
+ '/payment_sources',
951
+ '/gateway_payment_method_tokens',
952
+ true,
953
+ null,
954
+ false,
955
+ {},
956
+ {},
957
+ ],
947
958
  ['retrieve', 'GET', '/payment_sources', null, true, null, false, {}, {}],
948
959
  ['list', 'GET', '/payment_sources', null, false, null, false, {}, {}],
949
960
  [
@@ -999,7 +1010,21 @@ export const Endpoints = {
999
1010
  },
1000
1011
  ],
1001
1012
  ],
1013
+ gatewayPaymentMethodToken: [],
1002
1014
  thirdPartyPaymentMethod: [],
1015
+ vaultedPaymentMethod: [
1016
+ [
1017
+ 'retrieve',
1018
+ 'GET',
1019
+ '/vaulted_payment_methods',
1020
+ null,
1021
+ true,
1022
+ null,
1023
+ false,
1024
+ {},
1025
+ {},
1026
+ ],
1027
+ ],
1003
1028
  virtualBankAccount: [
1004
1029
  [
1005
1030
  'createUsingPermanentToken',
@@ -1591,6 +1616,19 @@ export const Endpoints = {
1591
1616
  isIdempotent: true,
1592
1617
  },
1593
1618
  ],
1619
+ [
1620
+ 'voidBeforeCapture',
1621
+ 'POST',
1622
+ '/invoices',
1623
+ '/void_before_capture',
1624
+ true,
1625
+ null,
1626
+ false,
1627
+ {},
1628
+ {
1629
+ isIdempotent: true,
1630
+ },
1631
+ ],
1594
1632
  [
1595
1633
  'delete',
1596
1634
  'POST',
@@ -1775,6 +1813,19 @@ export const Endpoints = {
1775
1813
  isIdempotent: true,
1776
1814
  },
1777
1815
  ],
1816
+ [
1817
+ 'update',
1818
+ 'POST',
1819
+ '/credit_notes',
1820
+ '/update',
1821
+ true,
1822
+ null,
1823
+ false,
1824
+ {},
1825
+ {
1826
+ isIdempotent: true,
1827
+ },
1828
+ ],
1778
1829
  [
1779
1830
  'removeTaxWithheldRefund',
1780
1831
  'POST',
@@ -3031,6 +3082,19 @@ export const Endpoints = {
3031
3082
  quotedDeltaRamp: [],
3032
3083
  billingConfiguration: [],
3033
3084
  quoteLineGroup: [],
3085
+ quoteEntitlement: [
3086
+ [
3087
+ 'listQuoteEntitlements',
3088
+ 'GET',
3089
+ '/quotes',
3090
+ '/quote_entitlements',
3091
+ true,
3092
+ null,
3093
+ false,
3094
+ {},
3095
+ {},
3096
+ ],
3097
+ ],
3034
3098
  cpqQuoteSignature: [],
3035
3099
  plan: [
3036
3100
  [
@@ -3806,6 +3870,19 @@ export const Endpoints = {
3806
3870
  isIdempotent: true,
3807
3871
  },
3808
3872
  ],
3873
+ [
3874
+ 'ramps',
3875
+ 'POST',
3876
+ '/exports',
3877
+ '/ramps',
3878
+ false,
3879
+ null,
3880
+ false,
3881
+ {},
3882
+ {
3883
+ isIdempotent: true,
3884
+ },
3885
+ ],
3809
3886
  ],
3810
3887
  paymentIntent: [
3811
3888
  [
@@ -3816,7 +3893,9 @@ export const Endpoints = {
3816
3893
  false,
3817
3894
  null,
3818
3895
  false,
3819
- {},
3896
+ {
3897
+ payment_method_options: 0,
3898
+ },
3820
3899
  {
3821
3900
  isIdempotent: true,
3822
3901
  },
@@ -3829,7 +3908,9 @@ export const Endpoints = {
3829
3908
  true,
3830
3909
  null,
3831
3910
  false,
3832
- {},
3911
+ {
3912
+ payment_method_options: 0,
3913
+ },
3833
3914
  {
3834
3915
  isIdempotent: true,
3835
3916
  },
@@ -4750,6 +4831,7 @@ export const Endpoints = {
4750
4831
  ],
4751
4832
  ],
4752
4833
  omnichannelSubscriptionItemScheduledChange: [],
4834
+ omnichannelSubscriptionItemMetric: [],
4753
4835
  omnichannelSubscription: [
4754
4836
  [
4755
4837
  'retrieve',
@@ -106,6 +106,7 @@ export var WebhookEventType;
106
106
  WebhookEventType["OmnichannelSubscriptionItemExpired"] = "omnichannel_subscription_item_expired";
107
107
  WebhookEventType["OmnichannelSubscriptionItemGracePeriodExpired"] = "omnichannel_subscription_item_grace_period_expired";
108
108
  WebhookEventType["OmnichannelSubscriptionItemGracePeriodStarted"] = "omnichannel_subscription_item_grace_period_started";
109
+ WebhookEventType["OmnichannelSubscriptionItemMrrUpdated"] = "omnichannel_subscription_item_mrr_updated";
109
110
  WebhookEventType["OmnichannelSubscriptionItemPauseScheduled"] = "omnichannel_subscription_item_pause_scheduled";
110
111
  WebhookEventType["OmnichannelSubscriptionItemPaused"] = "omnichannel_subscription_item_paused";
111
112
  WebhookEventType["OmnichannelSubscriptionItemReactivated"] = "omnichannel_subscription_item_reactivated";
@@ -231,6 +232,9 @@ export var WebhookEventType;
231
232
  WebhookEventType["VariantCreated"] = "variant_created";
232
233
  WebhookEventType["VariantDeleted"] = "variant_deleted";
233
234
  WebhookEventType["VariantUpdated"] = "variant_updated";
235
+ WebhookEventType["VaultTokenCreated"] = "vault_token_created";
236
+ WebhookEventType["VaultTokenDeleted"] = "vault_token_deleted";
237
+ WebhookEventType["VaultTokenUpdated"] = "vault_token_updated";
234
238
  WebhookEventType["VirtualBankAccountAdded"] = "virtual_bank_account_added";
235
239
  WebhookEventType["VirtualBankAccountDeleted"] = "virtual_bank_account_deleted";
236
240
  WebhookEventType["VirtualBankAccountUpdated"] = "virtual_bank_account_updated";
@@ -256,8 +256,8 @@ const ListCouponCurrencyCodeSchema = z.object({
256
256
  not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
257
257
  });
258
258
  const ListCouponApplicableItemPriceIdsSchema = z.object({
259
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
260
259
  is: z.string().min(1).optional(),
260
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
261
261
  });
262
262
  const ListCouponBodySchema = z.looseObject({
263
263
  limit: z.number().int().min(1).max(100).optional(),
@@ -1,5 +1,5 @@
1
1
  // Generated Zod schemas: CreditNote
2
- // Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, creditNotesForCustomer, delete, removeTaxWithheldRefund, importCreditNote
2
+ // Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, creditNotesForCustomer, delete, update, removeTaxWithheldRefund, importCreditNote
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //CreditNote.create
@@ -337,6 +337,11 @@ const DeleteCreditNoteBodySchema = z.looseObject({
337
337
  comment: z.string().max(300).optional(),
338
338
  });
339
339
  export { DeleteCreditNoteBodySchema };
340
+ //CreditNote.update
341
+ const UpdateCreditNoteBodySchema = z.looseObject({
342
+ comment: z.string().max(300).optional(),
343
+ });
344
+ export { UpdateCreditNoteBodySchema };
340
345
  //CreditNote.removeTaxWithheldRefund
341
346
  const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = z.object({
342
347
  id: z.string().max(40),
@@ -4,12 +4,12 @@
4
4
  import { z } from 'zod';
5
5
  //CreditUnit.list
6
6
  const ListCreditUnitStatusSchema = z.object({
7
- in: z.enum(['active', 'archived']).optional(),
8
7
  is: z.enum(['active', 'archived']).optional(),
8
+ in: z.enum(['active', 'archived']).optional(),
9
9
  });
10
10
  const ListCreditUnitIdSchema = z.object({
11
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
12
11
  is: z.string().min(1).optional(),
12
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
13
13
  });
14
14
  const ListCreditUnitBodySchema = z.looseObject({
15
15
  limit: z.number().int().min(1).max(100).optional(),
@@ -4,20 +4,20 @@
4
4
  import { z } from 'zod';
5
5
  //Entitlement.list
6
6
  const ListEntitlementFeatureIdSchema = z.object({
7
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
8
7
  is: z.string().min(1).optional(),
8
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
9
9
  });
10
10
  const ListEntitlementEntityTypeSchema = z.object({
11
- in: z
11
+ is: z
12
12
  .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
13
13
  .optional(),
14
- is: z
14
+ in: z
15
15
  .enum(['plan', 'addon', 'charge', 'plan_price', 'addon_price'])
16
16
  .optional(),
17
17
  });
18
18
  const ListEntitlementEntityIdSchema = z.object({
19
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
20
19
  is: z.string().min(1).optional(),
20
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
21
21
  });
22
22
  const ListEntitlementBodySchema = z.looseObject({
23
23
  limit: z.number().int().min(1).max(100).optional(),
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  //EntitlementOverride.addEntitlementOverrideForSubscription
6
6
  const AddEntitlementOverrideForSubscriptionEntitlementOverrideEntitlementOverridesSchema = z.object({
7
7
  feature_id: z.array(z.string().max(50).optional()),
8
- entity_id: z.array(z.string().max(50).optional()).optional(),
8
+ entity_id: z.array(z.string().max(100).optional()).optional(),
9
9
  entity_type: z
10
10
  .array(z
11
11
  .enum(['plan_price', 'addon_price', 'charge', 'charge_price'])
@@ -987,7 +987,7 @@ const CancelSubscriptionEstimateBodySchema = z.looseObject({
987
987
  end_of_term: z.boolean().default(false).optional(),
988
988
  cancel_at: z.number().int().optional(),
989
989
  credit_option_for_current_term_charges: z
990
- .enum(['none', 'prorate', 'full'])
990
+ .enum(['none', 'prorate', 'full', 'consumption_based'])
991
991
  .optional(),
992
992
  unbilled_charges_option: z.enum(['invoice', 'delete']).optional(),
993
993
  account_receivables_handling: z
@@ -1032,7 +1032,7 @@ const CancelSubscriptionForItemsEstimateBodySchema = z.looseObject({
1032
1032
  end_of_term: z.boolean().default(false).optional(),
1033
1033
  cancel_at: z.number().int().optional(),
1034
1034
  credit_option_for_current_term_charges: z
1035
- .enum(['none', 'prorate', 'full'])
1035
+ .enum(['none', 'prorate', 'full', 'consumption_based'])
1036
1036
  .optional(),
1037
1037
  unbilled_charges_option: z.enum(['invoice', 'delete']).optional(),
1038
1038
  account_receivables_handling: z
@@ -290,10 +290,14 @@ const ListEventEventTypeSchema = z.object({
290
290
  'alert_status_changed',
291
291
  'omnichannel_subscription_item_updated',
292
292
  'omnichannel_subscription_item_recovered',
293
+ 'omnichannel_subscription_item_mrr_updated',
293
294
  'ledger_account_balance_updated',
294
295
  'grant_blocks_created',
295
296
  'grant_blocks_updated',
296
297
  'ledger_updated',
298
+ 'vault_token_created',
299
+ 'vault_token_updated',
300
+ 'vault_token_deleted',
297
301
  ])
298
302
  .optional(),
299
303
  is_not: z
@@ -521,10 +525,14 @@ const ListEventEventTypeSchema = z.object({
521
525
  'alert_status_changed',
522
526
  'omnichannel_subscription_item_updated',
523
527
  'omnichannel_subscription_item_recovered',
528
+ 'omnichannel_subscription_item_mrr_updated',
524
529
  'ledger_account_balance_updated',
525
530
  'grant_blocks_created',
526
531
  'grant_blocks_updated',
527
532
  'ledger_updated',
533
+ 'vault_token_created',
534
+ 'vault_token_updated',
535
+ 'vault_token_deleted',
528
536
  ])
529
537
  .optional(),
530
538
  in: z
@@ -752,10 +760,14 @@ const ListEventEventTypeSchema = z.object({
752
760
  'alert_status_changed',
753
761
  'omnichannel_subscription_item_updated',
754
762
  'omnichannel_subscription_item_recovered',
763
+ 'omnichannel_subscription_item_mrr_updated',
755
764
  'ledger_account_balance_updated',
756
765
  'grant_blocks_created',
757
766
  'grant_blocks_updated',
758
767
  'ledger_updated',
768
+ 'vault_token_created',
769
+ 'vault_token_updated',
770
+ 'vault_token_deleted',
759
771
  ])
760
772
  .optional(),
761
773
  not_in: z
@@ -983,10 +995,14 @@ const ListEventEventTypeSchema = z.object({
983
995
  'alert_status_changed',
984
996
  'omnichannel_subscription_item_updated',
985
997
  'omnichannel_subscription_item_recovered',
998
+ 'omnichannel_subscription_item_mrr_updated',
986
999
  'ledger_account_balance_updated',
987
1000
  'grant_blocks_created',
988
1001
  'grant_blocks_updated',
989
1002
  'ledger_updated',
1003
+ 'vault_token_created',
1004
+ 'vault_token_updated',
1005
+ 'vault_token_deleted',
990
1006
  ])
991
1007
  .optional(),
992
1008
  });
@@ -1,5 +1,5 @@
1
1
  // Generated Zod schemas: Export
2
- // Actions: revenueRecognition, deferredRevenue, plans, addons, coupons, customers, subscriptions, invoices, creditNotes, transactions, orders, itemFamilies, items, itemPrices, attachedItems, differentialPrices, priceVariants
2
+ // Actions: revenueRecognition, deferredRevenue, plans, addons, coupons, customers, subscriptions, invoices, creditNotes, transactions, orders, itemFamilies, items, itemPrices, attachedItems, differentialPrices, priceVariants, ramps
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //Export.revenueRecognition
@@ -1099,8 +1099,8 @@ const CouponsExportCurrencyCodeSchema = z.object({
1099
1099
  not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1100
1100
  });
1101
1101
  const CouponsExportApplicableItemPriceIdsSchema = z.object({
1102
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1103
1102
  is: z.string().min(1).optional(),
1103
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1104
1104
  });
1105
1105
  const CouponsExportIdSchema = z.object({
1106
1106
  is: z.string().min(1).optional(),
@@ -3412,3 +3412,35 @@ const PriceVariantsExportBodySchema = z.looseObject({
3412
3412
  .optional(),
3413
3413
  });
3414
3414
  export { PriceVariantsExportBodySchema };
3415
+ //Export.ramps
3416
+ const RampsExportStatusSchema = z.object({
3417
+ is: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
3418
+ in: z.enum(['scheduled', 'succeeded', 'failed', 'draft']).optional(),
3419
+ });
3420
+ const RampsExportSubscriptionIdSchema = z.object({
3421
+ is: z.string().min(1).optional(),
3422
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
3423
+ });
3424
+ const RampsExportEffectiveFromSchema = z.object({
3425
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
3426
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
3427
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
3428
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
3429
+ });
3430
+ const RampsExportUpdatedAtSchema = z.object({
3431
+ after: z.string().regex(RegExp('^\\d{10}$')).optional(),
3432
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
3433
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
3434
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
3435
+ });
3436
+ const RampsExportRampItemSchema = z.object({
3437
+ status: RampsExportStatusSchema.optional(),
3438
+ subscription_id: RampsExportSubscriptionIdSchema.optional(),
3439
+ effective_from: RampsExportEffectiveFromSchema.optional(),
3440
+ updated_at: RampsExportUpdatedAtSchema.optional(),
3441
+ });
3442
+ const RampsExportBodySchema = z.looseObject({
3443
+ export_type: z.enum(['data', 'import_friendly_data']).optional(),
3444
+ ramp: z.array(RampsExportRampItemSchema.optional()).optional(),
3445
+ });
3446
+ export { RampsExportBodySchema };
@@ -1749,6 +1749,7 @@ const PreCancelHostedPageBodySchema = z.looseObject({
1749
1749
  pass_thru_content: z.string().max(2048).optional(),
1750
1750
  cancel_url: z.string().max(250).optional(),
1751
1751
  redirect_url: z.string().max(250).optional(),
1752
+ locale: z.string().max(50).optional(),
1752
1753
  subscription: PreCancelHostedPageSubscriptionSchema.optional(),
1753
1754
  });
1754
1755
  export { PreCancelHostedPageBodySchema };
@@ -55,6 +55,7 @@ export * from './promotional_credit.schema.js';
55
55
  export * from './promotional_grant.schema.js';
56
56
  export * from './purchase.schema.js';
57
57
  export * from './quote.schema.js';
58
+ export * from './quote_entitlement.schema.js';
58
59
  export * from './ramp.schema.js';
59
60
  export * from './recorded_purchase.schema.js';
60
61
  export * from './resource_migration.schema.js';
@@ -1,5 +1,5 @@
1
1
  // Generated Zod schemas: Invoice
2
- // Actions: create, createForChargeItemsAndCharges, charge, chargeAddon, createForChargeItem, stopDunning, pauseDunning, resumeDunning, importInvoice, applyPayments, deleteLineItems, applyCredits, list, invoicesForCustomer, invoicesForSubscription, retrieve, pdf, listPaymentReferenceNumbers, addCharge, addAddonCharge, addChargeItem, close, collectPayment, recordPayment, recordTaxWithheld, removeTaxWithheld, refund, recordRefund, removePayment, removeCreditNote, voidInvoice, writeOff, delete, updateDetails, applyPaymentScheduleScheme
2
+ // Actions: create, createForChargeItemsAndCharges, charge, chargeAddon, createForChargeItem, stopDunning, pauseDunning, resumeDunning, importInvoice, applyPayments, deleteLineItems, applyCredits, list, invoicesForCustomer, invoicesForSubscription, retrieve, pdf, listPaymentReferenceNumbers, addCharge, addAddonCharge, addChargeItem, close, collectPayment, recordPayment, recordTaxWithheld, removeTaxWithheld, refund, recordRefund, removePayment, removeCreditNote, voidInvoice, writeOff, voidBeforeCapture, delete, updateDetails, applyPaymentScheduleScheme
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //Invoice.create
@@ -1421,12 +1421,12 @@ const PdfInvoiceBodySchema = z.looseObject({
1421
1421
  export { PdfInvoiceBodySchema };
1422
1422
  //Invoice.listPaymentReferenceNumbers
1423
1423
  const ListPaymentReferenceNumbersInvoiceIdSchema = z.object({
1424
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1425
1424
  is: z.string().min(1).optional(),
1425
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1426
1426
  });
1427
1427
  const ListPaymentReferenceNumbersInvoiceNumberSchema = z.object({
1428
- in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1429
1428
  is: z.string().min(1).optional(),
1429
+ in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
1430
1430
  });
1431
1431
  const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema = z.object({
1432
1432
  number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
@@ -1679,6 +1679,13 @@ const WriteOffInvoiceBodySchema = z.looseObject({
1679
1679
  comment: z.string().max(300).optional(),
1680
1680
  });
1681
1681
  export { WriteOffInvoiceBodySchema };
1682
+ //Invoice.voidBeforeCapture
1683
+ const VoidBeforeCaptureInvoiceBodySchema = z.looseObject({
1684
+ comment: z.string().max(300).optional(),
1685
+ void_reason_code: z.string().max(100).optional(),
1686
+ invoice_action: z.enum(['void', 'write_off']).optional(),
1687
+ });
1688
+ export { VoidBeforeCaptureInvoiceBodySchema };
1682
1689
  //Invoice.delete
1683
1690
  const DeleteInvoiceBodySchema = z.looseObject({
1684
1691
  comment: z.string().max(300).optional(),
@@ -16,7 +16,7 @@ const ListLedgerOperationsLedgerOperationCreatedAtSchema = z.object({
16
16
  between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
17
17
  });
18
18
  const ListLedgerOperationsLedgerOperationTypeSchema = z.object({
19
- in: z
19
+ is: z
20
20
  .enum([
21
21
  'allocation',
22
22
  'capture',
@@ -29,7 +29,7 @@ const ListLedgerOperationsLedgerOperationTypeSchema = z.object({
29
29
  'adjustment',
30
30
  ])
31
31
  .optional(),
32
- is: z
32
+ in: z
33
33
  .enum([
34
34
  'allocation',
35
35
  'capture',
@@ -4,8 +4,8 @@
4
4
  import { z } from 'zod';
5
5
  //Meter.list
6
6
  const ListMeterNameSchema = z.object({
7
- starts_with: z.string().min(1).optional(),
8
7
  is: z.string().min(1).optional(),
8
+ starts_with: z.string().min(1).optional(),
9
9
  });
10
10
  const ListMeterSortBySchema = z.looseObject({
11
11
  asc: z.enum(['id', 'name', 'created_at', 'updated_at']).optional(),
@@ -31,12 +31,16 @@ const ListOmnichannelSubscriptionIdAtSourceSchema = z.object({
31
31
  not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
32
32
  });
33
33
  const ListOmnichannelSubscriptionUpdatedAtSchema = z.object({
34
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
35
34
  after: z.string().regex(RegExp('^\\d{10}$')).optional(),
35
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
36
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
37
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
36
38
  });
37
39
  const ListOmnichannelSubscriptionPurchasedAtSchema = z.object({
38
- before: z.string().regex(RegExp('^\\d{10}$')).optional(),
39
40
  after: z.string().regex(RegExp('^\\d{10}$')).optional(),
41
+ on: z.string().regex(RegExp('^\\d{10}$')).optional(),
42
+ before: z.string().regex(RegExp('^\\d{10}$')).optional(),
43
+ between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
40
44
  });
41
45
  const ListOmnichannelSubscriptionSortBySchema = z.looseObject({
42
46
  asc: z.enum(['created_at', 'updated_at']).optional(),
@@ -3,6 +3,7 @@
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //PaymentIntent.create
6
+ const CreatePaymentIntentPaymentMethodOptionsSchema = z.looseObject({});
6
7
  const CreatePaymentIntentBodySchema = z.looseObject({
7
8
  business_entity_id: z.string().max(50).optional(),
8
9
  customer_id: z.string().max(50).optional(),
@@ -69,9 +70,11 @@ const CreatePaymentIntentBodySchema = z.looseObject({
69
70
  .optional(),
70
71
  success_url: z.string().max(250).optional(),
71
72
  failure_url: z.string().max(250).optional(),
73
+ payment_method_options: CreatePaymentIntentPaymentMethodOptionsSchema.optional(),
72
74
  });
73
75
  export { CreatePaymentIntentBodySchema };
74
76
  //PaymentIntent.update
77
+ const UpdatePaymentIntentPaymentMethodOptionsSchema = z.looseObject({});
75
78
  const UpdatePaymentIntentBodySchema = z.looseObject({
76
79
  amount: z.number().int().min(0).optional(),
77
80
  currency_code: z.string().max(3).optional(),
@@ -134,5 +137,6 @@ const UpdatePaymentIntentBodySchema = z.looseObject({
134
137
  .optional(),
135
138
  success_url: z.string().max(250).optional(),
136
139
  failure_url: z.string().max(250).optional(),
140
+ payment_method_options: UpdatePaymentIntentPaymentMethodOptionsSchema.optional(),
137
141
  });
138
142
  export { UpdatePaymentIntentBodySchema };
@@ -1,5 +1,5 @@
1
1
  // Generated Zod schemas: PaymentSource
2
- // Actions: createUsingTempToken, createUsingPermanentToken, createUsingToken, createUsingPaymentIntent, createVoucherPaymentSource, createCard, createBankAccount, updateCard, updateBankAccount, verifyBankAccount, list, switchGatewayAccount, exportPaymentSource
2
+ // Actions: createUsingTempToken, createUsingPermanentToken, createUsingToken, createUsingPaymentIntent, createVoucherPaymentSource, createCard, createBankAccount, updateCard, updateBankAccount, verifyBankAccount, listGatewayTokensForPaymentSource, list, switchGatewayAccount, exportPaymentSource
3
3
  // Do not edit manually – regenerate via sdk-generator
4
4
  import { z } from 'zod';
5
5
  //PaymentSource.createUsingTempToken
@@ -379,6 +379,13 @@ const VerifyBankAccountPaymentSourceBodySchema = z.looseObject({
379
379
  amount2: z.number().int().min(0),
380
380
  });
381
381
  export { VerifyBankAccountPaymentSourceBodySchema };
382
+ //PaymentSource.listGatewayTokensForPaymentSource
383
+ const ListGatewayTokensForPaymentSourcePaymentSourceBodySchema = z.looseObject({
384
+ limit: z.number().int().min(1).max(100).optional(),
385
+ offset: z.string().max(1000).optional(),
386
+ include_deleted: z.boolean().default(false).optional(),
387
+ });
388
+ export { ListGatewayTokensForPaymentSourcePaymentSourceBodySchema };
382
389
  //PaymentSource.list
383
390
  const ListPaymentSourceCustomerIdSchema = z.object({
384
391
  is: z.string().min(1).optional(),
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  //PricingPageSession.createForNewSubscription
6
6
  const CreateForNewSubscriptionPricingPageSessionCustomSchema = z.looseObject({});
7
7
  const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = z.object({
8
- id: z.string().max(50),
8
+ id: z.string().max(50).optional(),
9
9
  });
10
10
  const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = z.looseObject({
11
11
  id: z.string().max(50).optional(),