Skip to main content
Version: 0.13.0 (Previous)

📐 Product schemas

Product schemas define public request contracts and reusable product shapes. Reusable shapes are strict where the source sets additionalProperties: false; request contracts below preserve source locations and requiredness.

Inventory

ExportRequest locationContract
productSchemaN/AReusable strict object shape.
createProductImageSchemaBodySource-defined request contract.
ProductImageN/APublic TypeScript image shape.
NormalizedProductImageN/APublic TypeScript image shape.
productVariantSchemaN/AReusable strict object shape.
createProductSchemaBodySource-defined request contract.
updateProductSchemaPath, bodySource-defined request contract.
createProductBatchSchemaBodySource-defined request contract.
updateProductBatchSchemaBodySource-defined request contract.
deleteProductBatchSchemaBodySource-defined request contract.
copyProductBatchSchemaBodySource-defined request contract.
getProductSchemaPathSource-defined request contract.
deleteProductSchemaPathSource-defined request contract.
copyProductSchemaPathSource-defined request contract.
findProductsSchemaQuerySource-defined request contract.
deleteProductImageSchemaPathSource-defined request contract.
createProductVariantSchemaPath, bodySource-defined request contract.
getProductVariantSchemaPathSource-defined request contract.
updateProductVariantSchemaPath, bodySource-defined request contract.
deleteProductVariantSchemaPathSource-defined request contract.
findProductVariantsSchemaPath, QuerySource-defined request contract.
createProductVariantBulkSchemaPath, bodySource-defined request contract.
updateProductVariantBulkSchemaPath, bodySource-defined request contract.
deleteProductVariantBulkSchemaPath, bodySource-defined request contract.
getProductLikersSchemaPathSource-defined request contract.

Details

productSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
N/AdescriptionstringNoadditionalProperties: false.
N/AnamestringNoadditionalProperties: false.

Used by route: None

Used by feature: None

Used by schemas: createProductSchema, updateProductSchema, createProductBatchSchema, updateProductBatchSchema.

View complete source
export const productSchema = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
description: { type: 'string' },
name: { type: 'string' },
},
type: 'object',
} as const satisfies SchemaDefinition;

createProductImageSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
BodyobjectIdstringYesUUID format; JSON body required.
BodytypestringYesJSON body required; inherited strict object.

Used by route: createProductImageRoute

Used by feature: createProductImageFeature

View complete source
export const createProductImageSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...productImageSchema,
required: ['objectId', 'type'],
},
},
},
required: true,
},
});

ProductImage

Definition

This exported TypeScript shape describes stored or normalized product image data.

LocationFieldTypeRequiredConstraints
N/AobjectIdstringYesStored image object identifier.
N/AtypestringYesStored image type.

Used by route: None

Used by feature: None

View complete source
export type ProductImage = {
objectId: string;
type: string;
};

NormalizedProductImage

Definition

This exported TypeScript shape describes stored or normalized product image data.

LocationFieldTypeRequiredConstraints
N/AurlstringYesPublic normalized URL.
N/AtypestringYesImage type.

Used by route: None

Used by feature: None

View complete source
export type NormalizedProductImage = {
url: string;
type: string;
};

productVariantSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
N/AdescriptionstringNoadditionalProperties: false.
N/AimageIdsstring[]NoArray items are strings.
N/Aprice.amountnumberNoNested price object is strict.
N/Aprice.currencystringNoNested price object is strict.
N/Aprice.taxIncludedbooleanNoNested price object is strict.
N/Aprice.taxablebooleanNoNested price object is strict.
N/AskustringNoStrict reusable shape.
N/AtitlestringNoStrict reusable shape.

Used by route: None

Used by feature: None

Used by schemas: createProductVariantSchema, updateProductVariantSchema, createProductVariantBulkSchema, updateProductVariantBulkSchema.

View complete source
export const productVariantSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
description: { type: 'string' },
// TODO: Go back and add images to update product schema and update here to follow same structure
imageIds: {
items: { type: 'string' },
type: 'array',
},
price: {
additionalProperties: false,
properties: {
amount: { type: 'number' },
currency: { type: 'string' },
taxIncluded: { type: 'boolean' },
taxable: { type: 'boolean' },
},
type: 'object',
},
sku: { type: 'string' },
title: { type: 'string' },
},
type: 'object',
};

createProductSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
BodydescriptionstringYesJSON body required; inherited from productSchema.
BodynamestringYesJSON body required; inherited from productSchema.

Used by route: createProductRoute

Used by feature: createProductFeature

View complete source
export const createProductSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...productSchema,
required: ['name', 'description'],
},
},
},
required: true,
},
});

updateProductSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
BodydescriptionstringNoJSON body itself is required; strict product shape.
BodynamestringNoJSON body itself is required; strict product shape.

Used by route: updateProductRoute

Used by feature: editProductFeatures

View complete source
export const updateProductSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
...productSchema,
required: [],
},
},
},
required: true,
},
});

createProductBatchSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
Body[]Product[]YesJSON array; each item requires name and description, using strict productSchema.

Used by route: createProductBatchRoute

Used by feature: createProductBatchFeature

View complete source
export const createProductBatchSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
items: {
...productSchema,
required: ['name', 'description'],
},
type: 'array',
},
},
},
required: true,
},
});

updateProductBatchSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
Bodyidsstring[]YesarrayOfStringsSchema.
BodydataProductYesStrict productSchema with no required fields.

Used by route: updateProductBatchRoute

Used by feature: editProductBatchFeatures

View complete source
export const updateProductBatchSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
data: { ...productSchema, required: [] },
ids: { ...arrayOfStringsSchema },
},
required: ['ids', 'data'],
type: 'object',
},
},
},
required: true,
},
});

deleteProductBatchSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
Body[]string[]YesarrayOfStringsSchema; JSON body required.

Used by route: deleteProductBatchRoute

Used by feature: deleteProductBatchFeatures

View complete source
export const deleteProductBatchSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...arrayOfStringsSchema,
},
},
},
required: true,
},
});

copyProductBatchSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
Body[]string[]YesarrayOfStringsSchema; JSON body required.

Used by route: copyProductBatchRoute

Used by feature: copyProductBatchFeatures

View complete source
export const copyProductBatchSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...arrayOfStringsSchema,
},
},
},
required: true,
},
});

getProductSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.

Used by route: getProductRoute

Used by feature: getProductFeatures

View complete source
export const getProductSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
});

deleteProductSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.

Used by route: deleteProductRoute

Used by feature: deleteProductFeatures

View complete source
export const deleteProductSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
});

copyProductSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.

Used by route: copyProductRoute

Used by feature: copyProductFeatures

View complete source
export const copyProductSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
});

findProductsSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
QuerynamestringNoProduct name filter.
QuerydescriptionstringNoProduct description filter.
Querypagination parametersSharedNoSpread from paginationQueryParametersSchema.

Used by route: findProductsRoute

Used by feature: findProductsFeatures

View complete source
export const findProductsSchema = withSchema({
parameters: [
{
in: 'query',
name: 'name',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'description',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

deleteProductImageSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
PathimageIdstringYesShared path parameter.

Used by route: deleteProductImageRoute

Used by feature: deleteProductImageFeature

View complete source
export const deleteProductImageSchema = withSchema({
parameters: [{ ...productIdPathParameter }, { ...imageIdPathParameter }],
});

createProductVariantSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
BodytitlestringYesJSON body required; strict variant shape.
Bodydescription, imageIds, price, skuVariant fieldsNoInherited from productVariantSchema.

Used by route: createProductVariantRoute

Used by feature: createProductVariantFeature

View complete source
export const createProductVariantSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
...productVariantSchema,
required: ['title'],
},
},
},
required: true,
},
});

getProductVariantSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
PathproductVariantIdstringYesShared path parameter.

Used by route: getProductVariantRoute

Used by feature: getProductVariantFeature

View complete source
export const getProductVariantSchema = withSchema({
parameters: [
{ ...productIdPathParameter },
{ ...productVariantIdPathParameter },
],
});

updateProductVariantSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
PathproductVariantIdstringYesShared path parameter.
Bodyvariant fieldsproductVariantSchemaNoBody is present in the operation but requestBody.required is omitted.

Used by route: updateProductVariantRoute

Used by feature: updateProductVariantFeature

View complete source
export const updateProductVariantSchema = withSchema({
parameters: [
{ ...productIdPathParameter },
{ ...productVariantIdPathParameter },
],
requestBody: {
content: {
'application/json': {
schema: {
...productVariantSchema,
required: [],
},
},
},
},
});

deleteProductVariantSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
PathproductVariantIdstringYesShared path parameter.

Used by route: deleteProductVariantRoute

Used by feature: deleteProductVariantFeature

View complete source
export const deleteProductVariantSchema = withSchema({
parameters: [
{ ...productIdPathParameter },
{ ...productVariantIdPathParameter },
],
});

findProductVariantsSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
Querypagination parametersSharedNoSpread from paginationQueryParametersSchema.

Used by route: findProductVariantsRoute

Used by feature: findProductVariantsFeature

View complete source
export const findProductVariantsSchema = withSchema({
parameters: [
{ ...productIdPathParameter },
...paginationQueryParametersSchema,
],
});

createProductVariantBulkSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
Body[]ProductVariant[]YesJSON array, 1–100 items; each requires title.

Used by route: createProductVariantBulkRoute

Used by feature: createProductVariantBulkFeature

View complete source
export const createProductVariantBulkSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
items: {
...productVariantSchema,
required: ['title'],
},
maxItems: 100,
minItems: 1,
type: 'array',
},
},
},
required: true,
},
});

updateProductVariantBulkSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
Bodyidsstring[]YesarrayOfStringsSchema, 1–100 items.
BodydataobjectYesVariant properties, no required nested fields.

Used by route: updateProductVariantBulkRoute

Used by feature: updateProductVariantBulkFeature

View complete source
export const updateProductVariantBulkSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
...productVariantSchema,
properties: {
data: {
properties: { ...productVariantSchema.properties },
required: [],
type: 'object',
},
ids: { ...arrayOfStringsSchema, maxItems: 100, minItems: 1 },
},
required: ['ids', 'data'],
},
},
},
},
});

deleteProductVariantBulkSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.
Body[]string[]YesarrayOfStringsSchema, 1–100 items.

Used by route: deleteProductVariantBulkRoute

Used by feature: deleteProductVariantBulkFeature

View complete source
export const deleteProductVariantBulkSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
...arrayOfStringsSchema,
maxItems: 100,
minItems: 1,
},
},
},
required: true,
},
});

getProductLikersSchema

Definition

This export defines the source-backed request or reusable validation shape.

LocationFieldTypeRequiredConstraints
PathproductIdstringYesShared path parameter.

Used by route: getProductLikersRoute

Used by feature: getProductLikersFeature

View complete source
export const getProductLikersSchema = withSchema({
parameters: [{ ...productIdPathParameter }],
});