-
Notifications
You must be signed in to change notification settings - Fork 281
Open
Description
for vendors creating a product, they are obligated to manage the stock, while the reverses are in Medusa admin, where admin can choose freely.
export type CreateProductVariantType = z.infer<typeof CreateProductVariant>;
export const CreateProductVariant = z
.object({
title: z.string(),
sku: z.string().optional(),
ean: z.string().optional(),
upc: z.string().optional(),
barcode: z.string().optional(),
hs_code: z.string().optional(),
mid_code: z.string().optional(),
allow_backorder: z.literal(false).optional().default(false),
manage_inventory: z.literal(true).optional().default(true),
variant_rank: z.number().optional(),
weight: z.number().optional(),
length: z.number().optional(),
height: z.number().optional(),
width: z.number().optional(),
origin_country: z.string().optional(),
material: z.string().optional(),
metadata: z.record(z.unknown()).optional(),
prices: z.array(CreateVariantPrice),
options: z.record(z.string()).optional(),
inventory_items: z
.array(
z.object({
inventory_item_id: z.string(),
required_quantity: z.number(),
})
)
.optional(),
})
.strict();
Metadata
Metadata
Assignees
Labels
No labels