chargebee 3.35.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 +65 -0
- package/cjs/environment.js +1 -1
- package/cjs/resources/api_endpoints.js +56 -0
- package/cjs/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/cjs/schema/business_rule.schema.js +2 -2
- package/cjs/schema/business_ruleset.schema.js +2 -2
- package/cjs/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/cjs/schema/entitlement_override.schema.js +17 -1
- package/cjs/schema/estimate.schema.js +581 -36
- package/cjs/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/cjs/schema/index.js +3 -0
- package/cjs/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/cjs/schema/metered_feature.schema.js +10 -1
- package/cjs/schema/omnichannel_one_time_order.schema.js +32 -2
- package/cjs/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/cjs/schema/quote.schema.js +901 -81
- package/cjs/schema/quote_entitlement.schema.js +6 -2
- package/cjs/schema/ramp.schema.js +238 -24
- package/cjs/schema/site_migration_detail.schema.js +50 -16
- package/cjs/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/cjs/schema/usage_event.schema.js +13 -1
- package/cjs/schema/virtual_bank_account.schema.js +42 -10
- package/cjs/schema/webhook_endpoint.schema.js +4 -0
- package/esm/environment.js +1 -1
- package/esm/resources/api_endpoints.js +56 -0
- package/esm/resources/webhook/eventType.js +2 -0
- 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 +16 -5
- package/esm/schema/business_rule.schema.js +2 -2
- package/esm/schema/business_ruleset.schema.js +2 -2
- package/esm/schema/comment.schema.js +15 -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 +496 -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 +33 -4
- package/esm/schema/entitlement_override.schema.js +17 -1
- package/esm/schema/estimate.schema.js +581 -36
- package/esm/schema/event.schema.js +1282 -633
- 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 +562 -66
- package/esm/schema/index.js +3 -0
- package/esm/schema/invoice.schema.js +821 -121
- 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_operation.schema.js +42 -15
- package/esm/schema/metered_feature.schema.js +10 -1
- package/esm/schema/omnichannel_one_time_order.schema.js +32 -2
- package/esm/schema/omnichannel_subscription.schema.js +136 -30
- 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 +360 -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 +79 -14
- 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 +204 -12
- package/esm/schema/quote.schema.js +901 -81
- package/esm/schema/quote_entitlement.schema.js +6 -2
- package/esm/schema/ramp.schema.js +238 -24
- package/esm/schema/site_migration_detail.schema.js +50 -16
- package/esm/schema/subscription.schema.js +998 -169
- 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 +55 -12
- package/esm/schema/usage_event.schema.js +13 -1
- package/esm/schema/virtual_bank_account.schema.js +42 -10
- package/esm/schema/webhook_endpoint.schema.js +4 -0
- package/package.json +1 -1
- package/types/core.d.ts +10 -6
- package/types/index.d.ts +8 -1
- package/types/resources/BillingLineItem.d.ts +10 -0
- package/types/resources/BillingMetadata.d.ts +9 -0
- package/types/resources/Content.d.ts +5 -0
- package/types/resources/Discount.d.ts +1 -0
- package/types/resources/DraftRequest.d.ts +1 -1
- package/types/resources/Estimate.d.ts +3 -0
- package/types/resources/Event.d.ts +2 -0
- 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/HostedPage.d.ts +18 -0
- package/types/resources/Invoice.d.ts +4 -0
- package/types/resources/OrganizationDetail.d.ts +84 -0
- package/types/resources/Subscription.d.ts +3 -0
- package/types/resources/Usage.d.ts +1 -0
- package/types/resources/WebhookEvent.d.ts +10 -0
|
@@ -352,6 +352,15 @@ const CreateInvoicePaymentIntentSchema = z.object({
|
|
|
352
352
|
gw_payment_method_id: z.string().max(65000).optional(),
|
|
353
353
|
additional_information: CreateInvoiceAdditionalInformationSchema.optional(),
|
|
354
354
|
});
|
|
355
|
+
const CreateInvoiceAddonsItemSchema = z.object({
|
|
356
|
+
id: z.string().max(100).optional(),
|
|
357
|
+
quantity: z.number().int().min(1).optional(),
|
|
358
|
+
unit_price: z.number().int().min(0).optional(),
|
|
359
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
360
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
361
|
+
date_from: z.number().int().optional(),
|
|
362
|
+
date_to: z.number().int().optional(),
|
|
363
|
+
});
|
|
355
364
|
const CreateInvoiceAddonsSchema = z.object({
|
|
356
365
|
id: z.array(z.string().max(100).optional()).optional(),
|
|
357
366
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -361,6 +370,23 @@ const CreateInvoiceAddonsSchema = z.object({
|
|
|
361
370
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
362
371
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
363
372
|
});
|
|
373
|
+
const CreateInvoiceChargesItemSchema = z.object({
|
|
374
|
+
amount: z.number().int().min(1).optional(),
|
|
375
|
+
amount_in_decimal: z.string().max(39).optional(),
|
|
376
|
+
description: z.string().max(250).optional(),
|
|
377
|
+
taxable: z.boolean().default(true).optional(),
|
|
378
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
379
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
380
|
+
hsn_code: z.string().max(50).optional(),
|
|
381
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
382
|
+
avalara_sale_type: z
|
|
383
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
384
|
+
.optional(),
|
|
385
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
386
|
+
avalara_service_type: z.number().int().optional(),
|
|
387
|
+
date_from: z.number().int().optional(),
|
|
388
|
+
date_to: z.number().int().optional(),
|
|
389
|
+
});
|
|
364
390
|
const CreateInvoiceChargesSchema = z.object({
|
|
365
391
|
amount: z.array(z.number().int().min(1).optional()).optional(),
|
|
366
392
|
amount_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
@@ -378,11 +404,22 @@ const CreateInvoiceChargesSchema = z.object({
|
|
|
378
404
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
379
405
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
380
406
|
});
|
|
407
|
+
const CreateInvoiceTaxProvidersFieldsItemSchema = z.object({
|
|
408
|
+
provider_name: z.string().max(50).optional(),
|
|
409
|
+
field_id: z.string().max(50).optional(),
|
|
410
|
+
field_value: z.string().max(50).optional(),
|
|
411
|
+
});
|
|
381
412
|
const CreateInvoiceTaxProvidersFieldsSchema = z.object({
|
|
382
413
|
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
383
414
|
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
384
415
|
field_value: z.array(z.string().max(50).optional()).optional(),
|
|
385
416
|
});
|
|
417
|
+
const CreateInvoiceNotesToRemoveItemSchema = z.object({
|
|
418
|
+
entity_type: z
|
|
419
|
+
.enum(['plan', 'addon', 'customer', 'subscription', 'coupon'])
|
|
420
|
+
.optional(),
|
|
421
|
+
entity_id: z.string().max(100).optional(),
|
|
422
|
+
});
|
|
386
423
|
const CreateInvoiceNotesToRemoveSchema = z.object({
|
|
387
424
|
entity_type: z
|
|
388
425
|
.array(z
|
|
@@ -414,10 +451,30 @@ const CreateInvoiceBodySchema = z.looseObject({
|
|
|
414
451
|
bank_account: CreateInvoiceBankAccountSchema.optional(),
|
|
415
452
|
payment_method: CreateInvoicePaymentMethodSchema.optional(),
|
|
416
453
|
payment_intent: CreateInvoicePaymentIntentSchema.optional(),
|
|
417
|
-
addons:
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
454
|
+
addons: z
|
|
455
|
+
.union([
|
|
456
|
+
z.array(CreateInvoiceAddonsItemSchema.optional()),
|
|
457
|
+
CreateInvoiceAddonsSchema,
|
|
458
|
+
])
|
|
459
|
+
.optional(),
|
|
460
|
+
charges: z
|
|
461
|
+
.union([
|
|
462
|
+
z.array(CreateInvoiceChargesItemSchema.optional()),
|
|
463
|
+
CreateInvoiceChargesSchema,
|
|
464
|
+
])
|
|
465
|
+
.optional(),
|
|
466
|
+
tax_providers_fields: z
|
|
467
|
+
.union([
|
|
468
|
+
z.array(CreateInvoiceTaxProvidersFieldsItemSchema.optional()),
|
|
469
|
+
CreateInvoiceTaxProvidersFieldsSchema,
|
|
470
|
+
])
|
|
471
|
+
.optional(),
|
|
472
|
+
notes_to_remove: z
|
|
473
|
+
.union([
|
|
474
|
+
z.array(CreateInvoiceNotesToRemoveItemSchema.optional()),
|
|
475
|
+
CreateInvoiceNotesToRemoveSchema,
|
|
476
|
+
])
|
|
477
|
+
.optional(),
|
|
421
478
|
});
|
|
422
479
|
export { CreateInvoiceBodySchema };
|
|
423
480
|
//Invoice.createForChargeItemsAndCharges
|
|
@@ -770,6 +827,17 @@ const CreateForChargeItemsAndChargesInvoicePaymentIntentSchema = z.object({
|
|
|
770
827
|
gw_payment_method_id: z.string().max(65000).optional(),
|
|
771
828
|
additional_information: CreateForChargeItemsAndChargesInvoiceAdditionalInformationSchema.optional(),
|
|
772
829
|
});
|
|
830
|
+
const CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema = z.object({
|
|
831
|
+
item_price_id: z.string().max(100).optional(),
|
|
832
|
+
quantity: z.number().int().min(1).optional(),
|
|
833
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
834
|
+
unit_price: z.number().int().min(0).optional(),
|
|
835
|
+
unit_price_in_decimal: z.string().max(39).optional(),
|
|
836
|
+
date_from: z.number().int().optional(),
|
|
837
|
+
date_to: z.number().int().optional(),
|
|
838
|
+
description: z.string().max(250).optional(),
|
|
839
|
+
entity_description: z.string().max(2000).optional(),
|
|
840
|
+
});
|
|
773
841
|
const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
|
|
774
842
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
775
843
|
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -781,6 +849,17 @@ const CreateForChargeItemsAndChargesInvoiceItemPricesSchema = z.object({
|
|
|
781
849
|
description: z.array(z.string().max(250).optional()).optional(),
|
|
782
850
|
entity_description: z.array(z.string().max(2000).optional()).optional(),
|
|
783
851
|
});
|
|
852
|
+
const CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema = z.object({
|
|
853
|
+
item_price_id: z.string().max(100).optional(),
|
|
854
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
855
|
+
ending_unit: z.number().int().optional(),
|
|
856
|
+
price: z.number().int().min(0).optional(),
|
|
857
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
858
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
859
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
860
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
861
|
+
package_size: z.number().int().min(1).optional(),
|
|
862
|
+
});
|
|
784
863
|
const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
|
|
785
864
|
item_price_id: z.array(z.string().max(100).optional()).optional(),
|
|
786
865
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -794,6 +873,24 @@ const CreateForChargeItemsAndChargesInvoiceItemTiersSchema = z.object({
|
|
|
794
873
|
.optional(),
|
|
795
874
|
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
796
875
|
});
|
|
876
|
+
const CreateForChargeItemsAndChargesInvoiceChargesItemSchema = z.object({
|
|
877
|
+
entity_description: z.string().max(2000).optional(),
|
|
878
|
+
amount: z.number().int().min(1).optional(),
|
|
879
|
+
amount_in_decimal: z.string().max(39).optional(),
|
|
880
|
+
description: z.string().max(250).optional(),
|
|
881
|
+
taxable: z.boolean().default(true).optional(),
|
|
882
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
883
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
884
|
+
hsn_code: z.string().max(50).optional(),
|
|
885
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
886
|
+
avalara_sale_type: z
|
|
887
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
888
|
+
.optional(),
|
|
889
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
890
|
+
avalara_service_type: z.number().int().optional(),
|
|
891
|
+
date_from: z.number().int().optional(),
|
|
892
|
+
date_to: z.number().int().optional(),
|
|
893
|
+
});
|
|
797
894
|
const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
|
|
798
895
|
entity_description: z.array(z.string().max(2000).optional()).optional(),
|
|
799
896
|
amount: z.array(z.number().int().min(1).optional()).optional(),
|
|
@@ -812,6 +909,19 @@ const CreateForChargeItemsAndChargesInvoiceChargesSchema = z.object({
|
|
|
812
909
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
813
910
|
date_to: z.array(z.number().int().optional()).optional(),
|
|
814
911
|
});
|
|
912
|
+
const CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema = z.object({
|
|
913
|
+
entity_type: z
|
|
914
|
+
.enum([
|
|
915
|
+
'customer',
|
|
916
|
+
'subscription',
|
|
917
|
+
'coupon',
|
|
918
|
+
'plan_item_price',
|
|
919
|
+
'addon_item_price',
|
|
920
|
+
'charge_item_price',
|
|
921
|
+
])
|
|
922
|
+
.optional(),
|
|
923
|
+
entity_id: z.string().max(100).optional(),
|
|
924
|
+
});
|
|
815
925
|
const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
|
|
816
926
|
entity_type: z
|
|
817
927
|
.array(z
|
|
@@ -827,11 +937,23 @@ const CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema = z.object({
|
|
|
827
937
|
.optional(),
|
|
828
938
|
entity_id: z.array(z.string().max(100).optional()).optional(),
|
|
829
939
|
});
|
|
940
|
+
const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema = z.object({
|
|
941
|
+
provider_name: z.string().max(50).optional(),
|
|
942
|
+
field_id: z.string().max(50).optional(),
|
|
943
|
+
field_value: z.string().max(50).optional(),
|
|
944
|
+
});
|
|
830
945
|
const CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema = z.object({
|
|
831
946
|
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
832
947
|
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
833
948
|
field_value: z.array(z.string().max(50).optional()).optional(),
|
|
834
949
|
});
|
|
950
|
+
const CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema = z.object({
|
|
951
|
+
percentage: z.number().min(0.01).max(100).optional(),
|
|
952
|
+
amount: z.number().int().min(0).optional(),
|
|
953
|
+
quantity: z.number().int().min(1).optional(),
|
|
954
|
+
apply_on: z.enum(['invoice_amount', 'specific_item_price']),
|
|
955
|
+
item_price_id: z.string().max(100).optional(),
|
|
956
|
+
});
|
|
835
957
|
const CreateForChargeItemsAndChargesInvoiceDiscountsSchema = z.object({
|
|
836
958
|
percentage: z.array(z.number().min(0.01).max(100).optional()).optional(),
|
|
837
959
|
amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
@@ -852,6 +974,23 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
|
|
|
852
974
|
payment_source_id: z.string().max(40).optional(),
|
|
853
975
|
auto_collection: z.enum(['on', 'off']).optional(),
|
|
854
976
|
net_term_days: z.number().int().optional(),
|
|
977
|
+
offline_payment_method: z
|
|
978
|
+
.enum([
|
|
979
|
+
'no_preference',
|
|
980
|
+
'cash',
|
|
981
|
+
'check',
|
|
982
|
+
'bank_transfer',
|
|
983
|
+
'ach_credit',
|
|
984
|
+
'sepa_credit',
|
|
985
|
+
'boleto',
|
|
986
|
+
'us_automated_bank_transfer',
|
|
987
|
+
'eu_automated_bank_transfer',
|
|
988
|
+
'uk_automated_bank_transfer',
|
|
989
|
+
'jp_automated_bank_transfer',
|
|
990
|
+
'mx_automated_bank_transfer',
|
|
991
|
+
'custom',
|
|
992
|
+
])
|
|
993
|
+
.optional(),
|
|
855
994
|
invoice_date: z.number().int().optional(),
|
|
856
995
|
create_pending_invoice: z.boolean().optional(),
|
|
857
996
|
token_id: z.string().max(40).optional(),
|
|
@@ -864,15 +1003,50 @@ const CreateForChargeItemsAndChargesInvoiceBodySchema = z.looseObject({
|
|
|
864
1003
|
bank_account: CreateForChargeItemsAndChargesInvoiceBankAccountSchema.optional(),
|
|
865
1004
|
payment_method: CreateForChargeItemsAndChargesInvoicePaymentMethodSchema.optional(),
|
|
866
1005
|
payment_intent: CreateForChargeItemsAndChargesInvoicePaymentIntentSchema.optional(),
|
|
867
|
-
item_prices:
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
1006
|
+
item_prices: z
|
|
1007
|
+
.union([
|
|
1008
|
+
z.array(CreateForChargeItemsAndChargesInvoiceItemPricesItemSchema.optional()),
|
|
1009
|
+
CreateForChargeItemsAndChargesInvoiceItemPricesSchema,
|
|
1010
|
+
])
|
|
1011
|
+
.optional(),
|
|
1012
|
+
item_tiers: z
|
|
1013
|
+
.union([
|
|
1014
|
+
z.array(CreateForChargeItemsAndChargesInvoiceItemTiersItemSchema.optional()),
|
|
1015
|
+
CreateForChargeItemsAndChargesInvoiceItemTiersSchema,
|
|
1016
|
+
])
|
|
1017
|
+
.optional(),
|
|
1018
|
+
charges: z
|
|
1019
|
+
.union([
|
|
1020
|
+
z.array(CreateForChargeItemsAndChargesInvoiceChargesItemSchema.optional()),
|
|
1021
|
+
CreateForChargeItemsAndChargesInvoiceChargesSchema,
|
|
1022
|
+
])
|
|
1023
|
+
.optional(),
|
|
1024
|
+
notes_to_remove: z
|
|
1025
|
+
.union([
|
|
1026
|
+
z.array(CreateForChargeItemsAndChargesInvoiceNotesToRemoveItemSchema.optional()),
|
|
1027
|
+
CreateForChargeItemsAndChargesInvoiceNotesToRemoveSchema,
|
|
1028
|
+
])
|
|
1029
|
+
.optional(),
|
|
1030
|
+
tax_providers_fields: z
|
|
1031
|
+
.union([
|
|
1032
|
+
z.array(CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsItemSchema.optional()),
|
|
1033
|
+
CreateForChargeItemsAndChargesInvoiceTaxProvidersFieldsSchema,
|
|
1034
|
+
])
|
|
1035
|
+
.optional(),
|
|
1036
|
+
discounts: z
|
|
1037
|
+
.union([
|
|
1038
|
+
z.array(CreateForChargeItemsAndChargesInvoiceDiscountsItemSchema.optional()),
|
|
1039
|
+
CreateForChargeItemsAndChargesInvoiceDiscountsSchema,
|
|
1040
|
+
])
|
|
1041
|
+
.optional(),
|
|
873
1042
|
});
|
|
874
1043
|
export { CreateForChargeItemsAndChargesInvoiceBodySchema };
|
|
875
1044
|
//Invoice.charge
|
|
1045
|
+
const ChargeInvoiceTaxProvidersFieldsItemSchema = z.object({
|
|
1046
|
+
provider_name: z.string().max(50).optional(),
|
|
1047
|
+
field_id: z.string().max(50).optional(),
|
|
1048
|
+
field_value: z.string().max(50).optional(),
|
|
1049
|
+
});
|
|
876
1050
|
const ChargeInvoiceTaxProvidersFieldsSchema = z.object({
|
|
877
1051
|
provider_name: z.array(z.string().max(50).optional()).optional(),
|
|
878
1052
|
field_id: z.array(z.string().max(50).optional()).optional(),
|
|
@@ -898,7 +1072,12 @@ const ChargeInvoiceBodySchema = z.looseObject({
|
|
|
898
1072
|
invoice_date: z.number().int().optional(),
|
|
899
1073
|
payment_source_id: z.string().max(40).optional(),
|
|
900
1074
|
payment_initiator: z.enum(['customer', 'merchant']).optional(),
|
|
901
|
-
tax_providers_fields:
|
|
1075
|
+
tax_providers_fields: z
|
|
1076
|
+
.union([
|
|
1077
|
+
z.array(ChargeInvoiceTaxProvidersFieldsItemSchema.optional()),
|
|
1078
|
+
ChargeInvoiceTaxProvidersFieldsSchema,
|
|
1079
|
+
])
|
|
1080
|
+
.optional(),
|
|
902
1081
|
});
|
|
903
1082
|
export { ChargeInvoiceBodySchema };
|
|
904
1083
|
//Invoice.chargeAddon
|
|
@@ -930,6 +1109,16 @@ const CreateForChargeItemInvoiceItemPriceSchema = z.object({
|
|
|
930
1109
|
date_from: z.number().int().optional(),
|
|
931
1110
|
date_to: z.number().int().optional(),
|
|
932
1111
|
});
|
|
1112
|
+
const CreateForChargeItemInvoiceItemTiersItemSchema = z.object({
|
|
1113
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
1114
|
+
ending_unit: z.number().int().optional(),
|
|
1115
|
+
price: z.number().int().min(0).optional(),
|
|
1116
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
1117
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
1118
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
1119
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
1120
|
+
package_size: z.number().int().min(1).optional(),
|
|
1121
|
+
});
|
|
933
1122
|
const CreateForChargeItemInvoiceItemTiersSchema = z.object({
|
|
934
1123
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
935
1124
|
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
@@ -951,7 +1140,12 @@ const CreateForChargeItemInvoiceBodySchema = z.looseObject({
|
|
|
951
1140
|
payment_initiator: z.enum(['customer', 'merchant']).optional(),
|
|
952
1141
|
invoice_date: z.number().int().optional(),
|
|
953
1142
|
item_price: CreateForChargeItemInvoiceItemPriceSchema.optional(),
|
|
954
|
-
item_tiers:
|
|
1143
|
+
item_tiers: z
|
|
1144
|
+
.union([
|
|
1145
|
+
z.array(CreateForChargeItemInvoiceItemTiersItemSchema.optional()),
|
|
1146
|
+
CreateForChargeItemInvoiceItemTiersSchema,
|
|
1147
|
+
])
|
|
1148
|
+
.optional(),
|
|
955
1149
|
});
|
|
956
1150
|
export { CreateForChargeItemInvoiceBodySchema };
|
|
957
1151
|
//Invoice.stopDunning
|
|
@@ -1010,6 +1204,74 @@ const ImportInvoiceInvoiceShippingAddressSchema = z.object({
|
|
|
1010
1204
|
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
1011
1205
|
.optional(),
|
|
1012
1206
|
});
|
|
1207
|
+
const ImportInvoiceInvoiceLineItemsItemSchema = z.object({
|
|
1208
|
+
id: z.string().max(40).optional(),
|
|
1209
|
+
date_from: z.number().int().optional(),
|
|
1210
|
+
date_to: z.number().int().optional(),
|
|
1211
|
+
subscription_id: z.string().max(50).optional(),
|
|
1212
|
+
description: z.string().max(250),
|
|
1213
|
+
unit_amount: z.number().int().optional(),
|
|
1214
|
+
quantity: z.number().int().optional(),
|
|
1215
|
+
amount: z.number().int().optional(),
|
|
1216
|
+
unit_amount_in_decimal: z.string().max(39).optional(),
|
|
1217
|
+
quantity_in_decimal: z.string().max(33).optional(),
|
|
1218
|
+
amount_in_decimal: z.string().max(39).optional(),
|
|
1219
|
+
entity_type: z
|
|
1220
|
+
.enum([
|
|
1221
|
+
'adhoc',
|
|
1222
|
+
'plan_item_price',
|
|
1223
|
+
'addon_item_price',
|
|
1224
|
+
'charge_item_price',
|
|
1225
|
+
'plan_setup',
|
|
1226
|
+
'plan',
|
|
1227
|
+
'addon',
|
|
1228
|
+
])
|
|
1229
|
+
.optional(),
|
|
1230
|
+
entity_id: z.string().max(100).optional(),
|
|
1231
|
+
item_level_discount1_entity_id: z.string().max(100).optional(),
|
|
1232
|
+
item_level_discount1_amount: z.number().int().min(0).optional(),
|
|
1233
|
+
item_level_discount2_entity_id: z.string().max(100).optional(),
|
|
1234
|
+
item_level_discount2_amount: z.number().int().min(0).optional(),
|
|
1235
|
+
tax1_name: z.string().max(50).optional(),
|
|
1236
|
+
tax1_amount: z.number().int().min(0).optional(),
|
|
1237
|
+
tax2_name: z.string().max(50).optional(),
|
|
1238
|
+
tax2_amount: z.number().int().min(0).optional(),
|
|
1239
|
+
tax3_name: z.string().max(50).optional(),
|
|
1240
|
+
tax3_amount: z.number().int().min(0).optional(),
|
|
1241
|
+
tax4_name: z.string().max(50).optional(),
|
|
1242
|
+
tax4_amount: z.number().int().min(0).optional(),
|
|
1243
|
+
tax5_name: z.string().max(50).optional(),
|
|
1244
|
+
tax5_amount: z.number().int().min(0).optional(),
|
|
1245
|
+
tax6_name: z.string().max(50).optional(),
|
|
1246
|
+
tax6_amount: z.number().int().min(0).optional(),
|
|
1247
|
+
tax7_name: z.string().max(50).optional(),
|
|
1248
|
+
tax7_amount: z.number().int().min(0).optional(),
|
|
1249
|
+
tax8_name: z.string().max(50).optional(),
|
|
1250
|
+
tax8_amount: z.number().int().min(0).optional(),
|
|
1251
|
+
tax9_name: z.string().max(50).optional(),
|
|
1252
|
+
tax9_amount: z.number().int().min(0).optional(),
|
|
1253
|
+
tax10_name: z.string().max(50).optional(),
|
|
1254
|
+
tax10_amount: z.number().int().min(0).optional(),
|
|
1255
|
+
is_partial_tax_applied: z.boolean().optional(),
|
|
1256
|
+
taxable_amount: z.number().int().min(0).optional(),
|
|
1257
|
+
tax_exempt_reason: z
|
|
1258
|
+
.enum([
|
|
1259
|
+
'region_non_taxable',
|
|
1260
|
+
'export',
|
|
1261
|
+
'customer_exempt',
|
|
1262
|
+
'product_exempt',
|
|
1263
|
+
'zero_rated',
|
|
1264
|
+
'reverse_charge',
|
|
1265
|
+
'high_value_physical_goods',
|
|
1266
|
+
'zero_value_item',
|
|
1267
|
+
'tax_not_configured_external_provider',
|
|
1268
|
+
])
|
|
1269
|
+
.optional(),
|
|
1270
|
+
proration_mode: z
|
|
1271
|
+
.enum(['reset', 'delta', 'service_period_revision', 'adjusted_term'])
|
|
1272
|
+
.optional(),
|
|
1273
|
+
created_at: z.number().int().optional(),
|
|
1274
|
+
});
|
|
1013
1275
|
const ImportInvoiceInvoiceLineItemsSchema = z.object({
|
|
1014
1276
|
id: z.array(z.string().max(40).optional()).optional(),
|
|
1015
1277
|
date_from: z.array(z.number().int().optional()).optional(),
|
|
@@ -1092,11 +1354,27 @@ const ImportInvoiceInvoiceLineItemsSchema = z.object({
|
|
|
1092
1354
|
.optional(),
|
|
1093
1355
|
created_at: z.array(z.number().int().optional()).optional(),
|
|
1094
1356
|
});
|
|
1357
|
+
const ImportInvoiceInvoicePaymentReferenceNumbersItemSchema = z.object({
|
|
1358
|
+
id: z.string().max(40).optional(),
|
|
1359
|
+
type: z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']),
|
|
1360
|
+
number: z.string().max(100),
|
|
1361
|
+
});
|
|
1095
1362
|
const ImportInvoiceInvoicePaymentReferenceNumbersSchema = z.object({
|
|
1096
1363
|
id: z.array(z.string().max(40).optional()).optional(),
|
|
1097
1364
|
type: z.array(z.enum(['kid', 'ocr', 'frn', 'fik', 'swiss_reference']).optional()),
|
|
1098
1365
|
number: z.array(z.string().max(100).optional()),
|
|
1099
1366
|
});
|
|
1367
|
+
const ImportInvoiceInvoiceLineItemTiersItemSchema = z.object({
|
|
1368
|
+
line_item_id: z.string().max(40),
|
|
1369
|
+
starting_unit: z.number().int().min(0).optional(),
|
|
1370
|
+
ending_unit: z.number().int().optional(),
|
|
1371
|
+
quantity_used: z.number().int().min(0).optional(),
|
|
1372
|
+
unit_amount: z.number().int().min(0).optional(),
|
|
1373
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
1374
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
1375
|
+
quantity_used_in_decimal: z.string().max(33).optional(),
|
|
1376
|
+
unit_amount_in_decimal: z.string().max(40).optional(),
|
|
1377
|
+
});
|
|
1100
1378
|
const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
|
|
1101
1379
|
line_item_id: z.array(z.string().max(40).optional()),
|
|
1102
1380
|
starting_unit: z.array(z.number().int().min(0).optional()).optional(),
|
|
@@ -1108,6 +1386,19 @@ const ImportInvoiceInvoiceLineItemTiersSchema = z.object({
|
|
|
1108
1386
|
quantity_used_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
1109
1387
|
unit_amount_in_decimal: z.array(z.string().max(40).optional()).optional(),
|
|
1110
1388
|
});
|
|
1389
|
+
const ImportInvoiceInvoiceDiscountsItemSchema = z.object({
|
|
1390
|
+
line_item_id: z.string().max(40).optional(),
|
|
1391
|
+
entity_type: z.enum([
|
|
1392
|
+
'item_level_coupon',
|
|
1393
|
+
'document_level_coupon',
|
|
1394
|
+
'promotional_credits',
|
|
1395
|
+
'item_level_discount',
|
|
1396
|
+
'document_level_discount',
|
|
1397
|
+
]),
|
|
1398
|
+
entity_id: z.string().max(100).optional(),
|
|
1399
|
+
description: z.string().max(250).optional(),
|
|
1400
|
+
amount: z.number().int().min(0),
|
|
1401
|
+
});
|
|
1111
1402
|
const ImportInvoiceInvoiceDiscountsSchema = z.object({
|
|
1112
1403
|
line_item_id: z.array(z.string().max(40).optional()).optional(),
|
|
1113
1404
|
entity_type: z.array(z
|
|
@@ -1123,6 +1414,26 @@ const ImportInvoiceInvoiceDiscountsSchema = z.object({
|
|
|
1123
1414
|
description: z.array(z.string().max(250).optional()).optional(),
|
|
1124
1415
|
amount: z.array(z.number().int().min(0).optional()),
|
|
1125
1416
|
});
|
|
1417
|
+
const ImportInvoiceInvoiceTaxesItemSchema = z.object({
|
|
1418
|
+
name: z.string().max(100),
|
|
1419
|
+
rate: z.number().min(0).max(100),
|
|
1420
|
+
amount: z.number().int().min(0).optional(),
|
|
1421
|
+
description: z.string().max(50).optional(),
|
|
1422
|
+
juris_type: z
|
|
1423
|
+
.enum([
|
|
1424
|
+
'country',
|
|
1425
|
+
'federal',
|
|
1426
|
+
'state',
|
|
1427
|
+
'county',
|
|
1428
|
+
'city',
|
|
1429
|
+
'special',
|
|
1430
|
+
'unincorporated',
|
|
1431
|
+
'other',
|
|
1432
|
+
])
|
|
1433
|
+
.optional(),
|
|
1434
|
+
juris_name: z.string().max(250).optional(),
|
|
1435
|
+
juris_code: z.string().max(250).optional(),
|
|
1436
|
+
});
|
|
1126
1437
|
const ImportInvoiceInvoiceTaxesSchema = z.object({
|
|
1127
1438
|
name: z.array(z.string().max(100).optional()),
|
|
1128
1439
|
rate: z.array(z.number().min(0).max(100).optional()),
|
|
@@ -1145,6 +1456,21 @@ const ImportInvoiceInvoiceTaxesSchema = z.object({
|
|
|
1145
1456
|
juris_name: z.array(z.string().max(250).optional()).optional(),
|
|
1146
1457
|
juris_code: z.array(z.string().max(250).optional()).optional(),
|
|
1147
1458
|
});
|
|
1459
|
+
const ImportInvoiceInvoicePaymentsItemSchema = z.object({
|
|
1460
|
+
id: z.string().max(40).optional(),
|
|
1461
|
+
amount: z.number().int().min(1),
|
|
1462
|
+
payment_method: z.enum([
|
|
1463
|
+
'cash',
|
|
1464
|
+
'check',
|
|
1465
|
+
'bank_transfer',
|
|
1466
|
+
'other',
|
|
1467
|
+
'app_store',
|
|
1468
|
+
'play_store',
|
|
1469
|
+
'custom',
|
|
1470
|
+
]),
|
|
1471
|
+
date: z.number().int().optional(),
|
|
1472
|
+
reference_number: z.string().max(100).min(1).optional(),
|
|
1473
|
+
});
|
|
1148
1474
|
const ImportInvoiceInvoicePaymentsSchema = z.object({
|
|
1149
1475
|
id: z.array(z.string().max(40).optional()).optional(),
|
|
1150
1476
|
amount: z.array(z.number().int().min(1).optional()),
|
|
@@ -1157,17 +1483,25 @@ const ImportInvoiceInvoicePaymentsSchema = z.object({
|
|
|
1157
1483
|
'app_store',
|
|
1158
1484
|
'play_store',
|
|
1159
1485
|
'custom',
|
|
1160
|
-
'tamara',
|
|
1161
|
-
'qpay',
|
|
1162
|
-
'blik',
|
|
1163
|
-
'fpx',
|
|
1164
|
-
'wero',
|
|
1165
|
-
'p24',
|
|
1166
1486
|
])
|
|
1167
1487
|
.optional()),
|
|
1168
1488
|
date: z.array(z.number().int().optional()).optional(),
|
|
1169
1489
|
reference_number: z.array(z.string().max(100).min(1).optional()).optional(),
|
|
1170
1490
|
});
|
|
1491
|
+
const ImportInvoiceInvoiceNotesItemSchema = z.object({
|
|
1492
|
+
entity_type: z
|
|
1493
|
+
.enum([
|
|
1494
|
+
'coupon',
|
|
1495
|
+
'plan_item_price',
|
|
1496
|
+
'addon_item_price',
|
|
1497
|
+
'charge_item_price',
|
|
1498
|
+
'plan',
|
|
1499
|
+
'addon',
|
|
1500
|
+
])
|
|
1501
|
+
.optional(),
|
|
1502
|
+
entity_id: z.string().max(50).optional(),
|
|
1503
|
+
note: z.string().max(65000).optional(),
|
|
1504
|
+
});
|
|
1171
1505
|
const ImportInvoiceInvoiceNotesSchema = z.object({
|
|
1172
1506
|
entity_type: z
|
|
1173
1507
|
.array(z
|
|
@@ -1184,6 +1518,25 @@ const ImportInvoiceInvoiceNotesSchema = z.object({
|
|
|
1184
1518
|
entity_id: z.array(z.string().max(50).optional()).optional(),
|
|
1185
1519
|
note: z.array(z.string().max(65000).optional()).optional(),
|
|
1186
1520
|
});
|
|
1521
|
+
const ImportInvoiceInvoiceLineItemAddressesItemSchema = z.object({
|
|
1522
|
+
line_item_id: z.string().max(40).optional(),
|
|
1523
|
+
first_name: z.string().max(150).optional(),
|
|
1524
|
+
last_name: z.string().max(150).optional(),
|
|
1525
|
+
email: z.string().email().max(70).optional(),
|
|
1526
|
+
company: z.string().max(250).optional(),
|
|
1527
|
+
phone: z.string().max(50).optional(),
|
|
1528
|
+
line1: z.string().max(150).optional(),
|
|
1529
|
+
line2: z.string().max(150).optional(),
|
|
1530
|
+
line3: z.string().max(150).optional(),
|
|
1531
|
+
city: z.string().max(50).optional(),
|
|
1532
|
+
state_code: z.string().max(50).optional(),
|
|
1533
|
+
state: z.string().max(50).optional(),
|
|
1534
|
+
zip: z.string().max(20).optional(),
|
|
1535
|
+
country: z.string().max(50).optional(),
|
|
1536
|
+
validation_status: z
|
|
1537
|
+
.enum(['not_validated', 'valid', 'partially_valid', 'invalid'])
|
|
1538
|
+
.optional(),
|
|
1539
|
+
});
|
|
1187
1540
|
const ImportInvoiceInvoiceLineItemAddressesSchema = z.object({
|
|
1188
1541
|
line_item_id: z.array(z.string().max(40).optional()).optional(),
|
|
1189
1542
|
first_name: z.array(z.string().max(150).optional()).optional(),
|
|
@@ -1246,41 +1599,110 @@ const ImportInvoiceInvoiceBodySchema = z.looseObject({
|
|
|
1246
1599
|
credit_note: ImportInvoiceInvoiceCreditNoteSchema.optional(),
|
|
1247
1600
|
billing_address: ImportInvoiceInvoiceBillingAddressSchema.optional(),
|
|
1248
1601
|
shipping_address: ImportInvoiceInvoiceShippingAddressSchema.optional(),
|
|
1249
|
-
line_items:
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1602
|
+
line_items: z
|
|
1603
|
+
.union([
|
|
1604
|
+
z.array(ImportInvoiceInvoiceLineItemsItemSchema.optional()),
|
|
1605
|
+
ImportInvoiceInvoiceLineItemsSchema,
|
|
1606
|
+
])
|
|
1607
|
+
.optional(),
|
|
1608
|
+
payment_reference_numbers: z
|
|
1609
|
+
.union([
|
|
1610
|
+
z.array(ImportInvoiceInvoicePaymentReferenceNumbersItemSchema.optional()),
|
|
1611
|
+
ImportInvoiceInvoicePaymentReferenceNumbersSchema,
|
|
1612
|
+
])
|
|
1613
|
+
.optional(),
|
|
1614
|
+
line_item_tiers: z
|
|
1615
|
+
.union([
|
|
1616
|
+
z.array(ImportInvoiceInvoiceLineItemTiersItemSchema.optional()),
|
|
1617
|
+
ImportInvoiceInvoiceLineItemTiersSchema,
|
|
1618
|
+
])
|
|
1619
|
+
.optional(),
|
|
1620
|
+
discounts: z
|
|
1621
|
+
.union([
|
|
1622
|
+
z.array(ImportInvoiceInvoiceDiscountsItemSchema.optional()),
|
|
1623
|
+
ImportInvoiceInvoiceDiscountsSchema,
|
|
1624
|
+
])
|
|
1625
|
+
.optional(),
|
|
1626
|
+
taxes: z
|
|
1627
|
+
.union([
|
|
1628
|
+
z.array(ImportInvoiceInvoiceTaxesItemSchema.optional()),
|
|
1629
|
+
ImportInvoiceInvoiceTaxesSchema,
|
|
1630
|
+
])
|
|
1631
|
+
.optional(),
|
|
1632
|
+
payments: z
|
|
1633
|
+
.union([
|
|
1634
|
+
z.array(ImportInvoiceInvoicePaymentsItemSchema.optional()),
|
|
1635
|
+
ImportInvoiceInvoicePaymentsSchema,
|
|
1636
|
+
])
|
|
1637
|
+
.optional(),
|
|
1638
|
+
notes: z
|
|
1639
|
+
.union([
|
|
1640
|
+
z.array(ImportInvoiceInvoiceNotesItemSchema.optional()),
|
|
1641
|
+
ImportInvoiceInvoiceNotesSchema,
|
|
1642
|
+
])
|
|
1643
|
+
.optional(),
|
|
1644
|
+
line_item_addresses: z
|
|
1645
|
+
.union([
|
|
1646
|
+
z.array(ImportInvoiceInvoiceLineItemAddressesItemSchema.optional()),
|
|
1647
|
+
ImportInvoiceInvoiceLineItemAddressesSchema,
|
|
1648
|
+
])
|
|
1649
|
+
.optional(),
|
|
1257
1650
|
});
|
|
1258
1651
|
export { ImportInvoiceInvoiceBodySchema };
|
|
1259
1652
|
//Invoice.applyPayments
|
|
1653
|
+
const ApplyPaymentsInvoiceTransactionsItemSchema = z.object({
|
|
1654
|
+
id: z.string().max(40).optional(),
|
|
1655
|
+
amount: z.number().int().min(0).optional(),
|
|
1656
|
+
});
|
|
1260
1657
|
const ApplyPaymentsInvoiceTransactionsSchema = z.object({
|
|
1261
1658
|
id: z.array(z.string().max(40).optional()).optional(),
|
|
1262
1659
|
amount: z.array(z.number().int().min(0).optional()).optional(),
|
|
1263
1660
|
});
|
|
1264
1661
|
const ApplyPaymentsInvoiceBodySchema = z.looseObject({
|
|
1265
1662
|
comment: z.string().max(300).optional(),
|
|
1266
|
-
transactions:
|
|
1663
|
+
transactions: z
|
|
1664
|
+
.union([
|
|
1665
|
+
z.array(ApplyPaymentsInvoiceTransactionsItemSchema.optional()),
|
|
1666
|
+
ApplyPaymentsInvoiceTransactionsSchema,
|
|
1667
|
+
])
|
|
1668
|
+
.optional(),
|
|
1267
1669
|
});
|
|
1268
1670
|
export { ApplyPaymentsInvoiceBodySchema };
|
|
1269
1671
|
//Invoice.deleteLineItems
|
|
1672
|
+
const DeleteLineItemsInvoiceLineItemsItemSchema = z.object({
|
|
1673
|
+
id: z.string().max(40).optional(),
|
|
1674
|
+
});
|
|
1270
1675
|
const DeleteLineItemsInvoiceLineItemsSchema = z.object({
|
|
1271
1676
|
id: z.array(z.string().max(40).optional()).optional(),
|
|
1272
1677
|
});
|
|
1273
1678
|
const DeleteLineItemsInvoiceBodySchema = z.looseObject({
|
|
1274
|
-
line_items:
|
|
1679
|
+
line_items: z
|
|
1680
|
+
.union([
|
|
1681
|
+
z.array(DeleteLineItemsInvoiceLineItemsItemSchema.optional()),
|
|
1682
|
+
DeleteLineItemsInvoiceLineItemsSchema,
|
|
1683
|
+
])
|
|
1684
|
+
.optional(),
|
|
1275
1685
|
});
|
|
1276
1686
|
export { DeleteLineItemsInvoiceBodySchema };
|
|
1277
1687
|
//Invoice.applyCredits
|
|
1688
|
+
const ApplyCreditsInvoiceCreditNotesItemSchema = z.object({
|
|
1689
|
+
id: z.string().max(50).optional(),
|
|
1690
|
+
amount: z.number().int().min(1).optional(),
|
|
1691
|
+
applied_at: z.number().int().optional(),
|
|
1692
|
+
});
|
|
1278
1693
|
const ApplyCreditsInvoiceCreditNotesSchema = z.object({
|
|
1279
1694
|
id: z.array(z.string().max(50).optional()).optional(),
|
|
1695
|
+
amount: z.array(z.number().int().min(1).optional()).optional(),
|
|
1696
|
+
applied_at: z.array(z.number().int().optional()).optional(),
|
|
1280
1697
|
});
|
|
1281
1698
|
const ApplyCreditsInvoiceBodySchema = z.looseObject({
|
|
1282
1699
|
comment: z.string().max(300).optional(),
|
|
1283
|
-
credit_notes:
|
|
1700
|
+
credit_notes: z
|
|
1701
|
+
.union([
|
|
1702
|
+
z.array(ApplyCreditsInvoiceCreditNotesItemSchema.optional()),
|
|
1703
|
+
ApplyCreditsInvoiceCreditNotesSchema,
|
|
1704
|
+
])
|
|
1705
|
+
.optional(),
|
|
1284
1706
|
});
|
|
1285
1707
|
export { ApplyCreditsInvoiceBodySchema };
|
|
1286
1708
|
//Invoice.list
|
|
@@ -1288,26 +1710,56 @@ const ListInvoiceIdSchema = z.object({
|
|
|
1288
1710
|
is: z.string().min(1).optional(),
|
|
1289
1711
|
is_not: z.string().min(1).optional(),
|
|
1290
1712
|
starts_with: z.string().min(1).optional(),
|
|
1291
|
-
in: z
|
|
1292
|
-
|
|
1713
|
+
in: z
|
|
1714
|
+
.union([
|
|
1715
|
+
z.array(z.string().optional()),
|
|
1716
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1717
|
+
])
|
|
1718
|
+
.optional(),
|
|
1719
|
+
not_in: z
|
|
1720
|
+
.union([
|
|
1721
|
+
z.array(z.string().optional()),
|
|
1722
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1723
|
+
])
|
|
1724
|
+
.optional(),
|
|
1293
1725
|
});
|
|
1294
1726
|
const ListInvoiceSubscriptionIdSchema = z.object({
|
|
1295
1727
|
is: z.string().min(1).optional(),
|
|
1296
1728
|
is_not: z.string().min(1).optional(),
|
|
1297
1729
|
starts_with: z.string().min(1).optional(),
|
|
1298
|
-
is_present: z.enum(['true', 'false']).optional(),
|
|
1299
|
-
in: z
|
|
1300
|
-
|
|
1730
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
1731
|
+
in: z
|
|
1732
|
+
.union([
|
|
1733
|
+
z.array(z.string().optional()),
|
|
1734
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1735
|
+
])
|
|
1736
|
+
.optional(),
|
|
1737
|
+
not_in: z
|
|
1738
|
+
.union([
|
|
1739
|
+
z.array(z.string().optional()),
|
|
1740
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1741
|
+
])
|
|
1742
|
+
.optional(),
|
|
1301
1743
|
});
|
|
1302
1744
|
const ListInvoiceCustomerIdSchema = z.object({
|
|
1303
1745
|
is: z.string().min(1).optional(),
|
|
1304
1746
|
is_not: z.string().min(1).optional(),
|
|
1305
1747
|
starts_with: z.string().min(1).optional(),
|
|
1306
|
-
in: z
|
|
1307
|
-
|
|
1748
|
+
in: z
|
|
1749
|
+
.union([
|
|
1750
|
+
z.array(z.string().optional()),
|
|
1751
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1752
|
+
])
|
|
1753
|
+
.optional(),
|
|
1754
|
+
not_in: z
|
|
1755
|
+
.union([
|
|
1756
|
+
z.array(z.string().optional()),
|
|
1757
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
1758
|
+
])
|
|
1759
|
+
.optional(),
|
|
1308
1760
|
});
|
|
1309
1761
|
const ListInvoiceRecurringSchema = z.object({
|
|
1310
|
-
is: z.enum(['true', 'false']).optional(),
|
|
1762
|
+
is: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
1311
1763
|
});
|
|
1312
1764
|
const ListInvoiceStatusSchema = z.object({
|
|
1313
1765
|
is: z
|
|
@@ -1317,113 +1769,330 @@ const ListInvoiceStatusSchema = z.object({
|
|
|
1317
1769
|
.enum(['paid', 'posted', 'payment_due', 'not_paid', 'voided', 'pending'])
|
|
1318
1770
|
.optional(),
|
|
1319
1771
|
in: z
|
|
1320
|
-
.
|
|
1772
|
+
.union([
|
|
1773
|
+
z.array(z
|
|
1774
|
+
.enum([
|
|
1775
|
+
'paid',
|
|
1776
|
+
'posted',
|
|
1777
|
+
'payment_due',
|
|
1778
|
+
'not_paid',
|
|
1779
|
+
'voided',
|
|
1780
|
+
'pending',
|
|
1781
|
+
])
|
|
1782
|
+
.optional()),
|
|
1783
|
+
z.enum([
|
|
1784
|
+
'paid',
|
|
1785
|
+
'posted',
|
|
1786
|
+
'payment_due',
|
|
1787
|
+
'not_paid',
|
|
1788
|
+
'voided',
|
|
1789
|
+
'pending',
|
|
1790
|
+
]),
|
|
1791
|
+
])
|
|
1321
1792
|
.optional(),
|
|
1322
1793
|
not_in: z
|
|
1323
|
-
.
|
|
1794
|
+
.union([
|
|
1795
|
+
z.array(z
|
|
1796
|
+
.enum([
|
|
1797
|
+
'paid',
|
|
1798
|
+
'posted',
|
|
1799
|
+
'payment_due',
|
|
1800
|
+
'not_paid',
|
|
1801
|
+
'voided',
|
|
1802
|
+
'pending',
|
|
1803
|
+
])
|
|
1804
|
+
.optional()),
|
|
1805
|
+
z.enum([
|
|
1806
|
+
'paid',
|
|
1807
|
+
'posted',
|
|
1808
|
+
'payment_due',
|
|
1809
|
+
'not_paid',
|
|
1810
|
+
'voided',
|
|
1811
|
+
'pending',
|
|
1812
|
+
]),
|
|
1813
|
+
])
|
|
1324
1814
|
.optional(),
|
|
1325
1815
|
});
|
|
1326
1816
|
const ListInvoicePriceTypeSchema = z.object({
|
|
1327
1817
|
is: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
1328
1818
|
is_not: z.enum(['tax_exclusive', 'tax_inclusive']).optional(),
|
|
1329
|
-
in: z
|
|
1330
|
-
|
|
1819
|
+
in: z
|
|
1820
|
+
.union([
|
|
1821
|
+
z.array(z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
|
|
1822
|
+
z.enum(['tax_exclusive', 'tax_inclusive']),
|
|
1823
|
+
])
|
|
1824
|
+
.optional(),
|
|
1825
|
+
not_in: z
|
|
1826
|
+
.union([
|
|
1827
|
+
z.array(z.enum(['tax_exclusive', 'tax_inclusive']).optional()),
|
|
1828
|
+
z.enum(['tax_exclusive', 'tax_inclusive']),
|
|
1829
|
+
])
|
|
1830
|
+
.optional(),
|
|
1331
1831
|
});
|
|
1332
1832
|
const ListInvoiceDateSchema = z.object({
|
|
1333
|
-
after: z
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1833
|
+
after: z
|
|
1834
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1835
|
+
.optional(),
|
|
1836
|
+
before: z
|
|
1837
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1838
|
+
.optional(),
|
|
1839
|
+
on: z
|
|
1840
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1841
|
+
.optional(),
|
|
1842
|
+
between: z
|
|
1843
|
+
.union([
|
|
1844
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1845
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
1846
|
+
])
|
|
1847
|
+
.optional(),
|
|
1337
1848
|
});
|
|
1338
1849
|
const ListInvoicePaidAtSchema = z.object({
|
|
1339
|
-
after: z
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1850
|
+
after: z
|
|
1851
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1852
|
+
.optional(),
|
|
1853
|
+
before: z
|
|
1854
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1855
|
+
.optional(),
|
|
1856
|
+
on: z
|
|
1857
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
1858
|
+
.optional(),
|
|
1859
|
+
between: z
|
|
1860
|
+
.union([
|
|
1861
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1862
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
1863
|
+
])
|
|
1864
|
+
.optional(),
|
|
1343
1865
|
});
|
|
1344
1866
|
const ListInvoiceTotalSchema = z.object({
|
|
1345
|
-
is: z
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1867
|
+
is: z
|
|
1868
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1869
|
+
.optional(),
|
|
1870
|
+
is_not: z
|
|
1871
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1872
|
+
.optional(),
|
|
1873
|
+
lt: z
|
|
1874
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1875
|
+
.optional(),
|
|
1876
|
+
lte: z
|
|
1877
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1878
|
+
.optional(),
|
|
1879
|
+
gt: z
|
|
1880
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1881
|
+
.optional(),
|
|
1882
|
+
gte: z
|
|
1883
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1884
|
+
.optional(),
|
|
1885
|
+
between: z
|
|
1886
|
+
.union([
|
|
1887
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1888
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
1889
|
+
])
|
|
1890
|
+
.optional(),
|
|
1352
1891
|
});
|
|
1353
1892
|
const ListInvoiceAmountPaidSchema = z.object({
|
|
1354
|
-
is: z
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1893
|
+
is: z
|
|
1894
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1895
|
+
.optional(),
|
|
1896
|
+
is_not: z
|
|
1897
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1898
|
+
.optional(),
|
|
1899
|
+
lt: z
|
|
1900
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1901
|
+
.optional(),
|
|
1902
|
+
lte: z
|
|
1903
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1904
|
+
.optional(),
|
|
1905
|
+
gt: z
|
|
1906
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1907
|
+
.optional(),
|
|
1908
|
+
gte: z
|
|
1909
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1910
|
+
.optional(),
|
|
1911
|
+
between: z
|
|
1912
|
+
.union([
|
|
1913
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1914
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
1915
|
+
])
|
|
1916
|
+
.optional(),
|
|
1361
1917
|
});
|
|
1362
1918
|
const ListInvoiceAmountAdjustedSchema = z.object({
|
|
1363
|
-
is: z
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1919
|
+
is: z
|
|
1920
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1921
|
+
.optional(),
|
|
1922
|
+
is_not: z
|
|
1923
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1924
|
+
.optional(),
|
|
1925
|
+
lt: z
|
|
1926
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1927
|
+
.optional(),
|
|
1928
|
+
lte: z
|
|
1929
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1930
|
+
.optional(),
|
|
1931
|
+
gt: z
|
|
1932
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1933
|
+
.optional(),
|
|
1934
|
+
gte: z
|
|
1935
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1936
|
+
.optional(),
|
|
1937
|
+
between: z
|
|
1938
|
+
.union([
|
|
1939
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1940
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
1941
|
+
])
|
|
1942
|
+
.optional(),
|
|
1370
1943
|
});
|
|
1371
1944
|
const ListInvoiceCreditsAppliedSchema = z.object({
|
|
1372
|
-
is: z
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1945
|
+
is: z
|
|
1946
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1947
|
+
.optional(),
|
|
1948
|
+
is_not: z
|
|
1949
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1950
|
+
.optional(),
|
|
1951
|
+
lt: z
|
|
1952
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1953
|
+
.optional(),
|
|
1954
|
+
lte: z
|
|
1955
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1956
|
+
.optional(),
|
|
1957
|
+
gt: z
|
|
1958
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1959
|
+
.optional(),
|
|
1960
|
+
gte: z
|
|
1961
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1962
|
+
.optional(),
|
|
1963
|
+
between: z
|
|
1964
|
+
.union([
|
|
1965
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1966
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
1967
|
+
])
|
|
1968
|
+
.optional(),
|
|
1379
1969
|
});
|
|
1380
1970
|
const ListInvoiceAmountDueSchema = z.object({
|
|
1381
|
-
is: z
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1971
|
+
is: z
|
|
1972
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1973
|
+
.optional(),
|
|
1974
|
+
is_not: z
|
|
1975
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1976
|
+
.optional(),
|
|
1977
|
+
lt: z
|
|
1978
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1979
|
+
.optional(),
|
|
1980
|
+
lte: z
|
|
1981
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1982
|
+
.optional(),
|
|
1983
|
+
gt: z
|
|
1984
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1985
|
+
.optional(),
|
|
1986
|
+
gte: z
|
|
1987
|
+
.union([z.number().int(), z.string().regex(RegExp('^-?\\d+$'))])
|
|
1988
|
+
.optional(),
|
|
1989
|
+
between: z
|
|
1990
|
+
.union([
|
|
1991
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
1992
|
+
z.string().regex(RegExp('^\\[-?\\d+,-?\\d+\\]$')),
|
|
1993
|
+
])
|
|
1994
|
+
.optional(),
|
|
1388
1995
|
});
|
|
1389
1996
|
const ListInvoiceDunningStatusSchema = z.object({
|
|
1390
1997
|
is: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
|
|
1391
1998
|
is_not: z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional(),
|
|
1392
|
-
in: z
|
|
1393
|
-
|
|
1394
|
-
|
|
1999
|
+
in: z
|
|
2000
|
+
.union([
|
|
2001
|
+
z.array(z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
|
|
2002
|
+
z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
|
|
2003
|
+
])
|
|
2004
|
+
.optional(),
|
|
2005
|
+
not_in: z
|
|
2006
|
+
.union([
|
|
2007
|
+
z.array(z.enum(['in_progress', 'exhausted', 'stopped', 'success']).optional()),
|
|
2008
|
+
z.enum(['in_progress', 'exhausted', 'stopped', 'success']),
|
|
2009
|
+
])
|
|
2010
|
+
.optional(),
|
|
2011
|
+
is_present: z.union([z.boolean(), z.enum(['true', 'false'])]).optional(),
|
|
1395
2012
|
});
|
|
1396
2013
|
const ListInvoicePaymentOwnerSchema = z.object({
|
|
1397
2014
|
is: z.string().min(1).optional(),
|
|
1398
2015
|
is_not: z.string().min(1).optional(),
|
|
1399
2016
|
starts_with: z.string().min(1).optional(),
|
|
1400
|
-
in: z
|
|
1401
|
-
|
|
2017
|
+
in: z
|
|
2018
|
+
.union([
|
|
2019
|
+
z.array(z.string().optional()),
|
|
2020
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2021
|
+
])
|
|
2022
|
+
.optional(),
|
|
2023
|
+
not_in: z
|
|
2024
|
+
.union([
|
|
2025
|
+
z.array(z.string().optional()),
|
|
2026
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2027
|
+
])
|
|
2028
|
+
.optional(),
|
|
1402
2029
|
});
|
|
1403
2030
|
const ListInvoiceUpdatedAtSchema = z.object({
|
|
1404
|
-
after: z
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
2031
|
+
after: z
|
|
2032
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2033
|
+
.optional(),
|
|
2034
|
+
before: z
|
|
2035
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2036
|
+
.optional(),
|
|
2037
|
+
on: z
|
|
2038
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2039
|
+
.optional(),
|
|
2040
|
+
between: z
|
|
2041
|
+
.union([
|
|
2042
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
2043
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
2044
|
+
])
|
|
2045
|
+
.optional(),
|
|
1408
2046
|
});
|
|
1409
2047
|
const ListInvoiceChannelSchema = z.object({
|
|
1410
2048
|
is: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
1411
2049
|
is_not: z.enum(['web', 'app_store', 'play_store']).optional(),
|
|
1412
|
-
in: z
|
|
1413
|
-
|
|
2050
|
+
in: z
|
|
2051
|
+
.union([
|
|
2052
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
2053
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
2054
|
+
])
|
|
2055
|
+
.optional(),
|
|
2056
|
+
not_in: z
|
|
2057
|
+
.union([
|
|
2058
|
+
z.array(z.enum(['web', 'app_store', 'play_store']).optional()),
|
|
2059
|
+
z.enum(['web', 'app_store', 'play_store']),
|
|
2060
|
+
])
|
|
2061
|
+
.optional(),
|
|
1414
2062
|
});
|
|
1415
2063
|
const ListInvoiceVoidedAtSchema = z.object({
|
|
1416
|
-
after: z
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
2064
|
+
after: z
|
|
2065
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2066
|
+
.optional(),
|
|
2067
|
+
before: z
|
|
2068
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2069
|
+
.optional(),
|
|
2070
|
+
on: z
|
|
2071
|
+
.union([z.number().int(), z.string().regex(RegExp('^\\d{10}$'))])
|
|
2072
|
+
.optional(),
|
|
2073
|
+
between: z
|
|
2074
|
+
.union([
|
|
2075
|
+
z.array(z.number().int().optional()).min(2).max(2),
|
|
2076
|
+
z.string().regex(RegExp('^\\[\\d{10},\\d{10}\\]$')),
|
|
2077
|
+
])
|
|
2078
|
+
.optional(),
|
|
1420
2079
|
});
|
|
1421
2080
|
const ListInvoiceVoidReasonCodeSchema = z.object({
|
|
1422
2081
|
is: z.string().min(1).optional(),
|
|
1423
2082
|
is_not: z.string().min(1).optional(),
|
|
1424
2083
|
starts_with: z.string().min(1).optional(),
|
|
1425
|
-
in: z
|
|
1426
|
-
|
|
2084
|
+
in: z
|
|
2085
|
+
.union([
|
|
2086
|
+
z.array(z.string().optional()),
|
|
2087
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2088
|
+
])
|
|
2089
|
+
.optional(),
|
|
2090
|
+
not_in: z
|
|
2091
|
+
.union([
|
|
2092
|
+
z.array(z.string().optional()),
|
|
2093
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2094
|
+
])
|
|
2095
|
+
.optional(),
|
|
1427
2096
|
});
|
|
1428
2097
|
const ListInvoiceSortBySchema = z.looseObject({
|
|
1429
2098
|
asc: z.enum(['date', 'updated_at']).optional(),
|
|
@@ -1496,23 +2165,31 @@ const PdfInvoiceBodySchema = z.looseObject({
|
|
|
1496
2165
|
export { PdfInvoiceBodySchema };
|
|
1497
2166
|
//Invoice.listPaymentReferenceNumbers
|
|
1498
2167
|
const ListPaymentReferenceNumbersInvoiceIdSchema = z.object({
|
|
1499
|
-
in: z
|
|
2168
|
+
in: z
|
|
2169
|
+
.union([
|
|
2170
|
+
z.array(z.string().optional()),
|
|
2171
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2172
|
+
])
|
|
2173
|
+
.optional(),
|
|
1500
2174
|
is: z.string().min(1).optional(),
|
|
1501
2175
|
});
|
|
1502
2176
|
const ListPaymentReferenceNumbersInvoiceNumberSchema = z.object({
|
|
1503
|
-
in: z
|
|
2177
|
+
in: z
|
|
2178
|
+
.union([
|
|
2179
|
+
z.array(z.string().optional()),
|
|
2180
|
+
z.string().regex(RegExp('^\\[(.*)(,.*)*\\]$')),
|
|
2181
|
+
])
|
|
2182
|
+
.optional(),
|
|
1504
2183
|
is: z.string().min(1).optional(),
|
|
1505
2184
|
});
|
|
1506
|
-
const
|
|
2185
|
+
const ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema = z.object({
|
|
1507
2186
|
number: ListPaymentReferenceNumbersInvoiceNumberSchema.optional(),
|
|
1508
2187
|
});
|
|
1509
2188
|
const ListPaymentReferenceNumbersInvoiceBodySchema = z.looseObject({
|
|
1510
2189
|
limit: z.number().int().min(1).max(100).optional(),
|
|
1511
2190
|
offset: z.string().max(1000).optional(),
|
|
1512
2191
|
id: ListPaymentReferenceNumbersInvoiceIdSchema.optional(),
|
|
1513
|
-
payment_reference_number:
|
|
1514
|
-
.array(ListPaymentReferenceNumbersInvoicePaymentReferenceNumberItemSchema.optional())
|
|
1515
|
-
.optional(),
|
|
2192
|
+
payment_reference_number: ListPaymentReferenceNumbersInvoicePaymentReferenceNumberSchema.optional(),
|
|
1516
2193
|
});
|
|
1517
2194
|
export { ListPaymentReferenceNumbersInvoiceBodySchema };
|
|
1518
2195
|
//Invoice.addCharge
|
|
@@ -1562,6 +2239,16 @@ const AddChargeItemInvoiceItemPriceSchema = z.object({
|
|
|
1562
2239
|
date_from: z.number().int().optional(),
|
|
1563
2240
|
date_to: z.number().int().optional(),
|
|
1564
2241
|
});
|
|
2242
|
+
const AddChargeItemInvoiceItemTiersItemSchema = z.object({
|
|
2243
|
+
starting_unit: z.number().int().min(1).optional(),
|
|
2244
|
+
ending_unit: z.number().int().optional(),
|
|
2245
|
+
price: z.number().int().min(0).optional(),
|
|
2246
|
+
starting_unit_in_decimal: z.string().max(33).optional(),
|
|
2247
|
+
ending_unit_in_decimal: z.string().max(33).optional(),
|
|
2248
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
2249
|
+
pricing_type: z.enum(['per_unit', 'flat_fee', 'package']).optional(),
|
|
2250
|
+
package_size: z.number().int().min(1).optional(),
|
|
2251
|
+
});
|
|
1565
2252
|
const AddChargeItemInvoiceItemTiersSchema = z.object({
|
|
1566
2253
|
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
1567
2254
|
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
@@ -1578,10 +2265,30 @@ const AddChargeItemInvoiceBodySchema = z.looseObject({
|
|
|
1578
2265
|
comment: z.string().max(300).optional(),
|
|
1579
2266
|
subscription_id: z.string().max(50).optional(),
|
|
1580
2267
|
item_price: AddChargeItemInvoiceItemPriceSchema.optional(),
|
|
1581
|
-
item_tiers:
|
|
2268
|
+
item_tiers: z
|
|
2269
|
+
.union([
|
|
2270
|
+
z.array(AddChargeItemInvoiceItemTiersItemSchema.optional()),
|
|
2271
|
+
AddChargeItemInvoiceItemTiersSchema,
|
|
2272
|
+
])
|
|
2273
|
+
.optional(),
|
|
1582
2274
|
});
|
|
1583
2275
|
export { AddChargeItemInvoiceBodySchema };
|
|
1584
2276
|
//Invoice.close
|
|
2277
|
+
const CloseInvoiceNotesToRemoveItemSchema = z.object({
|
|
2278
|
+
entity_type: z
|
|
2279
|
+
.enum([
|
|
2280
|
+
'customer',
|
|
2281
|
+
'subscription',
|
|
2282
|
+
'coupon',
|
|
2283
|
+
'plan_item_price',
|
|
2284
|
+
'addon_item_price',
|
|
2285
|
+
'charge_item_price',
|
|
2286
|
+
'plan',
|
|
2287
|
+
'addon',
|
|
2288
|
+
])
|
|
2289
|
+
.optional(),
|
|
2290
|
+
entity_id: z.string().max(100).optional(),
|
|
2291
|
+
});
|
|
1585
2292
|
const CloseInvoiceNotesToRemoveSchema = z.object({
|
|
1586
2293
|
entity_type: z
|
|
1587
2294
|
.array(z
|
|
@@ -1604,7 +2311,12 @@ const CloseInvoiceBodySchema = z.looseObject({
|
|
|
1604
2311
|
invoice_note: z.string().max(2000).optional(),
|
|
1605
2312
|
remove_general_note: z.boolean().default(false).optional(),
|
|
1606
2313
|
invoice_date: z.number().int().optional(),
|
|
1607
|
-
notes_to_remove:
|
|
2314
|
+
notes_to_remove: z
|
|
2315
|
+
.union([
|
|
2316
|
+
z.array(CloseInvoiceNotesToRemoveItemSchema.optional()),
|
|
2317
|
+
CloseInvoiceNotesToRemoveSchema,
|
|
2318
|
+
])
|
|
2319
|
+
.optional(),
|
|
1608
2320
|
});
|
|
1609
2321
|
export { CloseInvoiceBodySchema };
|
|
1610
2322
|
//Invoice.collectPayment
|
|
@@ -1627,12 +2339,6 @@ const RecordPaymentInvoiceTransactionSchema = z.object({
|
|
|
1627
2339
|
'app_store',
|
|
1628
2340
|
'play_store',
|
|
1629
2341
|
'custom',
|
|
1630
|
-
'tamara',
|
|
1631
|
-
'qpay',
|
|
1632
|
-
'blik',
|
|
1633
|
-
'fpx',
|
|
1634
|
-
'wero',
|
|
1635
|
-
'p24',
|
|
1636
2342
|
]),
|
|
1637
2343
|
reference_number: z.string().max(100).optional(),
|
|
1638
2344
|
custom_payment_method_id: z.string().max(50).optional(),
|
|
@@ -1699,12 +2405,6 @@ const RecordRefundInvoiceTransactionSchema = z.object({
|
|
|
1699
2405
|
'app_store',
|
|
1700
2406
|
'play_store',
|
|
1701
2407
|
'custom',
|
|
1702
|
-
'tamara',
|
|
1703
|
-
'qpay',
|
|
1704
|
-
'blik',
|
|
1705
|
-
'fpx',
|
|
1706
|
-
'wero',
|
|
1707
|
-
'p24',
|
|
1708
2408
|
]),
|
|
1709
2409
|
reference_number: z.string().max(100).optional(),
|
|
1710
2410
|
custom_payment_method_id: z.string().max(50).optional(),
|