chargebee 3.24.0 → 3.25.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +39 -0
- package/cjs/RequestWrapper.js +27 -0
- package/cjs/chargebee.cjs.js +3 -0
- package/cjs/chargebee.cjs.worker.js +2 -0
- package/cjs/chargebeeZodValidationError.js +18 -0
- package/cjs/createChargebee.js +5 -0
- package/cjs/environment.js +1 -1
- package/cjs/schema/addon.schema.js +153 -0
- package/cjs/schema/address.schema.js +35 -0
- package/cjs/schema/alert.schema.js +38 -0
- package/cjs/schema/attached_item.schema.js +58 -0
- package/cjs/schema/business_entity.schema.js +46 -0
- package/cjs/schema/card.schema.js +165 -0
- package/cjs/schema/comment.schema.js +69 -0
- package/cjs/schema/coupon.schema.js +209 -0
- package/cjs/schema/coupon_code.schema.js +14 -0
- package/cjs/schema/coupon_set.schema.js +28 -0
- package/cjs/schema/credit_note.schema.js +288 -0
- package/cjs/schema/currency.schema.js +32 -0
- package/cjs/schema/customer.schema.js +986 -0
- package/cjs/schema/customer_entitlement.schema.js +14 -0
- package/cjs/schema/differential_price.schema.js +68 -0
- package/cjs/schema/entitlement.schema.js +27 -0
- package/cjs/schema/entitlement_override.schema.js +33 -0
- package/cjs/schema/estimate.schema.js +1525 -0
- package/cjs/schema/export.schema.js +1545 -0
- package/cjs/schema/feature.schema.js +37 -0
- package/cjs/schema/gift.schema.js +277 -0
- package/cjs/schema/hosted_page.schema.js +1649 -0
- package/cjs/schema/in_app_subscription.schema.js +68 -0
- package/cjs/schema/index.js +80 -0
- package/cjs/schema/invoice.schema.js +1467 -0
- package/cjs/schema/item.schema.js +91 -0
- package/cjs/schema/item_entitlement.schema.js +45 -0
- package/cjs/schema/item_family.schema.js +21 -0
- package/cjs/schema/item_price.schema.js +190 -0
- package/cjs/schema/non_subscription.schema.js +28 -0
- package/cjs/schema/offer_event.schema.js +13 -0
- package/cjs/schema/offer_fulfillment.schema.js +20 -0
- package/cjs/schema/omnichannel_one_time_order.schema.js +26 -0
- package/cjs/schema/omnichannel_subscription.schema.js +89 -0
- package/cjs/schema/omnichannel_subscription_item.schema.js +13 -0
- package/cjs/schema/order.schema.js +273 -0
- package/cjs/schema/payment_intent.schema.js +117 -0
- package/cjs/schema/payment_schedule_scheme.schema.js +20 -0
- package/cjs/schema/payment_source.schema.js +358 -0
- package/cjs/schema/payment_voucher.schema.js +57 -0
- package/cjs/schema/personalized_offer.schema.js +28 -0
- package/cjs/schema/plan.schema.js +225 -0
- package/cjs/schema/portal_session.schema.js +22 -0
- package/cjs/schema/price_variant.schema.js +36 -0
- package/cjs/schema/pricing_page_session.schema.js +135 -0
- package/cjs/schema/promotional_credit.schema.js +78 -0
- package/cjs/schema/purchase.schema.js +272 -0
- package/cjs/schema/quote.schema.js +1557 -0
- package/cjs/schema/ramp.schema.js +209 -0
- package/cjs/schema/recorded_purchase.schema.js +32 -0
- package/cjs/schema/resource_migration.schema.js +14 -0
- package/cjs/schema/site_migration_detail.schema.js +81 -0
- package/cjs/schema/subscription.schema.js +2993 -0
- package/cjs/schema/subscription_entitlement.schema.js +25 -0
- package/cjs/schema/time_machine.schema.js +17 -0
- package/cjs/schema/transaction.schema.js +70 -0
- package/cjs/schema/unbilled_charge.schema.js +113 -0
- package/cjs/schema/usage.schema.js +93 -0
- package/cjs/schema/usage_charge.schema.js +17 -0
- package/cjs/schema/usage_event.schema.js +28 -0
- package/cjs/schema/usage_file.schema.js +13 -0
- package/cjs/schema/usage_summary.schema.js +17 -0
- package/cjs/schema/virtual_bank_account.schema.js +43 -0
- package/cjs/schema/webhook_endpoint.schema.js +504 -0
- package/cjs/validationLoader.js +59 -0
- package/esm/RequestWrapper.js +27 -0
- package/esm/chargebee.esm.js +2 -0
- package/esm/chargebee.esm.worker.js +1 -0
- package/esm/chargebeeZodValidationError.js +14 -0
- package/esm/createChargebee.js +5 -0
- package/esm/environment.js +1 -1
- package/esm/schema/addon.schema.js +150 -0
- package/esm/schema/address.schema.js +32 -0
- package/esm/schema/alert.schema.js +35 -0
- package/esm/schema/attached_item.schema.js +55 -0
- package/esm/schema/business_entity.schema.js +43 -0
- package/esm/schema/card.schema.js +162 -0
- package/esm/schema/comment.schema.js +66 -0
- package/esm/schema/coupon.schema.js +206 -0
- package/esm/schema/coupon_code.schema.js +11 -0
- package/esm/schema/coupon_set.schema.js +25 -0
- package/esm/schema/credit_note.schema.js +285 -0
- package/esm/schema/currency.schema.js +29 -0
- package/esm/schema/customer.schema.js +983 -0
- package/esm/schema/customer_entitlement.schema.js +11 -0
- package/esm/schema/differential_price.schema.js +65 -0
- package/esm/schema/entitlement.schema.js +24 -0
- package/esm/schema/entitlement_override.schema.js +30 -0
- package/esm/schema/estimate.schema.js +1522 -0
- package/esm/schema/export.schema.js +1542 -0
- package/esm/schema/feature.schema.js +34 -0
- package/esm/schema/gift.schema.js +274 -0
- package/esm/schema/hosted_page.schema.js +1646 -0
- package/esm/schema/in_app_subscription.schema.js +65 -0
- package/esm/schema/index.js +64 -0
- package/esm/schema/invoice.schema.js +1464 -0
- package/esm/schema/item.schema.js +88 -0
- package/esm/schema/item_entitlement.schema.js +42 -0
- package/esm/schema/item_family.schema.js +18 -0
- package/esm/schema/item_price.schema.js +187 -0
- package/esm/schema/non_subscription.schema.js +25 -0
- package/esm/schema/offer_event.schema.js +10 -0
- package/esm/schema/offer_fulfillment.schema.js +17 -0
- package/esm/schema/omnichannel_one_time_order.schema.js +23 -0
- package/esm/schema/omnichannel_subscription.schema.js +86 -0
- package/esm/schema/omnichannel_subscription_item.schema.js +10 -0
- package/esm/schema/order.schema.js +270 -0
- package/esm/schema/payment_intent.schema.js +114 -0
- package/esm/schema/payment_schedule_scheme.schema.js +17 -0
- package/esm/schema/payment_source.schema.js +355 -0
- package/esm/schema/payment_voucher.schema.js +54 -0
- package/esm/schema/personalized_offer.schema.js +25 -0
- package/esm/schema/plan.schema.js +222 -0
- package/esm/schema/portal_session.schema.js +19 -0
- package/esm/schema/price_variant.schema.js +33 -0
- package/esm/schema/pricing_page_session.schema.js +132 -0
- package/esm/schema/promotional_credit.schema.js +75 -0
- package/esm/schema/purchase.schema.js +269 -0
- package/esm/schema/quote.schema.js +1554 -0
- package/esm/schema/ramp.schema.js +206 -0
- package/esm/schema/recorded_purchase.schema.js +29 -0
- package/esm/schema/resource_migration.schema.js +11 -0
- package/esm/schema/site_migration_detail.schema.js +78 -0
- package/esm/schema/subscription.schema.js +2990 -0
- package/esm/schema/subscription_entitlement.schema.js +22 -0
- package/esm/schema/time_machine.schema.js +14 -0
- package/esm/schema/transaction.schema.js +67 -0
- package/esm/schema/unbilled_charge.schema.js +110 -0
- package/esm/schema/usage.schema.js +90 -0
- package/esm/schema/usage_charge.schema.js +14 -0
- package/esm/schema/usage_event.schema.js +25 -0
- package/esm/schema/usage_file.schema.js +10 -0
- package/esm/schema/usage_summary.schema.js +14 -0
- package/esm/schema/virtual_bank_account.schema.js +40 -0
- package/esm/schema/webhook_endpoint.schema.js +501 -0
- package/esm/validationLoader.js +56 -0
- package/package.json +4 -1
- package/types/core.d.ts +2 -0
- package/types/index.d.ts +16 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Generated Zod schemas: Item
|
|
2
|
+
// Actions: create, update
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//Item.create
|
|
6
|
+
const CreateItemMetadataSchema = z.looseObject({});
|
|
7
|
+
const CreateItemBundleConfigurationSchema = z.object({
|
|
8
|
+
type: z.enum(['fixed']).optional(),
|
|
9
|
+
});
|
|
10
|
+
const CreateItemBundleItemsToAddSchema = z.object({
|
|
11
|
+
item_id: z.array(z.string().max(100).optional()).optional(),
|
|
12
|
+
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
13
|
+
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
14
|
+
price_allocation: z.array(z.number().min(0).max(100).optional()).optional(),
|
|
15
|
+
});
|
|
16
|
+
const CreateItemBodySchema = z.looseObject({
|
|
17
|
+
id: z.string().max(100),
|
|
18
|
+
name: z.string().max(100),
|
|
19
|
+
type: z.enum(['plan', 'addon', 'charge']),
|
|
20
|
+
description: z.string().max(2000).optional(),
|
|
21
|
+
item_family_id: z.string().max(100),
|
|
22
|
+
is_giftable: z.boolean().default(false).optional(),
|
|
23
|
+
is_shippable: z.boolean().default(false).optional(),
|
|
24
|
+
external_name: z.string().max(100).optional(),
|
|
25
|
+
enabled_in_portal: z.boolean().default(true).optional(),
|
|
26
|
+
redirect_url: z.string().max(500).optional(),
|
|
27
|
+
enabled_for_checkout: z.boolean().default(true).optional(),
|
|
28
|
+
item_applicability: z.enum(['all', 'restricted']).optional(),
|
|
29
|
+
applicable_items: z.array(z.string().max(100).optional()).optional(),
|
|
30
|
+
unit: z.string().max(30).optional(),
|
|
31
|
+
gift_claim_redirect_url: z.string().max(500).optional(),
|
|
32
|
+
included_in_mrr: z.boolean().optional(),
|
|
33
|
+
metered: z.boolean().default(false).optional(),
|
|
34
|
+
usage_calculation: z
|
|
35
|
+
.enum(['sum_of_usages', 'last_usage', 'max_usage'])
|
|
36
|
+
.optional(),
|
|
37
|
+
is_percentage_pricing: z.boolean().default(false).optional(),
|
|
38
|
+
metadata: CreateItemMetadataSchema.optional(),
|
|
39
|
+
business_entity_id: z.string().max(50).optional(),
|
|
40
|
+
bundle_configuration: CreateItemBundleConfigurationSchema.optional(),
|
|
41
|
+
bundle_items_to_add: CreateItemBundleItemsToAddSchema.optional(),
|
|
42
|
+
});
|
|
43
|
+
export { CreateItemBodySchema };
|
|
44
|
+
//Item.update
|
|
45
|
+
const UpdateItemMetadataSchema = z.looseObject({});
|
|
46
|
+
const UpdateItemBundleConfigurationSchema = z.object({
|
|
47
|
+
type: z.enum(['fixed']).optional(),
|
|
48
|
+
});
|
|
49
|
+
const UpdateItemBundleItemsToAddSchema = z.object({
|
|
50
|
+
item_id: z.array(z.string().max(100).optional()).optional(),
|
|
51
|
+
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
52
|
+
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
53
|
+
price_allocation: z.array(z.number().min(0).max(100).optional()).optional(),
|
|
54
|
+
});
|
|
55
|
+
const UpdateItemBundleItemsToUpdateSchema = z.object({
|
|
56
|
+
item_id: z.array(z.string().max(100).optional()).optional(),
|
|
57
|
+
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
58
|
+
quantity: z.array(z.number().int().min(1).optional()).optional(),
|
|
59
|
+
price_allocation: z.array(z.number().min(0).max(100).optional()).optional(),
|
|
60
|
+
});
|
|
61
|
+
const UpdateItemBundleItemsToRemoveSchema = z.object({
|
|
62
|
+
item_id: z.array(z.string().max(100).optional()).optional(),
|
|
63
|
+
item_type: z.array(z.enum(['plan', 'addon', 'charge']).optional()).optional(),
|
|
64
|
+
});
|
|
65
|
+
const UpdateItemBodySchema = z.looseObject({
|
|
66
|
+
name: z.string().max(100).optional(),
|
|
67
|
+
description: z.string().max(2000).optional(),
|
|
68
|
+
is_shippable: z.boolean().default(false).optional(),
|
|
69
|
+
external_name: z.string().max(100).optional(),
|
|
70
|
+
item_family_id: z.string().max(100).optional(),
|
|
71
|
+
enabled_in_portal: z.boolean().default(true).optional(),
|
|
72
|
+
redirect_url: z.string().max(500).optional(),
|
|
73
|
+
enabled_for_checkout: z.boolean().default(true).optional(),
|
|
74
|
+
item_applicability: z.enum(['all', 'restricted']).optional(),
|
|
75
|
+
clear_applicable_items: z.boolean().default(false).optional(),
|
|
76
|
+
applicable_items: z.array(z.string().max(100).optional()).optional(),
|
|
77
|
+
unit: z.string().max(30).optional(),
|
|
78
|
+
gift_claim_redirect_url: z.string().max(500).optional(),
|
|
79
|
+
metadata: UpdateItemMetadataSchema.optional(),
|
|
80
|
+
included_in_mrr: z.boolean().optional(),
|
|
81
|
+
status: z.enum(['active', 'archived']).optional(),
|
|
82
|
+
is_percentage_pricing: z.boolean().default(false).optional(),
|
|
83
|
+
bundle_configuration: UpdateItemBundleConfigurationSchema.optional(),
|
|
84
|
+
bundle_items_to_add: UpdateItemBundleItemsToAddSchema.optional(),
|
|
85
|
+
bundle_items_to_update: UpdateItemBundleItemsToUpdateSchema.optional(),
|
|
86
|
+
bundle_items_to_remove: UpdateItemBundleItemsToRemoveSchema.optional(),
|
|
87
|
+
});
|
|
88
|
+
export { UpdateItemBodySchema };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Generated Zod schemas: ItemEntitlement
|
|
2
|
+
// Actions: itemEntitlementsForItem, itemEntitlementsForFeature, addItemEntitlements, upsertOrRemoveItemEntitlementsForItem
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//ItemEntitlement.itemEntitlementsForItem
|
|
6
|
+
const ItemEntitlementsForItemItemEntitlementBodySchema = z.looseObject({
|
|
7
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
8
|
+
offset: z.string().max(1000).optional(),
|
|
9
|
+
include_drafts: z.boolean().default(false).optional(),
|
|
10
|
+
embed: z.string().max(1000).optional(),
|
|
11
|
+
});
|
|
12
|
+
export { ItemEntitlementsForItemItemEntitlementBodySchema };
|
|
13
|
+
//ItemEntitlement.itemEntitlementsForFeature
|
|
14
|
+
const ItemEntitlementsForFeatureItemEntitlementBodySchema = z.looseObject({
|
|
15
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
16
|
+
offset: z.string().max(1000).optional(),
|
|
17
|
+
include_drafts: z.boolean().default(false).optional(),
|
|
18
|
+
});
|
|
19
|
+
export { ItemEntitlementsForFeatureItemEntitlementBodySchema };
|
|
20
|
+
//ItemEntitlement.addItemEntitlements
|
|
21
|
+
const AddItemEntitlementsItemEntitlementItemEntitlementsSchema = z.object({
|
|
22
|
+
item_id: z.array(z.string().max(100).optional()),
|
|
23
|
+
item_type: z
|
|
24
|
+
.array(z.enum(['plan', 'addon', 'charge', 'subscription', 'item']).optional())
|
|
25
|
+
.optional(),
|
|
26
|
+
value: z.array(z.string().max(50).optional()).optional(),
|
|
27
|
+
});
|
|
28
|
+
const AddItemEntitlementsItemEntitlementBodySchema = z.looseObject({
|
|
29
|
+
action: z.enum(['upsert', 'remove']),
|
|
30
|
+
item_entitlements: AddItemEntitlementsItemEntitlementItemEntitlementsSchema.optional(),
|
|
31
|
+
});
|
|
32
|
+
export { AddItemEntitlementsItemEntitlementBodySchema };
|
|
33
|
+
//ItemEntitlement.upsertOrRemoveItemEntitlementsForItem
|
|
34
|
+
const UpsertOrRemoveItemEntitlementsForItemItemEntitlementItemEntitlementsSchema = z.object({
|
|
35
|
+
feature_id: z.array(z.string().max(50).optional()),
|
|
36
|
+
value: z.array(z.string().max(50).optional()).optional(),
|
|
37
|
+
});
|
|
38
|
+
const UpsertOrRemoveItemEntitlementsForItemItemEntitlementBodySchema = z.looseObject({
|
|
39
|
+
action: z.enum(['upsert', 'remove']),
|
|
40
|
+
item_entitlements: UpsertOrRemoveItemEntitlementsForItemItemEntitlementItemEntitlementsSchema.optional(),
|
|
41
|
+
});
|
|
42
|
+
export { UpsertOrRemoveItemEntitlementsForItemItemEntitlementBodySchema };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated Zod schemas: ItemFamily
|
|
2
|
+
// Actions: create, update
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//ItemFamily.create
|
|
6
|
+
const CreateItemFamilyBodySchema = z.looseObject({
|
|
7
|
+
id: z.string().max(50),
|
|
8
|
+
name: z.string().max(50),
|
|
9
|
+
description: z.string().max(500).optional(),
|
|
10
|
+
business_entity_id: z.string().max(50).optional(),
|
|
11
|
+
});
|
|
12
|
+
export { CreateItemFamilyBodySchema };
|
|
13
|
+
//ItemFamily.update
|
|
14
|
+
const UpdateItemFamilyBodySchema = z.looseObject({
|
|
15
|
+
name: z.string().max(50).optional(),
|
|
16
|
+
description: z.string().max(500).optional(),
|
|
17
|
+
});
|
|
18
|
+
export { UpdateItemFamilyBodySchema };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// Generated Zod schemas: ItemPrice
|
|
2
|
+
// Actions: create, update, findApplicableItems, findApplicableItemPrices
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//ItemPrice.create
|
|
6
|
+
const CreateItemPriceMetadataSchema = z.looseObject({});
|
|
7
|
+
const CreateItemPriceTaxDetailSchema = z.object({
|
|
8
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
9
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
10
|
+
hsn_code: z.string().max(50).optional(),
|
|
11
|
+
avalara_sale_type: z
|
|
12
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
13
|
+
.optional(),
|
|
14
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
15
|
+
avalara_service_type: z.number().int().optional(),
|
|
16
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
17
|
+
});
|
|
18
|
+
const CreateItemPriceAccountingDetailSchema = z.object({
|
|
19
|
+
sku: z.string().max(100).optional(),
|
|
20
|
+
accounting_code: z.string().max(100).optional(),
|
|
21
|
+
accounting_category1: z.string().max(100).optional(),
|
|
22
|
+
accounting_category2: z.string().max(100).optional(),
|
|
23
|
+
accounting_category3: z.string().max(100).optional(),
|
|
24
|
+
accounting_category4: z.string().max(100).optional(),
|
|
25
|
+
});
|
|
26
|
+
const CreateItemPriceTiersSchema = z.object({
|
|
27
|
+
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
28
|
+
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
29
|
+
price: z.array(z.number().int().min(0).optional()).optional(),
|
|
30
|
+
starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
31
|
+
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
32
|
+
price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
33
|
+
pricing_type: z
|
|
34
|
+
.array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
|
|
35
|
+
.optional(),
|
|
36
|
+
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
37
|
+
});
|
|
38
|
+
const CreateItemPriceTaxProvidersFieldsSchema = z.object({
|
|
39
|
+
provider_name: z.array(z.string().max(50).optional()),
|
|
40
|
+
field_id: z.array(z.string().max(50).optional()),
|
|
41
|
+
field_value: z.array(z.string().max(50).optional()),
|
|
42
|
+
});
|
|
43
|
+
const CreateItemPriceBodySchema = z.looseObject({
|
|
44
|
+
id: z.string().max(100),
|
|
45
|
+
name: z.string().max(100),
|
|
46
|
+
description: z.string().max(2000).optional(),
|
|
47
|
+
item_id: z.string().max(100),
|
|
48
|
+
invoice_notes: z.string().max(2000).optional(),
|
|
49
|
+
proration_type: z
|
|
50
|
+
.enum(['site_default', 'partial_term', 'full_term'])
|
|
51
|
+
.optional(),
|
|
52
|
+
external_name: z.string().max(100).optional(),
|
|
53
|
+
currency_code: z.string().max(3).optional(),
|
|
54
|
+
price_variant_id: z.string().max(100).optional(),
|
|
55
|
+
is_taxable: z.boolean().default(true).optional(),
|
|
56
|
+
free_quantity: z.number().int().min(0).optional(),
|
|
57
|
+
free_quantity_in_decimal: z.string().max(33).optional(),
|
|
58
|
+
metadata: CreateItemPriceMetadataSchema.optional(),
|
|
59
|
+
show_description_in_invoices: z.boolean().default(false).optional(),
|
|
60
|
+
show_description_in_quotes: z.boolean().default(false).optional(),
|
|
61
|
+
usage_accumulation_reset_frequency: z
|
|
62
|
+
.enum(['never', 'subscription_billing_frequency'])
|
|
63
|
+
.optional(),
|
|
64
|
+
business_entity_id: z.string().max(50).optional(),
|
|
65
|
+
pricing_model: z
|
|
66
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
67
|
+
.optional(),
|
|
68
|
+
price: z.number().int().min(0).optional(),
|
|
69
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
70
|
+
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
71
|
+
period: z.number().int().min(1).optional(),
|
|
72
|
+
trial_period_unit: z.enum(['day', 'month']).optional(),
|
|
73
|
+
trial_period: z.number().int().min(0).optional(),
|
|
74
|
+
shipping_period: z.number().int().min(1).optional(),
|
|
75
|
+
shipping_period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
76
|
+
billing_cycles: z.number().int().min(1).optional(),
|
|
77
|
+
trial_end_action: z
|
|
78
|
+
.enum(['site_default', 'activate_subscription', 'cancel_subscription'])
|
|
79
|
+
.optional(),
|
|
80
|
+
tax_detail: CreateItemPriceTaxDetailSchema.optional(),
|
|
81
|
+
accounting_detail: CreateItemPriceAccountingDetailSchema.optional(),
|
|
82
|
+
tiers: CreateItemPriceTiersSchema.optional(),
|
|
83
|
+
tax_providers_fields: CreateItemPriceTaxProvidersFieldsSchema.optional(),
|
|
84
|
+
});
|
|
85
|
+
export { CreateItemPriceBodySchema };
|
|
86
|
+
//ItemPrice.update
|
|
87
|
+
const UpdateItemPriceMetadataSchema = z.looseObject({});
|
|
88
|
+
const UpdateItemPriceTaxDetailSchema = z.object({
|
|
89
|
+
tax_profile_id: z.string().max(50).optional(),
|
|
90
|
+
avalara_tax_code: z.string().max(50).optional(),
|
|
91
|
+
hsn_code: z.string().max(50).optional(),
|
|
92
|
+
avalara_sale_type: z
|
|
93
|
+
.enum(['wholesale', 'retail', 'consumed', 'vendor_use'])
|
|
94
|
+
.optional(),
|
|
95
|
+
avalara_transaction_type: z.number().int().optional(),
|
|
96
|
+
avalara_service_type: z.number().int().optional(),
|
|
97
|
+
taxjar_product_code: z.string().max(50).optional(),
|
|
98
|
+
});
|
|
99
|
+
const UpdateItemPriceAccountingDetailSchema = z.object({
|
|
100
|
+
sku: z.string().max(100).optional(),
|
|
101
|
+
accounting_code: z.string().max(100).optional(),
|
|
102
|
+
accounting_category1: z.string().max(100).optional(),
|
|
103
|
+
accounting_category2: z.string().max(100).optional(),
|
|
104
|
+
accounting_category3: z.string().max(100).optional(),
|
|
105
|
+
accounting_category4: z.string().max(100).optional(),
|
|
106
|
+
});
|
|
107
|
+
const UpdateItemPriceTiersSchema = z.object({
|
|
108
|
+
starting_unit: z.array(z.number().int().min(1).optional()).optional(),
|
|
109
|
+
ending_unit: z.array(z.number().int().optional()).optional(),
|
|
110
|
+
price: z.array(z.number().int().min(0).optional()).optional(),
|
|
111
|
+
starting_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
112
|
+
ending_unit_in_decimal: z.array(z.string().max(33).optional()).optional(),
|
|
113
|
+
price_in_decimal: z.array(z.string().max(39).optional()).optional(),
|
|
114
|
+
pricing_type: z
|
|
115
|
+
.array(z.enum(['per_unit', 'flat_fee', 'package']).optional())
|
|
116
|
+
.optional(),
|
|
117
|
+
package_size: z.array(z.number().int().min(1).optional()).optional(),
|
|
118
|
+
});
|
|
119
|
+
const UpdateItemPriceTaxProvidersFieldsSchema = z.object({
|
|
120
|
+
provider_name: z.array(z.string().max(50).optional()),
|
|
121
|
+
field_id: z.array(z.string().max(50).optional()),
|
|
122
|
+
field_value: z.array(z.string().max(50).optional()),
|
|
123
|
+
});
|
|
124
|
+
const UpdateItemPriceBodySchema = z.looseObject({
|
|
125
|
+
name: z.string().max(100).optional(),
|
|
126
|
+
description: z.string().max(2000).optional(),
|
|
127
|
+
proration_type: z
|
|
128
|
+
.enum(['site_default', 'partial_term', 'full_term'])
|
|
129
|
+
.optional(),
|
|
130
|
+
price_variant_id: z.string().max(100).optional(),
|
|
131
|
+
status: z.enum(['active', 'archived']).optional(),
|
|
132
|
+
external_name: z.string().max(100).optional(),
|
|
133
|
+
usage_accumulation_reset_frequency: z
|
|
134
|
+
.enum(['never', 'subscription_billing_frequency'])
|
|
135
|
+
.optional(),
|
|
136
|
+
currency_code: z.string().max(3).optional(),
|
|
137
|
+
invoice_notes: z.string().max(2000).optional(),
|
|
138
|
+
is_taxable: z.boolean().default(true).optional(),
|
|
139
|
+
free_quantity: z.number().int().min(0).optional(),
|
|
140
|
+
free_quantity_in_decimal: z.string().max(33).optional(),
|
|
141
|
+
metadata: UpdateItemPriceMetadataSchema.optional(),
|
|
142
|
+
pricing_model: z
|
|
143
|
+
.enum(['flat_fee', 'per_unit', 'tiered', 'volume', 'stairstep'])
|
|
144
|
+
.optional(),
|
|
145
|
+
price: z.number().int().min(0).optional(),
|
|
146
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
147
|
+
period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
148
|
+
period: z.number().int().min(1).optional(),
|
|
149
|
+
trial_period_unit: z.enum(['day', 'month']).optional(),
|
|
150
|
+
trial_period: z.number().int().min(0).optional(),
|
|
151
|
+
shipping_period: z.number().int().min(1).optional(),
|
|
152
|
+
shipping_period_unit: z.enum(['day', 'week', 'month', 'year']).optional(),
|
|
153
|
+
billing_cycles: z.number().int().min(1).optional(),
|
|
154
|
+
trial_end_action: z
|
|
155
|
+
.enum(['site_default', 'activate_subscription', 'cancel_subscription'])
|
|
156
|
+
.optional(),
|
|
157
|
+
show_description_in_invoices: z.boolean().optional(),
|
|
158
|
+
show_description_in_quotes: z.boolean().optional(),
|
|
159
|
+
tax_detail: UpdateItemPriceTaxDetailSchema.optional(),
|
|
160
|
+
accounting_detail: UpdateItemPriceAccountingDetailSchema.optional(),
|
|
161
|
+
tiers: UpdateItemPriceTiersSchema.optional(),
|
|
162
|
+
tax_providers_fields: UpdateItemPriceTaxProvidersFieldsSchema.optional(),
|
|
163
|
+
});
|
|
164
|
+
export { UpdateItemPriceBodySchema };
|
|
165
|
+
//ItemPrice.findApplicableItems
|
|
166
|
+
const FindApplicableItemsItemPriceSortBySchema = z.looseObject({
|
|
167
|
+
asc: z.enum(['name', 'id', 'updated_at']).optional(),
|
|
168
|
+
desc: z.enum(['name', 'id', 'updated_at']).optional(),
|
|
169
|
+
});
|
|
170
|
+
const FindApplicableItemsItemPriceBodySchema = z.looseObject({
|
|
171
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
172
|
+
offset: z.string().max(1000).optional(),
|
|
173
|
+
sort_by: FindApplicableItemsItemPriceSortBySchema.optional(),
|
|
174
|
+
});
|
|
175
|
+
export { FindApplicableItemsItemPriceBodySchema };
|
|
176
|
+
//ItemPrice.findApplicableItemPrices
|
|
177
|
+
const FindApplicableItemPricesItemPriceSortBySchema = z.looseObject({
|
|
178
|
+
asc: z.enum(['name', 'id', 'updated_at']).optional(),
|
|
179
|
+
desc: z.enum(['name', 'id', 'updated_at']).optional(),
|
|
180
|
+
});
|
|
181
|
+
const FindApplicableItemPricesItemPriceBodySchema = z.looseObject({
|
|
182
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
183
|
+
offset: z.string().max(1000).optional(),
|
|
184
|
+
item_id: z.string().max(100).optional(),
|
|
185
|
+
sort_by: FindApplicableItemPricesItemPriceSortBySchema.optional(),
|
|
186
|
+
});
|
|
187
|
+
export { FindApplicableItemPricesItemPriceBodySchema };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Generated Zod schemas: NonSubscription
|
|
2
|
+
// Actions: processReceipt
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//NonSubscription.processReceipt
|
|
6
|
+
const ProcessReceiptNonSubscriptionProductSchema = z.object({
|
|
7
|
+
id: z.string().max(96),
|
|
8
|
+
currency_code: z.string().max(3),
|
|
9
|
+
price: z.number().int().min(0),
|
|
10
|
+
type: z.enum(['consumable', 'non_consumable', 'non_renewing_subscription']),
|
|
11
|
+
name: z.string().max(96).optional(),
|
|
12
|
+
price_in_decimal: z.string().max(39).optional(),
|
|
13
|
+
});
|
|
14
|
+
const ProcessReceiptNonSubscriptionCustomerSchema = z.object({
|
|
15
|
+
id: z.string().max(50).optional(),
|
|
16
|
+
email: z.string().email().max(70).optional(),
|
|
17
|
+
first_name: z.string().max(150).optional(),
|
|
18
|
+
last_name: z.string().max(150).optional(),
|
|
19
|
+
});
|
|
20
|
+
const ProcessReceiptNonSubscriptionBodySchema = z.looseObject({
|
|
21
|
+
receipt: z.string().max(65000),
|
|
22
|
+
product: ProcessReceiptNonSubscriptionProductSchema.optional(),
|
|
23
|
+
customer: ProcessReceiptNonSubscriptionCustomerSchema.optional(),
|
|
24
|
+
});
|
|
25
|
+
export { ProcessReceiptNonSubscriptionBodySchema };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated Zod schemas: OfferEvent
|
|
2
|
+
// Actions: offerEvents
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//OfferEvent.offerEvents
|
|
6
|
+
const OfferEventsOfferEventBodySchema = z.looseObject({
|
|
7
|
+
personalized_offer_id: z.string().max(50),
|
|
8
|
+
type: z.enum(['viewed', 'dismissed']),
|
|
9
|
+
});
|
|
10
|
+
export { OfferEventsOfferEventBodySchema };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Generated Zod schemas: OfferFulfillment
|
|
2
|
+
// Actions: offerFulfillments, offerFulfillmentsUpdate
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//OfferFulfillment.offerFulfillments
|
|
6
|
+
const OfferFulfillmentsOfferFulfillmentBodySchema = z.looseObject({
|
|
7
|
+
personalized_offer_id: z.string().max(50),
|
|
8
|
+
option_id: z.string().max(50),
|
|
9
|
+
});
|
|
10
|
+
export { OfferFulfillmentsOfferFulfillmentBodySchema };
|
|
11
|
+
//OfferFulfillment.offerFulfillmentsUpdate
|
|
12
|
+
const OfferFulfillmentsUpdateOfferFulfillmentBodySchema = z.looseObject({
|
|
13
|
+
id: z.string().max(50),
|
|
14
|
+
status: z.enum(['completed', 'failed']),
|
|
15
|
+
failure_reason: z.string().max(100).optional(),
|
|
16
|
+
});
|
|
17
|
+
export { OfferFulfillmentsUpdateOfferFulfillmentBodySchema };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Generated Zod schemas: OmnichannelOneTimeOrder
|
|
2
|
+
// Actions: list
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//OmnichannelOneTimeOrder.list
|
|
6
|
+
const ListOmnichannelOneTimeOrderSourceSchema = z.object({
|
|
7
|
+
is: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
8
|
+
is_not: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
9
|
+
in: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
10
|
+
not_in: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
11
|
+
});
|
|
12
|
+
const ListOmnichannelOneTimeOrderCustomerIdSchema = z.object({
|
|
13
|
+
is: z.string().min(1).optional(),
|
|
14
|
+
is_not: z.string().min(1).optional(),
|
|
15
|
+
starts_with: z.string().min(1).optional(),
|
|
16
|
+
});
|
|
17
|
+
const ListOmnichannelOneTimeOrderBodySchema = z.looseObject({
|
|
18
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
19
|
+
offset: z.string().max(1000).optional(),
|
|
20
|
+
source: ListOmnichannelOneTimeOrderSourceSchema.optional(),
|
|
21
|
+
customer_id: ListOmnichannelOneTimeOrderCustomerIdSchema.optional(),
|
|
22
|
+
});
|
|
23
|
+
export { ListOmnichannelOneTimeOrderBodySchema };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Generated Zod schemas: OmnichannelSubscription
|
|
2
|
+
// Actions: list, omnichannel_transactionsForOmnichannelSubscription, move
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//OmnichannelSubscription.list
|
|
6
|
+
const ListOmnichannelSubscriptionSourceSchema = z.object({
|
|
7
|
+
is: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
8
|
+
is_not: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
9
|
+
in: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
10
|
+
not_in: z.enum(['apple_app_store', 'google_play_store']).optional(),
|
|
11
|
+
});
|
|
12
|
+
const ListOmnichannelSubscriptionCustomerIdSchema = z.object({
|
|
13
|
+
is: z.string().min(1).optional(),
|
|
14
|
+
is_not: z.string().min(1).optional(),
|
|
15
|
+
starts_with: z.string().min(1).optional(),
|
|
16
|
+
});
|
|
17
|
+
const ListOmnichannelSubscriptionStatusSchema = z.object({
|
|
18
|
+
is: z
|
|
19
|
+
.enum([
|
|
20
|
+
'active',
|
|
21
|
+
'expired',
|
|
22
|
+
'cancelled',
|
|
23
|
+
'in_dunning',
|
|
24
|
+
'in_grace_period',
|
|
25
|
+
'paused',
|
|
26
|
+
])
|
|
27
|
+
.optional(),
|
|
28
|
+
is_not: z
|
|
29
|
+
.enum([
|
|
30
|
+
'active',
|
|
31
|
+
'expired',
|
|
32
|
+
'cancelled',
|
|
33
|
+
'in_dunning',
|
|
34
|
+
'in_grace_period',
|
|
35
|
+
'paused',
|
|
36
|
+
])
|
|
37
|
+
.optional(),
|
|
38
|
+
in: z
|
|
39
|
+
.enum([
|
|
40
|
+
'active',
|
|
41
|
+
'expired',
|
|
42
|
+
'cancelled',
|
|
43
|
+
'in_dunning',
|
|
44
|
+
'in_grace_period',
|
|
45
|
+
'paused',
|
|
46
|
+
])
|
|
47
|
+
.optional(),
|
|
48
|
+
not_in: z
|
|
49
|
+
.enum([
|
|
50
|
+
'active',
|
|
51
|
+
'expired',
|
|
52
|
+
'cancelled',
|
|
53
|
+
'in_dunning',
|
|
54
|
+
'in_grace_period',
|
|
55
|
+
'paused',
|
|
56
|
+
])
|
|
57
|
+
.optional(),
|
|
58
|
+
});
|
|
59
|
+
const ListOmnichannelSubscriptionItemIdAtSourceSchema = z.object({
|
|
60
|
+
is: z.string().min(1).optional(),
|
|
61
|
+
is_not: z.string().min(1).optional(),
|
|
62
|
+
starts_with: z.string().min(1).optional(),
|
|
63
|
+
});
|
|
64
|
+
const ListOmnichannelSubscriptionOmnichannelSubscriptionItemSchema = z.object({
|
|
65
|
+
status: ListOmnichannelSubscriptionStatusSchema.optional(),
|
|
66
|
+
item_id_at_source: ListOmnichannelSubscriptionItemIdAtSourceSchema.optional(),
|
|
67
|
+
});
|
|
68
|
+
const ListOmnichannelSubscriptionBodySchema = z.looseObject({
|
|
69
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
70
|
+
offset: z.string().max(1000).optional(),
|
|
71
|
+
source: ListOmnichannelSubscriptionSourceSchema.optional(),
|
|
72
|
+
customer_id: ListOmnichannelSubscriptionCustomerIdSchema.optional(),
|
|
73
|
+
omnichannel_subscription_item: ListOmnichannelSubscriptionOmnichannelSubscriptionItemSchema.optional(),
|
|
74
|
+
});
|
|
75
|
+
export { ListOmnichannelSubscriptionBodySchema };
|
|
76
|
+
//OmnichannelSubscription.omnichannel_transactionsForOmnichannelSubscription
|
|
77
|
+
const OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBodySchema = z.looseObject({
|
|
78
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
79
|
+
offset: z.string().max(1000).optional(),
|
|
80
|
+
});
|
|
81
|
+
export { OmnichannelTransactionsforomnichannelsubscriptionOmnichannelSubscriptionBodySchema };
|
|
82
|
+
//OmnichannelSubscription.move
|
|
83
|
+
const MoveOmnichannelSubscriptionBodySchema = z.looseObject({
|
|
84
|
+
to_customer_id: z.string().max(50),
|
|
85
|
+
});
|
|
86
|
+
export { MoveOmnichannelSubscriptionBodySchema };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated Zod schemas: OmnichannelSubscriptionItem
|
|
2
|
+
// Actions: listOmniSubItemScheduleChanges
|
|
3
|
+
// Do not edit manually – regenerate via sdk-generator
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
//OmnichannelSubscriptionItem.listOmniSubItemScheduleChanges
|
|
6
|
+
const ListOmniSubItemScheduleChangesOmnichannelSubscriptionItemBodySchema = z.looseObject({
|
|
7
|
+
limit: z.number().int().min(1).max(100).optional(),
|
|
8
|
+
offset: z.string().max(1000).optional(),
|
|
9
|
+
});
|
|
10
|
+
export { ListOmniSubItemScheduleChangesOmnichannelSubscriptionItemBodySchema };
|