chargebee 3.25.0-beta.1 → 3.25.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 (166) hide show
  1. package/CHANGELOG.md +66 -4
  2. package/README.md +0 -39
  3. package/cjs/RequestWrapper.js +1 -28
  4. package/cjs/chargebee.cjs.js +0 -3
  5. package/cjs/chargebee.cjs.worker.js +0 -2
  6. package/cjs/createChargebee.js +0 -5
  7. package/cjs/environment.js +1 -1
  8. package/cjs/resources/api_endpoints.js +1 -2
  9. package/cjs/resources/webhook/eventType.js +2 -0
  10. package/esm/RequestWrapper.js +1 -28
  11. package/esm/chargebee.esm.js +0 -2
  12. package/esm/chargebee.esm.worker.js +0 -1
  13. package/esm/createChargebee.js +0 -5
  14. package/esm/environment.js +1 -1
  15. package/esm/resources/api_endpoints.js +1 -2
  16. package/esm/resources/webhook/eventType.js +2 -0
  17. package/package.json +1 -4
  18. package/types/core.d.ts +23 -6
  19. package/types/index.d.ts +0 -17
  20. package/types/resources/Content.d.ts +0 -1
  21. package/types/resources/Customer.d.ts +14 -4
  22. package/types/resources/Estimate.d.ts +14 -4
  23. package/types/resources/Event.d.ts +2 -0
  24. package/types/resources/Gift.d.ts +23 -6
  25. package/types/resources/HostedPage.d.ts +1 -0
  26. package/types/resources/Invoice.d.ts +14 -5
  27. package/types/resources/OmnichannelSubscription.d.ts +6 -0
  28. package/types/resources/OmnichannelSubscriptionItem.d.ts +1 -0
  29. package/types/resources/PaymentIntent.d.ts +35 -10
  30. package/types/resources/PaymentSource.d.ts +7 -2
  31. package/types/resources/Purchase.d.ts +7 -2
  32. package/types/resources/Subscription.d.ts +49 -14
  33. package/types/resources/WebhookEvent.d.ts +22 -4
  34. package/cjs/chargebeeZodValidationError.js +0 -18
  35. package/cjs/schema/addon.schema.js +0 -153
  36. package/cjs/schema/address.schema.js +0 -35
  37. package/cjs/schema/alert.schema.js +0 -38
  38. package/cjs/schema/attached_item.schema.js +0 -58
  39. package/cjs/schema/business_entity.schema.js +0 -46
  40. package/cjs/schema/card.schema.js +0 -165
  41. package/cjs/schema/comment.schema.js +0 -69
  42. package/cjs/schema/coupon.schema.js +0 -209
  43. package/cjs/schema/coupon_code.schema.js +0 -14
  44. package/cjs/schema/coupon_set.schema.js +0 -28
  45. package/cjs/schema/credit_note.schema.js +0 -288
  46. package/cjs/schema/currency.schema.js +0 -32
  47. package/cjs/schema/customer.schema.js +0 -986
  48. package/cjs/schema/customer_entitlement.schema.js +0 -14
  49. package/cjs/schema/differential_price.schema.js +0 -68
  50. package/cjs/schema/entitlement.schema.js +0 -27
  51. package/cjs/schema/entitlement_override.schema.js +0 -33
  52. package/cjs/schema/estimate.schema.js +0 -1525
  53. package/cjs/schema/export.schema.js +0 -1545
  54. package/cjs/schema/feature.schema.js +0 -37
  55. package/cjs/schema/gift.schema.js +0 -277
  56. package/cjs/schema/hosted_page.schema.js +0 -1649
  57. package/cjs/schema/in_app_subscription.schema.js +0 -68
  58. package/cjs/schema/index.js +0 -80
  59. package/cjs/schema/invoice.schema.js +0 -1467
  60. package/cjs/schema/item.schema.js +0 -91
  61. package/cjs/schema/item_entitlement.schema.js +0 -45
  62. package/cjs/schema/item_family.schema.js +0 -21
  63. package/cjs/schema/item_price.schema.js +0 -190
  64. package/cjs/schema/non_subscription.schema.js +0 -28
  65. package/cjs/schema/offer_event.schema.js +0 -13
  66. package/cjs/schema/offer_fulfillment.schema.js +0 -20
  67. package/cjs/schema/omnichannel_one_time_order.schema.js +0 -26
  68. package/cjs/schema/omnichannel_subscription.schema.js +0 -89
  69. package/cjs/schema/omnichannel_subscription_item.schema.js +0 -13
  70. package/cjs/schema/order.schema.js +0 -273
  71. package/cjs/schema/payment_intent.schema.js +0 -117
  72. package/cjs/schema/payment_schedule_scheme.schema.js +0 -20
  73. package/cjs/schema/payment_source.schema.js +0 -358
  74. package/cjs/schema/payment_voucher.schema.js +0 -57
  75. package/cjs/schema/personalized_offer.schema.js +0 -28
  76. package/cjs/schema/plan.schema.js +0 -225
  77. package/cjs/schema/portal_session.schema.js +0 -22
  78. package/cjs/schema/price_variant.schema.js +0 -36
  79. package/cjs/schema/pricing_page_session.schema.js +0 -135
  80. package/cjs/schema/promotional_credit.schema.js +0 -78
  81. package/cjs/schema/purchase.schema.js +0 -272
  82. package/cjs/schema/quote.schema.js +0 -1557
  83. package/cjs/schema/ramp.schema.js +0 -209
  84. package/cjs/schema/recorded_purchase.schema.js +0 -32
  85. package/cjs/schema/resource_migration.schema.js +0 -14
  86. package/cjs/schema/site_migration_detail.schema.js +0 -81
  87. package/cjs/schema/subscription.schema.js +0 -2993
  88. package/cjs/schema/subscription_entitlement.schema.js +0 -25
  89. package/cjs/schema/time_machine.schema.js +0 -17
  90. package/cjs/schema/transaction.schema.js +0 -70
  91. package/cjs/schema/unbilled_charge.schema.js +0 -113
  92. package/cjs/schema/usage.schema.js +0 -93
  93. package/cjs/schema/usage_charge.schema.js +0 -17
  94. package/cjs/schema/usage_event.schema.js +0 -28
  95. package/cjs/schema/usage_file.schema.js +0 -13
  96. package/cjs/schema/usage_summary.schema.js +0 -17
  97. package/cjs/schema/virtual_bank_account.schema.js +0 -43
  98. package/cjs/schema/webhook_endpoint.schema.js +0 -504
  99. package/cjs/validationLoader.js +0 -59
  100. package/esm/chargebeeZodValidationError.js +0 -14
  101. package/esm/schema/addon.schema.js +0 -150
  102. package/esm/schema/address.schema.js +0 -32
  103. package/esm/schema/alert.schema.js +0 -35
  104. package/esm/schema/attached_item.schema.js +0 -55
  105. package/esm/schema/business_entity.schema.js +0 -43
  106. package/esm/schema/card.schema.js +0 -162
  107. package/esm/schema/comment.schema.js +0 -66
  108. package/esm/schema/coupon.schema.js +0 -206
  109. package/esm/schema/coupon_code.schema.js +0 -11
  110. package/esm/schema/coupon_set.schema.js +0 -25
  111. package/esm/schema/credit_note.schema.js +0 -285
  112. package/esm/schema/currency.schema.js +0 -29
  113. package/esm/schema/customer.schema.js +0 -983
  114. package/esm/schema/customer_entitlement.schema.js +0 -11
  115. package/esm/schema/differential_price.schema.js +0 -65
  116. package/esm/schema/entitlement.schema.js +0 -24
  117. package/esm/schema/entitlement_override.schema.js +0 -30
  118. package/esm/schema/estimate.schema.js +0 -1522
  119. package/esm/schema/export.schema.js +0 -1542
  120. package/esm/schema/feature.schema.js +0 -34
  121. package/esm/schema/gift.schema.js +0 -274
  122. package/esm/schema/hosted_page.schema.js +0 -1646
  123. package/esm/schema/in_app_subscription.schema.js +0 -65
  124. package/esm/schema/index.js +0 -64
  125. package/esm/schema/invoice.schema.js +0 -1464
  126. package/esm/schema/item.schema.js +0 -88
  127. package/esm/schema/item_entitlement.schema.js +0 -42
  128. package/esm/schema/item_family.schema.js +0 -18
  129. package/esm/schema/item_price.schema.js +0 -187
  130. package/esm/schema/non_subscription.schema.js +0 -25
  131. package/esm/schema/offer_event.schema.js +0 -10
  132. package/esm/schema/offer_fulfillment.schema.js +0 -17
  133. package/esm/schema/omnichannel_one_time_order.schema.js +0 -23
  134. package/esm/schema/omnichannel_subscription.schema.js +0 -86
  135. package/esm/schema/omnichannel_subscription_item.schema.js +0 -10
  136. package/esm/schema/order.schema.js +0 -270
  137. package/esm/schema/payment_intent.schema.js +0 -114
  138. package/esm/schema/payment_schedule_scheme.schema.js +0 -17
  139. package/esm/schema/payment_source.schema.js +0 -355
  140. package/esm/schema/payment_voucher.schema.js +0 -54
  141. package/esm/schema/personalized_offer.schema.js +0 -25
  142. package/esm/schema/plan.schema.js +0 -222
  143. package/esm/schema/portal_session.schema.js +0 -19
  144. package/esm/schema/price_variant.schema.js +0 -33
  145. package/esm/schema/pricing_page_session.schema.js +0 -132
  146. package/esm/schema/promotional_credit.schema.js +0 -75
  147. package/esm/schema/purchase.schema.js +0 -269
  148. package/esm/schema/quote.schema.js +0 -1554
  149. package/esm/schema/ramp.schema.js +0 -206
  150. package/esm/schema/recorded_purchase.schema.js +0 -29
  151. package/esm/schema/resource_migration.schema.js +0 -11
  152. package/esm/schema/site_migration_detail.schema.js +0 -78
  153. package/esm/schema/subscription.schema.js +0 -2990
  154. package/esm/schema/subscription_entitlement.schema.js +0 -22
  155. package/esm/schema/time_machine.schema.js +0 -14
  156. package/esm/schema/transaction.schema.js +0 -67
  157. package/esm/schema/unbilled_charge.schema.js +0 -110
  158. package/esm/schema/usage.schema.js +0 -90
  159. package/esm/schema/usage_charge.schema.js +0 -14
  160. package/esm/schema/usage_event.schema.js +0 -25
  161. package/esm/schema/usage_file.schema.js +0 -10
  162. package/esm/schema/usage_summary.schema.js +0 -14
  163. package/esm/schema/virtual_bank_account.schema.js +0 -40
  164. package/esm/schema/webhook_endpoint.schema.js +0 -501
  165. package/esm/validationLoader.js +0 -56
  166. package/types/resources/QuoteEntitlement.d.ts +0 -16
@@ -1,206 +0,0 @@
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 };
@@ -1,11 +0,0 @@
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 };
@@ -1,25 +0,0 @@
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 };
@@ -1,285 +0,0 @@
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 };
@@ -1,29 +0,0 @@
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 };