chargebee 3.26.0 → 3.27.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.
- package/CHANGELOG.md +7 -0
- package/README.md +39 -0
- package/cjs/RequestWrapper.js +27 -0
- package/cjs/chargebee.cjs.js +3 -0
- package/cjs/chargebee.cjs.worker.js +2 -0
- package/cjs/chargebeeZodValidationError.js +18 -0
- package/cjs/createChargebee.js +5 -0
- package/cjs/environment.js +1 -1
- package/cjs/schema/addon.schema.js +269 -0
- package/cjs/schema/address.schema.js +35 -0
- package/cjs/schema/alert.schema.js +74 -0
- package/cjs/schema/alert_status.schema.js +31 -0
- package/cjs/schema/attached_item.schema.js +144 -0
- package/cjs/schema/business_entity.schema.js +46 -0
- package/cjs/schema/card.schema.js +165 -0
- package/cjs/schema/comment.schema.js +69 -0
- package/cjs/schema/coupon.schema.js +323 -0
- package/cjs/schema/coupon_code.schema.js +49 -0
- package/cjs/schema/coupon_set.schema.js +88 -0
- package/cjs/schema/credit_note.schema.js +502 -0
- package/cjs/schema/currency.schema.js +32 -0
- package/cjs/schema/customer.schema.js +1201 -0
- package/cjs/schema/customer_entitlement.schema.js +14 -0
- package/cjs/schema/differential_price.schema.js +106 -0
- package/cjs/schema/entitlement.schema.js +54 -0
- package/cjs/schema/entitlement_override.schema.js +35 -0
- package/cjs/schema/estimate.schema.js +1535 -0
- package/cjs/schema/event.schema.js +1060 -0
- package/cjs/schema/export.schema.js +3385 -0
- package/cjs/schema/feature.schema.js +78 -0
- package/cjs/schema/gift.schema.js +293 -0
- package/cjs/schema/grant_block.schema.js +47 -0
- package/cjs/schema/hosted_page.schema.js +1777 -0
- package/cjs/schema/in_app_subscription.schema.js +68 -0
- package/cjs/schema/index.js +88 -0
- package/cjs/schema/invoice.schema.js +1685 -0
- package/cjs/schema/item.schema.js +195 -0
- package/cjs/schema/item_entitlement.schema.js +45 -0
- package/cjs/schema/item_family.schema.js +57 -0
- package/cjs/schema/item_price.schema.js +335 -0
- package/cjs/schema/ledger_account_balance.schema.js +21 -0
- package/cjs/schema/ledger_operation.schema.js +104 -0
- package/cjs/schema/meter.schema.js +13 -0
- package/cjs/schema/metered_feature.schema.js +20 -0
- package/cjs/schema/non_subscription.schema.js +28 -0
- package/cjs/schema/offer_event.schema.js +13 -0
- package/cjs/schema/offer_fulfillment.schema.js +20 -0
- package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
- package/cjs/schema/omnichannel_subscription.schema.js +122 -0
- package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
- package/cjs/schema/order.schema.js +441 -0
- package/cjs/schema/payment_intent.schema.js +127 -0
- package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
- package/cjs/schema/payment_source.schema.js +630 -0
- package/cjs/schema/payment_voucher.schema.js +57 -0
- package/cjs/schema/personalized_offer.schema.js +28 -0
- package/cjs/schema/plan.schema.js +363 -0
- package/cjs/schema/portal_session.schema.js +22 -0
- package/cjs/schema/price_variant.schema.js +93 -0
- package/cjs/schema/pricing_page_session.schema.js +135 -0
- package/cjs/schema/promotional_credit.schema.js +78 -0
- package/cjs/schema/promotional_grant.schema.js +17 -0
- package/cjs/schema/purchase.schema.js +277 -0
- package/cjs/schema/quote.schema.js +1667 -0
- package/cjs/schema/ramp.schema.js +245 -0
- package/cjs/schema/recorded_purchase.schema.js +32 -0
- package/cjs/schema/resource_migration.schema.js +14 -0
- package/cjs/schema/site_migration_detail.schema.js +81 -0
- package/cjs/schema/subscription.schema.js +3344 -0
- package/cjs/schema/subscription_entitlement.schema.js +25 -0
- package/cjs/schema/time_machine.schema.js +17 -0
- package/cjs/schema/transaction.schema.js +744 -0
- package/cjs/schema/unbilled_charge.schema.js +139 -0
- package/cjs/schema/usage.schema.js +93 -0
- package/cjs/schema/usage_charge.schema.js +17 -0
- package/cjs/schema/usage_event.schema.js +28 -0
- package/cjs/schema/usage_file.schema.js +13 -0
- package/cjs/schema/usage_summary.schema.js +17 -0
- package/cjs/schema/virtual_bank_account.schema.js +71 -0
- package/cjs/schema/webhook_endpoint.schema.js +508 -0
- package/cjs/validationLoader.js +59 -0
- package/esm/RequestWrapper.js +27 -0
- package/esm/chargebee.esm.js +2 -0
- package/esm/chargebee.esm.worker.js +1 -0
- package/esm/chargebeeZodValidationError.js +14 -0
- package/esm/createChargebee.js +5 -0
- package/esm/environment.js +1 -1
- package/esm/schema/addon.schema.js +266 -0
- package/esm/schema/address.schema.js +32 -0
- package/esm/schema/alert.schema.js +71 -0
- package/esm/schema/alert_status.schema.js +28 -0
- package/esm/schema/attached_item.schema.js +141 -0
- package/esm/schema/business_entity.schema.js +43 -0
- package/esm/schema/card.schema.js +162 -0
- package/esm/schema/comment.schema.js +66 -0
- package/esm/schema/coupon.schema.js +320 -0
- package/esm/schema/coupon_code.schema.js +46 -0
- package/esm/schema/coupon_set.schema.js +85 -0
- package/esm/schema/credit_note.schema.js +499 -0
- package/esm/schema/currency.schema.js +29 -0
- package/esm/schema/customer.schema.js +1198 -0
- package/esm/schema/customer_entitlement.schema.js +11 -0
- package/esm/schema/differential_price.schema.js +103 -0
- package/esm/schema/entitlement.schema.js +51 -0
- package/esm/schema/entitlement_override.schema.js +32 -0
- package/esm/schema/estimate.schema.js +1532 -0
- package/esm/schema/event.schema.js +1057 -0
- package/esm/schema/export.schema.js +3382 -0
- package/esm/schema/feature.schema.js +75 -0
- package/esm/schema/gift.schema.js +290 -0
- package/esm/schema/grant_block.schema.js +44 -0
- package/esm/schema/hosted_page.schema.js +1774 -0
- package/esm/schema/in_app_subscription.schema.js +65 -0
- package/esm/schema/index.js +72 -0
- package/esm/schema/invoice.schema.js +1682 -0
- package/esm/schema/item.schema.js +192 -0
- package/esm/schema/item_entitlement.schema.js +42 -0
- package/esm/schema/item_family.schema.js +54 -0
- package/esm/schema/item_price.schema.js +332 -0
- package/esm/schema/ledger_account_balance.schema.js +18 -0
- package/esm/schema/ledger_operation.schema.js +101 -0
- package/esm/schema/meter.schema.js +10 -0
- package/esm/schema/metered_feature.schema.js +17 -0
- package/esm/schema/non_subscription.schema.js +25 -0
- package/esm/schema/offer_event.schema.js +10 -0
- package/esm/schema/offer_fulfillment.schema.js +17 -0
- package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
- package/esm/schema/omnichannel_subscription.schema.js +119 -0
- package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
- package/esm/schema/order.schema.js +438 -0
- package/esm/schema/payment_intent.schema.js +124 -0
- package/esm/schema/payment_schedule_scheme.schema.js +17 -0
- package/esm/schema/payment_source.schema.js +627 -0
- package/esm/schema/payment_voucher.schema.js +54 -0
- package/esm/schema/personalized_offer.schema.js +25 -0
- package/esm/schema/plan.schema.js +360 -0
- package/esm/schema/portal_session.schema.js +19 -0
- package/esm/schema/price_variant.schema.js +90 -0
- package/esm/schema/pricing_page_session.schema.js +132 -0
- package/esm/schema/promotional_credit.schema.js +75 -0
- package/esm/schema/promotional_grant.schema.js +14 -0
- package/esm/schema/purchase.schema.js +274 -0
- package/esm/schema/quote.schema.js +1664 -0
- package/esm/schema/ramp.schema.js +242 -0
- package/esm/schema/recorded_purchase.schema.js +29 -0
- package/esm/schema/resource_migration.schema.js +11 -0
- package/esm/schema/site_migration_detail.schema.js +78 -0
- package/esm/schema/subscription.schema.js +3341 -0
- package/esm/schema/subscription_entitlement.schema.js +22 -0
- package/esm/schema/time_machine.schema.js +14 -0
- package/esm/schema/transaction.schema.js +741 -0
- package/esm/schema/unbilled_charge.schema.js +136 -0
- package/esm/schema/usage.schema.js +90 -0
- package/esm/schema/usage_charge.schema.js +14 -0
- package/esm/schema/usage_event.schema.js +25 -0
- package/esm/schema/usage_file.schema.js +10 -0
- package/esm/schema/usage_summary.schema.js +14 -0
- package/esm/schema/virtual_bank_account.schema.js +68 -0
- package/esm/schema/webhook_endpoint.schema.js +505 -0
- package/esm/validationLoader.js +56 -0
- package/package.json +4 -1
- package/types/core.d.ts +2 -0
- package/types/index.d.ts +16 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
// Generated Zod schemas: CreditNote
|
|
2
|
+
// Actions: create, retrieve, pdf, refund, recordRefund, voidCreditNote, list, 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.list
|
|
112
|
+
const ListCreditNoteIdSchema = z.object({
|
|
113
|
+
is: z.string().min(1).optional(),
|
|
114
|
+
is_not: z.string().min(1).optional(),
|
|
115
|
+
starts_with: z.string().min(1).optional(),
|
|
116
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
117
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
118
|
+
});
|
|
119
|
+
const ListCreditNoteCustomerIdSchema = z.object({
|
|
120
|
+
is: z.string().min(1).optional(),
|
|
121
|
+
is_not: z.string().min(1).optional(),
|
|
122
|
+
starts_with: z.string().min(1).optional(),
|
|
123
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
124
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
125
|
+
});
|
|
126
|
+
const ListCreditNoteSubscriptionIdSchema = z.object({
|
|
127
|
+
is: z.string().min(1).optional(),
|
|
128
|
+
is_not: z.string().min(1).optional(),
|
|
129
|
+
starts_with: z.string().min(1).optional(),
|
|
130
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
131
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
132
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
133
|
+
});
|
|
134
|
+
const ListCreditNoteReferenceInvoiceIdSchema = z.object({
|
|
135
|
+
is: z.string().min(1).optional(),
|
|
136
|
+
is_not: z.string().min(1).optional(),
|
|
137
|
+
starts_with: z.string().min(1).optional(),
|
|
138
|
+
is_present: z.enum(['true', 'false']).optional(),
|
|
139
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
140
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
141
|
+
});
|
|
142
|
+
const ListCreditNoteTypeSchema = z.object({
|
|
143
|
+
is: z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
144
|
+
is_not: z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
145
|
+
in: z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
146
|
+
not_in: z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
147
|
+
});
|
|
148
|
+
const ListCreditNoteReasonCodeSchema = z.object({
|
|
149
|
+
is: z
|
|
150
|
+
.enum([
|
|
151
|
+
'write_off',
|
|
152
|
+
'subscription_change',
|
|
153
|
+
'subscription_cancellation',
|
|
154
|
+
'subscription_pause',
|
|
155
|
+
'chargeback',
|
|
156
|
+
'product_unsatisfactory',
|
|
157
|
+
'service_unsatisfactory',
|
|
158
|
+
'order_change',
|
|
159
|
+
'order_cancellation',
|
|
160
|
+
'waiver',
|
|
161
|
+
'other',
|
|
162
|
+
'fraudulent',
|
|
163
|
+
])
|
|
164
|
+
.optional(),
|
|
165
|
+
is_not: z
|
|
166
|
+
.enum([
|
|
167
|
+
'write_off',
|
|
168
|
+
'subscription_change',
|
|
169
|
+
'subscription_cancellation',
|
|
170
|
+
'subscription_pause',
|
|
171
|
+
'chargeback',
|
|
172
|
+
'product_unsatisfactory',
|
|
173
|
+
'service_unsatisfactory',
|
|
174
|
+
'order_change',
|
|
175
|
+
'order_cancellation',
|
|
176
|
+
'waiver',
|
|
177
|
+
'other',
|
|
178
|
+
'fraudulent',
|
|
179
|
+
])
|
|
180
|
+
.optional(),
|
|
181
|
+
in: z
|
|
182
|
+
.enum([
|
|
183
|
+
'write_off',
|
|
184
|
+
'subscription_change',
|
|
185
|
+
'subscription_cancellation',
|
|
186
|
+
'subscription_pause',
|
|
187
|
+
'chargeback',
|
|
188
|
+
'product_unsatisfactory',
|
|
189
|
+
'service_unsatisfactory',
|
|
190
|
+
'order_change',
|
|
191
|
+
'order_cancellation',
|
|
192
|
+
'waiver',
|
|
193
|
+
'other',
|
|
194
|
+
'fraudulent',
|
|
195
|
+
])
|
|
196
|
+
.optional(),
|
|
197
|
+
not_in: z
|
|
198
|
+
.enum([
|
|
199
|
+
'write_off',
|
|
200
|
+
'subscription_change',
|
|
201
|
+
'subscription_cancellation',
|
|
202
|
+
'subscription_pause',
|
|
203
|
+
'chargeback',
|
|
204
|
+
'product_unsatisfactory',
|
|
205
|
+
'service_unsatisfactory',
|
|
206
|
+
'order_change',
|
|
207
|
+
'order_cancellation',
|
|
208
|
+
'waiver',
|
|
209
|
+
'other',
|
|
210
|
+
'fraudulent',
|
|
211
|
+
])
|
|
212
|
+
.optional(),
|
|
213
|
+
});
|
|
214
|
+
const ListCreditNoteCreateReasonCodeSchema = z.object({
|
|
215
|
+
is: z.string().min(1).optional(),
|
|
216
|
+
is_not: z.string().min(1).optional(),
|
|
217
|
+
starts_with: z.string().min(1).optional(),
|
|
218
|
+
in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
219
|
+
not_in: z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')).optional(),
|
|
220
|
+
});
|
|
221
|
+
const ListCreditNoteStatusSchema = z.object({
|
|
222
|
+
is: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
223
|
+
is_not: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
224
|
+
in: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
225
|
+
not_in: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
226
|
+
});
|
|
227
|
+
const ListCreditNoteDateSchema = z.object({
|
|
228
|
+
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
229
|
+
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
230
|
+
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
231
|
+
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
232
|
+
});
|
|
233
|
+
const ListCreditNoteTotalSchema = z.object({
|
|
234
|
+
is: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
235
|
+
is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
236
|
+
lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
237
|
+
lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
238
|
+
gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
239
|
+
gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
240
|
+
between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
241
|
+
});
|
|
242
|
+
const ListCreditNotePriceTypeSchema = z.object({
|
|
243
|
+
is: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
244
|
+
is_not: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
245
|
+
in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
246
|
+
not_in: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
247
|
+
});
|
|
248
|
+
const ListCreditNoteAmountAllocatedSchema = z.object({
|
|
249
|
+
is: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
250
|
+
is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
251
|
+
lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
252
|
+
lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
253
|
+
gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
254
|
+
gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
255
|
+
between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
256
|
+
});
|
|
257
|
+
const ListCreditNoteAmountRefundedSchema = z.object({
|
|
258
|
+
is: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
259
|
+
is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
260
|
+
lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
261
|
+
lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
262
|
+
gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
263
|
+
gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
264
|
+
between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
265
|
+
});
|
|
266
|
+
const ListCreditNoteAmountAvailableSchema = z.object({
|
|
267
|
+
is: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
268
|
+
is_not: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
269
|
+
lt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
270
|
+
lte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
271
|
+
gt: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
272
|
+
gte: z.string().regex(RegExp('^-?\\d+$')).optional(),
|
|
273
|
+
between: z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')).optional(),
|
|
274
|
+
});
|
|
275
|
+
const ListCreditNoteVoidedAtSchema = z.object({
|
|
276
|
+
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
277
|
+
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
278
|
+
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
279
|
+
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
280
|
+
});
|
|
281
|
+
const ListCreditNoteUpdatedAtSchema = z.object({
|
|
282
|
+
after: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
283
|
+
before: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
284
|
+
on: z.string().regex(RegExp('^\\d{10}$')).optional(),
|
|
285
|
+
between: z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')).optional(),
|
|
286
|
+
});
|
|
287
|
+
const ListCreditNoteSortBySchema = z.looseObject({
|
|
288
|
+
asc: z.enum(['date']).optional(),
|
|
289
|
+
desc: z.enum(['date']).optional(),
|
|
290
|
+
});
|
|
291
|
+
const ListCreditNoteChannelSchema = z.object({
|
|
292
|
+
is: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
293
|
+
is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
294
|
+
in: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
295
|
+
not_in: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
296
|
+
});
|
|
297
|
+
const ListCreditNoteEinvoiceSchema = z.object({
|
|
298
|
+
status: ListCreditNoteStatusSchema.optional(),
|
|
299
|
+
});
|
|
300
|
+
const ListCreditNoteBodySchema = z.looseObject({
|
|
301
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
302
|
+
offset: z.string().max(1000).optional(),
|
|
303
|
+
include_deleted: z.boolean().default(false).optional(),
|
|
304
|
+
id: ListCreditNoteIdSchema.optional(),
|
|
305
|
+
customer_id: ListCreditNoteCustomerIdSchema.optional(),
|
|
306
|
+
subscription_id: ListCreditNoteSubscriptionIdSchema.optional(),
|
|
307
|
+
reference_invoice_id: ListCreditNoteReferenceInvoiceIdSchema.optional(),
|
|
308
|
+
type: ListCreditNoteTypeSchema.optional(),
|
|
309
|
+
reason_code: ListCreditNoteReasonCodeSchema.optional(),
|
|
310
|
+
create_reason_code: ListCreditNoteCreateReasonCodeSchema.optional(),
|
|
311
|
+
status: ListCreditNoteStatusSchema.optional(),
|
|
312
|
+
date: ListCreditNoteDateSchema.optional(),
|
|
313
|
+
total: ListCreditNoteTotalSchema.optional(),
|
|
314
|
+
price_type: ListCreditNotePriceTypeSchema.optional(),
|
|
315
|
+
amount_allocated: ListCreditNoteAmountAllocatedSchema.optional(),
|
|
316
|
+
amount_refunded: ListCreditNoteAmountRefundedSchema.optional(),
|
|
317
|
+
amount_available: ListCreditNoteAmountAvailableSchema.optional(),
|
|
318
|
+
voided_at: ListCreditNoteVoidedAtSchema.optional(),
|
|
319
|
+
updated_at: ListCreditNoteUpdatedAtSchema.optional(),
|
|
320
|
+
sort_by: ListCreditNoteSortBySchema.optional(),
|
|
321
|
+
channel: ListCreditNoteChannelSchema.optional(),
|
|
322
|
+
einvoice: ListCreditNoteEinvoiceSchema.optional(),
|
|
323
|
+
});
|
|
324
|
+
export { ListCreditNoteBodySchema };
|
|
325
|
+
//CreditNote.creditNotesForCustomer
|
|
326
|
+
const CreditNotesForCustomerCreditNoteBodySchema = z.looseObject({
|
|
327
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
328
|
+
offset: z.string().max(1000).optional(),
|
|
329
|
+
});
|
|
330
|
+
export { CreditNotesForCustomerCreditNoteBodySchema };
|
|
331
|
+
//CreditNote.delete
|
|
332
|
+
const DeleteCreditNoteBodySchema = z.looseObject({
|
|
333
|
+
comment: z.string().max(300).optional(),
|
|
334
|
+
});
|
|
335
|
+
export { DeleteCreditNoteBodySchema };
|
|
336
|
+
//CreditNote.removeTaxWithheldRefund
|
|
337
|
+
const RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema = z.object({
|
|
338
|
+
id: z.string().max(40),
|
|
339
|
+
});
|
|
340
|
+
const RemoveTaxWithheldRefundCreditNoteBodySchema = z.looseObject({
|
|
341
|
+
tax_withheld: RemoveTaxWithheldRefundCreditNoteTaxWithheldSchema.optional(),
|
|
342
|
+
});
|
|
343
|
+
export { RemoveTaxWithheldRefundCreditNoteBodySchema };
|
|
344
|
+
//CreditNote.importCreditNote
|
|
345
|
+
const ImportCreditNoteCreditNoteLineItemsSchema = z.object({
|
|
346
|
+
reference_line_item_id: z.array(z.string().max(40).optional()).optional(),
|
|
347
|
+
id: z.array(z.string().max(40).optional()).optional(),
|
|
348
|
+
date_from: z.array(z.number().int().optional()).optional(),
|
|
349
|
+
date_to: z.array(z.number().int().optional()).optional(),
|
|
350
|
+
subscription_id: z.array(z.string().max(50).optional()).optional(),
|
|
351
|
+
description: z.array(z.string().max(250).optional()),
|
|
352
|
+
unit_amount: z.array(z.number().int().optional()).optional(),
|
|
353
|
+
quantity: z.array(z.number().int().optional()).optional(),
|
|
354
|
+
amount: z.array(z.number().int().optional()).optional(),
|
|
355
|
+
unit_amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
356
|
+
quantity_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
357
|
+
amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
358
|
+
entity_type: z
|
|
359
|
+
.array(z
|
|
360
|
+
.enum([
|
|
361
|
+
'adhoc',
|
|
362
|
+
'plan_item_price',
|
|
363
|
+
'addon_item_price',
|
|
364
|
+
'charge_item_price',
|
|
365
|
+
'plan_setup',
|
|
366
|
+
'plan',
|
|
367
|
+
'addon',
|
|
368
|
+
])
|
|
369
|
+
.optional())
|
|
370
|
+
.optional(),
|
|
371
|
+
entity_id: z.array(z.string().max(100).optional()).optional(),
|
|
372
|
+
item_level_discount1_entity_id: z
|
|
373
|
+
.array(z.string().max(100).optional())
|
|
374
|
+
.optional(),
|
|
375
|
+
item_level_discount1_amount: z
|
|
376
|
+
.array(z.number().int().min(0).optional())
|
|
377
|
+
.optional(),
|
|
378
|
+
item_level_discount2_entity_id: z
|
|
379
|
+
.array(z.string().max(100).optional())
|
|
380
|
+
.optional(),
|
|
381
|
+
item_level_discount2_amount: z
|
|
382
|
+
.array(z.number().int().min(0).optional())
|
|
383
|
+
.optional(),
|
|
384
|
+
tax1_name: z.array(z.string().max(50).optional()).optional(),
|
|
385
|
+
tax1_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
386
|
+
tax2_name: z.array(z.string().max(50).optional()).optional(),
|
|
387
|
+
tax2_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
388
|
+
tax3_name: z.array(z.string().max(50).optional()).optional(),
|
|
389
|
+
tax3_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
390
|
+
tax4_name: z.array(z.string().max(50).optional()).optional(),
|
|
391
|
+
tax4_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
392
|
+
tax5_name: z.array(z.string().max(50).optional()).optional(),
|
|
393
|
+
tax5_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
394
|
+
tax6_name: z.array(z.string().max(50).optional()).optional(),
|
|
395
|
+
tax6_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
396
|
+
tax7_name: z.array(z.string().max(50).optional()).optional(),
|
|
397
|
+
tax7_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
398
|
+
tax8_name: z.array(z.string().max(50).optional()).optional(),
|
|
399
|
+
tax8_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
400
|
+
tax9_name: z.array(z.string().max(50).optional()).optional(),
|
|
401
|
+
tax9_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
402
|
+
tax10_name: z.array(z.string().max(50).optional()).optional(),
|
|
403
|
+
tax10_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
404
|
+
});
|
|
405
|
+
const ImportCreditNoteCreditNoteLineItemTiersSchema = z.object({
|
|
406
|
+
line_item_id: z.array(z.string().max(40).optional()),
|
|
407
|
+
starting_unit: z.array(z.number().int().min(0).optional()).optional(),
|
|
408
|
+
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
409
|
+
quantity_used: z.array(z.number().int().min(0).optional()).optional(),
|
|
410
|
+
unit_amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
411
|
+
starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
412
|
+
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
413
|
+
quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
414
|
+
unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
|
|
415
|
+
});
|
|
416
|
+
const ImportCreditNoteCreditNoteDiscountsSchema = z.object({
|
|
417
|
+
line_item_id: z.array(z.string().max(40).optional()).optional(),
|
|
418
|
+
entity_type: z.array(z
|
|
419
|
+
.enum([
|
|
420
|
+
'item_level_coupon',
|
|
421
|
+
'document_level_coupon',
|
|
422
|
+
'promotional_credits',
|
|
423
|
+
'item_level_discount',
|
|
424
|
+
'document_level_discount',
|
|
425
|
+
])
|
|
426
|
+
.optional()),
|
|
427
|
+
entity_id: z.array(z.string().max(100).optional()).optional(),
|
|
428
|
+
description: z.array(z.string().max(250).optional()).optional(),
|
|
429
|
+
amount: z.array(z.number().int().min(0).optional()),
|
|
430
|
+
});
|
|
431
|
+
const ImportCreditNoteCreditNoteTaxesSchema = z.object({
|
|
432
|
+
name: z.array(z.string().max(100).optional()),
|
|
433
|
+
rate: z.array(z.number().min(0).max(100).optional()),
|
|
434
|
+
amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
435
|
+
description: z.array(z.string().max(50).optional()).optional(),
|
|
436
|
+
juris_type: z
|
|
437
|
+
.array(z
|
|
438
|
+
.enum([
|
|
439
|
+
'country',
|
|
440
|
+
'federal',
|
|
441
|
+
'state',
|
|
442
|
+
'county',
|
|
443
|
+
'city',
|
|
444
|
+
'special',
|
|
445
|
+
'unincorporated',
|
|
446
|
+
'other',
|
|
447
|
+
])
|
|
448
|
+
.optional())
|
|
449
|
+
.optional(),
|
|
450
|
+
juris_name: z.array(z.string().max(250).optional()).optional(),
|
|
451
|
+
juris_code: z.array(z.string().max(250).optional()).optional(),
|
|
452
|
+
});
|
|
453
|
+
const ImportCreditNoteCreditNoteAllocationsSchema = z.object({
|
|
454
|
+
invoice_id: z.array(z.string().max(50).optional()),
|
|
455
|
+
allocated_amount: z.array(z.number().int().min(1).optional()),
|
|
456
|
+
allocated_at: z.array(z.number().int().optional()),
|
|
457
|
+
});
|
|
458
|
+
const ImportCreditNoteCreditNoteLinkedRefundsSchema = z.object({
|
|
459
|
+
id: z.array(z.string().max(40).optional()).optional(),
|
|
460
|
+
amount: z.array(z.number().int().min(1).optional()),
|
|
461
|
+
payment_method: z.array(z
|
|
462
|
+
.enum([
|
|
463
|
+
'cash',
|
|
464
|
+
'check',
|
|
465
|
+
'bank_transfer',
|
|
466
|
+
'other',
|
|
467
|
+
'app_store',
|
|
468
|
+
'play_store',
|
|
469
|
+
'custom',
|
|
470
|
+
])
|
|
471
|
+
.optional()),
|
|
472
|
+
date: z.array(z.number().int().optional()),
|
|
473
|
+
reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
|
|
474
|
+
});
|
|
475
|
+
const ImportCreditNoteCreditNoteBodySchema = z.looseObject({
|
|
476
|
+
id: z.string().max(50),
|
|
477
|
+
customer_id: z.string().max(50).optional(),
|
|
478
|
+
subscription_id: z.string().max(50).optional(),
|
|
479
|
+
reference_invoice_id: z.string().max(50),
|
|
480
|
+
type: z.enum(['adjustment', 'refundable', 'store']),
|
|
481
|
+
currency_code: z.string().max(3).optional(),
|
|
482
|
+
create_reason_code: z.string().max(100),
|
|
483
|
+
date: z.number().int(),
|
|
484
|
+
status: z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
485
|
+
total: z.number().int().min(0).optional(),
|
|
486
|
+
refunded_at: z.number().int().optional(),
|
|
487
|
+
voided_at: z.number().int().optional(),
|
|
488
|
+
sub_total: z.number().int().min(0).optional(),
|
|
489
|
+
round_off_amount: z.number().int().min(-99).max(99).optional(),
|
|
490
|
+
fractional_correction: z.number().int().min(-50000).max(50000).optional(),
|
|
491
|
+
vat_number_prefix: z.string().max(10).optional(),
|
|
492
|
+
line_items: ImportCreditNoteCreditNoteLineItemsSchema.optional(),
|
|
493
|
+
line_item_tiers: ImportCreditNoteCreditNoteLineItemTiersSchema.optional(),
|
|
494
|
+
discounts: ImportCreditNoteCreditNoteDiscountsSchema.optional(),
|
|
495
|
+
taxes: ImportCreditNoteCreditNoteTaxesSchema.optional(),
|
|
496
|
+
allocations: ImportCreditNoteCreditNoteAllocationsSchema.optional(),
|
|
497
|
+
linked_refunds: ImportCreditNoteCreditNoteLinkedRefundsSchema.optional(),
|
|
498
|
+
});
|
|
499
|
+
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 };
|