chargebee 3.23.1 → 3.25.0-beta.1

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 (166) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +39 -0
  3. package/cjs/RequestWrapper.js +27 -0
  4. package/cjs/chargebee.cjs.js +3 -0
  5. package/cjs/chargebee.cjs.worker.js +2 -0
  6. package/cjs/chargebeeZodValidationError.js +18 -0
  7. package/cjs/createChargebee.js +5 -0
  8. package/cjs/environment.js +1 -1
  9. package/cjs/resources/api_endpoints.js +80 -2
  10. package/cjs/schema/addon.schema.js +153 -0
  11. package/cjs/schema/address.schema.js +35 -0
  12. package/cjs/schema/alert.schema.js +38 -0
  13. package/cjs/schema/attached_item.schema.js +58 -0
  14. package/cjs/schema/business_entity.schema.js +46 -0
  15. package/cjs/schema/card.schema.js +165 -0
  16. package/cjs/schema/comment.schema.js +69 -0
  17. package/cjs/schema/coupon.schema.js +209 -0
  18. package/cjs/schema/coupon_code.schema.js +14 -0
  19. package/cjs/schema/coupon_set.schema.js +28 -0
  20. package/cjs/schema/credit_note.schema.js +288 -0
  21. package/cjs/schema/currency.schema.js +32 -0
  22. package/cjs/schema/customer.schema.js +986 -0
  23. package/cjs/schema/customer_entitlement.schema.js +14 -0
  24. package/cjs/schema/differential_price.schema.js +68 -0
  25. package/cjs/schema/entitlement.schema.js +27 -0
  26. package/cjs/schema/entitlement_override.schema.js +33 -0
  27. package/cjs/schema/estimate.schema.js +1525 -0
  28. package/cjs/schema/export.schema.js +1545 -0
  29. package/cjs/schema/feature.schema.js +37 -0
  30. package/cjs/schema/gift.schema.js +277 -0
  31. package/cjs/schema/hosted_page.schema.js +1649 -0
  32. package/cjs/schema/in_app_subscription.schema.js +68 -0
  33. package/cjs/schema/index.js +80 -0
  34. package/cjs/schema/invoice.schema.js +1467 -0
  35. package/cjs/schema/item.schema.js +91 -0
  36. package/cjs/schema/item_entitlement.schema.js +45 -0
  37. package/cjs/schema/item_family.schema.js +21 -0
  38. package/cjs/schema/item_price.schema.js +190 -0
  39. package/cjs/schema/non_subscription.schema.js +28 -0
  40. package/cjs/schema/offer_event.schema.js +13 -0
  41. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  42. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  43. package/cjs/schema/omnichannel_subscription.schema.js +89 -0
  44. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  45. package/cjs/schema/order.schema.js +273 -0
  46. package/cjs/schema/payment_intent.schema.js +117 -0
  47. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  48. package/cjs/schema/payment_source.schema.js +358 -0
  49. package/cjs/schema/payment_voucher.schema.js +57 -0
  50. package/cjs/schema/personalized_offer.schema.js +28 -0
  51. package/cjs/schema/plan.schema.js +225 -0
  52. package/cjs/schema/portal_session.schema.js +22 -0
  53. package/cjs/schema/price_variant.schema.js +36 -0
  54. package/cjs/schema/pricing_page_session.schema.js +135 -0
  55. package/cjs/schema/promotional_credit.schema.js +78 -0
  56. package/cjs/schema/purchase.schema.js +272 -0
  57. package/cjs/schema/quote.schema.js +1557 -0
  58. package/cjs/schema/ramp.schema.js +209 -0
  59. package/cjs/schema/recorded_purchase.schema.js +32 -0
  60. package/cjs/schema/resource_migration.schema.js +14 -0
  61. package/cjs/schema/site_migration_detail.schema.js +81 -0
  62. package/cjs/schema/subscription.schema.js +2993 -0
  63. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  64. package/cjs/schema/time_machine.schema.js +17 -0
  65. package/cjs/schema/transaction.schema.js +70 -0
  66. package/cjs/schema/unbilled_charge.schema.js +113 -0
  67. package/cjs/schema/usage.schema.js +93 -0
  68. package/cjs/schema/usage_charge.schema.js +17 -0
  69. package/cjs/schema/usage_event.schema.js +28 -0
  70. package/cjs/schema/usage_file.schema.js +13 -0
  71. package/cjs/schema/usage_summary.schema.js +17 -0
  72. package/cjs/schema/virtual_bank_account.schema.js +43 -0
  73. package/cjs/schema/webhook_endpoint.schema.js +504 -0
  74. package/cjs/validationLoader.js +59 -0
  75. package/esm/RequestWrapper.js +27 -0
  76. package/esm/chargebee.esm.js +2 -0
  77. package/esm/chargebee.esm.worker.js +1 -0
  78. package/esm/chargebeeZodValidationError.js +14 -0
  79. package/esm/createChargebee.js +5 -0
  80. package/esm/environment.js +1 -1
  81. package/esm/resources/api_endpoints.js +80 -2
  82. package/esm/schema/addon.schema.js +150 -0
  83. package/esm/schema/address.schema.js +32 -0
  84. package/esm/schema/alert.schema.js +35 -0
  85. package/esm/schema/attached_item.schema.js +55 -0
  86. package/esm/schema/business_entity.schema.js +43 -0
  87. package/esm/schema/card.schema.js +162 -0
  88. package/esm/schema/comment.schema.js +66 -0
  89. package/esm/schema/coupon.schema.js +206 -0
  90. package/esm/schema/coupon_code.schema.js +11 -0
  91. package/esm/schema/coupon_set.schema.js +25 -0
  92. package/esm/schema/credit_note.schema.js +285 -0
  93. package/esm/schema/currency.schema.js +29 -0
  94. package/esm/schema/customer.schema.js +983 -0
  95. package/esm/schema/customer_entitlement.schema.js +11 -0
  96. package/esm/schema/differential_price.schema.js +65 -0
  97. package/esm/schema/entitlement.schema.js +24 -0
  98. package/esm/schema/entitlement_override.schema.js +30 -0
  99. package/esm/schema/estimate.schema.js +1522 -0
  100. package/esm/schema/export.schema.js +1542 -0
  101. package/esm/schema/feature.schema.js +34 -0
  102. package/esm/schema/gift.schema.js +274 -0
  103. package/esm/schema/hosted_page.schema.js +1646 -0
  104. package/esm/schema/in_app_subscription.schema.js +65 -0
  105. package/esm/schema/index.js +64 -0
  106. package/esm/schema/invoice.schema.js +1464 -0
  107. package/esm/schema/item.schema.js +88 -0
  108. package/esm/schema/item_entitlement.schema.js +42 -0
  109. package/esm/schema/item_family.schema.js +18 -0
  110. package/esm/schema/item_price.schema.js +187 -0
  111. package/esm/schema/non_subscription.schema.js +25 -0
  112. package/esm/schema/offer_event.schema.js +10 -0
  113. package/esm/schema/offer_fulfillment.schema.js +17 -0
  114. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  115. package/esm/schema/omnichannel_subscription.schema.js +86 -0
  116. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  117. package/esm/schema/order.schema.js +270 -0
  118. package/esm/schema/payment_intent.schema.js +114 -0
  119. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  120. package/esm/schema/payment_source.schema.js +355 -0
  121. package/esm/schema/payment_voucher.schema.js +54 -0
  122. package/esm/schema/personalized_offer.schema.js +25 -0
  123. package/esm/schema/plan.schema.js +222 -0
  124. package/esm/schema/portal_session.schema.js +19 -0
  125. package/esm/schema/price_variant.schema.js +33 -0
  126. package/esm/schema/pricing_page_session.schema.js +132 -0
  127. package/esm/schema/promotional_credit.schema.js +75 -0
  128. package/esm/schema/purchase.schema.js +269 -0
  129. package/esm/schema/quote.schema.js +1554 -0
  130. package/esm/schema/ramp.schema.js +206 -0
  131. package/esm/schema/recorded_purchase.schema.js +29 -0
  132. package/esm/schema/resource_migration.schema.js +11 -0
  133. package/esm/schema/site_migration_detail.schema.js +78 -0
  134. package/esm/schema/subscription.schema.js +2990 -0
  135. package/esm/schema/subscription_entitlement.schema.js +22 -0
  136. package/esm/schema/time_machine.schema.js +14 -0
  137. package/esm/schema/transaction.schema.js +67 -0
  138. package/esm/schema/unbilled_charge.schema.js +110 -0
  139. package/esm/schema/usage.schema.js +90 -0
  140. package/esm/schema/usage_charge.schema.js +14 -0
  141. package/esm/schema/usage_event.schema.js +25 -0
  142. package/esm/schema/usage_file.schema.js +10 -0
  143. package/esm/schema/usage_summary.schema.js +14 -0
  144. package/esm/schema/virtual_bank_account.schema.js +40 -0
  145. package/esm/schema/webhook_endpoint.schema.js +501 -0
  146. package/esm/validationLoader.js +56 -0
  147. package/package.json +5 -2
  148. package/types/core.d.ts +34 -8
  149. package/types/index.d.ts +20 -0
  150. package/types/resources/Alert.d.ts +110 -4
  151. package/types/resources/AlertStatus.d.ts +43 -2
  152. package/types/resources/Card.d.ts +1 -0
  153. package/types/resources/Content.d.ts +2 -0
  154. package/types/resources/Customer.d.ts +16 -2
  155. package/types/resources/Estimate.d.ts +16 -2
  156. package/types/resources/Event.d.ts +4 -2
  157. package/types/resources/FilterCondition.d.ts +10 -0
  158. package/types/resources/Gift.d.ts +16 -2
  159. package/types/resources/Invoice.d.ts +17 -2
  160. package/types/resources/PaymentIntent.d.ts +42 -6
  161. package/types/resources/PaymentSource.d.ts +11 -2
  162. package/types/resources/Purchase.d.ts +8 -1
  163. package/types/resources/Quote.d.ts +2 -0
  164. package/types/resources/QuoteEntitlement.d.ts +16 -0
  165. package/types/resources/Subscription.d.ts +56 -7
  166. package/types/resources/VirtualBankAccount.d.ts +2 -0
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ // Generated Zod schemas: PortalSession
3
+ // Actions: create, activate
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ActivatePortalSessionBodySchema = exports.CreatePortalSessionBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //PortalSession.create
9
+ const CreatePortalSessionCustomerSchema = zod_1.z.object({
10
+ id: zod_1.z.string().max(50),
11
+ });
12
+ const CreatePortalSessionBodySchema = zod_1.z.looseObject({
13
+ redirect_url: zod_1.z.string().max(250).optional(),
14
+ forward_url: zod_1.z.string().max(250).optional(),
15
+ customer: CreatePortalSessionCustomerSchema.optional(),
16
+ });
17
+ exports.CreatePortalSessionBodySchema = CreatePortalSessionBodySchema;
18
+ //PortalSession.activate
19
+ const ActivatePortalSessionBodySchema = zod_1.z.looseObject({
20
+ token: zod_1.z.string().max(70),
21
+ });
22
+ exports.ActivatePortalSessionBodySchema = ActivatePortalSessionBodySchema;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Generated Zod schemas: PriceVariant
3
+ // Actions: create, update
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UpdatePriceVariantBodySchema = exports.CreatePriceVariantBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //PriceVariant.create
9
+ const CreatePriceVariantAttributesSchema = zod_1.z.object({
10
+ name: zod_1.z.array(zod_1.z.string().max(100).optional()),
11
+ value: zod_1.z.array(zod_1.z.string().max(100).optional()),
12
+ });
13
+ const CreatePriceVariantBodySchema = zod_1.z.looseObject({
14
+ id: zod_1.z.string().max(100),
15
+ name: zod_1.z.string().max(100),
16
+ external_name: zod_1.z.string().max(100).optional(),
17
+ description: zod_1.z.string().max(500).optional(),
18
+ variant_group: zod_1.z.string().max(100).optional(),
19
+ business_entity_id: zod_1.z.string().max(50).optional(),
20
+ attributes: CreatePriceVariantAttributesSchema.optional(),
21
+ });
22
+ exports.CreatePriceVariantBodySchema = CreatePriceVariantBodySchema;
23
+ //PriceVariant.update
24
+ const UpdatePriceVariantAttributesSchema = zod_1.z.object({
25
+ name: zod_1.z.array(zod_1.z.string().max(100).optional()),
26
+ value: zod_1.z.array(zod_1.z.string().max(100).optional()),
27
+ });
28
+ const UpdatePriceVariantBodySchema = zod_1.z.looseObject({
29
+ name: zod_1.z.string().max(100).optional(),
30
+ external_name: zod_1.z.string().max(100).optional(),
31
+ description: zod_1.z.string().max(500).optional(),
32
+ variant_group: zod_1.z.string().max(100).optional(),
33
+ status: zod_1.z.enum(['active', 'archived']).optional(),
34
+ attributes: UpdatePriceVariantAttributesSchema.optional(),
35
+ });
36
+ exports.UpdatePriceVariantBodySchema = UpdatePriceVariantBodySchema;
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ // Generated Zod schemas: PricingPageSession
3
+ // Actions: createForNewSubscription, createForExistingSubscription
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = exports.CreateForNewSubscriptionPricingPageSessionBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //PricingPageSession.createForNewSubscription
9
+ const CreateForNewSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
10
+ const CreateForNewSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
11
+ id: zod_1.z.string().max(50),
12
+ });
13
+ const CreateForNewSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
14
+ id: zod_1.z.string().max(50).optional(),
15
+ });
16
+ const CreateForNewSubscriptionPricingPageSessionCustomerSchema = zod_1.z.looseObject({
17
+ id: zod_1.z.string().max(50).optional(),
18
+ email: zod_1.z.string().email().max(70).optional(),
19
+ first_name: zod_1.z.string().max(150).optional(),
20
+ last_name: zod_1.z.string().max(150).optional(),
21
+ company: zod_1.z.string().max(250).optional(),
22
+ phone: zod_1.z.string().max(50).optional(),
23
+ locale: zod_1.z.string().max(50).optional(),
24
+ });
25
+ const CreateForNewSubscriptionPricingPageSessionBillingAddressSchema = zod_1.z.object({
26
+ first_name: zod_1.z.string().max(150).optional(),
27
+ last_name: zod_1.z.string().max(150).optional(),
28
+ email: zod_1.z.string().email().max(70).optional(),
29
+ company: zod_1.z.string().max(250).optional(),
30
+ phone: zod_1.z.string().max(50).optional(),
31
+ line1: zod_1.z.string().max(150).optional(),
32
+ line2: zod_1.z.string().max(150).optional(),
33
+ line3: zod_1.z.string().max(150).optional(),
34
+ city: zod_1.z.string().max(50).optional(),
35
+ state_code: zod_1.z.string().max(50).optional(),
36
+ state: zod_1.z.string().max(50).optional(),
37
+ zip: zod_1.z.string().max(20).optional(),
38
+ country: zod_1.z.string().max(50).optional(),
39
+ validation_status: zod_1.z
40
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
41
+ .optional(),
42
+ });
43
+ const CreateForNewSubscriptionPricingPageSessionShippingAddressSchema = zod_1.z.object({
44
+ first_name: zod_1.z.string().max(150).optional(),
45
+ last_name: zod_1.z.string().max(150).optional(),
46
+ email: zod_1.z.string().email().max(70).optional(),
47
+ company: zod_1.z.string().max(250).optional(),
48
+ phone: zod_1.z.string().max(50).optional(),
49
+ line1: zod_1.z.string().max(150).optional(),
50
+ line2: zod_1.z.string().max(150).optional(),
51
+ line3: zod_1.z.string().max(150).optional(),
52
+ city: zod_1.z.string().max(50).optional(),
53
+ state_code: zod_1.z.string().max(50).optional(),
54
+ state: zod_1.z.string().max(50).optional(),
55
+ zip: zod_1.z.string().max(20).optional(),
56
+ country: zod_1.z.string().max(50).optional(),
57
+ validation_status: zod_1.z
58
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
59
+ .optional(),
60
+ });
61
+ const CreateForNewSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
62
+ action_at_term_end: zod_1.z
63
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
64
+ .optional(),
65
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
66
+ });
67
+ const CreateForNewSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
68
+ apply_on: zod_1.z
69
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
70
+ .optional(),
71
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
72
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
73
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
74
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
75
+ period_unit: zod_1.z
76
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
77
+ .optional(),
78
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
79
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
80
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
81
+ label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
82
+ });
83
+ const CreateForNewSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
84
+ redirect_url: zod_1.z.string().max(250).optional(),
85
+ business_entity_id: zod_1.z.string().max(50).optional(),
86
+ auto_select_local_currency: zod_1.z.boolean().default(false).optional(),
87
+ custom: CreateForNewSubscriptionPricingPageSessionCustomSchema.optional(),
88
+ pricing_page: CreateForNewSubscriptionPricingPageSessionPricingPageSchema.optional(),
89
+ subscription: CreateForNewSubscriptionPricingPageSessionSubscriptionSchema.optional(),
90
+ customer: CreateForNewSubscriptionPricingPageSessionCustomerSchema.optional(),
91
+ billing_address: CreateForNewSubscriptionPricingPageSessionBillingAddressSchema.optional(),
92
+ shipping_address: CreateForNewSubscriptionPricingPageSessionShippingAddressSchema.optional(),
93
+ contract_term: CreateForNewSubscriptionPricingPageSessionContractTermSchema.optional(),
94
+ discounts: CreateForNewSubscriptionPricingPageSessionDiscountsSchema.optional(),
95
+ });
96
+ exports.CreateForNewSubscriptionPricingPageSessionBodySchema = CreateForNewSubscriptionPricingPageSessionBodySchema;
97
+ //PricingPageSession.createForExistingSubscription
98
+ const CreateForExistingSubscriptionPricingPageSessionCustomSchema = zod_1.z.looseObject({});
99
+ const CreateForExistingSubscriptionPricingPageSessionPricingPageSchema = zod_1.z.object({
100
+ id: zod_1.z.string().max(50).optional(),
101
+ });
102
+ const CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema = zod_1.z.looseObject({
103
+ id: zod_1.z.string().max(50),
104
+ });
105
+ const CreateForExistingSubscriptionPricingPageSessionContractTermSchema = zod_1.z.object({
106
+ action_at_term_end: zod_1.z
107
+ .enum(['renew', 'evergreen', 'cancel', 'renew_once'])
108
+ .optional(),
109
+ cancellation_cutoff_period: zod_1.z.number().int().optional(),
110
+ });
111
+ const CreateForExistingSubscriptionPricingPageSessionDiscountsSchema = zod_1.z.object({
112
+ apply_on: zod_1.z
113
+ .array(zod_1.z.enum(['invoice_amount', 'specific_item_price']).optional())
114
+ .optional(),
115
+ duration_type: zod_1.z.array(zod_1.z.enum(['one_time', 'forever', 'limited_period']).optional()),
116
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
117
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
118
+ period: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
119
+ period_unit: zod_1.z
120
+ .array(zod_1.z.enum(['day', 'week', 'month', 'year']).optional())
121
+ .optional(),
122
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
123
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
124
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
125
+ label: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
126
+ });
127
+ const CreateForExistingSubscriptionPricingPageSessionBodySchema = zod_1.z.looseObject({
128
+ redirect_url: zod_1.z.string().max(250).optional(),
129
+ custom: CreateForExistingSubscriptionPricingPageSessionCustomSchema.optional(),
130
+ pricing_page: CreateForExistingSubscriptionPricingPageSessionPricingPageSchema.optional(),
131
+ subscription: CreateForExistingSubscriptionPricingPageSessionSubscriptionSchema.optional(),
132
+ contract_term: CreateForExistingSubscriptionPricingPageSessionContractTermSchema.optional(),
133
+ discounts: CreateForExistingSubscriptionPricingPageSessionDiscountsSchema.optional(),
134
+ });
135
+ exports.CreateForExistingSubscriptionPricingPageSessionBodySchema = CreateForExistingSubscriptionPricingPageSessionBodySchema;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ // Generated Zod schemas: PromotionalCredit
3
+ // Actions: add, deduct, set, list
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ListPromotionalCreditBodySchema = exports.SetPromotionalCreditBodySchema = exports.DeductPromotionalCreditBodySchema = exports.AddPromotionalCreditBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //PromotionalCredit.add
9
+ const AddPromotionalCreditBodySchema = zod_1.z.looseObject({
10
+ customer_id: zod_1.z.string().max(50),
11
+ amount: zod_1.z.number().int().min(0).optional(),
12
+ amount_in_decimal: zod_1.z.string().max(33).optional(),
13
+ currency_code: zod_1.z.string().max(3).optional(),
14
+ description: zod_1.z.string().max(250),
15
+ credit_type: zod_1.z
16
+ .enum(['loyalty_credits', 'referral_rewards', 'general'])
17
+ .optional(),
18
+ reference: zod_1.z.string().max(500).optional(),
19
+ });
20
+ exports.AddPromotionalCreditBodySchema = AddPromotionalCreditBodySchema;
21
+ //PromotionalCredit.deduct
22
+ const DeductPromotionalCreditBodySchema = zod_1.z.looseObject({
23
+ customer_id: zod_1.z.string().max(50),
24
+ amount: zod_1.z.number().int().min(0).optional(),
25
+ amount_in_decimal: zod_1.z.string().max(33).optional(),
26
+ currency_code: zod_1.z.string().max(3).optional(),
27
+ description: zod_1.z.string().max(250),
28
+ credit_type: zod_1.z
29
+ .enum(['loyalty_credits', 'referral_rewards', 'general'])
30
+ .optional(),
31
+ reference: zod_1.z.string().max(500).optional(),
32
+ });
33
+ exports.DeductPromotionalCreditBodySchema = DeductPromotionalCreditBodySchema;
34
+ //PromotionalCredit.set
35
+ const SetPromotionalCreditBodySchema = zod_1.z.looseObject({
36
+ customer_id: zod_1.z.string().max(50),
37
+ amount: zod_1.z.number().int().min(0).optional(),
38
+ amount_in_decimal: zod_1.z.string().max(33).optional(),
39
+ currency_code: zod_1.z.string().max(3).optional(),
40
+ description: zod_1.z.string().max(250),
41
+ credit_type: zod_1.z
42
+ .enum(['loyalty_credits', 'referral_rewards', 'general'])
43
+ .optional(),
44
+ reference: zod_1.z.string().max(500).optional(),
45
+ });
46
+ exports.SetPromotionalCreditBodySchema = SetPromotionalCreditBodySchema;
47
+ //PromotionalCredit.list
48
+ const ListPromotionalCreditIdSchema = zod_1.z.object({
49
+ is: zod_1.z.string().min(1).optional(),
50
+ is_not: zod_1.z.string().min(1).optional(),
51
+ starts_with: zod_1.z.string().min(1).optional(),
52
+ });
53
+ const ListPromotionalCreditCreatedAtSchema = zod_1.z.object({
54
+ after: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
55
+ before: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
56
+ on: zod_1.z.string().regex(RegExp('^d{10}$')).optional(),
57
+ between: zod_1.z.string().regex(RegExp('^[d{10},d{10}]$')).optional(),
58
+ });
59
+ const ListPromotionalCreditTypeSchema = zod_1.z.object({
60
+ is: zod_1.z.enum(['increment', 'decrement']).optional(),
61
+ is_not: zod_1.z.enum(['increment', 'decrement']).optional(),
62
+ in: zod_1.z.enum(['increment', 'decrement']).optional(),
63
+ not_in: zod_1.z.enum(['increment', 'decrement']).optional(),
64
+ });
65
+ const ListPromotionalCreditCustomerIdSchema = zod_1.z.object({
66
+ is: zod_1.z.string().min(1).optional(),
67
+ is_not: zod_1.z.string().min(1).optional(),
68
+ starts_with: zod_1.z.string().min(1).optional(),
69
+ });
70
+ const ListPromotionalCreditBodySchema = zod_1.z.looseObject({
71
+ limit: zod_1.z.number().int().min(1).max(100).optional(),
72
+ offset: zod_1.z.string().max(1000).optional(),
73
+ id: ListPromotionalCreditIdSchema.optional(),
74
+ created_at: ListPromotionalCreditCreatedAtSchema.optional(),
75
+ type: ListPromotionalCreditTypeSchema.optional(),
76
+ customer_id: ListPromotionalCreditCustomerIdSchema.optional(),
77
+ });
78
+ exports.ListPromotionalCreditBodySchema = ListPromotionalCreditBodySchema;
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ // Generated Zod schemas: Purchase
3
+ // Actions: create, estimate
4
+ // Do not edit manually – regenerate via sdk-generator
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.EstimatePurchaseBodySchema = exports.CreatePurchaseBodySchema = void 0;
7
+ const zod_1 = require("zod");
8
+ //Purchase.create
9
+ const CreatePurchaseInvoiceInfoSchema = zod_1.z.object({
10
+ po_number: zod_1.z.string().max(100).optional(),
11
+ notes: zod_1.z.string().max(2000).optional(),
12
+ });
13
+ const CreatePurchasePaymentScheduleSchema = zod_1.z.object({
14
+ scheme_id: zod_1.z.string().max(40).optional(),
15
+ amount: zod_1.z.number().int().min(0).optional(),
16
+ });
17
+ const CreatePurchaseStatementDescriptorSchema = zod_1.z.object({
18
+ descriptor: zod_1.z.string().max(65000).optional(),
19
+ });
20
+ const CreatePurchaseAdditionalInformationSchema = zod_1.z.looseObject({});
21
+ const CreatePurchasePaymentIntentSchema = zod_1.z.object({
22
+ id: zod_1.z.string().max(150).optional(),
23
+ gateway_account_id: zod_1.z.string().max(50).optional(),
24
+ gw_token: zod_1.z.string().max(65000).optional(),
25
+ payment_method_type: zod_1.z
26
+ .enum([
27
+ 'card',
28
+ 'ideal',
29
+ 'sofort',
30
+ 'bancontact',
31
+ 'google_pay',
32
+ 'dotpay',
33
+ 'giropay',
34
+ 'apple_pay',
35
+ 'upi',
36
+ 'netbanking_emandates',
37
+ 'paypal_express_checkout',
38
+ 'direct_debit',
39
+ 'boleto',
40
+ 'venmo',
41
+ 'amazon_payments',
42
+ 'pay_to',
43
+ 'faster_payments',
44
+ 'sepa_instant_transfer',
45
+ 'klarna_pay_now',
46
+ 'online_banking_poland',
47
+ 'payconiq_by_bancontact',
48
+ 'electronic_payment_standard',
49
+ 'kbc_payment_button',
50
+ 'pay_by_bank',
51
+ 'trustly',
52
+ 'stablecoin',
53
+ 'kakao_pay',
54
+ 'naver_pay',
55
+ 'revolut_pay',
56
+ 'cash_app_pay',
57
+ 'wechat_pay',
58
+ 'alipay',
59
+ 'pix',
60
+ 'twint',
61
+ 'go_pay',
62
+ 'grab_pay',
63
+ 'pay_co',
64
+ 'after_pay',
65
+ 'swish',
66
+ 'payme',
67
+ ])
68
+ .optional(),
69
+ reference_id: zod_1.z.string().max(65000).optional(),
70
+ gw_payment_method_id: zod_1.z.string().max(65000).optional(),
71
+ additional_information: CreatePurchaseAdditionalInformationSchema.optional(),
72
+ });
73
+ const CreatePurchasePurchaseItemsSchema = zod_1.z.object({
74
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
75
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
76
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
77
+ unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
78
+ unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
79
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
80
+ });
81
+ const CreatePurchaseItemTiersSchema = zod_1.z.object({
82
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
83
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
84
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
85
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
86
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
87
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
88
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
89
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
90
+ });
91
+ const CreatePurchaseShippingAddressesSchema = zod_1.z.object({
92
+ first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
93
+ last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
94
+ email: zod_1.z.array(zod_1.z.string().email().max(70).optional()).optional(),
95
+ company: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
96
+ phone: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
97
+ line1: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
98
+ line2: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
99
+ line3: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
100
+ city: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
101
+ state: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
102
+ state_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
103
+ country: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
104
+ zip: zod_1.z.array(zod_1.z.string().max(20).optional()).optional(),
105
+ validation_status: zod_1.z
106
+ .array(zod_1.z
107
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
108
+ .optional())
109
+ .optional(),
110
+ });
111
+ const CreatePurchaseDiscountsSchema = zod_1.z.object({
112
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
113
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
114
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
115
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
116
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
117
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
118
+ });
119
+ const CreatePurchaseMetaDataItemSchema = zod_1.z.looseObject({});
120
+ const CreatePurchaseSubscriptionInfoSchema = zod_1.z.object({
121
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
122
+ subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
123
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
124
+ contract_term_billing_cycle_on_renewal: zod_1.z
125
+ .array(zod_1.z.number().int().min(1).max(100).optional())
126
+ .optional(),
127
+ meta_data: zod_1.z.array(CreatePurchaseMetaDataItemSchema.optional()).optional(),
128
+ });
129
+ const CreatePurchaseContractTermsSchema = zod_1.z.object({
130
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
131
+ action_at_term_end: zod_1.z
132
+ .array(zod_1.z.enum(['renew', 'evergreen', 'cancel', 'renew_once']).optional())
133
+ .optional(),
134
+ cancellation_cutoff_period: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
135
+ });
136
+ const CreatePurchaseBodySchema = zod_1.z.looseObject({
137
+ customer_id: zod_1.z.string().max(50),
138
+ payment_source_id: zod_1.z.string().max(40).optional(),
139
+ replace_primary_payment_source: zod_1.z.boolean().default(true).optional(),
140
+ invoice_info: CreatePurchaseInvoiceInfoSchema.optional(),
141
+ payment_schedule: CreatePurchasePaymentScheduleSchema.optional(),
142
+ statement_descriptor: CreatePurchaseStatementDescriptorSchema.optional(),
143
+ payment_intent: CreatePurchasePaymentIntentSchema.optional(),
144
+ purchase_items: CreatePurchasePurchaseItemsSchema.optional(),
145
+ item_tiers: CreatePurchaseItemTiersSchema.optional(),
146
+ shipping_addresses: CreatePurchaseShippingAddressesSchema.optional(),
147
+ discounts: CreatePurchaseDiscountsSchema.optional(),
148
+ subscription_info: CreatePurchaseSubscriptionInfoSchema.optional(),
149
+ contract_terms: CreatePurchaseContractTermsSchema.optional(),
150
+ });
151
+ exports.CreatePurchaseBodySchema = CreatePurchaseBodySchema;
152
+ //Purchase.estimate
153
+ const EstimatePurchaseCustomerSchema = zod_1.z.object({
154
+ vat_number: zod_1.z.string().max(20).optional(),
155
+ vat_number_prefix: zod_1.z.string().max(10).optional(),
156
+ registered_for_gst: zod_1.z.boolean().optional(),
157
+ taxability: zod_1.z.enum(['taxable', 'exempt']).optional(),
158
+ entity_code: zod_1.z
159
+ .enum([
160
+ 'a',
161
+ 'b',
162
+ 'c',
163
+ 'd',
164
+ 'e',
165
+ 'f',
166
+ 'g',
167
+ 'h',
168
+ 'i',
169
+ 'j',
170
+ 'k',
171
+ 'l',
172
+ 'm',
173
+ 'n',
174
+ 'p',
175
+ 'q',
176
+ 'r',
177
+ 'med1',
178
+ 'med2',
179
+ ])
180
+ .optional(),
181
+ exempt_number: zod_1.z.string().max(100).optional(),
182
+ exemption_details: zod_1.z.array(zod_1.z.string().optional()).optional(),
183
+ customer_type: zod_1.z
184
+ .enum(['residential', 'business', 'senior_citizen', 'industrial'])
185
+ .optional(),
186
+ });
187
+ const EstimatePurchaseBillingAddressSchema = zod_1.z.object({
188
+ line1: zod_1.z.string().max(150).optional(),
189
+ line2: zod_1.z.string().max(150).optional(),
190
+ line3: zod_1.z.string().max(150).optional(),
191
+ city: zod_1.z.string().max(50).optional(),
192
+ state_code: zod_1.z.string().max(50).optional(),
193
+ zip: zod_1.z.string().max(20).optional(),
194
+ country: zod_1.z.string().max(50).optional(),
195
+ validation_status: zod_1.z
196
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
197
+ .optional(),
198
+ });
199
+ const EstimatePurchasePurchaseItemsSchema = zod_1.z.object({
200
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
201
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()),
202
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
203
+ unit_amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
204
+ unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
205
+ quantity_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
206
+ });
207
+ const EstimatePurchaseItemTiersSchema = zod_1.z.object({
208
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
209
+ item_price_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
210
+ starting_unit: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
211
+ ending_unit: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
212
+ price: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
213
+ starting_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
214
+ ending_unit_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
215
+ price_in_decimal: zod_1.z.array(zod_1.z.string().max(39).optional()).optional(),
216
+ });
217
+ const EstimatePurchaseShippingAddressesSchema = zod_1.z.object({
218
+ first_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
219
+ last_name: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
220
+ email: zod_1.z.array(zod_1.z.string().email().max(70).optional()).optional(),
221
+ company: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
222
+ phone: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
223
+ line1: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
224
+ line2: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
225
+ line3: zod_1.z.array(zod_1.z.string().max(150).optional()).optional(),
226
+ city: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
227
+ state: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
228
+ state_code: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
229
+ country: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
230
+ zip: zod_1.z.array(zod_1.z.string().max(20).optional()).optional(),
231
+ validation_status: zod_1.z
232
+ .array(zod_1.z
233
+ .enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
234
+ .optional())
235
+ .optional(),
236
+ });
237
+ const EstimatePurchaseDiscountsSchema = zod_1.z.object({
238
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
239
+ coupon_id: zod_1.z.array(zod_1.z.string().max(100).optional()).optional(),
240
+ percentage: zod_1.z.array(zod_1.z.number().min(0.01).max(100).optional()).optional(),
241
+ quantity: zod_1.z.array(zod_1.z.number().int().min(1).optional()).optional(),
242
+ amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
243
+ included_in_mrr: zod_1.z.array(zod_1.z.boolean().optional()).optional(),
244
+ });
245
+ const EstimatePurchaseSubscriptionInfoSchema = zod_1.z.object({
246
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
247
+ subscription_id: zod_1.z.array(zod_1.z.string().max(50).optional()).optional(),
248
+ billing_cycles: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
249
+ contract_term_billing_cycle_on_renewal: zod_1.z
250
+ .array(zod_1.z.number().int().min(1).max(100).optional())
251
+ .optional(),
252
+ });
253
+ const EstimatePurchaseContractTermsSchema = zod_1.z.object({
254
+ index: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
255
+ action_at_term_end: zod_1.z
256
+ .array(zod_1.z.enum(['renew', 'evergreen', 'cancel', 'renew_once']).optional())
257
+ .optional(),
258
+ cancellation_cutoff_period: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
259
+ });
260
+ const EstimatePurchaseBodySchema = zod_1.z.looseObject({
261
+ client_profile_id: zod_1.z.string().max(50).optional(),
262
+ customer_id: zod_1.z.string().max(50).optional(),
263
+ customer: EstimatePurchaseCustomerSchema.optional(),
264
+ billing_address: EstimatePurchaseBillingAddressSchema.optional(),
265
+ purchase_items: EstimatePurchasePurchaseItemsSchema.optional(),
266
+ item_tiers: EstimatePurchaseItemTiersSchema.optional(),
267
+ shipping_addresses: EstimatePurchaseShippingAddressesSchema.optional(),
268
+ discounts: EstimatePurchaseDiscountsSchema.optional(),
269
+ subscription_info: EstimatePurchaseSubscriptionInfoSchema.optional(),
270
+ contract_terms: EstimatePurchaseContractTermsSchema.optional(),
271
+ });
272
+ exports.EstimatePurchaseBodySchema = EstimatePurchaseBodySchema;