chargebee 3.34.0 → 3.36.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 +237 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +230 -2
- package/cjs/resources/webhook/eventType.js +25 -1
- package/cjs/schema/addon.schema.js +221 -40
- package/cjs/schema/alert.schema.js +17 -2
- package/cjs/schema/alert_status.schema.js +6 -1
- package/cjs/schema/attached_item.schema.js +101 -26
- package/cjs/schema/business_entity.schema.js +43 -6
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/collections_payment_promise.schema.js +43 -0
- package/cjs/schema/comment.schema.js +17 -4
- package/cjs/schema/coupon.schema.js +218 -37
- package/cjs/schema/coupon_code.schema.js +36 -6
- package/cjs/schema/coupon_set.schema.js +108 -27
- package/cjs/schema/credit_note.schema.js +497 -105
- package/cjs/schema/credit_unit.schema.js +12 -2
- package/cjs/schema/customer.schema.js +212 -62
- package/cjs/schema/differential_price.schema.js +100 -12
- package/cjs/schema/dispute.schema.js +125 -33
- package/cjs/schema/einvoice.schema.js +27 -6
- package/cjs/schema/email_log.schema.js +15 -4
- package/cjs/schema/entitlement.schema.js +35 -6
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +585 -40
- package/cjs/schema/event.schema.js +1334 -585
- package/cjs/schema/export.schema.js +4459 -1412
- package/cjs/schema/feature.schema.js +73 -11
- package/cjs/schema/gateway_request_log.schema.js +309 -0
- package/cjs/schema/gateway_webhook_log.schema.js +257 -0
- package/cjs/schema/gift.schema.js +51 -5
- package/cjs/schema/grant_block.schema.js +45 -12
- package/cjs/schema/hosted_page.schema.js +564 -68
- package/cjs/schema/index.js +6 -0
- package/cjs/schema/invoice.schema.js +843 -123
- package/cjs/schema/item.schema.js +151 -28
- package/cjs/schema/item_entitlement.schema.js +23 -2
- package/cjs/schema/item_family.schema.js +29 -8
- package/cjs/schema/item_price.schema.js +263 -48
- package/cjs/schema/ledger_account_balance.schema.js +11 -2
- package/cjs/schema/ledger_operation.schema.js +44 -17
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +42 -4
- package/cjs/schema/omnichannel_subscription.schema.js +146 -32
- package/cjs/schema/order.schema.js +233 -61
- package/cjs/schema/organization_detail.schema.js +36 -0
- package/cjs/schema/payment_schedule.schema.js +39 -8
- package/cjs/schema/payment_schedule_scheme.schema.js +37 -7
- package/cjs/schema/payment_source.schema.js +375 -148
- package/cjs/schema/payment_voucher.schema.js +33 -5
- package/cjs/schema/plan.schema.js +345 -57
- package/cjs/schema/price_ramp.schema.js +153 -0
- package/cjs/schema/price_variant.schema.js +88 -18
- package/cjs/schema/pricing_page_session.schema.js +36 -2
- package/cjs/schema/promotional_credit.schema.js +27 -6
- package/cjs/schema/purchase.schema.js +210 -12
- package/cjs/schema/quote.schema.js +907 -87
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +242 -24
- package/cjs/schema/retry_segment.schema.js +12 -0
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +1002 -173
- package/cjs/schema/subscription_entitlement.schema.js +9 -1
- package/cjs/schema/transaction.schema.js +780 -342
- package/cjs/schema/unbilled_charge.schema.js +141 -13
- package/cjs/schema/usage.schema.js +59 -11
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/usage_summary.schema.js +1 -0
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +50 -2
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +230 -2
- package/esm/resources/webhook/eventType.js +25 -1
- package/esm/schema/addon.schema.js +221 -40
- package/esm/schema/alert.schema.js +17 -2
- package/esm/schema/alert_status.schema.js +6 -1
- package/esm/schema/attached_item.schema.js +101 -26
- package/esm/schema/business_entity.schema.js +42 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/collections_payment_promise.schema.js +40 -0
- package/esm/schema/comment.schema.js +17 -4
- package/esm/schema/coupon.schema.js +218 -37
- package/esm/schema/coupon_code.schema.js +36 -6
- package/esm/schema/coupon_set.schema.js +108 -27
- package/esm/schema/credit_note.schema.js +497 -105
- package/esm/schema/credit_unit.schema.js +12 -2
- package/esm/schema/customer.schema.js +212 -62
- package/esm/schema/differential_price.schema.js +100 -12
- package/esm/schema/dispute.schema.js +125 -33
- package/esm/schema/einvoice.schema.js +27 -6
- package/esm/schema/email_log.schema.js +15 -4
- package/esm/schema/entitlement.schema.js +35 -6
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +585 -40
- package/esm/schema/event.schema.js +1334 -585
- package/esm/schema/export.schema.js +4459 -1412
- package/esm/schema/feature.schema.js +73 -11
- package/esm/schema/gateway_request_log.schema.js +306 -0
- package/esm/schema/gateway_webhook_log.schema.js +254 -0
- package/esm/schema/gift.schema.js +51 -5
- package/esm/schema/grant_block.schema.js +45 -12
- package/esm/schema/hosted_page.schema.js +564 -68
- package/esm/schema/index.js +6 -0
- package/esm/schema/invoice.schema.js +842 -122
- package/esm/schema/item.schema.js +151 -28
- package/esm/schema/item_entitlement.schema.js +23 -2
- package/esm/schema/item_family.schema.js +29 -8
- package/esm/schema/item_price.schema.js +263 -48
- package/esm/schema/ledger_account_balance.schema.js +10 -1
- package/esm/schema/ledger_operation.schema.js +44 -17
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +42 -4
- package/esm/schema/omnichannel_subscription.schema.js +146 -32
- package/esm/schema/order.schema.js +233 -61
- package/esm/schema/organization_detail.schema.js +33 -0
- package/esm/schema/payment_schedule.schema.js +39 -8
- package/esm/schema/payment_schedule_scheme.schema.js +37 -7
- package/esm/schema/payment_source.schema.js +375 -148
- package/esm/schema/payment_voucher.schema.js +33 -5
- package/esm/schema/plan.schema.js +345 -57
- package/esm/schema/price_ramp.schema.js +150 -0
- package/esm/schema/price_variant.schema.js +88 -18
- package/esm/schema/pricing_page_session.schema.js +36 -2
- package/esm/schema/promotional_credit.schema.js +27 -6
- package/esm/schema/purchase.schema.js +210 -12
- package/esm/schema/quote.schema.js +907 -87
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +242 -24
- package/esm/schema/retry_segment.schema.js +9 -0
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +1002 -173
- package/esm/schema/subscription_entitlement.schema.js +9 -1
- package/esm/schema/transaction.schema.js +780 -342
- package/esm/schema/unbilled_charge.schema.js +141 -13
- package/esm/schema/usage.schema.js +59 -11
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/usage_summary.schema.js +1 -0
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +50 -2
- package/package.json +1 -1
- package/types/core.d.ts +63 -74
- package/types/index.d.ts +29 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/BusinessEntity.d.ts +52 -0
- package/types/resources/Citation.d.ts +13 -0
- package/types/resources/CollectionsDispute.d.ts +24 -0
- package/types/resources/CollectionsPaymentPromise.d.ts +93 -0
- package/types/resources/CollectionsReminderSequence.d.ts +35 -0
- package/types/resources/Comment.d.ts +2 -1
- package/types/resources/Content.d.ts +23 -1
- package/types/resources/CreditNote.d.ts +1 -0
- package/types/resources/CustomData.d.ts +14 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftEstimate.d.ts +13 -0
- package/types/resources/DraftRequest.d.ts +45 -0
- package/types/resources/EmailAttachment.d.ts +16 -0
- package/types/resources/EmailConversation.d.ts +18 -0
- package/types/resources/EmailLog.d.ts +1 -0
- package/types/resources/EmailMessage.d.ts +40 -0
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +25 -1
- package/types/resources/Execution.d.ts +12 -0
- package/types/resources/GatewayPaymentMethodToken.d.ts +2 -2
- package/types/resources/GatewayRequestLog.d.ts +82 -0
- package/types/resources/GatewayWebhookLog.d.ts +74 -0
- package/types/resources/GrantBlock.d.ts +5 -0
- package/types/resources/GroupByAttribute.d.ts +15 -0
- package/types/resources/GroupByRecommendation.d.ts +10 -0
- package/types/resources/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +19 -0
- package/types/resources/ItemPrice.d.ts +1 -0
- package/types/resources/LedgerAccountBalance.d.ts +19 -0
- package/types/resources/Meter.d.ts +1 -0
- package/types/resources/MeteredFeature.d.ts +1 -0
- package/types/resources/OmnichannelOneTimeOrder.d.ts +5 -1
- package/types/resources/OmnichannelSubscription.d.ts +6 -1
- package/types/resources/OmnichannelSubscriptionItem.d.ts +4 -1
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/PaymentSchedule.d.ts +1 -1
- package/types/resources/PaymentScheduleEstimate.d.ts +1 -1
- package/types/resources/PaymentSource.d.ts +19 -0
- package/types/resources/PreferenceVariant.d.ts +10 -0
- package/types/resources/PriceRamp.d.ts +113 -0
- package/types/resources/PrivateNote.d.ts +18 -0
- package/types/resources/Purchase.d.ts +6 -0
- package/types/resources/Ramp.d.ts +6 -0
- package/types/resources/RampInterval.d.ts +12 -0
- package/types/resources/RecordedPurchase.d.ts +5 -1
- package/types/resources/RetrySegment.d.ts +36 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Transaction.d.ts +4 -0
- package/types/resources/Usage.d.ts +7 -0
- package/types/resources/UsageSummary.d.ts +2 -0
- package/types/resources/WebhookEvent.d.ts +159 -5
- package/types/resources/AppliedBusinessRule.d.ts +0 -15
|
@@ -6,6 +6,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ImportCreditNoteCreditNoteBodySchema = exports.RemoveTaxWithheldRefundCreditNoteBodySchema = exports.UpdateCreditNoteBodySchema = exports.DeleteCreditNoteBodySchema = exports.CreditNotesForCustomerCreditNoteBodySchema = exports.ListCreditNoteBodySchema = exports.VoidCreditNoteCreditNoteBodySchema = exports.RecordRefundCreditNoteBodySchema = exports.RefundCreditNoteBodySchema = exports.PdfCreditNoteBodySchema = exports.RetrieveCreditNoteBodySchema = exports.CreateCreditNoteBodySchema = void 0;
|
|
7
7
|
const zod_1 = require("zod");
|
|
8
8
|
//CreditNote.create
|
|
9
|
+
const CreateCreditNoteLineItemsItemSchema = zod_1.z.object({
|
|
10
|
+
reference_line_item_id: zod_1.z.string().max(40).optional(),
|
|
11
|
+
unit_amount: zod_1.z.number().int().optional(),
|
|
12
|
+
unit_amount_in_decimal: zod_1.z.string().max(39).optional(),
|
|
13
|
+
quantity: zod_1.z.number().int().optional(),
|
|
14
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
15
|
+
amount: zod_1.z.number().int().optional(),
|
|
16
|
+
date_from: zod_1.z.number().int().optional(),
|
|
17
|
+
date_to: zod_1.z.number().int().optional(),
|
|
18
|
+
description: zod_1.z.string().max(250).optional(),
|
|
19
|
+
entity_type: zod_1.z
|
|
20
|
+
.enum([
|
|
21
|
+
'adhoc',
|
|
22
|
+
'plan_item_price',
|
|
23
|
+
'addon_item_price',
|
|
24
|
+
'charge_item_price',
|
|
25
|
+
'plan',
|
|
26
|
+
'addon',
|
|
27
|
+
])
|
|
28
|
+
.optional(),
|
|
29
|
+
entity_id: zod_1.z.string().max(100).optional(),
|
|
30
|
+
});
|
|
9
31
|
const CreateCreditNoteLineItemsSchema = zod_1.z.object({
|
|
10
32
|
reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
11
33
|
unit_amount: zod_1.z.array(zod_1.z.number().int().optional()).optional(),
|
|
@@ -50,7 +72,12 @@ const CreateCreditNoteBodySchema = zod_1.z.looseObject({
|
|
|
50
72
|
customer_notes: zod_1.z.string().max(2000).optional(),
|
|
51
73
|
currency_code: zod_1.z.string().max(3).optional(),
|
|
52
74
|
comment: zod_1.z.string().max(300).optional(),
|
|
53
|
-
line_items:
|
|
75
|
+
line_items: zod_1.z
|
|
76
|
+
.union([
|
|
77
|
+
zod_1.z.array(CreateCreditNoteLineItemsItemSchema.optional()),
|
|
78
|
+
CreateCreditNoteLineItemsSchema,
|
|
79
|
+
])
|
|
80
|
+
.optional(),
|
|
54
81
|
});
|
|
55
82
|
exports.CreateCreditNoteBodySchema = CreateCreditNoteBodySchema;
|
|
56
83
|
//CreditNote.retrieve
|
|
@@ -95,12 +122,6 @@ const RecordRefundCreditNoteTransactionSchema = zod_1.z.object({
|
|
|
95
122
|
'app_store',
|
|
96
123
|
'play_store',
|
|
97
124
|
'custom',
|
|
98
|
-
'tamara',
|
|
99
|
-
'qpay',
|
|
100
|
-
'blik',
|
|
101
|
-
'fpx',
|
|
102
|
-
'wero',
|
|
103
|
-
'p24',
|
|
104
125
|
]),
|
|
105
126
|
reference_number: zod_1.z.string().max(100).optional(),
|
|
106
127
|
custom_payment_method_id: zod_1.z.string().max(50).optional(),
|
|
@@ -122,37 +143,87 @@ const ListCreditNoteIdSchema = zod_1.z.object({
|
|
|
122
143
|
is: zod_1.z.string().min(1).optional(),
|
|
123
144
|
is_not: zod_1.z.string().min(1).optional(),
|
|
124
145
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
125
|
-
in: zod_1.z
|
|
126
|
-
|
|
146
|
+
in: zod_1.z
|
|
147
|
+
.union([
|
|
148
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
149
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
150
|
+
])
|
|
151
|
+
.optional(),
|
|
152
|
+
not_in: zod_1.z
|
|
153
|
+
.union([
|
|
154
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
155
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
156
|
+
])
|
|
157
|
+
.optional(),
|
|
127
158
|
});
|
|
128
159
|
const ListCreditNoteCustomerIdSchema = zod_1.z.object({
|
|
129
160
|
is: zod_1.z.string().min(1).optional(),
|
|
130
161
|
is_not: zod_1.z.string().min(1).optional(),
|
|
131
162
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
132
|
-
in: zod_1.z
|
|
133
|
-
|
|
163
|
+
in: zod_1.z
|
|
164
|
+
.union([
|
|
165
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
166
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
167
|
+
])
|
|
168
|
+
.optional(),
|
|
169
|
+
not_in: zod_1.z
|
|
170
|
+
.union([
|
|
171
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
172
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
173
|
+
])
|
|
174
|
+
.optional(),
|
|
134
175
|
});
|
|
135
176
|
const ListCreditNoteSubscriptionIdSchema = zod_1.z.object({
|
|
136
177
|
is: zod_1.z.string().min(1).optional(),
|
|
137
178
|
is_not: zod_1.z.string().min(1).optional(),
|
|
138
179
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
139
|
-
is_present: zod_1.z.enum(['true', 'false']).optional(),
|
|
140
|
-
in: zod_1.z
|
|
141
|
-
|
|
180
|
+
is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
181
|
+
in: zod_1.z
|
|
182
|
+
.union([
|
|
183
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
184
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
185
|
+
])
|
|
186
|
+
.optional(),
|
|
187
|
+
not_in: zod_1.z
|
|
188
|
+
.union([
|
|
189
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
190
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
191
|
+
])
|
|
192
|
+
.optional(),
|
|
142
193
|
});
|
|
143
194
|
const ListCreditNoteReferenceInvoiceIdSchema = zod_1.z.object({
|
|
144
195
|
is: zod_1.z.string().min(1).optional(),
|
|
145
196
|
is_not: zod_1.z.string().min(1).optional(),
|
|
146
197
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
147
|
-
is_present: zod_1.z.enum(['true', 'false']).optional(),
|
|
148
|
-
in: zod_1.z
|
|
149
|
-
|
|
198
|
+
is_present: zod_1.z.union([zod_1.z.boolean(), zod_1.z.enum(['true', 'false'])]).optional(),
|
|
199
|
+
in: zod_1.z
|
|
200
|
+
.union([
|
|
201
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
202
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
203
|
+
])
|
|
204
|
+
.optional(),
|
|
205
|
+
not_in: zod_1.z
|
|
206
|
+
.union([
|
|
207
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
208
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
209
|
+
])
|
|
210
|
+
.optional(),
|
|
150
211
|
});
|
|
151
212
|
const ListCreditNoteTypeSchema = zod_1.z.object({
|
|
152
213
|
is: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
153
214
|
is_not: zod_1.z.enum(['adjustment', 'refundable', 'store']).optional(),
|
|
154
|
-
in: zod_1.z
|
|
155
|
-
|
|
215
|
+
in: zod_1.z
|
|
216
|
+
.union([
|
|
217
|
+
zod_1.z.array(zod_1.z.enum(['adjustment', 'refundable', 'store']).optional()),
|
|
218
|
+
zod_1.z.enum(['adjustment', 'refundable', 'store']),
|
|
219
|
+
])
|
|
220
|
+
.optional(),
|
|
221
|
+
not_in: zod_1.z
|
|
222
|
+
.union([
|
|
223
|
+
zod_1.z.array(zod_1.z.enum(['adjustment', 'refundable', 'store']).optional()),
|
|
224
|
+
zod_1.z.enum(['adjustment', 'refundable', 'store']),
|
|
225
|
+
])
|
|
226
|
+
.optional(),
|
|
156
227
|
});
|
|
157
228
|
const ListCreditNoteReasonCodeSchema = zod_1.z.object({
|
|
158
229
|
is: zod_1.z
|
|
@@ -188,35 +259,71 @@ const ListCreditNoteReasonCodeSchema = zod_1.z.object({
|
|
|
188
259
|
])
|
|
189
260
|
.optional(),
|
|
190
261
|
in: zod_1.z
|
|
191
|
-
.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
262
|
+
.union([
|
|
263
|
+
zod_1.z.array(zod_1.z
|
|
264
|
+
.enum([
|
|
265
|
+
'write_off',
|
|
266
|
+
'subscription_change',
|
|
267
|
+
'subscription_cancellation',
|
|
268
|
+
'subscription_pause',
|
|
269
|
+
'chargeback',
|
|
270
|
+
'product_unsatisfactory',
|
|
271
|
+
'service_unsatisfactory',
|
|
272
|
+
'order_change',
|
|
273
|
+
'order_cancellation',
|
|
274
|
+
'waiver',
|
|
275
|
+
'other',
|
|
276
|
+
'fraudulent',
|
|
277
|
+
])
|
|
278
|
+
.optional()),
|
|
279
|
+
zod_1.z.enum([
|
|
280
|
+
'write_off',
|
|
281
|
+
'subscription_change',
|
|
282
|
+
'subscription_cancellation',
|
|
283
|
+
'subscription_pause',
|
|
284
|
+
'chargeback',
|
|
285
|
+
'product_unsatisfactory',
|
|
286
|
+
'service_unsatisfactory',
|
|
287
|
+
'order_change',
|
|
288
|
+
'order_cancellation',
|
|
289
|
+
'waiver',
|
|
290
|
+
'other',
|
|
291
|
+
'fraudulent',
|
|
292
|
+
]),
|
|
204
293
|
])
|
|
205
294
|
.optional(),
|
|
206
295
|
not_in: zod_1.z
|
|
207
|
-
.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
296
|
+
.union([
|
|
297
|
+
zod_1.z.array(zod_1.z
|
|
298
|
+
.enum([
|
|
299
|
+
'write_off',
|
|
300
|
+
'subscription_change',
|
|
301
|
+
'subscription_cancellation',
|
|
302
|
+
'subscription_pause',
|
|
303
|
+
'chargeback',
|
|
304
|
+
'product_unsatisfactory',
|
|
305
|
+
'service_unsatisfactory',
|
|
306
|
+
'order_change',
|
|
307
|
+
'order_cancellation',
|
|
308
|
+
'waiver',
|
|
309
|
+
'other',
|
|
310
|
+
'fraudulent',
|
|
311
|
+
])
|
|
312
|
+
.optional()),
|
|
313
|
+
zod_1.z.enum([
|
|
314
|
+
'write_off',
|
|
315
|
+
'subscription_change',
|
|
316
|
+
'subscription_cancellation',
|
|
317
|
+
'subscription_pause',
|
|
318
|
+
'chargeback',
|
|
319
|
+
'product_unsatisfactory',
|
|
320
|
+
'service_unsatisfactory',
|
|
321
|
+
'order_change',
|
|
322
|
+
'order_cancellation',
|
|
323
|
+
'waiver',
|
|
324
|
+
'other',
|
|
325
|
+
'fraudulent',
|
|
326
|
+
]),
|
|
220
327
|
])
|
|
221
328
|
.optional(),
|
|
222
329
|
});
|
|
@@ -224,74 +331,205 @@ const ListCreditNoteCreateReasonCodeSchema = zod_1.z.object({
|
|
|
224
331
|
is: zod_1.z.string().min(1).optional(),
|
|
225
332
|
is_not: zod_1.z.string().min(1).optional(),
|
|
226
333
|
starts_with: zod_1.z.string().min(1).optional(),
|
|
227
|
-
in: zod_1.z
|
|
228
|
-
|
|
334
|
+
in: zod_1.z
|
|
335
|
+
.union([
|
|
336
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
337
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
338
|
+
])
|
|
339
|
+
.optional(),
|
|
340
|
+
not_in: zod_1.z
|
|
341
|
+
.union([
|
|
342
|
+
zod_1.z.array(zod_1.z.string().optional()),
|
|
343
|
+
zod_1.z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
344
|
+
])
|
|
345
|
+
.optional(),
|
|
229
346
|
});
|
|
230
347
|
const ListCreditNoteStatusSchema = zod_1.z.object({
|
|
231
348
|
is: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
232
349
|
is_not: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
233
|
-
in: zod_1.z
|
|
234
|
-
|
|
350
|
+
in: zod_1.z
|
|
351
|
+
.union([
|
|
352
|
+
zod_1.z.array(zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional()),
|
|
353
|
+
zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']),
|
|
354
|
+
])
|
|
355
|
+
.optional(),
|
|
356
|
+
not_in: zod_1.z
|
|
357
|
+
.union([
|
|
358
|
+
zod_1.z.array(zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional()),
|
|
359
|
+
zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']),
|
|
360
|
+
])
|
|
361
|
+
.optional(),
|
|
235
362
|
});
|
|
236
363
|
const ListCreditNoteDateSchema = zod_1.z.object({
|
|
237
|
-
after: zod_1.z
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
364
|
+
after: zod_1.z
|
|
365
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
366
|
+
.optional(),
|
|
367
|
+
before: zod_1.z
|
|
368
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
369
|
+
.optional(),
|
|
370
|
+
on: zod_1.z
|
|
371
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
372
|
+
.optional(),
|
|
373
|
+
between: zod_1.z
|
|
374
|
+
.union([
|
|
375
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
376
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
377
|
+
])
|
|
378
|
+
.optional(),
|
|
241
379
|
});
|
|
242
380
|
const ListCreditNoteTotalSchema = zod_1.z.object({
|
|
243
|
-
is: zod_1.z
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
381
|
+
is: zod_1.z
|
|
382
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
383
|
+
.optional(),
|
|
384
|
+
is_not: zod_1.z
|
|
385
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
386
|
+
.optional(),
|
|
387
|
+
lt: zod_1.z
|
|
388
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
389
|
+
.optional(),
|
|
390
|
+
lte: zod_1.z
|
|
391
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
392
|
+
.optional(),
|
|
393
|
+
gt: zod_1.z
|
|
394
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
395
|
+
.optional(),
|
|
396
|
+
gte: zod_1.z
|
|
397
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
398
|
+
.optional(),
|
|
399
|
+
between: zod_1.z
|
|
400
|
+
.union([
|
|
401
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
402
|
+
zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
403
|
+
])
|
|
404
|
+
.optional(),
|
|
250
405
|
});
|
|
251
406
|
const ListCreditNotePriceTypeSchema = zod_1.z.object({
|
|
252
407
|
is: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
253
408
|
is_not: zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
254
|
-
in: zod_1.z
|
|
255
|
-
|
|
409
|
+
in: zod_1.z
|
|
410
|
+
.union([
|
|
411
|
+
zod_1.z.array(zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
|
|
412
|
+
zod_1.z.enum(['tax_exclusive', 'tax_inclusive']),
|
|
413
|
+
])
|
|
414
|
+
.optional(),
|
|
415
|
+
not_in: zod_1.z
|
|
416
|
+
.union([
|
|
417
|
+
zod_1.z.array(zod_1.z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
|
|
418
|
+
zod_1.z.enum(['tax_exclusive', 'tax_inclusive']),
|
|
419
|
+
])
|
|
420
|
+
.optional(),
|
|
256
421
|
});
|
|
257
422
|
const ListCreditNoteAmountAllocatedSchema = zod_1.z.object({
|
|
258
|
-
is: zod_1.z
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
423
|
+
is: zod_1.z
|
|
424
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
425
|
+
.optional(),
|
|
426
|
+
is_not: zod_1.z
|
|
427
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
428
|
+
.optional(),
|
|
429
|
+
lt: zod_1.z
|
|
430
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
431
|
+
.optional(),
|
|
432
|
+
lte: zod_1.z
|
|
433
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
434
|
+
.optional(),
|
|
435
|
+
gt: zod_1.z
|
|
436
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
437
|
+
.optional(),
|
|
438
|
+
gte: zod_1.z
|
|
439
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
440
|
+
.optional(),
|
|
441
|
+
between: zod_1.z
|
|
442
|
+
.union([
|
|
443
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
444
|
+
zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
445
|
+
])
|
|
446
|
+
.optional(),
|
|
265
447
|
});
|
|
266
448
|
const ListCreditNoteAmountRefundedSchema = zod_1.z.object({
|
|
267
|
-
is: zod_1.z
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
449
|
+
is: zod_1.z
|
|
450
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
451
|
+
.optional(),
|
|
452
|
+
is_not: zod_1.z
|
|
453
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
454
|
+
.optional(),
|
|
455
|
+
lt: zod_1.z
|
|
456
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
457
|
+
.optional(),
|
|
458
|
+
lte: zod_1.z
|
|
459
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
460
|
+
.optional(),
|
|
461
|
+
gt: zod_1.z
|
|
462
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
463
|
+
.optional(),
|
|
464
|
+
gte: zod_1.z
|
|
465
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
466
|
+
.optional(),
|
|
467
|
+
between: zod_1.z
|
|
468
|
+
.union([
|
|
469
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
470
|
+
zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
471
|
+
])
|
|
472
|
+
.optional(),
|
|
274
473
|
});
|
|
275
474
|
const ListCreditNoteAmountAvailableSchema = zod_1.z.object({
|
|
276
|
-
is: zod_1.z
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
475
|
+
is: zod_1.z
|
|
476
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
477
|
+
.optional(),
|
|
478
|
+
is_not: zod_1.z
|
|
479
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
480
|
+
.optional(),
|
|
481
|
+
lt: zod_1.z
|
|
482
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
483
|
+
.optional(),
|
|
484
|
+
lte: zod_1.z
|
|
485
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
486
|
+
.optional(),
|
|
487
|
+
gt: zod_1.z
|
|
488
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
489
|
+
.optional(),
|
|
490
|
+
gte: zod_1.z
|
|
491
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^-?\\d+$'))])
|
|
492
|
+
.optional(),
|
|
493
|
+
between: zod_1.z
|
|
494
|
+
.union([
|
|
495
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
496
|
+
zod_1.z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
497
|
+
])
|
|
498
|
+
.optional(),
|
|
283
499
|
});
|
|
284
500
|
const ListCreditNoteVoidedAtSchema = zod_1.z.object({
|
|
285
|
-
after: zod_1.z
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
501
|
+
after: zod_1.z
|
|
502
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
503
|
+
.optional(),
|
|
504
|
+
before: zod_1.z
|
|
505
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
506
|
+
.optional(),
|
|
507
|
+
on: zod_1.z
|
|
508
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
509
|
+
.optional(),
|
|
510
|
+
between: zod_1.z
|
|
511
|
+
.union([
|
|
512
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
513
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
514
|
+
])
|
|
515
|
+
.optional(),
|
|
289
516
|
});
|
|
290
517
|
const ListCreditNoteUpdatedAtSchema = zod_1.z.object({
|
|
291
|
-
after: zod_1.z
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
518
|
+
after: zod_1.z
|
|
519
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
520
|
+
.optional(),
|
|
521
|
+
before: zod_1.z
|
|
522
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
523
|
+
.optional(),
|
|
524
|
+
on: zod_1.z
|
|
525
|
+
.union([zod_1.z.number().int(), zod_1.z.string().regex(RegExp('^\\d{10}$'))])
|
|
526
|
+
.optional(),
|
|
527
|
+
between: zod_1.z
|
|
528
|
+
.union([
|
|
529
|
+
zod_1.z.array(zod_1.z.number().int().optional()).min(2).max(2),
|
|
530
|
+
zod_1.z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
531
|
+
])
|
|
532
|
+
.optional(),
|
|
295
533
|
});
|
|
296
534
|
const ListCreditNoteSortBySchema = zod_1.z.looseObject({
|
|
297
535
|
asc: zod_1.z.enum(['date']).optional(),
|
|
@@ -300,8 +538,18 @@ const ListCreditNoteSortBySchema = zod_1.z.looseObject({
|
|
|
300
538
|
const ListCreditNoteChannelSchema = zod_1.z.object({
|
|
301
539
|
is: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
302
540
|
is_not: zod_1.z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
303
|
-
in: zod_1.z
|
|
304
|
-
|
|
541
|
+
in: zod_1.z
|
|
542
|
+
.union([
|
|
543
|
+
zod_1.z.array(zod_1.z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
544
|
+
zod_1.z.enum(['web', 'app_store', 'play_store']),
|
|
545
|
+
])
|
|
546
|
+
.optional(),
|
|
547
|
+
not_in: zod_1.z
|
|
548
|
+
.union([
|
|
549
|
+
zod_1.z.array(zod_1.z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
550
|
+
zod_1.z.enum(['web', 'app_store', 'play_store']),
|
|
551
|
+
])
|
|
552
|
+
.optional(),
|
|
305
553
|
});
|
|
306
554
|
const ListCreditNoteEinvoiceSchema = zod_1.z.object({
|
|
307
555
|
status: ListCreditNoteStatusSchema.optional(),
|
|
@@ -356,6 +604,61 @@ const RemoveTaxWithheldRefundCreditNoteBodySchema = zod_1.z.looseObject({
|
|
|
356
604
|
});
|
|
357
605
|
exports.RemoveTaxWithheldRefundCreditNoteBodySchema = RemoveTaxWithheldRefundCreditNoteBodySchema;
|
|
358
606
|
//CreditNote.importCreditNote
|
|
607
|
+
const ImportCreditNoteCreditNoteLineItemsItemSchema = zod_1.z.object({
|
|
608
|
+
reference_line_item_id: zod_1.z.string().max(40).optional(),
|
|
609
|
+
id: zod_1.z.string().max(40).optional(),
|
|
610
|
+
date_from: zod_1.z.number().int().optional(),
|
|
611
|
+
date_to: zod_1.z.number().int().optional(),
|
|
612
|
+
subscription_id: zod_1.z.string().max(50).optional(),
|
|
613
|
+
description: zod_1.z.string().max(250),
|
|
614
|
+
unit_amount: zod_1.z.number().int().optional(),
|
|
615
|
+
quantity: zod_1.z.number().int().optional(),
|
|
616
|
+
amount: zod_1.z.number().int().optional(),
|
|
617
|
+
unit_amount_in_decimal: zod_1.z.string().max(39).optional(),
|
|
618
|
+
quantity_in_decimal: zod_1.z.string().max(33).optional(),
|
|
619
|
+
amount_in_decimal: zod_1.z.string().max(39).optional(),
|
|
620
|
+
entity_type: zod_1.z
|
|
621
|
+
.enum([
|
|
622
|
+
'adhoc',
|
|
623
|
+
'plan_item_price',
|
|
624
|
+
'addon_item_price',
|
|
625
|
+
'charge_item_price',
|
|
626
|
+
'plan_setup',
|
|
627
|
+
'plan',
|
|
628
|
+
'addon',
|
|
629
|
+
])
|
|
630
|
+
.optional(),
|
|
631
|
+
entity_id: zod_1.z.string().max(100).optional(),
|
|
632
|
+
item_level_discount1_entity_id: zod_1.z.string().max(100).optional(),
|
|
633
|
+
item_level_discount1_amount: zod_1.z.number().int().min(0).optional(),
|
|
634
|
+
item_level_discount2_entity_id: zod_1.z.string().max(100).optional(),
|
|
635
|
+
item_level_discount2_amount: zod_1.z.number().int().min(0).optional(),
|
|
636
|
+
tax1_name: zod_1.z.string().max(50).optional(),
|
|
637
|
+
tax1_amount: zod_1.z.number().int().min(0).optional(),
|
|
638
|
+
tax2_name: zod_1.z.string().max(50).optional(),
|
|
639
|
+
tax2_amount: zod_1.z.number().int().min(0).optional(),
|
|
640
|
+
tax3_name: zod_1.z.string().max(50).optional(),
|
|
641
|
+
tax3_amount: zod_1.z.number().int().min(0).optional(),
|
|
642
|
+
tax4_name: zod_1.z.string().max(50).optional(),
|
|
643
|
+
tax4_amount: zod_1.z.number().int().min(0).optional(),
|
|
644
|
+
tax5_name: zod_1.z.string().max(50).optional(),
|
|
645
|
+
tax5_amount: zod_1.z.number().int().min(0).optional(),
|
|
646
|
+
tax6_name: zod_1.z.string().max(50).optional(),
|
|
647
|
+
tax6_amount: zod_1.z.number().int().min(0).optional(),
|
|
648
|
+
tax7_name: zod_1.z.string().max(50).optional(),
|
|
649
|
+
tax7_amount: zod_1.z.number().int().min(0).optional(),
|
|
650
|
+
tax8_name: zod_1.z.string().max(50).optional(),
|
|
651
|
+
tax8_amount: zod_1.z.number().int().min(0).optional(),
|
|
652
|
+
tax9_name: zod_1.z.string().max(50).optional(),
|
|
653
|
+
tax9_amount: zod_1.z.number().int().min(0).optional(),
|
|
654
|
+
tax10_name: zod_1.z.string().max(50).optional(),
|
|
655
|
+
tax10_amount: zod_1.z.number().int().min(0).optional(),
|
|
656
|
+
is_partial_tax_applied: zod_1.z.boolean().optional(),
|
|
657
|
+
taxable_amount: zod_1.z.number().int().min(0).optional(),
|
|
658
|
+
proration_mode: zod_1.z
|
|
659
|
+
.enum(['reset', 'delta', 'service_period_revision', 'adjusted_term'])
|
|
660
|
+
.optional(),
|
|
661
|
+
});
|
|
359
662
|
const ImportCreditNoteCreditNoteLineItemsSchema = zod_1.z.object({
|
|
360
663
|
reference_line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
361
664
|
id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
@@ -423,6 +726,17 @@ const ImportCreditNoteCreditNoteLineItemsSchema = zod_1.z.object({
|
|
|
423
726
|
.optional())
|
|
424
727
|
.optional(),
|
|
425
728
|
});
|
|
729
|
+
const ImportCreditNoteCreditNoteLineItemTiersItemSchema = zod_1.z.object({
|
|
730
|
+
line_item_id: zod_1.z.string().max(40),
|
|
731
|
+
starting_unit: zod_1.z.number().int().min(0).optional(),
|
|
732
|
+
ending_unit: zod_1.z.number().int().optional(),
|
|
733
|
+
quantity_used: zod_1.z.number().int().min(0).optional(),
|
|
734
|
+
unit_amount: zod_1.z.number().int().min(0).optional(),
|
|
735
|
+
starting_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
736
|
+
ending_unit_in_decimal: zod_1.z.string().max(33).optional(),
|
|
737
|
+
quantity_used_in_decimal: zod_1.z.string().max(33).optional(),
|
|
738
|
+
unit_amount_in_decimal: zod_1.z.string().max(40).optional(),
|
|
739
|
+
});
|
|
426
740
|
const ImportCreditNoteCreditNoteLineItemTiersSchema = zod_1.z.object({
|
|
427
741
|
line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()),
|
|
428
742
|
starting_unit: zod_1.z.array(zod_1.z.number().int().min(0).optional()).optional(),
|
|
@@ -434,6 +748,19 @@ const ImportCreditNoteCreditNoteLineItemTiersSchema = zod_1.z.object({
|
|
|
434
748
|
quantity_used_in_decimal: zod_1.z.array(zod_1.z.string().max(33).optional()).optional(),
|
|
435
749
|
unit_amount_in_decimal: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
436
750
|
});
|
|
751
|
+
const ImportCreditNoteCreditNoteDiscountsItemSchema = zod_1.z.object({
|
|
752
|
+
line_item_id: zod_1.z.string().max(40).optional(),
|
|
753
|
+
entity_type: zod_1.z.enum([
|
|
754
|
+
'item_level_coupon',
|
|
755
|
+
'document_level_coupon',
|
|
756
|
+
'promotional_credits',
|
|
757
|
+
'item_level_discount',
|
|
758
|
+
'document_level_discount',
|
|
759
|
+
]),
|
|
760
|
+
entity_id: zod_1.z.string().max(100).optional(),
|
|
761
|
+
description: zod_1.z.string().max(250).optional(),
|
|
762
|
+
amount: zod_1.z.number().int().min(0),
|
|
763
|
+
});
|
|
437
764
|
const ImportCreditNoteCreditNoteDiscountsSchema = zod_1.z.object({
|
|
438
765
|
line_item_id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
439
766
|
entity_type: zod_1.z.array(zod_1.z
|
|
@@ -449,6 +776,26 @@ const ImportCreditNoteCreditNoteDiscountsSchema = zod_1.z.object({
|
|
|
449
776
|
description: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
|
|
450
777
|
amount: zod_1.z.array(zod_1.z.number().int().min(0).optional()),
|
|
451
778
|
});
|
|
779
|
+
const ImportCreditNoteCreditNoteTaxesItemSchema = zod_1.z.object({
|
|
780
|
+
name: zod_1.z.string().max(100),
|
|
781
|
+
rate: zod_1.z.number().min(0).max(100),
|
|
782
|
+
amount: zod_1.z.number().int().min(0).optional(),
|
|
783
|
+
description: zod_1.z.string().max(50).optional(),
|
|
784
|
+
juris_type: zod_1.z
|
|
785
|
+
.enum([
|
|
786
|
+
'country',
|
|
787
|
+
'federal',
|
|
788
|
+
'state',
|
|
789
|
+
'county',
|
|
790
|
+
'city',
|
|
791
|
+
'special',
|
|
792
|
+
'unincorporated',
|
|
793
|
+
'other',
|
|
794
|
+
])
|
|
795
|
+
.optional(),
|
|
796
|
+
juris_name: zod_1.z.string().max(250).optional(),
|
|
797
|
+
juris_code: zod_1.z.string().max(250).optional(),
|
|
798
|
+
});
|
|
452
799
|
const ImportCreditNoteCreditNoteTaxesSchema = zod_1.z.object({
|
|
453
800
|
name: zod_1.z.array(zod_1.z.string().max(100).optional()),
|
|
454
801
|
rate: zod_1.z.array(zod_1.z.number().min(0).max(100).optional()),
|
|
@@ -471,11 +818,31 @@ const ImportCreditNoteCreditNoteTaxesSchema = zod_1.z.object({
|
|
|
471
818
|
juris_name: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
|
|
472
819
|
juris_code: zod_1.z.array(zod_1.z.string().max(250).optional()).optional(),
|
|
473
820
|
});
|
|
821
|
+
const ImportCreditNoteCreditNoteAllocationsItemSchema = zod_1.z.object({
|
|
822
|
+
invoice_id: zod_1.z.string().max(50),
|
|
823
|
+
allocated_amount: zod_1.z.number().int().min(1),
|
|
824
|
+
allocated_at: zod_1.z.number().int(),
|
|
825
|
+
});
|
|
474
826
|
const ImportCreditNoteCreditNoteAllocationsSchema = zod_1.z.object({
|
|
475
827
|
invoice_id: zod_1.z.array(zod_1.z.string().max(50).optional()),
|
|
476
828
|
allocated_amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()),
|
|
477
829
|
allocated_at: zod_1.z.array(zod_1.z.number().int().optional()),
|
|
478
830
|
});
|
|
831
|
+
const ImportCreditNoteCreditNoteLinkedRefundsItemSchema = zod_1.z.object({
|
|
832
|
+
id: zod_1.z.string().max(40).optional(),
|
|
833
|
+
amount: zod_1.z.number().int().min(1),
|
|
834
|
+
payment_method: zod_1.z.enum([
|
|
835
|
+
'cash',
|
|
836
|
+
'check',
|
|
837
|
+
'bank_transfer',
|
|
838
|
+
'other',
|
|
839
|
+
'app_store',
|
|
840
|
+
'play_store',
|
|
841
|
+
'custom',
|
|
842
|
+
]),
|
|
843
|
+
date: zod_1.z.number().int(),
|
|
844
|
+
reference_number: zod_1.z.string().max(100).min(1).optional(),
|
|
845
|
+
});
|
|
479
846
|
const ImportCreditNoteCreditNoteLinkedRefundsSchema = zod_1.z.object({
|
|
480
847
|
id: zod_1.z.array(zod_1.z.string().max(40).optional()).optional(),
|
|
481
848
|
amount: zod_1.z.array(zod_1.z.number().int().min(1).optional()),
|
|
@@ -488,12 +855,6 @@ const ImportCreditNoteCreditNoteLinkedRefundsSchema = zod_1.z.object({
|
|
|
488
855
|
'app_store',
|
|
489
856
|
'play_store',
|
|
490
857
|
'custom',
|
|
491
|
-
'tamara',
|
|
492
|
-
'qpay',
|
|
493
|
-
'blik',
|
|
494
|
-
'fpx',
|
|
495
|
-
'wero',
|
|
496
|
-
'p24',
|
|
497
858
|
])
|
|
498
859
|
.optional()),
|
|
499
860
|
date: zod_1.z.array(zod_1.z.number().int().optional()),
|
|
@@ -508,6 +869,7 @@ const ImportCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({
|
|
|
508
869
|
currency_code: zod_1.z.string().max(3).optional(),
|
|
509
870
|
create_reason_code: zod_1.z.string().max(100),
|
|
510
871
|
date: zod_1.z.number().int(),
|
|
872
|
+
customer_notes: zod_1.z.string().max(2000).optional(),
|
|
511
873
|
status: zod_1.z.enum(['adjusted', 'refunded', 'refund_due', 'voided']).optional(),
|
|
512
874
|
total: zod_1.z.number().int().min(0).optional(),
|
|
513
875
|
refunded_at: zod_1.z.number().int().optional(),
|
|
@@ -516,11 +878,41 @@ const ImportCreditNoteCreditNoteBodySchema = zod_1.z.looseObject({
|
|
|
516
878
|
round_off_amount: zod_1.z.number().int().min(-99).max(99).optional(),
|
|
517
879
|
fractional_correction: zod_1.z.number().int().min(-50000).max(50000).optional(),
|
|
518
880
|
vat_number_prefix: zod_1.z.string().max(10).optional(),
|
|
519
|
-
line_items:
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
881
|
+
line_items: zod_1.z
|
|
882
|
+
.union([
|
|
883
|
+
zod_1.z.array(ImportCreditNoteCreditNoteLineItemsItemSchema.optional()),
|
|
884
|
+
ImportCreditNoteCreditNoteLineItemsSchema,
|
|
885
|
+
])
|
|
886
|
+
.optional(),
|
|
887
|
+
line_item_tiers: zod_1.z
|
|
888
|
+
.union([
|
|
889
|
+
zod_1.z.array(ImportCreditNoteCreditNoteLineItemTiersItemSchema.optional()),
|
|
890
|
+
ImportCreditNoteCreditNoteLineItemTiersSchema,
|
|
891
|
+
])
|
|
892
|
+
.optional(),
|
|
893
|
+
discounts: zod_1.z
|
|
894
|
+
.union([
|
|
895
|
+
zod_1.z.array(ImportCreditNoteCreditNoteDiscountsItemSchema.optional()),
|
|
896
|
+
ImportCreditNoteCreditNoteDiscountsSchema,
|
|
897
|
+
])
|
|
898
|
+
.optional(),
|
|
899
|
+
taxes: zod_1.z
|
|
900
|
+
.union([
|
|
901
|
+
zod_1.z.array(ImportCreditNoteCreditNoteTaxesItemSchema.optional()),
|
|
902
|
+
ImportCreditNoteCreditNoteTaxesSchema,
|
|
903
|
+
])
|
|
904
|
+
.optional(),
|
|
905
|
+
allocations: zod_1.z
|
|
906
|
+
.union([
|
|
907
|
+
zod_1.z.array(ImportCreditNoteCreditNoteAllocationsItemSchema.optional()),
|
|
908
|
+
ImportCreditNoteCreditNoteAllocationsSchema,
|
|
909
|
+
])
|
|
910
|
+
.optional(),
|
|
911
|
+
linked_refunds: zod_1.z
|
|
912
|
+
.union([
|
|
913
|
+
zod_1.z.array(ImportCreditNoteCreditNoteLinkedRefundsItemSchema.optional()),
|
|
914
|
+
ImportCreditNoteCreditNoteLinkedRefundsSchema,
|
|
915
|
+
])
|
|
916
|
+
.optional(),
|
|
525
917
|
});
|
|
526
918
|
exports.ImportCreditNoteCreditNoteBodySchema = ImportCreditNoteCreditNoteBodySchema;
|