chargebee 3.24.0 → 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 (147) hide show
  1. package/CHANGELOG.md +8 -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/schema/addon.schema.js +153 -0
  10. package/cjs/schema/address.schema.js +35 -0
  11. package/cjs/schema/alert.schema.js +38 -0
  12. package/cjs/schema/attached_item.schema.js +58 -0
  13. package/cjs/schema/business_entity.schema.js +46 -0
  14. package/cjs/schema/card.schema.js +165 -0
  15. package/cjs/schema/comment.schema.js +69 -0
  16. package/cjs/schema/coupon.schema.js +209 -0
  17. package/cjs/schema/coupon_code.schema.js +14 -0
  18. package/cjs/schema/coupon_set.schema.js +28 -0
  19. package/cjs/schema/credit_note.schema.js +288 -0
  20. package/cjs/schema/currency.schema.js +32 -0
  21. package/cjs/schema/customer.schema.js +986 -0
  22. package/cjs/schema/customer_entitlement.schema.js +14 -0
  23. package/cjs/schema/differential_price.schema.js +68 -0
  24. package/cjs/schema/entitlement.schema.js +27 -0
  25. package/cjs/schema/entitlement_override.schema.js +33 -0
  26. package/cjs/schema/estimate.schema.js +1525 -0
  27. package/cjs/schema/export.schema.js +1545 -0
  28. package/cjs/schema/feature.schema.js +37 -0
  29. package/cjs/schema/gift.schema.js +277 -0
  30. package/cjs/schema/hosted_page.schema.js +1649 -0
  31. package/cjs/schema/in_app_subscription.schema.js +68 -0
  32. package/cjs/schema/index.js +80 -0
  33. package/cjs/schema/invoice.schema.js +1467 -0
  34. package/cjs/schema/item.schema.js +91 -0
  35. package/cjs/schema/item_entitlement.schema.js +45 -0
  36. package/cjs/schema/item_family.schema.js +21 -0
  37. package/cjs/schema/item_price.schema.js +190 -0
  38. package/cjs/schema/non_subscription.schema.js +28 -0
  39. package/cjs/schema/offer_event.schema.js +13 -0
  40. package/cjs/schema/offer_fulfillment.schema.js +20 -0
  41. package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
  42. package/cjs/schema/omnichannel_subscription.schema.js +89 -0
  43. package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
  44. package/cjs/schema/order.schema.js +273 -0
  45. package/cjs/schema/payment_intent.schema.js +117 -0
  46. package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
  47. package/cjs/schema/payment_source.schema.js +358 -0
  48. package/cjs/schema/payment_voucher.schema.js +57 -0
  49. package/cjs/schema/personalized_offer.schema.js +28 -0
  50. package/cjs/schema/plan.schema.js +225 -0
  51. package/cjs/schema/portal_session.schema.js +22 -0
  52. package/cjs/schema/price_variant.schema.js +36 -0
  53. package/cjs/schema/pricing_page_session.schema.js +135 -0
  54. package/cjs/schema/promotional_credit.schema.js +78 -0
  55. package/cjs/schema/purchase.schema.js +272 -0
  56. package/cjs/schema/quote.schema.js +1557 -0
  57. package/cjs/schema/ramp.schema.js +209 -0
  58. package/cjs/schema/recorded_purchase.schema.js +32 -0
  59. package/cjs/schema/resource_migration.schema.js +14 -0
  60. package/cjs/schema/site_migration_detail.schema.js +81 -0
  61. package/cjs/schema/subscription.schema.js +2993 -0
  62. package/cjs/schema/subscription_entitlement.schema.js +25 -0
  63. package/cjs/schema/time_machine.schema.js +17 -0
  64. package/cjs/schema/transaction.schema.js +70 -0
  65. package/cjs/schema/unbilled_charge.schema.js +113 -0
  66. package/cjs/schema/usage.schema.js +93 -0
  67. package/cjs/schema/usage_charge.schema.js +17 -0
  68. package/cjs/schema/usage_event.schema.js +28 -0
  69. package/cjs/schema/usage_file.schema.js +13 -0
  70. package/cjs/schema/usage_summary.schema.js +17 -0
  71. package/cjs/schema/virtual_bank_account.schema.js +43 -0
  72. package/cjs/schema/webhook_endpoint.schema.js +504 -0
  73. package/cjs/validationLoader.js +59 -0
  74. package/esm/RequestWrapper.js +27 -0
  75. package/esm/chargebee.esm.js +2 -0
  76. package/esm/chargebee.esm.worker.js +1 -0
  77. package/esm/chargebeeZodValidationError.js +14 -0
  78. package/esm/createChargebee.js +5 -0
  79. package/esm/environment.js +1 -1
  80. package/esm/schema/addon.schema.js +150 -0
  81. package/esm/schema/address.schema.js +32 -0
  82. package/esm/schema/alert.schema.js +35 -0
  83. package/esm/schema/attached_item.schema.js +55 -0
  84. package/esm/schema/business_entity.schema.js +43 -0
  85. package/esm/schema/card.schema.js +162 -0
  86. package/esm/schema/comment.schema.js +66 -0
  87. package/esm/schema/coupon.schema.js +206 -0
  88. package/esm/schema/coupon_code.schema.js +11 -0
  89. package/esm/schema/coupon_set.schema.js +25 -0
  90. package/esm/schema/credit_note.schema.js +285 -0
  91. package/esm/schema/currency.schema.js +29 -0
  92. package/esm/schema/customer.schema.js +983 -0
  93. package/esm/schema/customer_entitlement.schema.js +11 -0
  94. package/esm/schema/differential_price.schema.js +65 -0
  95. package/esm/schema/entitlement.schema.js +24 -0
  96. package/esm/schema/entitlement_override.schema.js +30 -0
  97. package/esm/schema/estimate.schema.js +1522 -0
  98. package/esm/schema/export.schema.js +1542 -0
  99. package/esm/schema/feature.schema.js +34 -0
  100. package/esm/schema/gift.schema.js +274 -0
  101. package/esm/schema/hosted_page.schema.js +1646 -0
  102. package/esm/schema/in_app_subscription.schema.js +65 -0
  103. package/esm/schema/index.js +64 -0
  104. package/esm/schema/invoice.schema.js +1464 -0
  105. package/esm/schema/item.schema.js +88 -0
  106. package/esm/schema/item_entitlement.schema.js +42 -0
  107. package/esm/schema/item_family.schema.js +18 -0
  108. package/esm/schema/item_price.schema.js +187 -0
  109. package/esm/schema/non_subscription.schema.js +25 -0
  110. package/esm/schema/offer_event.schema.js +10 -0
  111. package/esm/schema/offer_fulfillment.schema.js +17 -0
  112. package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
  113. package/esm/schema/omnichannel_subscription.schema.js +86 -0
  114. package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
  115. package/esm/schema/order.schema.js +270 -0
  116. package/esm/schema/payment_intent.schema.js +114 -0
  117. package/esm/schema/payment_schedule_scheme.schema.js +17 -0
  118. package/esm/schema/payment_source.schema.js +355 -0
  119. package/esm/schema/payment_voucher.schema.js +54 -0
  120. package/esm/schema/personalized_offer.schema.js +25 -0
  121. package/esm/schema/plan.schema.js +222 -0
  122. package/esm/schema/portal_session.schema.js +19 -0
  123. package/esm/schema/price_variant.schema.js +33 -0
  124. package/esm/schema/pricing_page_session.schema.js +132 -0
  125. package/esm/schema/promotional_credit.schema.js +75 -0
  126. package/esm/schema/purchase.schema.js +269 -0
  127. package/esm/schema/quote.schema.js +1554 -0
  128. package/esm/schema/ramp.schema.js +206 -0
  129. package/esm/schema/recorded_purchase.schema.js +29 -0
  130. package/esm/schema/resource_migration.schema.js +11 -0
  131. package/esm/schema/site_migration_detail.schema.js +78 -0
  132. package/esm/schema/subscription.schema.js +2990 -0
  133. package/esm/schema/subscription_entitlement.schema.js +22 -0
  134. package/esm/schema/time_machine.schema.js +14 -0
  135. package/esm/schema/transaction.schema.js +67 -0
  136. package/esm/schema/unbilled_charge.schema.js +110 -0
  137. package/esm/schema/usage.schema.js +90 -0
  138. package/esm/schema/usage_charge.schema.js +14 -0
  139. package/esm/schema/usage_event.schema.js +25 -0
  140. package/esm/schema/usage_file.schema.js +10 -0
  141. package/esm/schema/usage_summary.schema.js +14 -0
  142. package/esm/schema/virtual_bank_account.schema.js +40 -0
  143. package/esm/schema/webhook_endpoint.schema.js +501 -0
  144. package/esm/validationLoader.js +56 -0
  145. package/package.json +4 -1
  146. package/types/core.d.ts +2 -0
  147. package/types/index.d.ts +16 -0
@@ -0,0 +1,206 @@
1
+ // Generated Zod schemas: Coupon
2
+ // Actions: create, createForItems, updateForItems, update, copy
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //Coupon.create
6
+ const CreateCouponMetaDataSchema = z.looseObject({});
7
+ const CreateCouponBodySchema = z.looseObject({
8
+ id: z.string().max(100),
9
+ name: z.string().max(50),
10
+ invoice_name: z.string().max(100).optional(),
11
+ discount_type: z
12
+ .enum(['fixed_amount', 'percentage', 'offer_quantity'])
13
+ .optional(),
14
+ discount_amount: z.number().int().min(0).optional(),
15
+ currency_code: z.string().max(3).optional(),
16
+ discount_percentage: z.number().min(0.01).max(100).optional(),
17
+ discount_quantity: z.number().int().min(1).optional(),
18
+ apply_on: z.enum([
19
+ 'invoice_amount',
20
+ 'specified_items_total',
21
+ 'each_specified_item',
22
+ 'each_unit_of_specified_items',
23
+ ]),
24
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']).optional(),
25
+ duration_month: z.number().int().min(1).max(240).optional(),
26
+ valid_till: z.number().int().optional(),
27
+ max_redemptions: z.number().int().min(1).optional(),
28
+ invoice_notes: z.string().max(2000).optional(),
29
+ meta_data: CreateCouponMetaDataSchema.optional(),
30
+ included_in_mrr: z.boolean().optional(),
31
+ period: z.number().int().min(1).optional(),
32
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
33
+ plan_constraint: z.enum(['none', 'all', 'specific']).optional(),
34
+ addon_constraint: z.enum(['none', 'all', 'specific']).optional(),
35
+ plan_ids: z.array(z.string().max(100).optional()).optional(),
36
+ addon_ids: z.array(z.string().max(100).optional()).optional(),
37
+ status: z.enum(['active', 'archived']).optional(),
38
+ });
39
+ export { CreateCouponBodySchema };
40
+ //Coupon.createForItems
41
+ const CreateForItemsCouponMetaDataSchema = z.looseObject({});
42
+ const CreateForItemsCouponItemConstraintsSchema = z.object({
43
+ constraint: z.array(z.enum(['none', 'all', 'specific', 'criteria']).optional()),
44
+ item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()),
45
+ item_price_ids: z.array(z.array(z.string().optional()).optional()).optional(),
46
+ });
47
+ const CreateForItemsCouponItemConstraintCriteriaSchema = z.object({
48
+ item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
49
+ item_family_ids: z
50
+ .array(z.array(z.string().optional()).optional())
51
+ .optional(),
52
+ currencies: z.array(z.array(z.string().optional()).optional()).optional(),
53
+ item_price_periods: z
54
+ .array(z.array(z.string().optional()).optional())
55
+ .optional(),
56
+ });
57
+ const CreateForItemsCouponCouponConstraintsSchema = z.object({
58
+ entity_type: z.array(z.enum(['customer']).optional()),
59
+ type: z.array(z
60
+ .enum([
61
+ 'max_redemptions',
62
+ 'unique_by',
63
+ 'existing_customer',
64
+ 'new_customer',
65
+ ])
66
+ .optional()),
67
+ value: z.array(z.string().max(65000).optional()).optional(),
68
+ });
69
+ const CreateForItemsCouponBodySchema = z.looseObject({
70
+ id: z.string().max(100),
71
+ name: z.string().max(50),
72
+ invoice_name: z.string().max(100).optional(),
73
+ discount_type: z
74
+ .enum(['fixed_amount', 'percentage', 'offer_quantity'])
75
+ .optional(),
76
+ discount_amount: z.number().int().min(0).optional(),
77
+ currency_code: z.string().max(3).optional(),
78
+ discount_percentage: z.number().min(0.01).max(100).optional(),
79
+ discount_quantity: z.number().int().min(1).optional(),
80
+ apply_on: z.enum([
81
+ 'invoice_amount',
82
+ 'specified_items_total',
83
+ 'each_specified_item',
84
+ 'each_unit_of_specified_items',
85
+ ]),
86
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']).optional(),
87
+ duration_month: z.number().int().min(1).max(240).optional(),
88
+ valid_from: z.number().int().optional(),
89
+ valid_till: z.number().int().optional(),
90
+ max_redemptions: z.number().int().min(1).optional(),
91
+ invoice_notes: z.string().max(2000).optional(),
92
+ meta_data: CreateForItemsCouponMetaDataSchema.optional(),
93
+ included_in_mrr: z.boolean().optional(),
94
+ period: z.number().int().min(1).optional(),
95
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
96
+ status: z.enum(['active', 'archived']).optional(),
97
+ item_constraints: CreateForItemsCouponItemConstraintsSchema.optional(),
98
+ item_constraint_criteria: CreateForItemsCouponItemConstraintCriteriaSchema.optional(),
99
+ coupon_constraints: CreateForItemsCouponCouponConstraintsSchema.optional(),
100
+ });
101
+ export { CreateForItemsCouponBodySchema };
102
+ //Coupon.updateForItems
103
+ const UpdateForItemsCouponMetaDataSchema = z.looseObject({});
104
+ const UpdateForItemsCouponItemConstraintsSchema = z.object({
105
+ constraint: z.array(z.enum(['none', 'all', 'specific', 'criteria']).optional()),
106
+ item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()),
107
+ item_price_ids: z.array(z.array(z.string().optional()).optional()).optional(),
108
+ });
109
+ const UpdateForItemsCouponItemConstraintCriteriaSchema = z.object({
110
+ item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
111
+ item_family_ids: z
112
+ .array(z.array(z.string().optional()).optional())
113
+ .optional(),
114
+ currencies: z.array(z.array(z.string().optional()).optional()).optional(),
115
+ item_price_periods: z
116
+ .array(z.array(z.string().optional()).optional())
117
+ .optional(),
118
+ });
119
+ const UpdateForItemsCouponCouponConstraintsSchema = z.object({
120
+ entity_type: z.array(z.enum(['customer']).optional()),
121
+ type: z.array(z
122
+ .enum([
123
+ 'max_redemptions',
124
+ 'unique_by',
125
+ 'existing_customer',
126
+ 'new_customer',
127
+ ])
128
+ .optional()),
129
+ value: z.array(z.string().max(65000).optional()).optional(),
130
+ });
131
+ const UpdateForItemsCouponBodySchema = z.looseObject({
132
+ name: z.string().max(50).optional(),
133
+ invoice_name: z.string().max(100).optional(),
134
+ discount_type: z
135
+ .enum(['fixed_amount', 'percentage', 'offer_quantity'])
136
+ .optional(),
137
+ discount_amount: z.number().int().min(0).optional(),
138
+ currency_code: z.string().max(3).optional(),
139
+ discount_percentage: z.number().min(0.01).max(100).optional(),
140
+ discount_quantity: z.number().int().min(1).optional(),
141
+ apply_on: z
142
+ .enum([
143
+ 'invoice_amount',
144
+ 'specified_items_total',
145
+ 'each_specified_item',
146
+ 'each_unit_of_specified_items',
147
+ ])
148
+ .optional(),
149
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']).optional(),
150
+ duration_month: z.number().int().min(1).max(240).optional(),
151
+ valid_from: z.number().int().optional(),
152
+ valid_till: z.number().int().optional(),
153
+ max_redemptions: z.number().int().min(1).optional(),
154
+ invoice_notes: z.string().max(2000).optional(),
155
+ meta_data: UpdateForItemsCouponMetaDataSchema.optional(),
156
+ included_in_mrr: z.boolean().optional(),
157
+ period: z.number().int().min(1).optional(),
158
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
159
+ item_constraints: UpdateForItemsCouponItemConstraintsSchema.optional(),
160
+ item_constraint_criteria: UpdateForItemsCouponItemConstraintCriteriaSchema.optional(),
161
+ coupon_constraints: UpdateForItemsCouponCouponConstraintsSchema.optional(),
162
+ });
163
+ export { UpdateForItemsCouponBodySchema };
164
+ //Coupon.update
165
+ const UpdateCouponMetaDataSchema = z.looseObject({});
166
+ const UpdateCouponBodySchema = z.looseObject({
167
+ name: z.string().max(50).optional(),
168
+ invoice_name: z.string().max(100).optional(),
169
+ discount_type: z
170
+ .enum(['fixed_amount', 'percentage', 'offer_quantity'])
171
+ .optional(),
172
+ discount_amount: z.number().int().min(0).optional(),
173
+ currency_code: z.string().max(3).optional(),
174
+ discount_percentage: z.number().min(0.01).max(100).optional(),
175
+ discount_quantity: z.number().int().min(1).optional(),
176
+ apply_on: z
177
+ .enum([
178
+ 'invoice_amount',
179
+ 'specified_items_total',
180
+ 'each_specified_item',
181
+ 'each_unit_of_specified_items',
182
+ ])
183
+ .optional(),
184
+ duration_type: z.enum(['one_time', 'forever', 'limited_period']).optional(),
185
+ duration_month: z.number().int().min(1).max(240).optional(),
186
+ valid_till: z.number().int().optional(),
187
+ max_redemptions: z.number().int().min(1).optional(),
188
+ invoice_notes: z.string().max(2000).optional(),
189
+ meta_data: UpdateCouponMetaDataSchema.optional(),
190
+ included_in_mrr: z.boolean().optional(),
191
+ period: z.number().int().min(1).optional(),
192
+ period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
193
+ plan_constraint: z.enum(['none', 'all', 'specific']).optional(),
194
+ addon_constraint: z.enum(['none', 'all', 'specific']).optional(),
195
+ plan_ids: z.array(z.string().max(100).optional()).optional(),
196
+ addon_ids: z.array(z.string().max(100).optional()).optional(),
197
+ });
198
+ export { UpdateCouponBodySchema };
199
+ //Coupon.copy
200
+ const CopyCouponBodySchema = z.looseObject({
201
+ from_site: z.string().max(50),
202
+ id_at_from_site: z.string().max(100),
203
+ id: z.string().max(100).optional(),
204
+ for_site_merging: z.boolean().default(false).optional(),
205
+ });
206
+ export { CopyCouponBodySchema };
@@ -0,0 +1,11 @@
1
+ // Generated Zod schemas: CouponCode
2
+ // Actions: create
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //CouponCode.create
6
+ const CreateCouponCodeBodySchema = z.looseObject({
7
+ coupon_id: z.string().max(100),
8
+ coupon_set_name: z.string().max(50),
9
+ code: z.string().max(50),
10
+ });
11
+ export { CreateCouponCodeBodySchema };
@@ -0,0 +1,25 @@
1
+ // Generated Zod schemas: CouponSet
2
+ // Actions: create, addCouponCodes, update
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //CouponSet.create
6
+ const CreateCouponSetMetaDataSchema = z.looseObject({});
7
+ const CreateCouponSetBodySchema = z.looseObject({
8
+ coupon_id: z.string().max(100),
9
+ name: z.string().max(50),
10
+ id: z.string().max(50),
11
+ meta_data: CreateCouponSetMetaDataSchema.optional(),
12
+ });
13
+ export { CreateCouponSetBodySchema };
14
+ //CouponSet.addCouponCodes
15
+ const AddCouponCodesCouponSetBodySchema = z.looseObject({
16
+ code: z.array(z.string().max(50).optional()).optional(),
17
+ });
18
+ export { AddCouponCodesCouponSetBodySchema };
19
+ //CouponSet.update
20
+ const UpdateCouponSetMetaDataSchema = z.looseObject({});
21
+ const UpdateCouponSetBodySchema = z.looseObject({
22
+ name: z.string().max(50).optional(),
23
+ meta_data: UpdateCouponSetMetaDataSchema.optional(),
24
+ });
25
+ export { UpdateCouponSetBodySchema };
@@ -0,0 +1,285 @@
1
+ // Generated Zod schemas: CreditNote
2
+ // Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, creditNotesForCustomer, delete, removeTaxWithheldRefund, importCreditNote
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //CreditNote.create
6
+ const CreateCreditNoteLineItemsSchema = z.object({
7
+ reference_line_item_id: z.array(z.string().max(40).optional()).optional(),
8
+ unit_amount: z.array(z.number().int().optional()).optional(),
9
+ unit_amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
10
+ quantity: z.array(z.number().int().optional()).optional(),
11
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
12
+ amount: z.array(z.number().int().optional()).optional(),
13
+ date_from: z.array(z.number().int().optional()).optional(),
14
+ date_to: z.array(z.number().int().optional()).optional(),
15
+ description: z.array(z.string().max(250).optional()).optional(),
16
+ entity_type: z
17
+ .array(z
18
+ .enum([
19
+ 'adhoc',
20
+ 'plan_item_price',
21
+ 'addon_item_price',
22
+ 'charge_item_price',
23
+ 'plan',
24
+ 'addon',
25
+ ])
26
+ .optional())
27
+ .optional(),
28
+ entity_id: z.array(z.string().max(100).optional()).optional(),
29
+ });
30
+ const CreateCreditNoteBodySchema = z.looseObject({
31
+ reference_invoice_id: z.string().max(50).optional(),
32
+ customer_id: z.string().max(50).optional(),
33
+ total: z.number().int().min(0).optional(),
34
+ type: z.enum(['adjustment', 'refundable', 'store']),
35
+ reason_code: z
36
+ .enum([
37
+ 'product_unsatisfactory',
38
+ 'service_unsatisfactory',
39
+ 'order_change',
40
+ 'order_cancellation',
41
+ 'waiver',
42
+ 'other',
43
+ ])
44
+ .optional(),
45
+ create_reason_code: z.string().max(100).optional(),
46
+ date: z.number().int().optional(),
47
+ customer_notes: z.string().max(2000).optional(),
48
+ currency_code: z.string().max(3).optional(),
49
+ comment: z.string().max(300).optional(),
50
+ line_items: CreateCreditNoteLineItemsSchema.optional(),
51
+ });
52
+ export { CreateCreditNoteBodySchema };
53
+ //CreditNote.retrieve
54
+ const RetrieveCreditNoteSubscriptionIdSchema = z.object({
55
+ is: z.string().min(1).optional(),
56
+ });
57
+ const RetrieveCreditNoteCustomerIdSchema = z.object({
58
+ is: z.string().min(1).optional(),
59
+ });
60
+ const RetrieveCreditNoteLineItemSchema = z.object({
61
+ subscription_id: RetrieveCreditNoteSubscriptionIdSchema.optional(),
62
+ customer_id: RetrieveCreditNoteCustomerIdSchema.optional(),
63
+ });
64
+ const RetrieveCreditNoteBodySchema = z.looseObject({
65
+ line_items_limit: z.number().int().min(1).max(300).optional(),
66
+ line_items_offset: z.string().max(1000).optional(),
67
+ line_item: RetrieveCreditNoteLineItemSchema.optional(),
68
+ });
69
+ export { RetrieveCreditNoteBodySchema };
70
+ //CreditNote.pdf
71
+ const PdfCreditNoteBodySchema = z.looseObject({
72
+ disposition_type: z.enum(['attachment', 'inline']).optional(),
73
+ });
74
+ export { PdfCreditNoteBodySchema };
75
+ //CreditNote.refund
76
+ const RefundCreditNoteBodySchema = z.looseObject({
77
+ refund_amount: z.number().int().min(1).optional(),
78
+ customer_notes: z.string().max(2000).optional(),
79
+ refund_reason_code: z.string().max(100).optional(),
80
+ });
81
+ export { RefundCreditNoteBodySchema };
82
+ //CreditNote.recordRefund
83
+ const RecordRefundCreditNoteTransactionSchema = z.object({
84
+ id: z.string().max(40).optional(),
85
+ amount: z.number().int().min(0).optional(),
86
+ payment_method: z.enum([
87
+ 'cash',
88
+ 'check',
89
+ 'chargeback',
90
+ 'bank_transfer',
91
+ 'other',
92
+ 'app_store',
93
+ 'play_store',
94
+ 'custom',
95
+ ]),
96
+ reference_number: z.string().max(100).optional(),
97
+ custom_payment_method_id: z.string().max(50).optional(),
98
+ date: z.number().int(),
99
+ });
100
+ const RecordRefundCreditNoteBodySchema = z.looseObject({
101
+ refund_reason_code: z.string().max(100).optional(),
102
+ comment: z.string().max(300).optional(),
103
+ transaction: RecordRefundCreditNoteTransactionSchema.optional(),
104
+ });
105
+ export { RecordRefundCreditNoteBodySchema };
106
+ //CreditNote.voidCreditNote
107
+ const VoidCreditNoteCreditNoteBodySchema = z.looseObject({
108
+ comment: z.string().max(300).optional(),
109
+ });
110
+ export { VoidCreditNoteCreditNoteBodySchema };
111
+ //CreditNote.creditNotesForCustomer
112
+ const CreditNotesForCustomerCreditNoteBodySchema = z.looseObject({
113
+ limit: z.number().int().min(1).max(100).optional(),
114
+ offset: z.string().max(1000).optional(),
115
+ });
116
+ export { CreditNotesForCustomerCreditNoteBodySchema };
117
+ //CreditNote.delete
118
+ const DeleteCreditNoteBodySchema = z.looseObject({
119
+ comment: z.string().max(300).optional(),
120
+ });
121
+ export { DeleteCreditNoteBodySchema };
122
+ //CreditNote.removeTaxWithheldRefund
123
+ const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = z.object({
124
+ id: z.string().max(40),
125
+ });
126
+ const RemoveTaxWithheldRefundCreditNoteBodySchema = z.looseObject({
127
+ tax_withheld: RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema.optional(),
128
+ });
129
+ export { RemoveTaxWithheldRefundCreditNoteBodySchema };
130
+ //CreditNote.importCreditNote
131
+ const ImportCreditNoteCreditNoteLineItemsSchema = z.object({
132
+ reference_line_item_id: z.array(z.string().max(40).optional()).optional(),
133
+ id: z.array(z.string().max(40).optional()).optional(),
134
+ date_from: z.array(z.number().int().optional()).optional(),
135
+ date_to: z.array(z.number().int().optional()).optional(),
136
+ subscription_id: z.array(z.string().max(50).optional()).optional(),
137
+ description: z.array(z.string().max(250).optional()),
138
+ unit_amount: z.array(z.number().int().optional()).optional(),
139
+ quantity: z.array(z.number().int().optional()).optional(),
140
+ amount: z.array(z.number().int().optional()).optional(),
141
+ unit_amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
142
+ quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
143
+ amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
144
+ entity_type: z
145
+ .array(z
146
+ .enum([
147
+ 'adhoc',
148
+ 'plan_item_price',
149
+ 'addon_item_price',
150
+ 'charge_item_price',
151
+ 'plan_setup',
152
+ 'plan',
153
+ 'addon',
154
+ ])
155
+ .optional())
156
+ .optional(),
157
+ entity_id: z.array(z.string().max(100).optional()).optional(),
158
+ item_level_discount1_entity_id: z
159
+ .array(z.string().max(100).optional())
160
+ .optional(),
161
+ item_level_discount1_amount: z
162
+ .array(z.number().int().min(0).optional())
163
+ .optional(),
164
+ item_level_discount2_entity_id: z
165
+ .array(z.string().max(100).optional())
166
+ .optional(),
167
+ item_level_discount2_amount: z
168
+ .array(z.number().int().min(0).optional())
169
+ .optional(),
170
+ tax1_name: z.array(z.string().max(50).optional()).optional(),
171
+ tax1_amount: z.array(z.number().int().min(0).optional()).optional(),
172
+ tax2_name: z.array(z.string().max(50).optional()).optional(),
173
+ tax2_amount: z.array(z.number().int().min(0).optional()).optional(),
174
+ tax3_name: z.array(z.string().max(50).optional()).optional(),
175
+ tax3_amount: z.array(z.number().int().min(0).optional()).optional(),
176
+ tax4_name: z.array(z.string().max(50).optional()).optional(),
177
+ tax4_amount: z.array(z.number().int().min(0).optional()).optional(),
178
+ tax5_name: z.array(z.string().max(50).optional()).optional(),
179
+ tax5_amount: z.array(z.number().int().min(0).optional()).optional(),
180
+ tax6_name: z.array(z.string().max(50).optional()).optional(),
181
+ tax6_amount: z.array(z.number().int().min(0).optional()).optional(),
182
+ tax7_name: z.array(z.string().max(50).optional()).optional(),
183
+ tax7_amount: z.array(z.number().int().min(0).optional()).optional(),
184
+ tax8_name: z.array(z.string().max(50).optional()).optional(),
185
+ tax8_amount: z.array(z.number().int().min(0).optional()).optional(),
186
+ tax9_name: z.array(z.string().max(50).optional()).optional(),
187
+ tax9_amount: z.array(z.number().int().min(0).optional()).optional(),
188
+ tax10_name: z.array(z.string().max(50).optional()).optional(),
189
+ tax10_amount: z.array(z.number().int().min(0).optional()).optional(),
190
+ });
191
+ const ImportCreditNoteCreditNoteLineItemTiersSchema = z.object({
192
+ line_item_id: z.array(z.string().max(40).optional()),
193
+ starting_unit: z.array(z.number().int().min(0).optional()).optional(),
194
+ ending_unit: z.array(z.number().int().optional()).optional(),
195
+ quantity_used: z.array(z.number().int().min(0).optional()).optional(),
196
+ unit_amount: z.array(z.number().int().min(0).optional()).optional(),
197
+ starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
198
+ ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
199
+ quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
200
+ unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
201
+ });
202
+ const ImportCreditNoteCreditNoteDiscountsSchema = z.object({
203
+ line_item_id: z.array(z.string().max(40).optional()).optional(),
204
+ entity_type: z.array(z
205
+ .enum([
206
+ 'item_level_coupon',
207
+ 'document_level_coupon',
208
+ 'promotional_credits',
209
+ 'item_level_discount',
210
+ 'document_level_discount',
211
+ ])
212
+ .optional()),
213
+ entity_id: z.array(z.string().max(100).optional()).optional(),
214
+ description: z.array(z.string().max(250).optional()).optional(),
215
+ amount: z.array(z.number().int().min(0).optional()),
216
+ });
217
+ const ImportCreditNoteCreditNoteTaxesSchema = z.object({
218
+ name: z.array(z.string().max(100).optional()),
219
+ rate: z.array(z.number().min(0).max(100).optional()),
220
+ amount: z.array(z.number().int().min(0).optional()).optional(),
221
+ description: z.array(z.string().max(50).optional()).optional(),
222
+ juris_type: z
223
+ .array(z
224
+ .enum([
225
+ 'country',
226
+ 'federal',
227
+ 'state',
228
+ 'county',
229
+ 'city',
230
+ 'special',
231
+ 'unincorporated',
232
+ 'other',
233
+ ])
234
+ .optional())
235
+ .optional(),
236
+ juris_name: z.array(z.string().max(250).optional()).optional(),
237
+ juris_code: z.array(z.string().max(250).optional()).optional(),
238
+ });
239
+ const ImportCreditNoteCreditNoteAllocationsSchema = z.object({
240
+ invoice_id: z.array(z.string().max(50).optional()),
241
+ allocated_amount: z.array(z.number().int().min(1).optional()),
242
+ allocated_at: z.array(z.number().int().optional()),
243
+ });
244
+ const ImportCreditNoteCreditNoteLinkedRefundsSchema = z.object({
245
+ id: z.array(z.string().max(40).optional()).optional(),
246
+ amount: z.array(z.number().int().min(1).optional()),
247
+ payment_method: z.array(z
248
+ .enum([
249
+ 'cash',
250
+ 'check',
251
+ 'bank_transfer',
252
+ 'other',
253
+ 'app_store',
254
+ 'play_store',
255
+ 'custom',
256
+ ])
257
+ .optional()),
258
+ date: z.array(z.number().int().optional()),
259
+ reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
260
+ });
261
+ const ImportCreditNoteCreditNoteBodySchema = z.looseObject({
262
+ id: z.string().max(50),
263
+ customer_id: z.string().max(50).optional(),
264
+ subscription_id: z.string().max(50).optional(),
265
+ reference_invoice_id: z.string().max(50),
266
+ type: z.enum(['adjustment', 'refundable', 'store']),
267
+ currency_code: z.string().max(3).optional(),
268
+ create_reason_code: z.string().max(100),
269
+ date: z.number().int(),
270
+ status: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
271
+ total: z.number().int().min(0).optional(),
272
+ refunded_at: z.number().int().optional(),
273
+ voided_at: z.number().int().optional(),
274
+ sub_total: z.number().int().min(0).optional(),
275
+ round_off_amount: z.number().int().min(-99).max(99).optional(),
276
+ fractional_correction: z.number().int().min(-50000).max(50000).optional(),
277
+ vat_number_prefix: z.string().max(10).optional(),
278
+ line_items: ImportCreditNoteCreditNoteLineItemsSchema.optional(),
279
+ line_item_tiers: ImportCreditNoteCreditNoteLineItemTiersSchema.optional(),
280
+ discounts: ImportCreditNoteCreditNoteDiscountsSchema.optional(),
281
+ taxes: ImportCreditNoteCreditNoteTaxesSchema.optional(),
282
+ allocations: ImportCreditNoteCreditNoteAllocationsSchema.optional(),
283
+ linked_refunds: ImportCreditNoteCreditNoteLinkedRefundsSchema.optional(),
284
+ });
285
+ export { ImportCreditNoteCreditNoteBodySchema };
@@ -0,0 +1,29 @@
1
+ // Generated Zod schemas: Currency
2
+ // Actions: list, create, update, addSchedule
3
+ // Do not edit manually – regenerate via sdk-generator
4
+ import { z } from 'zod';
5
+ //Currency.list
6
+ const ListCurrencyBodySchema = z.looseObject({
7
+ limit: z.number().int().min(1).max(100).optional(),
8
+ offset: z.string().max(1000).optional(),
9
+ });
10
+ export { ListCurrencyBodySchema };
11
+ //Currency.create
12
+ const CreateCurrencyBodySchema = z.looseObject({
13
+ currency_code: z.string().max(3),
14
+ forex_type: z.enum(['manual', 'auto']),
15
+ manual_exchange_rate: z.string().max(20).optional(),
16
+ });
17
+ export { CreateCurrencyBodySchema };
18
+ //Currency.update
19
+ const UpdateCurrencyBodySchema = z.looseObject({
20
+ forex_type: z.enum(['manual', 'auto']),
21
+ manual_exchange_rate: z.string().max(20).optional(),
22
+ });
23
+ export { UpdateCurrencyBodySchema };
24
+ //Currency.addSchedule
25
+ const AddScheduleCurrencyBodySchema = z.looseObject({
26
+ manual_exchange_rate: z.string().max(20),
27
+ schedule_at: z.number().int(),
28
+ });
29
+ export { AddScheduleCurrencyBodySchema };