diff --git a/.gitignore b/.gitignore index f7824810..b0a4d6fa 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,7 @@ dist-schema/ # Local Netlify folder .netlify -*.tsbuildinfo \ No newline at end of file +*.tsbuildinfo + +# Bundled sdk specs +packages/sdks/specs/bundled/ \ No newline at end of file diff --git a/examples/simple/e2e/product-list-page.spec.ts b/examples/simple/e2e/product-list-page.spec.ts index 9d193c82..f6c29613 100644 --- a/examples/simple/e2e/product-list-page.spec.ts +++ b/examples/simple/e2e/product-list-page.spec.ts @@ -1,6 +1,6 @@ import { test, expect } from "@playwright/test"; import { gateway } from "@elasticpath/js-sdk"; -import { buildSiteNavigation } from "../src/lib/build-site-navigation"; +import { buildSiteNavigation } from "@elasticpath/react-shopper-hooks"; const host = process.env.NEXT_PUBLIC_EPCC_ENDPOINT_URL; const client_id = process.env.NEXT_PUBLIC_EPCC_CLIENT_ID; @@ -19,9 +19,8 @@ test("should be able to use quick view to view full product details", async ({ /* Get the cart id from the cookie */ const allCookies = await page.context().cookies(); - const cartId = allCookies.find( - (cookie) => cookie.name === "_store_ep_cart", - )?.value; + const cartId = allCookies.find((cookie) => cookie.name === "_store_ep_cart") + ?.value; const nav = await buildSiteNavigation(client); @@ -34,7 +33,7 @@ test("should be able to use quick view to view full product details", async ({ ); } - await page.getByRole("button", {name: "Shop Now"}).click(); + await page.getByRole("button", { name: "Shop Now" }).click(); /* Check to make sure the page has navigated to the product list page for Men's / T-Shirts */ await expect(page).toHaveURL(`/search`); diff --git a/examples/simple/package.json b/examples/simple/package.json index 65c79f0c..c7810659 100644 --- a/examples/simple/package.json +++ b/examples/simple/package.json @@ -21,6 +21,8 @@ "dependencies": { "@elasticpath/js-sdk": "5.0.0", "@elasticpath/react-shopper-hooks": "workspace:*", + "@epcc-sdk/sdks-shopper": "workspace:*", + "@epcc-sdk/sdks-nextjs": "workspace:*", "clsx": "^1.2.1", "cookies-next": "^4.0.0", "focus-visible": "^5.2.0", diff --git a/examples/simple/src/app/(store)/products/[productId]/page.tsx b/examples/simple/src/app/(store)/products/[productId]/page.tsx index baf35da3..2fde0aed 100644 --- a/examples/simple/src/app/(store)/products/[productId]/page.tsx +++ b/examples/simple/src/app/(store)/products/[productId]/page.tsx @@ -1,10 +1,13 @@ import { Metadata } from "next"; import { ProductDetailsComponent, ProductProvider } from "./product-display"; import { getServerSideImplicitClient } from "../../../../lib/epcc-server-side-implicit-client"; -import { getProductById } from "../../../../services/products"; import { notFound } from "next/navigation"; import { parseProductResponse } from "@elasticpath/react-shopper-hooks"; import React from "react"; +import { getByContextProduct, client } from "@epcc-sdk/sdks-shopper"; +import { applyDefaultNextMiddleware } from "@epcc-sdk/sdks-nextjs"; +import { epccEnv } from "../../../../lib/resolve-epcc-env"; +import { ProductResponse, ShopperCatalogResource } from "@elasticpath/js-sdk"; export const dynamic = "force-dynamic"; @@ -12,31 +15,58 @@ type Props = { params: { productId: string }; }; +client.setConfig({ + baseUrl: `https://${epccEnv.host}`, +}); + +applyDefaultNextMiddleware(client); + export async function generateMetadata({ params: { productId }, }: Props): Promise { - const client = getServerSideImplicitClient(); - const product = await getProductById(productId, client); + const productResponse = await getByContextProduct({ + path: { + product_id: productId, + }, + query: { + include: ["main_images", "files", "component_products"], + }, + }); - if (!product) { + if (!productResponse.data) { notFound(); } + const product = productResponse.data; + return { - title: product.data.attributes.name, - description: product.data.attributes.description, + title: product.data?.attributes?.name, + description: product.data?.attributes?.description, }; } export default async function ProductPage({ params }: Props) { const client = getServerSideImplicitClient(); - const product = await getProductById(params.productId, client); + const productResponse = await getByContextProduct({ + path: { + product_id: params.productId, + }, + query: { + include: ["main_images", "files", "component_products"], + }, + }); - if (!product) { + if (!productResponse.data) { notFound(); } - const shopperProduct = await parseProductResponse(product, client); + const product = productResponse.data; + + // TODO I want to replace the ShopperProduct concept and just use the sdk types that are provided + const shopperProduct = await parseProductResponse( + product as unknown as ShopperCatalogResource, + client, + ); return (
- {products.map((product) => ( - -
  • -
    -
    - {product.main_image?.link.href ? ( - {product.main_image?.file_name!} - ) : ( -
    - -
    - )} + {products.map((product) => { + const mainImage = extractProductImage( + product, + featuredProductResponse.data?.included?.main_images, + ); + return ( + +
  • +
    +
    + {mainImage?.link?.href ? ( + {mainImage?.file_name!} + ) : ( +
    + +
    + )} +
    -
  • -

    - {product.attributes.name} -

    -

    - {product.meta.display_price?.without_tax?.formatted} -

    - - - ))} +

    + {product.attributes?.name} +

    +

    + {product.meta?.display_price?.without_tax?.formatted} +

    + + + ); + })} ); diff --git a/examples/simple/src/components/featured-products/fetchFeaturedProducts.ts b/examples/simple/src/components/featured-products/fetchFeaturedProducts.ts index a5b9f7bf..fa90fd1d 100644 --- a/examples/simple/src/components/featured-products/fetchFeaturedProducts.ts +++ b/examples/simple/src/components/featured-products/fetchFeaturedProducts.ts @@ -1,19 +1,15 @@ -import { getProducts } from "../../services/products"; -import { ElasticPath } from "@elasticpath/js-sdk"; -import { ProductResponseWithImage } from "../../lib/types/product-types"; -import { connectProductsWithMainImages } from "../../lib/connect-products-with-main-images"; +import { + getByContextAllProducts, + client as sdkClient, +} from "@epcc-sdk/sdks-shopper"; // Fetching the first 4 products of in the catalog to display in the featured-products component -export const fetchFeaturedProducts = async ( - client: ElasticPath, -): Promise => { - const { data: productsResponse, included: productsIncluded } = - await getProducts(client); - - return productsIncluded?.main_images - ? connectProductsWithMainImages( - productsResponse.slice(0, 4), // Only need the first 4 products to feature - productsIncluded?.main_images, - ) - : productsResponse; +export const fetchFeaturedProducts = async (client: typeof sdkClient) => { + return await getByContextAllProducts({ + client, + query: { + "page[limit]": 4, + "page[offset]": 0, + }, + }); }; diff --git a/examples/simple/src/components/header/navigation/MobileNavBar.tsx b/examples/simple/src/components/header/navigation/MobileNavBar.tsx index 06f832d4..10c9d449 100644 --- a/examples/simple/src/components/header/navigation/MobileNavBar.tsx +++ b/examples/simple/src/components/header/navigation/MobileNavBar.tsx @@ -3,8 +3,8 @@ import Link from "next/link"; import EpIcon from "../../icons/ep-icon"; import { MobileNavBarButton } from "./MobileNavBarButton"; import { getServerSideImplicitClient } from "../../../lib/epcc-server-side-implicit-client"; -import { buildSiteNavigation } from "../../../lib/build-site-navigation"; import { Cart } from "../../cart/CartSheet"; +import { buildSiteNavigation } from "@elasticpath/react-shopper-hooks"; export default async function MobileNavBar() { const client = getServerSideImplicitClient(); diff --git a/examples/simple/src/components/header/navigation/NavBarPopover.tsx b/examples/simple/src/components/header/navigation/NavBarPopover.tsx index 1409d5c7..04331f9a 100644 --- a/examples/simple/src/components/header/navigation/NavBarPopover.tsx +++ b/examples/simple/src/components/header/navigation/NavBarPopover.tsx @@ -1,6 +1,6 @@ "use client"; import { ReactElement } from "react"; -import { NavigationNode } from "../../../lib/build-site-navigation"; +import { NavigationNode } from "@elasticpath/react-shopper-hooks"; import { NavigationMenu, NavigationMenuContent, diff --git a/examples/simple/src/components/header/navigation/NavItemContent.tsx b/examples/simple/src/components/header/navigation/NavItemContent.tsx index dec7fce9..ffd0d015 100644 --- a/examples/simple/src/components/header/navigation/NavItemContent.tsx +++ b/examples/simple/src/components/header/navigation/NavItemContent.tsx @@ -1,5 +1,5 @@ import Link from "next/link"; -import { NavigationNode } from "../../../lib/build-site-navigation"; +import { NavigationNode } from "@elasticpath/react-shopper-hooks"; import { ArrowRightIcon } from "@heroicons/react/20/solid"; interface IProps { diff --git a/examples/simple/src/lib/build-breadcrumb-lookup.ts b/examples/simple/src/lib/build-breadcrumb-lookup.ts index 4d170da9..7f5f3f9d 100644 --- a/examples/simple/src/lib/build-breadcrumb-lookup.ts +++ b/examples/simple/src/lib/build-breadcrumb-lookup.ts @@ -1,4 +1,4 @@ -import { NavigationNode } from "./build-site-navigation"; +import { NavigationNode } from "@elasticpath/react-shopper-hooks"; import { BreadcrumbLookup } from "./types/breadcrumb-lookup"; export function buildBreadcrumbLookup( diff --git a/examples/simple/src/lib/build-site-navigation.ts b/examples/simple/src/lib/build-site-navigation.ts deleted file mode 100644 index d50c7f34..00000000 --- a/examples/simple/src/lib/build-site-navigation.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { Hierarchy,ElasticPath } from "@elasticpath/js-sdk"; -import { - getHierarchies, - getHierarchyChildren, - getHierarchyNodes, -} from "../services/hierarchy"; - -interface ISchema { - name: string; - slug: string; - href: string; - id: string; - children: ISchema[]; -} - -export interface NavigationNode { - name: string; - slug: string; - href: string; - id: string; - children: NavigationNode[]; -} - -export async function buildSiteNavigation( - client: ElasticPath, -): Promise { - // Fetch hierarchies to be used as top level nav - const hierarchies = await getHierarchies(client); - return constructTree(hierarchies, client); -} - -/** - * Construct hierarchy tree, limited to 5 hierarchies at the top level - */ -function constructTree( - hierarchies: Hierarchy[], - client: ElasticPath, -): Promise { - const tree = hierarchies - .slice(0, 4) - .map((hierarchy) => - createNode({ - name: hierarchy.attributes.name, - id: hierarchy.id, - slug: hierarchy.attributes.slug, - }), - ) - .map(async (hierarchy) => { - // Fetch first-level nav ('parent nodes') - the direct children of each hierarchy - const directChildren = await getHierarchyChildren(hierarchy.id, client); - // Fetch all nodes in each hierarchy (i.e. all 'child nodes' belonging to a hierarchy) - const allNodes = await getHierarchyNodes(hierarchy.id, client); - - // Build 2nd level by finding all 'child nodes' belonging to each first level featured-nodes - const directs = directChildren.slice(0, 4).map((child) => { - const children: ISchema[] = allNodes - .filter((node) => node?.relationships?.parent.data.id === child.id) - .map((node) => - createNode({ - name: node.attributes.name, - id: node.id, - slug: node.attributes.slug, - hrefBase: `${hierarchy.href}/${child.attributes.slug}`, - }), - ); - - return createNode({ - name: child.attributes.name, - id: child.id, - slug: child.attributes.slug, - hrefBase: hierarchy.href, - children, - }); - }); - - return { ...hierarchy, children: directs }; - }); - - return Promise.all(tree); -} - -interface CreateNodeDefinition { - name: string; - id: string; - slug?: string; - hrefBase?: string; - children?: ISchema[]; -} - -function createNode({ - name, - id, - slug = "missing-slug", - hrefBase = "", - children = [], -}: CreateNodeDefinition): ISchema { - return { - name, - id, - slug, - href: `${hrefBase}/${slug}`, - children, - }; -} diff --git a/examples/simple/src/lib/connect-products-with-main-images.ts b/examples/simple/src/lib/connect-products-with-main-images.ts index f1976000..77f9d8b9 100644 --- a/examples/simple/src/lib/connect-products-with-main-images.ts +++ b/examples/simple/src/lib/connect-products-with-main-images.ts @@ -1,12 +1,12 @@ -import { File, ProductResponse } from "@elasticpath/js-sdk"; import { ProductImageObject, ProductResponseWithImage, } from "./types/product-types"; +import { Product } from "@epcc-sdk/sdks-shopper"; export const connectProductsWithMainImages = ( - products: ProductResponse[], - images: File[], + products: Product[], + images: any[], // TODO fix file type in new sdk ): ProductResponseWithImage[] => { // Object with image id as a key and File data as a value let imagesObject: ProductImageObject = {}; @@ -18,7 +18,7 @@ export const connectProductsWithMainImages = ( productList.forEach((product) => { if ( - product.relationships.main_image?.data && + product.relationships?.main_image?.data?.id && imagesObject[product.relationships.main_image.data?.id] ) { product.main_image = diff --git a/examples/simple/src/lib/epcc-server-side-implicit-client.ts b/examples/simple/src/lib/epcc-server-side-implicit-client.ts index dfba3600..768b9b7d 100644 --- a/examples/simple/src/lib/epcc-server-side-implicit-client.ts +++ b/examples/simple/src/lib/epcc-server-side-implicit-client.ts @@ -6,23 +6,21 @@ import { COOKIE_PREFIX_KEY } from "./resolve-cart-env"; import { EP_CURRENCY_CODE } from "./resolve-ep-currency-code"; import { CREDENTIALS_COOKIE_NAME } from "./cookie-constants"; import { cookies } from "next/headers"; +import { client, createClient } from "@epcc-sdk/sdks-shopper"; +import { applyDefaultNextMiddleware } from "@epcc-sdk/sdks-nextjs"; const customHeaders = resolveEpccCustomRuleHeaders(); const { client_id, host } = epccEnv; +client.setConfig({ + baseUrl: `https://${epccEnv.host}`, +}); + +applyDefaultNextMiddleware(client); + export function getServerSideImplicitClient() { - const credentialsCookie = cookies().get(CREDENTIALS_COOKIE_NAME); - - return gateway({ - name: COOKIE_PREFIX_KEY, - client_id, - host, - currency: EP_CURRENCY_CODE, - ...(customHeaders ? { headers: customHeaders } : {}), - reauth: false, - storage: createServerSideNextCookieStorageFactory(credentialsCookie?.value), - }); + return client; } function createServerSideNextCookieStorageFactory( diff --git a/examples/simple/src/lib/get-store-initial-state.ts b/examples/simple/src/lib/get-store-initial-state.ts index dafe837b..8b775904 100644 --- a/examples/simple/src/lib/get-store-initial-state.ts +++ b/examples/simple/src/lib/get-store-initial-state.ts @@ -1,17 +1,24 @@ -import { ElasticPath } from "@elasticpath/js-sdk"; import { InitialState } from "@elasticpath/react-shopper-hooks"; -import { buildSiteNavigation } from "./build-site-navigation"; +import { buildSiteNavigation } from "@elasticpath/react-shopper-hooks"; import { getCartCookieServer } from "./cart-cookie-server"; import { getCart } from "../services/cart"; +import type { Client } from "@epcc-sdk/sdks-shopper"; +import { Cart, CartIncluded, ResourceIncluded } from "@elasticpath/js-sdk"; export async function getStoreInitialState( - client: ElasticPath, + client: Client, ): Promise { const nav = await buildSiteNavigation(client); const cartCookie = getCartCookieServer(); - const cart = await getCart(cartCookie, client); + const cartResponse = await getCart(cartCookie, client); + + if (!cartResponse.response.ok) { + throw new Error("Failed to get cart"); + } + + const cart = cartResponse.data as ResourceIncluded; return { cart, diff --git a/examples/simple/src/lib/types/product-types.ts b/examples/simple/src/lib/types/product-types.ts index e2cc5337..c9c54a0b 100644 --- a/examples/simple/src/lib/types/product-types.ts +++ b/examples/simple/src/lib/types/product-types.ts @@ -1,5 +1,7 @@ import type { ProductResponse, File } from "@elasticpath/js-sdk"; import type { Dispatch, SetStateAction } from "react"; +import type { GetByContextAllProductsResponse } from "@epcc-sdk/sdks-shopper"; +import { Product } from "@epcc-sdk/sdks-shopper"; export type IdentifiableBaseProduct = ProductResponse & { id: string; @@ -22,7 +24,7 @@ export interface OptionDict { [key: string]: string; } -export interface ProductResponseWithImage extends ProductResponse { +export interface ProductResponseWithImage extends Product { main_image?: File; } diff --git a/examples/simple/src/services/cart.ts b/examples/simple/src/services/cart.ts index e92757e4..0e23c0bb 100644 --- a/examples/simple/src/services/cart.ts +++ b/examples/simple/src/services/cart.ts @@ -1,9 +1,19 @@ -import type {ElasticPath } from "@elasticpath/js-sdk"; -import { Cart, CartIncluded, ResourceIncluded } from "@elasticpath/js-sdk"; +import { + client as elasticPathClient, + getCart as getCartClient, +} from "@epcc-sdk/sdks-shopper"; export async function getCart( cartId: string, - client: ElasticPath, -): Promise> { - return client.Cart(cartId).With("items").Get(); + client?: typeof elasticPathClient, +) { + return await getCartClient({ + client, + path: { + cartID: cartId, + }, + query: { + include: "items", + }, + }); } diff --git a/examples/simple/src/services/hierarchy.ts b/examples/simple/src/services/hierarchy.ts index 6fafee61..22063afc 100644 --- a/examples/simple/src/services/hierarchy.ts +++ b/examples/simple/src/services/hierarchy.ts @@ -1,28 +1,48 @@ -import type { Node, Hierarchy } from "@elasticpath/js-sdk"; -import {ElasticPath } from "@elasticpath/js-sdk"; +import type { client as elasticPathClient } from "@epcc-sdk/sdks-shopper"; +import { + getByContextAllHierarchies, + getByContextHierarchyChildNodes, + getByContextHierarchyNodes, +} from "@epcc-sdk/sdks-shopper"; -export async function getHierarchies(client: ElasticPath): Promise { - const result = await client.ShopperCatalog.Hierarchies.All(); - return result.data; +export async function getHierarchies(client?: typeof elasticPathClient) { + return await getByContextAllHierarchies({ + client, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, + }); } export async function getHierarchyChildren( hierarchyId: string, - client: ElasticPath, -): Promise { - const result = await client.ShopperCatalog.Hierarchies.GetHierarchyChildren({ - hierarchyId, + client?: typeof elasticPathClient, +) { + return await getByContextHierarchyChildNodes({ + client, + path: { + hierarchy_id: hierarchyId, + }, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, }); - return result.data; } export async function getHierarchyNodes( hierarchyId: string, - client: ElasticPath, -): Promise { - const result = await client.ShopperCatalog.Hierarchies.GetHierarchyNodes({ - hierarchyId, + client?: typeof elasticPathClient, +) { + return await getByContextHierarchyNodes({ + client, + path: { + hierarchy_id: hierarchyId, + }, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, }); - - return result.data; } diff --git a/examples/simple/src/services/products.ts b/examples/simple/src/services/products.ts index c8f49f64..e9221ca4 100644 --- a/examples/simple/src/services/products.ts +++ b/examples/simple/src/services/products.ts @@ -1,68 +1,8 @@ -import type { - ProductResponse, - ResourcePage, - ShopperCatalogResource, -} from "@elasticpath/js-sdk"; -import { wait300 } from "../lib/product-helper"; import { ElasticPath } from "@elasticpath/js-sdk"; -export async function getProductById( - productId: string, - client: ElasticPath, -): Promise> { - return client.ShopperCatalog.Products.With([ - "main_image", - "files", - "component_products", - ]).Get({ - productId, - }); -} - -export function getAllProducts(client: ElasticPath): Promise { - return _getAllProductPages(client)(); -} - export function getProducts(client: ElasticPath, offset = 0, limit = 100) { return client.ShopperCatalog.Products.With(["main_image"]) .Limit(limit) .Offset(offset) .All(); } - -const _getAllPages = - ( - nextPageRequestFn: ( - limit: number, - offset: number, - client?: ElasticPath, - ) => Promise>, - ) => - async ( - offset: number = 0, - limit: number = 25, - accdata: T[] = [], - ): Promise => { - const requestResp = await nextPageRequestFn(limit, offset); - const { - meta: { - page: newPage, - results: { total }, - }, - data: newData, - } = requestResp; - - const updatedOffset = offset + newPage.total; - const combinedData = [...accdata, ...newData]; - if (updatedOffset < total) { - return wait300.then(() => - _getAllPages(nextPageRequestFn)(updatedOffset, limit, combinedData), - ); - } - return Promise.resolve(combinedData); - }; - -const _getAllProductPages = (client: ElasticPath) => - _getAllPages((limit = 25, offset = 0) => - client.ShopperCatalog.Products.Limit(limit).Offset(offset).All(), - ); diff --git a/package.json b/package.json index fb3d3df9..16c92027 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "start:e2e": "turbo run start:e2e --filter='./examples/simple'", "test:e2e": "NODE_ENV=test turbo run test:e2e --filter='./examples/simple'", "build:cli": "turbo run build --filter=composable-cli...", - "build:packages": "turbo run build --filter='./packages/*'", + "build:packages": "turbo run build --filter='./packages/sdks/*' && turbo run build --filter='./packages/*'", "ci:version": "changeset version && pnpm install --no-frozen-lockfile", "ci:publish": "pnpm publish -r && changeset tag", "examples": "turbo run build --filter=composable-cli... && pnpm run scaffold:local", diff --git a/packages/sdks/nextjs/package.json b/packages/sdks/nextjs/package.json new file mode 100644 index 00000000..5ed4a3d0 --- /dev/null +++ b/packages/sdks/nextjs/package.json @@ -0,0 +1,34 @@ +{ + "name": "@epcc-sdk/sdks-nextjs", + "version": "0.0.1", + "description": "", + "main": "dist/index.js", + "scripts": { + "build": "tsc -p tsconfig.node.json" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": { + "import": "./dist/index.js", + "require": "./dist/index.js" + }, + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/**" + ], + "keywords": [], + "devDependencies": { + "next": "^14.0.0", + "typescript": "^5.5.3" + }, + "peerDependencies": { + "next": "^14.0.0" + }, + "dependencies": { + "@hey-api/client-fetch": "^0.2.4" + } +} diff --git a/packages/sdks/nextjs/src/constants/crendentials.ts b/packages/sdks/nextjs/src/constants/crendentials.ts new file mode 100644 index 00000000..dd1cc3fb --- /dev/null +++ b/packages/sdks/nextjs/src/constants/crendentials.ts @@ -0,0 +1,2 @@ +// TODO remove _store prefix once work has been done in examples folder +export const CREDENTIALS_COOKIE_NAME = "_store_ep_credentials" diff --git a/packages/sdks/nextjs/src/index.ts b/packages/sdks/nextjs/src/index.ts new file mode 100644 index 00000000..ba4c722a --- /dev/null +++ b/packages/sdks/nextjs/src/index.ts @@ -0,0 +1 @@ +export * from "./interceptors/auth-cookie-interceptor" diff --git a/packages/sdks/nextjs/src/interceptors/auth-cookie-interceptor.ts b/packages/sdks/nextjs/src/interceptors/auth-cookie-interceptor.ts new file mode 100644 index 00000000..35bb1be6 --- /dev/null +++ b/packages/sdks/nextjs/src/interceptors/auth-cookie-interceptor.ts @@ -0,0 +1,64 @@ +import type { Client } from "@hey-api/client-fetch" +import { cookies } from "next/headers" +import { CREDENTIALS_COOKIE_NAME } from "../constants/crendentials" + +export type RequestMiddleware = Parameters< + Client["interceptors"]["request"]["use"] +>[0] + +export type ResponseMiddleware = Parameters< + Client["interceptors"]["response"]["use"] +>[0] + +export function createAuthCookieInterceptor(creatOptions?: { + cookieKey?: string +}): RequestMiddleware { + return function authCookieInterceptor(request, options) { + const authCookie = cookies().get( + creatOptions?.cookieKey ?? CREDENTIALS_COOKIE_NAME, + ) + + let bearerToken = null + if (authCookie?.value) { + bearerToken = `Bearer ${JSON.parse(authCookie.value).access_token}` + } + + if (bearerToken) { + request.headers.set("Authorization", bearerToken) + } else { + console.warn( + "Elastic Path Next.js authentication cookie interceptor: Did not set Authorization header on request, no access token found in cookie, please check the cookie name.", + ) + } + + return request + } +} + +export type MiddlewareStack = Array< + | { + type: "request" + middleware: RequestMiddleware + } + | { + type: "response" + middleware: ResponseMiddleware + } +> + +export const defaultNextMiddleware: MiddlewareStack = [ + { + type: "request", + middleware: createAuthCookieInterceptor(), + }, +] + +export function applyDefaultNextMiddleware(client: Client): void { + for (const middlewareEntry of defaultNextMiddleware) { + if (middlewareEntry.type === "request") { + client.interceptors.request.use(middlewareEntry.middleware) + } else { + client.interceptors.response.use(middlewareEntry.middleware) + } + } +} diff --git a/packages/sdks/nextjs/tsconfig.json b/packages/sdks/nextjs/tsconfig.json new file mode 100644 index 00000000..d27f8641 --- /dev/null +++ b/packages/sdks/nextjs/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "outDir": "dist", + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": [ + "src" + ], + "references": [{ "path": "./tsconfig.node.json"}] +} diff --git a/packages/sdks/nextjs/tsconfig.node.json b/packages/sdks/nextjs/tsconfig.node.json new file mode 100644 index 00000000..180cab8c --- /dev/null +++ b/packages/sdks/nextjs/tsconfig.node.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src" + ], +} diff --git a/packages/sdks/pim/openapi-ts.config.ts b/packages/sdks/pim/openapi-ts.config.ts new file mode 100644 index 00000000..7b5affbe --- /dev/null +++ b/packages/sdks/pim/openapi-ts.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "@hey-api/openapi-ts" + +export default defineConfig({ + client: "@hey-api/client-fetch", + input: "../specs/pim.yaml", + output: { path: "src/client", format: "prettier" }, + types: { + name: "PascalCase", + enums: false, + dates: "types+transform", + }, +}) diff --git a/packages/sdks/pim/package.json b/packages/sdks/pim/package.json new file mode 100644 index 00000000..aff0b792 --- /dev/null +++ b/packages/sdks/pim/package.json @@ -0,0 +1,32 @@ +{ + "name": "@epcc-sdk/sdks-pxm", + "version": "0.0.1", + "description": "", + "main": "dist/index.js", + "scripts": { + "build": "tsc -p tsconfig.node.json", + "openapi-ts": "openapi-ts" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": { + "import": "./dist/index.js", + "require": "./dist/index.js" + }, + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/**" + ], + "keywords": [], + "devDependencies": { + "@hey-api/openapi-ts": "^0.48.2", + "typescript": "^5.5.3" + }, + "dependencies": { + "@hey-api/client-fetch": "^0.1.7" + } +} diff --git a/packages/sdks/pim/src/client/core/ApiError.ts b/packages/sdks/pim/src/client/core/ApiError.ts new file mode 100644 index 00000000..5499aa8f --- /dev/null +++ b/packages/sdks/pim/src/client/core/ApiError.ts @@ -0,0 +1,25 @@ +import type { ApiRequestOptions } from "./ApiRequestOptions" +import type { ApiResult } from "./ApiResult" + +export class ApiError extends Error { + public readonly url: string + public readonly status: number + public readonly statusText: string + public readonly body: unknown + public readonly request: ApiRequestOptions + + constructor( + request: ApiRequestOptions, + response: ApiResult, + message: string, + ) { + super(message) + + this.name = "ApiError" + this.url = response.url + this.status = response.status + this.statusText = response.statusText + this.body = response.body + this.request = request + } +} diff --git a/packages/sdks/pim/src/client/core/ApiRequestOptions.ts b/packages/sdks/pim/src/client/core/ApiRequestOptions.ts new file mode 100644 index 00000000..b5384fec --- /dev/null +++ b/packages/sdks/pim/src/client/core/ApiRequestOptions.ts @@ -0,0 +1,21 @@ +export type ApiRequestOptions = { + readonly method: + | "GET" + | "PUT" + | "POST" + | "DELETE" + | "OPTIONS" + | "HEAD" + | "PATCH" + readonly url: string + readonly path?: Record + readonly cookies?: Record + readonly headers?: Record + readonly query?: Record + readonly formData?: Record + readonly body?: any + readonly mediaType?: string + readonly responseHeader?: string + readonly responseTransformer?: (data: unknown) => Promise + readonly errors?: Record +} diff --git a/packages/sdks/pim/src/client/core/ApiResult.ts b/packages/sdks/pim/src/client/core/ApiResult.ts new file mode 100644 index 00000000..f88b8c64 --- /dev/null +++ b/packages/sdks/pim/src/client/core/ApiResult.ts @@ -0,0 +1,7 @@ +export type ApiResult = { + readonly body: TData + readonly ok: boolean + readonly status: number + readonly statusText: string + readonly url: string +} diff --git a/packages/sdks/pim/src/client/core/CancelablePromise.ts b/packages/sdks/pim/src/client/core/CancelablePromise.ts new file mode 100644 index 00000000..f47db79e --- /dev/null +++ b/packages/sdks/pim/src/client/core/CancelablePromise.ts @@ -0,0 +1,126 @@ +export class CancelError extends Error { + constructor(message: string) { + super(message) + this.name = "CancelError" + } + + public get isCancelled(): boolean { + return true + } +} + +export interface OnCancel { + readonly isResolved: boolean + readonly isRejected: boolean + readonly isCancelled: boolean + + (cancelHandler: () => void): void +} + +export class CancelablePromise implements Promise { + private _isResolved: boolean + private _isRejected: boolean + private _isCancelled: boolean + readonly cancelHandlers: (() => void)[] + readonly promise: Promise + private _resolve?: (value: T | PromiseLike) => void + private _reject?: (reason?: unknown) => void + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: unknown) => void, + onCancel: OnCancel, + ) => void, + ) { + this._isResolved = false + this._isRejected = false + this._isCancelled = false + this.cancelHandlers = [] + this.promise = new Promise((resolve, reject) => { + this._resolve = resolve + this._reject = reject + + const onResolve = (value: T | PromiseLike): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return + } + this._isResolved = true + if (this._resolve) this._resolve(value) + } + + const onReject = (reason?: unknown): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return + } + this._isRejected = true + if (this._reject) this._reject(reason) + } + + const onCancel = (cancelHandler: () => void): void => { + if (this._isResolved || this._isRejected || this._isCancelled) { + return + } + this.cancelHandlers.push(cancelHandler) + } + + Object.defineProperty(onCancel, "isResolved", { + get: (): boolean => this._isResolved, + }) + + Object.defineProperty(onCancel, "isRejected", { + get: (): boolean => this._isRejected, + }) + + Object.defineProperty(onCancel, "isCancelled", { + get: (): boolean => this._isCancelled, + }) + + return executor(onResolve, onReject, onCancel as OnCancel) + }) + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise" + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: unknown) => TResult2 | PromiseLike) | null, + ): Promise { + return this.promise.then(onFulfilled, onRejected) + } + + public catch( + onRejected?: ((reason: unknown) => TResult | PromiseLike) | null, + ): Promise { + return this.promise.catch(onRejected) + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.promise.finally(onFinally) + } + + public cancel(): void { + if (this._isResolved || this._isRejected || this._isCancelled) { + return + } + this._isCancelled = true + if (this.cancelHandlers.length) { + try { + for (const cancelHandler of this.cancelHandlers) { + cancelHandler() + } + } catch (error) { + console.warn("Cancellation threw an error", error) + return + } + } + this.cancelHandlers.length = 0 + if (this._reject) this._reject(new CancelError("Request aborted")) + } + + public get isCancelled(): boolean { + return this._isCancelled + } +} diff --git a/packages/sdks/pim/src/client/core/OpenAPI.ts b/packages/sdks/pim/src/client/core/OpenAPI.ts new file mode 100644 index 00000000..67761c5d --- /dev/null +++ b/packages/sdks/pim/src/client/core/OpenAPI.ts @@ -0,0 +1,56 @@ +import type { ApiRequestOptions } from "./ApiRequestOptions.ts" + +type Headers = Record +type Middleware = (value: T) => T | Promise +type Resolver = (options: ApiRequestOptions) => Promise + +export class Interceptors { + _fns: Middleware[] + + constructor() { + this._fns = [] + } + + eject(fn: Middleware): void { + const index = this._fns.indexOf(fn) + if (index !== -1) { + this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)] + } + } + + use(fn: Middleware): void { + this._fns = [...this._fns, fn] + } +} + +export type OpenAPIConfig = { + BASE: string + CREDENTIALS: "include" | "omit" | "same-origin" + ENCODE_PATH?: ((path: string) => string) | undefined + HEADERS?: Headers | Resolver | undefined + PASSWORD?: string | Resolver | undefined + TOKEN?: string | Resolver | undefined + USERNAME?: string | Resolver | undefined + VERSION: string + WITH_CREDENTIALS: boolean + interceptors: { + request: Interceptors + response: Interceptors + } +} + +export const OpenAPI: OpenAPIConfig = { + BASE: "https://euwest.api.elasticpath.com", + CREDENTIALS: "include", + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + TOKEN: undefined, + USERNAME: undefined, + VERSION: "1.0.0", + WITH_CREDENTIALS: false, + interceptors: { + request: new Interceptors(), + response: new Interceptors(), + }, +} diff --git a/packages/sdks/pim/src/client/core/request.ts b/packages/sdks/pim/src/client/core/request.ts new file mode 100644 index 00000000..c4f42672 --- /dev/null +++ b/packages/sdks/pim/src/client/core/request.ts @@ -0,0 +1,400 @@ +import { ApiError } from "./ApiError" +import type { ApiRequestOptions } from "./ApiRequestOptions" +import type { ApiResult } from "./ApiResult" +import { CancelablePromise } from "./CancelablePromise" +import type { OnCancel } from "./CancelablePromise" +import type { OpenAPIConfig } from "./OpenAPI" + +export const isString = (value: unknown): value is string => { + return typeof value === "string" +} + +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== "" +} + +export const isBlob = (value: any): value is Blob => { + return value instanceof Blob +} + +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData +} + +export const base64 = (str: string): string => { + try { + return btoa(str) + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString("base64") + } +} + +export const getQueryString = (params: Record): string => { + const qs: string[] = [] + + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`) + } + + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return + } + + if (value instanceof Date) { + append(key, value.toISOString()) + } else if (Array.isArray(value)) { + value.forEach((v) => encodePair(key, v)) + } else if (typeof value === "object") { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)) + } else { + append(key, value) + } + } + + Object.entries(params).forEach(([key, value]) => encodePair(key, value)) + + return qs.length ? `?${qs.join("&")}` : "" +} + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI + + const path = options.url + .replace("{api-version}", config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])) + } + return substring + }) + + const url = config.BASE + path + return options.query ? url + getQueryString(options.query) : url +} + +export const getFormData = ( + options: ApiRequestOptions, +): FormData | undefined => { + if (options.formData) { + const formData = new FormData() + + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value) + } else { + formData.append(key, JSON.stringify(value)) + } + } + + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach((v) => process(key, v)) + } else { + process(key, value) + } + }) + + return formData + } + return undefined +} + +type Resolver = (options: ApiRequestOptions) => Promise + +export const resolve = async ( + options: ApiRequestOptions, + resolver?: T | Resolver, +): Promise => { + if (typeof resolver === "function") { + return (resolver as Resolver)(options) + } + return resolver +} + +export const getHeaders = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, +): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + // @ts-ignore + resolve(options, config.TOKEN), + // @ts-ignore + resolve(options, config.USERNAME), + // @ts-ignore + resolve(options, config.PASSWORD), + // @ts-ignore + resolve(options, config.HEADERS), + ]) + + const headers = Object.entries({ + Accept: "application/json", + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce( + (headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), + {} as Record, + ) + + if (isStringWithValue(token)) { + headers["Authorization"] = `Bearer ${token}` + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`) + headers["Authorization"] = `Basic ${credentials}` + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers["Content-Type"] = options.mediaType + } else if (isBlob(options.body)) { + headers["Content-Type"] = options.body.type || "application/octet-stream" + } else if (isString(options.body)) { + headers["Content-Type"] = "text/plain" + } else if (!isFormData(options.body)) { + headers["Content-Type"] = "application/json" + } + } + + return new Headers(headers) +} + +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body !== undefined) { + if ( + options.mediaType?.includes("application/json") || + options.mediaType?.includes("+json") + ) { + return JSON.stringify(options.body) + } else if ( + isString(options.body) || + isBlob(options.body) || + isFormData(options.body) + ) { + return options.body + } else { + return JSON.stringify(options.body) + } + } + return undefined +} + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel, +): Promise => { + const controller = new AbortController() + + let request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + } + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS + } + + for (const fn of config.interceptors.request._fns) { + request = await fn(request) + } + + onCancel(() => controller.abort()) + + return await fetch(url, request) +} + +export const getResponseHeader = ( + response: Response, + responseHeader?: string, +): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader) + if (isString(content)) { + return content + } + } + return undefined +} + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get("Content-Type") + if (contentType) { + const binaryTypes = [ + "application/octet-stream", + "application/pdf", + "application/zip", + "audio/", + "image/", + "video/", + ] + if ( + contentType.includes("application/json") || + contentType.includes("+json") + ) { + return await response.json() + } else if (binaryTypes.some((type) => contentType.includes(type))) { + return await response.blob() + } else if (contentType.includes("multipart/form-data")) { + return await response.formData() + } else if (contentType.includes("text/")) { + return await response.text() + } + } + } catch (error) { + console.error(error) + } + } + return undefined +} + +export const catchErrorCodes = ( + options: ApiRequestOptions, + result: ApiResult, +): void => { + const errors: Record = { + 400: "Bad Request", + 401: "Unauthorized", + 402: "Payment Required", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Payload Too Large", + 414: "URI Too Long", + 415: "Unsupported Media Type", + 416: "Range Not Satisfiable", + 417: "Expectation Failed", + 418: "Im a teapot", + 421: "Misdirected Request", + 422: "Unprocessable Content", + 423: "Locked", + 424: "Failed Dependency", + 425: "Too Early", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 451: "Unavailable For Legal Reasons", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 510: "Not Extended", + 511: "Network Authentication Required", + ...options.errors, + } + + const error = errors[result.status] + if (error) { + throw new ApiError(options, result, error) + } + + if (!result.ok) { + const errorStatus = result.status ?? "unknown" + const errorStatusText = result.statusText ?? "unknown" + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2) + } catch (e) { + return undefined + } + })() + + throw new ApiError( + options, + result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`, + ) + } +} + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = ( + config: OpenAPIConfig, + options: ApiRequestOptions, +): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options) + const formData = getFormData(options) + const body = getRequestBody(options) + const headers = await getHeaders(config, options) + + if (!onCancel.isCancelled) { + let response = await sendRequest( + config, + options, + url, + body, + formData, + headers, + onCancel, + ) + + for (const fn of config.interceptors.response._fns) { + response = await fn(response) + } + + const responseBody = await getResponseBody(response) + const responseHeader = getResponseHeader( + response, + options.responseHeader, + ) + + let transformedBody = responseBody + if (options.responseTransformer && response.ok) { + transformedBody = await options.responseTransformer(responseBody) + } + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? transformedBody, + } + + catchErrorCodes(options, result) + + resolve(result.body) + } + } catch (error) { + reject(error) + } + }) +} diff --git a/packages/sdks/pim/src/client/index.ts b/packages/sdks/pim/src/client/index.ts new file mode 100644 index 00000000..a8a3135a --- /dev/null +++ b/packages/sdks/pim/src/client/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from "./schemas.gen" +export * from "./services.gen" +export * from "./types.gen" diff --git a/packages/sdks/pim/src/client/schemas.gen.ts b/packages/sdks/pim/src/client/schemas.gen.ts new file mode 100644 index 00000000..60a1ae74 --- /dev/null +++ b/packages/sdks/pim/src/client/schemas.gen.ts @@ -0,0 +1,3310 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const $job = { + type: "object", + properties: { + id: { + description: "A unique identifier generated when a job is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `pim-job`.", + type: "string", + enum: ["pim-job"], + }, + attributes: { + type: "object", + properties: { + started_at: { + description: "The date and time a job is started.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + nullable: true, + }, + completed_at: { + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + nullable: true, + description: "The date and time a job is completed.", + }, + created_at: { + type: "string", + description: "The date and time a job is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time a job is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + type: { + type: "string", + description: `The status of a job. + +* \`pending\` - Commerce has received the request but is currently busy processing other requests. +* \`started\` - Commerce has started processing the job. +* \`success\` - The job has successfully completed. +* \`failed\` - The job has failed. +`, + enum: [ + "child-products", + "product-import", + "product-export", + "hierarchy-duplicate", + "price-import", + ], + }, + status: { + type: "string", + enum: ["pending", "cancelled", "started", "success", "failed"], + }, + }, + }, + meta: { + type: "object", + properties: { + x_request_id: { + type: "string", + description: + "Applies to all job types. A unique request ID is generated when a job is created.", + }, + copied_from: { + type: "string", + description: + "Applies to `hierarchy-duplicate` job types. The ID of the original hierarchy that you duplicated.", + }, + hierarchy_id: { + type: "string", + description: + "Applies to `hierarchy-duplicate` job types. The duplicated hierarchy ID.", + }, + file_locations: { + type: "array", + nullable: true, + description: + "If the job type is `product_export`, a link to the file is created when running a job.", + items: { + type: "string", + }, + }, + filter: { + type: "string", + description: + "The entities included in the job. For example, if the job type is `product-export`, the PXM products included in the export.", + }, + }, + }, + }, +} as const + +export const $multi = { + type: "object", + properties: { + data: { + description: "An array of jobs.", + type: "array", + items: { + $ref: "#/components/schemas/job", + }, + }, + meta: { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 2, + }, + }, + }, + }, + }, + }, +} as const + +export const $error = { + required: ["errors"], + properties: { + errors: { + type: "array", + items: { + required: ["status", "title"], + properties: { + status: { + type: "string", + description: "The HTTP response code of the error.", + example: "500", + }, + title: { + type: "string", + description: "A brief summary of the error.", + example: "Internal server error", + }, + detail: { + type: "string", + description: "Optional additional detail about the error.", + example: "An internal error has occurred.", + }, + request_id: { + type: "string", + description: "Internal request ID.", + example: "00000000-0000-0000-0000-000000000000", + }, + meta: { + type: "object", + description: "Additional supporting meta data for the error.", + example: { + missing_ids: ["e7d50bd5-1833-43c0-9848-f9d325b08be8"], + }, + }, + }, + }, + }, + }, +} as const + +export const $single = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/job", + }, + }, +} as const + +export const $errors = { + type: "object", + properties: { + data: { + type: "array", + description: "An array of job errors.", + items: { + type: "object", + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `pim-job-error`.", + type: "string", + example: "pim-job-error", + enum: ["pim-job-error"], + }, + id: { + description: + "A unique identifier for a job error generated when a job error is created.", + type: "string", + }, + attributes: { + type: "object", + properties: { + message: { + description: "A description of an error message.", + type: "string", + example: + "data.attributes.sku: Must be unique amongst products.", + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $product_custom_inputs = { + type: "object", + description: + "You use the `custom_inputs` attribute to allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. See [Personalizing Products](/docs/api/pxm/products/create-product#personalizing-products).", + additionalProperties: { + description: + "A name for the custom text field. You can rename this to something more representative of the input that shoppers are adding, for example, `message` or `front`.", + type: "object", + properties: { + name: { + type: "string", + description: "A name for the custom text field.", + }, + validation_rules: { + type: "array", + description: "The validation rules for the custom text.", + }, + type: { + description: "This represents the type of the resource being returned.", + type: "string", + }, + options: { + type: "object", + description: "The length of the custom input text field.", + }, + max_length: { + type: "integer", + description: + "The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters.", + }, + required: { + type: "boolean", + description: `\`true\` or \`false\` depending on whether the custom text is required.`, + }, + }, + }, +} as const + +export const $product_build_rules = { + type: "object", + description: + "You can build a combination of child products associated with a product, based on build rules that you specify. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. See [Using Build Rules](/docs/api/pxm/products/build-child-products#using-build-rules).", + properties: { + default: { + description: + "Specifies the default behaviour, either `include` or `exclude`.", + type: "string", + enum: ["include", "exclude"], + }, + include: { + description: + "An array of option IDs to include when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations.", + type: "array", + items: { + type: "array", + items: { + type: "string", + }, + }, + }, + exclude: { + description: + "An array of option IDs to exclude when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations.", + type: "array", + items: { + type: "array", + items: { + type: "string", + }, + }, + }, + }, +} as const + +export const $product_bundle_components = { + type: "object", + description: + "With Product Experience Manager, you can create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. See [Bundles](/docs/api/pxm/products/products#bundles).", + additionalProperties: { + description: + "The name of the component, such as `games`. The `bundle_configuration` uses the component name to reference a component. A component name should be relatively short and must not contain any special characters.", + type: "object", + properties: { + name: { + type: "string", + description: + "The component name. The component name is the name that is displayed in your storefront.", + }, + options: { + type: "array", + description: + "The product options included in a component. This can be the ID of another bundle.", + items: { + type: "object", + properties: { + id: { + type: "string", + description: + "The unique ID of the product you want to add to a component.", + }, + type: { + type: "string", + description: + "This represents the type of object being returned. Always `product`.", + }, + quantity: { + type: "integer", + description: + "The number of this product option that a shopper must purchase.", + }, + sort_order: { + type: "integer", + description: + "The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want.", + }, + default: { + description: + "Whether the product option is a default option in a bundle. Shoppers can select a bundle that specifies a default list of product options. See [Dynamic Bundles](/docs/api/pxm/products/products#dynamic-bundles).", + type: "boolean", + }, + }, + }, + }, + min: { + type: "integer", + description: + "The minimum number of product options a shopper can select from this component.", + }, + max: { + type: "integer", + description: + "The maximum number of product options a shopper can select from this component.", + }, + sort_order: { + type: "integer", + description: + "The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want.", + }, + }, + }, +} as const + +export const $product_response = { + type: "object", + properties: { + id: { + description: + "A unique product ID that is generated when you create the product.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product`.", + type: "string", + enum: ["product"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A name for the product.", + type: "string", + }, + description: { + description: "A description for the product.", + type: "string", + }, + slug: { + description: + "A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug.", + type: "string", + }, + sku: { + description: "The unique stock keeping unit of the product.", + type: "string", + }, + status: { + description: "The status for the product, either `draft` or `live`.", + type: "string", + enum: ["live", "draft"], + }, + commodity_type: { + description: "The commodity type, either `physical` or `digital`.", + type: "string", + enum: ["physical", "digital"], + }, + upc_ean: { + description: + "The universal product code or european article number of the product.", + type: "string", + }, + mpn: { + description: "The manufacturer part number of the product.", + type: "string", + }, + external_ref: { + description: + "The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters.", + type: "string", + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want.", + type: "object", + }, + tags: { + description: + "You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas.", + type: "array", + items: { + type: "string", + }, + }, + extensions: { + type: "object", + additionalProperties: { + type: "object", + additionalProperties: { + oneOf: [ + { + type: "string", + nullable: true, + }, + { + type: "integer", + }, + { + type: "boolean", + }, + ], + }, + }, + }, + custom_inputs: { + $ref: "#/components/schemas/product_custom_inputs", + }, + build_rules: { + $ref: "#/components/schemas/product_build_rules", + }, + components: { + $ref: "#/components/schemas/product_bundle_components", + }, + }, + }, + meta: { + type: "object", + properties: { + created_at: { + description: "The date and time a product is created.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + description: "The date and time a product is updated.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + owner: { + description: "The resource owner, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + variations: { + description: + "A product's variations and the options defined for each variation. If you have specified `build_rules`, only the child products included in the `build_rules` are specified.", + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: + "A unique ID generated when a variation is created.", + }, + name: { + type: "string", + description: "The name of a variation.", + }, + options: { + type: "array", + items: { + type: "object", + description: "The options available for this variation.", + properties: { + id: { + type: "string", + description: + "A unique ID that is generated an option is created.", + }, + name: { + type: "string", + description: "The name of an option.", + }, + description: { + type: "string", + description: "A description of an option.", + }, + }, + }, + }, + }, + }, + }, + product_types: { + description: `One of the following product types: + +- \`standard\` - A \`standard\` product is a standalone product. +- \`parent\` - A \`parent\` product is a product that has child products that have been built using the \`Build Child Products\` endpoint. +- \`child\` - When you configure product variations and variation options for \`parent\` products, the \`child\` products derived from the \`parent\` products are automatically created in Commerce. +- \`bundle\` - A \`bundle\` is a purchasable product, comprising one or more standalone products (in other words, components) to be sold together. +`, + type: "array", + items: { + type: "string", + enum: ["parent", "child", "bundle", "standard"], + }, + }, + variation_matrix: { + description: + "The child products defined for a product. The order of the variations in the `variation_matrix` is the order of the variations in the array when the variations were linked to the product. For example, the first variation in the `variation_matrix` corresponds to the first variation in the array, and so on. You can use the `sort_order`attribute to sort the order of your variation and variation options in the `variation_matrix` object. See [Sorting the Order of Variations and Options](/docs/api/pxm/products/variations#sorting-the-order-of-variations-and-options) If no variations are defined for a product, the `variation_matrix` is empty.", + type: "object", + }, + }, + }, + relationships: { + description: + "Relationships are established between different product entities. For example, a `bundle` product and a `child` product are related to a `parent` product, as both are associated with it.", + type: "object", + additionalProperties: { + type: "object", + properties: { + data: { + oneOf: [ + { + type: "array", + items: { + type: "object", + properties: { + id: { + description: "A unique identifier for a resource.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned.", + type: "string", + }, + }, + }, + }, + { + type: "object", + nullable: true, + properties: { + id: { + description: "A unique identifier for a resource.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned.", + type: "string", + }, + }, + }, + ], + }, + links: { + description: `Links are used to allow you to move between requests. Single entities use a \`self\` parameter with a link to that specific resource. Sometimes, there are not enough entities for a project to fill multiple pages. In this situation, we return some defaults. + + | Property | Description | + | :--- | :--- | + | \`current\` | Always the current page. | + | \`first\` | Always the first page. | + | \`last\` | \`null\` if there is only one page. | + | \`prev\` | \`null\` if the user is on the first page. | + | \`next\` | \`null\` if there is only one page. | +`, + type: "object", + additionalProperties: { + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $multi_product_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/product_response", + }, + }, + included: { + type: "object", + description: + "Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned.", + properties: { + component_products: { + description: + "Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned.", + type: "array", + items: { + $ref: "#/components/schemas/product_response", + }, + }, + }, + }, + meta: { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 2, + }, + }, + }, + }, + }, + }, +} as const + +export const $product_locales = { + type: "object", + description: + "Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want.", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + required: ["name"], + properties: { + name: { + type: "string", + description: "A localized name for the product.", + }, + description: { + type: "string", + description: "A localized description for the product.", + }, + }, + }, +} as const + +export const $product_attributes = { + type: "object", + additionalProperties: false, + properties: { + external_ref: { + type: "string", + description: + "The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters.", + }, + name: { + type: "string", + description: "The product name to display to customers.", + }, + description: { + description: "A description for the product.", + type: "string", + }, + slug: { + type: "string", + description: + "The unique slug of the product. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + }, + sku: { + type: "string", + description: "The unique stock keeping unit of the product.", + }, + status: { + type: "string", + enum: ["live", "draft"], + description: + "The status for the product, either `draft` or `live`. Default is `draft`.", + }, + commodity_type: { + description: "The commodity type, either `physical` or `digital`.", + type: "string", + enum: ["physical", "digital"], + }, + upc_ean: { + type: "string", + description: + "The universal product code or european article number of the product.", + }, + mpn: { + type: "string", + description: "The manufacturer part number of the product.", + }, + tags: { + type: "array", + description: + "You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas. See [Product Tags](/docs/api/pxm/products/product-tags).", + items: { + type: "string", + }, + }, + build_rules: { + $ref: "#/components/schemas/product_build_rules", + }, + locales: { + $ref: "#/components/schemas/product_locales", + }, + custom_inputs: { + $ref: "#/components/schemas/product_custom_inputs", + }, + components: { + $ref: "#/components/schemas/product_bundle_components", + }, + }, +} as const + +export const $create_product_request = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource being returned. Always `product`.", + type: "string", + enum: ["product"], + example: "product", + }, + attributes: { + $ref: "#/components/schemas/product_attributes", + }, + relationships: { + description: + "Relationships are established between different product entities.", + type: "object", + properties: { + variations: { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: "A unique identifier for a resource.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned.", + type: "string", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $single_product_response = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product_response", + }, + included: { + type: "object", + description: + "Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned.", + properties: { + component_products: { + description: + "A list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned.", + type: "array", + items: { + $ref: "#/components/schemas/product_response", + }, + }, + }, + }, + }, +} as const + +export const $update_product_request = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes", "id"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product`.", + type: "string", + enum: ["product"], + example: "product", + }, + id: { + type: "string", + description: + "The unique identifier of the product. Must match the product ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + attributes: { + $ref: "#/components/schemas/product_attributes", + }, + }, + }, + }, +} as const + +export const $attributes = { + type: "object", + properties: { + name: { + description: + "The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + }, + description: { + description: "A description for a node.", + type: "string", + }, + slug: { + description: + "A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + }, + curated_products: { + description: + "You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront.", + type: "array", + items: { + description: "A list of product IDs whose products you want to curate.", + type: "string", + }, + }, + locales: { + description: + "Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A localized hierarchy or node name.", + type: "string", + }, + description: { + description: "A localized hierarchy or node description.", + type: "string", + }, + }, + }, + }, + }, +} as const + +export const $relationships = { + type: "object", + description: + "Relationships allow you to move between requests. Includes links to the child nodes and products associated with a hierarchy or node.", + properties: { + children: { + description: "The child nodes related to the resource.", + type: "object", + properties: { + data: { + description: "An array of child nodes.", + type: "array", + required: [], + }, + links: { + description: "Links allow you to move between requests.", + type: "object", + properties: { + related: { + description: "A link to a related resource.", + type: "string", + }, + }, + }, + }, + }, + parent: { + description: "The parent node related to the resource", + type: "object", + properties: { + data: { + description: "The parent node", + type: "object", + required: ["id", "type"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + id: { + description: "The unique identifier of a node.", + type: "string", + }, + }, + }, + }, + }, + products: { + type: "object", + description: "The products related to the resource.", + properties: { + data: { + description: "An array of products.", + type: "array", + required: [], + }, + links: { + type: "object", + description: "Links allow you to move between requests.", + properties: { + related: { + description: "A link to a related resource.", + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $node = { + type: "object", + properties: { + id: { + description: "The unique identifier of a node.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + attributes: { + $ref: "#/components/schemas/attributes", + }, + relationships: { + $ref: "#/components/schemas/relationships", + }, + meta: { + type: "object", + properties: { + sort_order: { + description: + "The sort order value. The node with the highest value of `sort_order` is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. See [Sorting Nodes in a hierarchy](/docs/api/pxm/products/create-node#sorting-nodes-in-a-hierarchy).", + type: "integer", + }, + created_at: { + description: "The date and time a node is created.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + description: "The date and time a node was updated.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + parent_name: { + description: "The name of the parent of the node if one exists.", + type: "string", + }, + owner: { + description: "The node owner, either `organization` or `store`.", + type: "string", + enum: ["store", "organization"], + }, + }, + }, + }, +} as const + +export const $multi_meta = { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 30, + minimum: 0, + }, + }, + }, + }, +} as const + +export const $multi_links = { + type: "object", + description: "Links are used to allow you to move between requests.", + properties: { + first: { + description: "Always the first page.", + type: "string", + example: "/pcm/hierarchies?page[offset]=0&page[limit]=10", + }, + last: { + description: "This is `null` if there is only one page.", + type: "string", + example: "/pcm/hierarchies?page[offset]=20&page[limit]=10", + }, + next: { + description: "This is `null` if there is only one page.", + type: "string", + example: "/pcm/hierarchies?page[offset]=10&page[limit]=10", + }, + prev: { + description: "This is `null` if you on the first page.", + type: "string", + example: "/pcm/hierarchies?page[offset]=8&page[limit]=10", + }, + }, +} as const + +export const $multi_nodes = { + type: "object", + properties: { + data: { + description: "An array of nodes.", + type: "array", + items: { + $ref: "#/components/schemas/node", + }, + }, + meta: { + $ref: "#/components/schemas/multi_meta", + }, + links: { + $ref: "#/components/schemas/multi_links", + }, + }, +} as const + +export const $template_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier for a template generated when a template is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `template`.", + type: "string", + enum: ["template"], + }, + }, + }, + }, + }, +} as const + +export const $product_templates_request = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: "The unique identifier of a template.", + }, + type: { + type: "string", + enum: ["template"], + description: + "This represents the type of resource object being returned. Always `template'.", + }, + }, + }, + }, + }, +} as const + +export const $component_products_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: + "The unique identifier of a product component generated when a product is created.", + }, + type: { + type: "string", + enum: ["product"], + description: + "This represents the type of resource object being returned. Always `product`.", + }, + }, + }, + }, + }, +} as const + +export const $file_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: "The unique identifier of the new file.", + }, + type: { + type: "string", + description: + "This represents the type of resource object being returned. Always `file`.", + enum: ["file"], + }, + }, + }, + }, + }, +} as const + +export const $product_files_request = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier for a file generated when a file is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource being returned. Always `file`.", + type: "string", + enum: ["file"], + }, + meta: { + type: "object", + properties: { + tags: { + description: "The files associated with a product.", + type: "array", + items: { + type: "string", + }, + }, + }, + additionalProperties: false, + }, + }, + }, + }, + }, +} as const + +export const $variations_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier generated when a variation is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + meta: { + type: "object", + properties: { + created_at: { + description: "The date and time a resource is created.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $product_variations_request = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: "The ID of the product variation.", + }, + type: { + type: "string", + enum: ["product-variation"], + description: + "This represents the type of resource being returned. Always `product-variation`.", + }, + }, + }, + }, + }, +} as const + +export const $main_image_response = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier for the image file generated automatically when a file is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `file`.", + type: "string", + }, + }, + }, + }, + }, +} as const + +export const $replace_main_image_request = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + description: "The ID of the new image file.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + type: "string", + enum: ["file"], + }, + }, + }, + }, + }, +} as const + +export const $main_image_request = { + type: "object", + properties: { + data: { + type: "object", + properties: { + id: { + type: "string", + description: "The ID of the image file.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource being returned. Always `file`.", + type: "string", + enum: ["file"], + }, + }, + }, + }, +} as const + +export const $multi_variations = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: "A unique identifier for a variation.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "The name of a variation.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + options: { + type: "array", + items: { + type: "object", + description: "The options available for this variation.", + properties: { + id: { + type: "string", + description: + "A unique ID that is generated when an option is created.", + }, + name: { + type: "string", + description: + "A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + }, + description: { + type: "string", + description: + "A human recognizable description of the option.", + }, + created_at: { + type: "string", + description: "The date and time an option is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time an option is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + }, + owner: { + type: "string", + description: + "The owner of the resource, either `organization` or `store`.", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time a variation is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time a variation is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, + meta: { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 3, + }, + }, + }, + }, + }, + }, +} as const + +export const $create_variation = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "The variation name.", + type: "string", + }, + sort_order: { + description: `The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the \`sort_order\` value to program your storefront to display the variation options in the order that you want. + + The variation with the highest value of \`sort_order\` is displayed first. For example, a variation with a \`sort_order\` value of 3 appears before a variation with a \`sort_order\` value of 2. + + You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set \`sort_order\` to either \`null\` or omit it entirely from the request if you wish to remove an existing \`sort_order\` attribute. + + You must rebuild your products for the sort order changes to take effect. +`, + type: "integer", + }, + }, + }, + }, + }, + }, +} as const + +export const $created_variation = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["id", "type", "attributes", "meta"], + properties: { + id: { + description: + "A unique identifier generated when a variation is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A human-recognizable identifier for a variation.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of the resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time a variation is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time a variation is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, +} as const + +export const $single_variation = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["id", "type", "attributes", "meta"], + properties: { + id: { + description: "A unique identifier for a variation.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "The name for a variation.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + options: { + description: + "A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue.", + type: "array", + items: { + type: "object", + description: "The options available for this variation", + properties: { + id: { + type: "string", + description: + "A unique ID that is generated an option is created.", + }, + name: { + type: "string", + description: + "A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + }, + description: { + type: "string", + description: "A description for an option.", + }, + created_at: { + type: "string", + description: "The date and time an option is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time an option is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + }, + owner: { + description: + "The owner of the resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time a variation is created.", + }, + updated_at: { + type: "string", + description: "The date and time a variation is updated.", + }, + }, + }, + }, + }, + }, +} as const + +export const $update_variation = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes", "id"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation`.", + type: "string", + enum: ["product-variation"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "The variation name.", + type: "string", + }, + sort_order: { + description: `The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the \`sort_order\` value to program your storefront to display the variation options in the order that you want. + + The variation with the highest value of \`sort_order\` is displayed first. For example, a variation with a \`sort_order\` value of 3 appears before a variation with a \`sort_order\` value of 2. + + You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set \`sort_order\` to either \`null\` or omit it entirely from the request if you wish to remove an existing \`sort_order\` attribute. + + You must rebuild your products for the sort order changes to take effect. +`, + type: "integer", + }, + }, + }, + id: { + type: "string", + description: + "The unique identifier of the variation. Must match the variation ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + }, + }, + }, +} as const + +export const $multi_options = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier generated when an option is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-option`.", + type: "string", + enum: ["product-variation-option"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + type: "string", + }, + description: { + description: "A human-recognizable description for the option.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time an option is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time an option is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, + meta: { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 3, + }, + }, + }, + }, + }, + }, +} as const + +export const $create_option = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-option`.", + type: "string", + enum: ["product-variation-option"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + type: "string", + }, + sort_order: { + description: `By default, variations and variation options are sorted alphabetically. You can use the \`sort_order\` attribute to sort the order of your variation and variation options in the \`variation_matrix\`. + + The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the \`sort_order\` value to program your storefront to display the variation options in the order that you want. + + The variation option with the highest value of \`sort_order\` is displayed first. For example, a variation option with a \`sort_order\` value of \`3\` appears before a variation option with a \`sort_order\` value of \`2\`. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + + You can set \`sort_order\` to either \`null\` or omit it entirely from the request if you wish to remove an existing \`sort_order\` attribute. + + You must rebuild your products for the sort order changes to take effect. +`, + type: "integer", + }, + description: { + description: "A description of a product variation option.", + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $created_option = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + id: { + description: + "A unique identifier that is generated when an option is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-option`.", + type: "string", + enum: ["product-variation-option"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + type: "string", + }, + description: { + description: "A human-recognizable description for the option.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time an option is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time an option is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, +} as const + +export const $single_option = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["id", "type", "attributes", "meta"], + properties: { + id: { + description: + "The unique identifier generated when an option is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-option`.", + type: "string", + enum: ["product-variation-option"], + }, + attributes: { + type: "object", + description: + "A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue.", + additionalProperties: false, + properties: { + name: { + description: + "A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + type: "string", + }, + description: { + description: "A human-recognizable description for the option.", + type: "string", + }, + sort_order: { + description: + "The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute.", + type: "integer", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + created_at: { + type: "string", + description: "The date and time an option is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time an option is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + }, + }, + }, + }, + }, +} as const + +export const $update_option = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes", "id"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-option`.", + type: "string", + enum: ["product-variation-option"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.", + type: "string", + }, + description: { + description: "The description of the option.", + type: "string", + }, + sort_order: { + description: `By default, variations and variation options are sorted alphabetically. You can use the \`sort_order\` attribute to sort the order of your variation and variation options in the \`variation_matrix\`. The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the \`sort_order\` value to program your storefront to display the variation options in the order that you want. + +The variation option with the highest value of \`sort_order\` is displayed first. For example, a variation option with a \`sort_order\` value of \`3\` appears before a variation option with a \`sort_order\` value of \`2\`. + +You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + +You can set \`sort_order\` to either \`null\` or omit it entirely from the request if you wish to remove an existing \`sort_order\` attribute. + +You must rebuild your products for the sort order changes to take effect. +`, + type: "integer", + }, + }, + }, + id: { + type: "string", + description: + "The unique identifier of the option. Must match the option ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + }, + }, + }, +} as const + +export const $multi_modifiers = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "A unique identifier for a modifier that is generated automatically when a modifier is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-modifier'.", + type: "string", + enum: ["product-variation-modifier"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + type: { + description: `You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + +| Modifier | Data Type | Effect | +| :--- | :--- | :--- | +| \`name_equals\` | \`string\` | Overrides the name of the child product with the name specified by the modifier. | +| \`name_append\` | \`string\` | Appends the string specified in the modifier to the name of the child product. | +| \`name_prepend\` | \`string\` | Prepends the string specified in the modifier to the name of the child product. | +| \`description_equals\` | \`string\` | Overrides the description of the child product. | +| \`description_append\` | \`string\` | Appends the string specified in the modifier to the description of the child product. | +| \`description_prepend\` | \`string\` | Prepends the string specified in the modifier to the product description of the child product. | +| \`commodity_type\` | \`string\` | Sets the commodity type of the child product, such as \`physical\` or \`digital\`. | +| \`price\` | \`string\` | Allows application of price modifiers (\`price_increment\`, \`price_decrement\`, and \`price_equals\`) to the child products. | +| \`price_increment\` | \`string\` | Increases the price of the child product. | +| \`price_decrement\` | \`string\` | Decreases the price of the child product. | +| \`price_equals\` | \`string\` | Sets the price of a child product to the amount you specify. | +| \`slug_append\` | \`string\` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_prepend\` | \`string\` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_builder\` | \`string\`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`sku_equals\` | \`string\` | Sets the SKU of the child product. | +| \`sku_append\` | \`string\` | Appends the string specified in the modifier to the SKU of the child product. | +| \`sku_prepend\` | \`string\` | Prepends the string specified in the modifier to the SKU of the child product. | +| \`sku_builder\` | \`string\` | Sets a part of the SKU of the child product. | +| \`status\` | \`string\` | Sets the status of the child product, such as \`draft\` or \`live\`. | +`, + type: "string", + enum: [ + "commodity_type", + "status", + "price", + "name_append", + "name_prepend", + "name_equals", + "sku_append", + "sku_prepend", + "sku_equals", + "sku_builder", + "slug_append", + "slug_prepend", + "slug_equals", + "slug_builder", + "description_append", + "description_prepend", + "description_equals", + "custom_inputs_equals", + "build_rules_equals", + "locales_equals", + "upc_ean_equals", + "mpn_equals", + "external_ref_equals", + ], + }, + value: { + description: + "Required for non-builder modifiers. The value of the modifier type.", + type: "string", + }, + seek: { + description: + "Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`.", + type: "string", + }, + set: { + description: + "Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`.", + type: "string", + }, + reference_name: { + description: "The name of the modifier.", + type: "string", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["store", "organization"], + }, + }, + }, + }, + }, + }, + meta: { + type: "object", + properties: { + results: { + type: "object", + description: "Contains the results for the entire collection.", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 3, + }, + }, + }, + }, + }, + }, +} as const + +export const $create_modifier = { + type: "object", + description: + "Use modifiers to change the properties of child products that are inherited from a parent product. With modifiers, you only need to have one parent product with a variation attached to the product.", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-modifier`.", + type: "string", + enum: ["product-variation-modifier"], + }, + attributes: { + type: "object", + required: ["type"], + additionalProperties: false, + properties: { + type: { + type: "string", + description: `You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + +| Modifier | Data Type | Effect | +| :--- | :--- | :--- | +| \`name_equals\` | \`string\` | Overrides the name of the child product with the name specified by the modifier. | +| \`name_append\` | \`string\` | Appends the string specified in the modifier to the name of the child product. | +| \`name_prepend\` | \`string\` | Prepends the string specified in the modifier to the name of the child product. | +| \`description_equals\` | \`string\` | Overrides the description of the child product. | +| \`description_append\` | \`string\` | Appends the string specified in the modifier to the description of the child product. | +| \`description_prepend\` | \`string\` | Prepends the string specified in the modifier to the product description of the child product. | +| \`commodity_type\` | \`string\` | Sets the commodity type of the child product, such as \`physical\` or \`digital\`. | +| \`price\` | \`string\` | Allows application of price modifiers (\`price_increment\`, \`price_decrement\`, and \`price_equals\`) to the child products. | +| \`price_increment\` | \`string\` | Increases the price of the child product. | +| \`price_decrement\` | \`string\` | Decreases the price of the child product. | +| \`price_equals\` | \`string\` | Sets the price of a child product to the amount you specify. | +| \`slug_append\` | \`string\` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_prepend\` | \`string\` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_builder\` | \`string\`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`sku_equals\` | \`string\` | Sets the SKU of the child product. | +| \`sku_append\` | \`string\` | Appends the string specified in the modifier to the SKU of the child product. | +| \`sku_prepend\` | \`string\` | Prepends the string specified in the modifier to the SKU of the child product. | +| \`sku_builder\` | \`string\` | Sets a part of the SKU of the child product. | +| \`status\` | \`string\` | Sets the status of the child product, such as \`draft\` or \`live\`. | +`, + enum: [ + "commodity_type", + "status", + "price", + "name_append", + "name_prepend", + "name_equals", + "sku_append", + "sku_prepend", + "sku_equals", + "sku_builder", + "slug_append", + "slug_prepend", + "slug_equals", + "slug_builder", + "description_append", + "description_prepend", + "description_equals", + "custom_inputs_equals", + "build_rules_equals", + "locales_equals", + "upc_ean_equals", + "mpn_equals", + "external_ref_equals", + ], + }, + value: { + description: + "Required for non-builder modifiers. The value of the modifier type.", + type: "string", + }, + seek: { + description: + "Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`.", + type: "string", + }, + set: { + description: + "Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`.", + type: "string", + }, + reference_name: { + description: "A name for the modifier.", + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $created_modifier = { + type: "object", + properties: { + data: { + type: "object", + properties: { + id: { + description: + "A unique identifier for a modifier that is generated automatically when a modifier is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-modifier'.", + type: "string", + enum: ["product-variation-modifier"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + type: { + description: `You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + +| Modifier | Data Type | Effect | +| :--- | :--- | :--- | +| \`name_equals\` | \`string\` | Overrides the name of the child product with the name specified by the modifier. | +| \`name_append\` | \`string\` | Appends the string specified in the modifier to the name of the child product. | +| \`name_prepend\` | \`string\` | Prepends the string specified in the modifier to the name of the child product. | +| \`description_equals\` | \`string\` | Overrides the description of the child product. | +| \`description_append\` | \`string\` | Appends the string specified in the modifier to the description of the child product. | +| \`description_prepend\` | \`string\` | Prepends the string specified in the modifier to the product description of the child product. | +| \`commodity_type\` | \`string\` | Sets the commodity type of the child product, such as \`physical\` or \`digital\`. | +| \`price\` | \`string\` | Allows application of price modifiers (\`price_increment\`, \`price_decrement\`, and \`price_equals\`) to the child products. | +| \`price_increment\` | \`string\` | Increases the price of the child product. | +| \`price_decrement\` | \`string\` | Decreases the price of the child product. | +| \`price_equals\` | \`string\` | Sets the price of a child product to the amount you specify. | +| \`slug_append\` | \`string\` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_prepend\` | \`string\` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_builder\` | \`string\`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`sku_equals\` | \`string\` | Sets the SKU of the child product. | +| \`sku_append\` | \`string\` | Appends the string specified in the modifier to the SKU of the child product. | +| \`sku_prepend\` | \`string\` | Prepends the string specified in the modifier to the SKU of the child product. | +| \`sku_builder\` | \`string\` | Sets a part of the SKU of the child product. | +| \`status\` | \`string\` | Sets the status of the child product, such as \`draft\` or \`live\`. | +`, + type: "string", + enum: [ + "commodity_type", + "status", + "price", + "name_append", + "name_prepend", + "name_equals", + "sku_append", + "sku_prepend", + "sku_equals", + "sku_builder", + "slug_append", + "slug_prepend", + "slug_equals", + "slug_builder", + "description_append", + "description_prepend", + "description_equals", + "custom_inputs_equals", + "build_rules_equals", + "locales_equals", + "upc_ean_equals", + "mpn_equals", + "external_ref_equals", + ], + }, + value: { + description: + "Required for non-builder modifiers. The value of the modifier type.", + type: "string", + }, + seek: { + description: + "Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`.", + type: "string", + }, + set: { + description: + "Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`.", + type: "string", + }, + reference_name: { + description: "The name of the modifier.", + type: "string", + }, + }, + }, + meta: { + type: "object", + properties: { + owner: { + description: + "The owner of the resource, either `organization` or `store`.", + type: "string", + enum: ["organization", "store"], + }, + }, + }, + }, + }, + }, +} as const + +export const $single_modifier = { + type: "object", + properties: { + data: { + type: "object", + properties: { + id: { + description: + "A unique identifier for a modifier that is generated automatically when a modifier is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-modifier'.", + type: "string", + enum: ["product-variation-modifier"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + type: { + description: `You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + +| Modifier | Data Type | Effect | +| :--- | :--- | :--- | +| \`name_equals\` | \`string\` | Overrides the name of the child product with the name specified by the modifier. | +| \`name_append\` | \`string\` | Appends the string specified in the modifier to the name of the child product. | +| \`name_prepend\` | \`string\` | Prepends the string specified in the modifier to the name of the child product. | +| \`description_equals\` | \`string\` | Overrides the description of the child product. | +| \`description_append\` | \`string\` | Appends the string specified in the modifier to the description of the child product. | +| \`description_prepend\` | \`string\` | Prepends the string specified in the modifier to the product description of the child product. | +| \`commodity_type\` | \`string\` | Sets the commodity type of the child product, such as \`physical\` or \`digital\`. | +| \`price\` | \`string\` | Allows application of price modifiers (\`price_increment\`, \`price_decrement\`, and \`price_equals\`) to the child products. | +| \`price_increment\` | \`string\` | Increases the price of the child product. | +| \`price_decrement\` | \`string\` | Decreases the price of the child product. | +| \`price_equals\` | \`string\` | Sets the price of a child product to the amount you specify. | +| \`slug_append\` | \`string\` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_prepend\` | \`string\` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_builder\` | \`string\`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`sku_equals\` | \`string\` | Sets the SKU of the child product. | +| \`sku_append\` | \`string\` | Appends the string specified in the modifier to the SKU of the child product. | +| \`sku_prepend\` | \`string\` | Prepends the string specified in the modifier to the SKU of the child product. | +| \`sku_builder\` | \`string\` | Sets a part of the SKU of the child product. | +| \`status\` | \`string\` | Sets the status of the child product, such as \`draft\` or \`live\`. | +`, + type: "string", + enum: [ + "commodity_type", + "status", + "price", + "name_append", + "name_prepend", + "name_equals", + "sku_append", + "sku_prepend", + "sku_equals", + "sku_builder", + "slug_append", + "slug_prepend", + "slug_equals", + "slug_builder", + "description_append", + "description_prepend", + "description_equals", + "custom_inputs_equals", + "build_rules_equals", + "locales_equals", + "upc_ean_equals", + "mpn_equals", + "external_ref_equals", + ], + }, + value: { + description: + "Required for non-builder modifiers. The value of the modifier type.", + type: "string", + }, + seek: { + description: + "Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`.", + type: "string", + }, + set: { + description: + "Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`.", + type: "string", + }, + reference_name: { + description: "The name of the modifier.", + type: "string", + }, + }, + }, + meta: { + type: "object", + description: + "The owner of the resource, either `organization` or `store`.", + properties: { + owner: { + type: "string", + enum: ["organization", "store"], + }, + }, + }, + }, + }, + }, +} as const + +export const $update_modifier = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["type", "attributes", "id"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `product-variation-modifier`.", + type: "string", + enum: ["product-variation-modifier"], + }, + attributes: { + type: "object", + required: ["type"], + additionalProperties: false, + properties: { + type: { + description: `You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + +| Modifier | Data Type | Effect | +| :--- | :--- | :--- | +| \`name_equals\` | \`string\` | Overrides the name of the child product with the name specified by the modifier. | +| \`name_append\` | \`string\` | Appends the string specified in the modifier to the name of the child product. | +| \`name_prepend\` | \`string\` | Prepends the string specified in the modifier to the name of the child product. | +| \`description_equals\` | \`string\` | Overrides the description of the child product. | +| \`description_append\` | \`string\` | Appends the string specified in the modifier to the description of the child product. | +| \`description_prepend\` | \`string\` | Prepends the string specified in the modifier to the product description of the child product. | +| \`commodity_type\` | \`string\` | Sets the commodity type of the child product, such as \`physical\` or \`digital\`. | +| \`price\` | \`string\` | Allows application of price modifiers (\`price_increment\`, \`price_decrement\`, and \`price_equals\`) to the child products. | +| \`price_increment\` | \`string\` | Increases the price of the child product. | +| \`price_decrement\` | \`string\` | Decreases the price of the child product. | +| \`price_equals\` | \`string\` | Sets the price of a child product to the amount you specify. | +| \`slug_append\` | \`string\` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_prepend\` | \`string\` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`slug_builder\` | \`string\`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the \`slug-builder\` modifier, you can use \`{}\` in the \`seek\` field, for example, \`"seek": :{COLOR}"\`. | +| \`sku_equals\` | \`string\` | Sets the SKU of the child product. | +| \`sku_append\` | \`string\` | Appends the string specified in the modifier to the SKU of the child product. | +| \`sku_prepend\` | \`string\` | Prepends the string specified in the modifier to the SKU of the child product. | +| \`sku_builder\` | \`string\` | Sets a part of the SKU of the child product. | +| \`status\` | \`string\` | Sets the status of the child product, such as \`draft\` or \`live\`. | +`, + type: "string", + enum: [ + "commodity_type", + "status", + "price", + "name_append", + "name_prepend", + "name_equals", + "sku_append", + "sku_prepend", + "sku_equals", + "sku_builder", + "slug_append", + "slug_prepend", + "slug_equals", + "slug_builder", + "description_append", + "description_prepend", + "description_equals", + "custom_inputs_equals", + "build_rules_equals", + "locales_equals", + "upc_ean_equals", + "mpn_equals", + "external_ref_equals", + ], + }, + value: { + description: + "Required for non-builder modifiers. The value of the modifier type.", + type: "string", + }, + seek: { + description: + "Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`.", + type: "string", + }, + set: { + description: + "Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`.", + type: "string", + }, + reference_name: { + description: "The name of the modifier.", + type: "string", + }, + }, + }, + id: { + type: "string", + description: + "The unique identifier of the modifier. Must match the modifier ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + }, + }, + }, +} as const + +export const $attributes_hierarchy = { + type: "object", + properties: { + name: { + description: "The name of a hierarchy, such as `Major Appliances`.", + type: "string", + }, + description: { + description: "A description for a hierarchy.", + type: "string", + }, + slug: { + description: "A unique slug for a hierarchy.", + type: "string", + }, + locales: { + description: + "Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A localized hierarchy or node name.", + type: "string", + }, + description: { + description: "A localized hierarchy or node description.", + type: "string", + }, + }, + }, + }, + }, +} as const + +export const $relationships_hierarchy = { + type: "object", + properties: { + children: { + description: "The child nodes related to the hierarchy.", + type: "object", + properties: { + data: { + description: "An array of child nodes.", + type: "array", + required: [], + }, + links: { + description: "Links allow you to move between requests.", + type: "object", + properties: { + related: { + description: "A link to a related resource.", + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $hierarchy = { + type: "object", + properties: { + id: { + description: "A unique identifier generated when a hierarchy is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `hierarchy`.", + type: "string", + enum: ["hierarchy"], + }, + attributes: { + $ref: "#/components/schemas/attributes_hierarchy", + }, + relationships: { + $ref: "#/components/schemas/relationships_hierarchy", + }, + meta: { + type: "object", + properties: { + created_at: { + description: "The date and time a hierarchy is created.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + description: "The date and time a hierarchy is updated.", + type: "string", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["store", "organization"], + }, + }, + }, + }, +} as const + +export const $multi_hierarchy = { + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/hierarchy", + }, + }, + links: { + $ref: "#/components/schemas/multi_links", + }, + meta: { + $ref: "#/components/schemas/multi_meta", + }, + }, +} as const + +export const $req_attributes_hierarchy = { + type: "object", + additionalProperties: false, + properties: { + name: { + description: "The name of the hierarchy, such as `Major Appliances`.", + type: "string", + }, + description: { + description: "A description of the hierarchy.", + type: "string", + }, + slug: { + description: "A unique slug for the hierarchy.", + type: "string", + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A localized name for the hierarchy.", + type: "string", + }, + description: { + description: "A localized description for the hierarchy.", + type: "string", + }, + }, + }, + }, + }, +} as const + +export const $create_hierarchy = { + type: "object", + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `hierarchy`.", + type: "string", + enum: ["hierarchy"], + }, + attributes: { + $ref: "#/components/schemas/req_attributes_hierarchy", + }, + }, + }, + }, +} as const + +export const $single_hierarchy = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/hierarchy", + }, + }, +} as const + +export const $update_hierarchy = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["id", "type", "attributes"], + properties: { + id: { + type: "string", + description: + "The unique identifier of the hierarchy. Must match the hierarchy ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `hierarchy`.", + type: "string", + enum: ["hierarchy"], + example: "hierarchy", + }, + attributes: { + $ref: "#/components/schemas/req_attributes_hierarchy", + }, + }, + }, + }, +} as const + +export const $attributes_nodes = { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + }, + description: { + description: "A description of the node.", + type: "string", + }, + slug: { + description: + "A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + }, + curated_products: { + description: + "You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. See [Curating Products in a node](/docs/api/pxm/products/create-node#curating-products-in-a-node).", + type: "array", + items: { + description: + "A list of product IDs for the products that you want to curate in a node.", + type: "string", + }, + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: false, + properties: { + name: { + description: "A localized name for the node.", + type: "string", + }, + description: { + description: "A localized description for the node.", + type: "string", + }, + }, + }, + }, + }, +} as const + +export const $create_node = { + type: "object", + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + attributes: { + $ref: "#/components/schemas/attributes_nodes", + }, + meta: { + type: "object", + additionalProperties: false, + properties: { + sort_order: { + description: `You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The \`sort_order\` for each node. This value determines the order of nodes in the response for the \`Get a Node’s Children\` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + +- If you don’t provide \`sort_order\` when creating nodes, all child nodes in the response for \`Get a Node’s Children\` request are ordered by the \`updated_at\` time in descending order, with the most recently updated child node first. +- If you set \`sort_order\` for only a few child nodes or not all, the child nodes with a \`sort_order\` value appear first and then other child nodes appear in the order of \`updated_at\` time. See [Sorting Nodes in a hierarchy](). +`, + type: "integer", + }, + }, + }, + }, + }, + }, +} as const + +export const $single_node = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/node", + }, + }, +} as const + +export const $update_node = { + type: "object", + properties: { + data: { + type: "object", + required: ["id", "type", "attributes"], + properties: { + id: { + type: "string", + description: + "The unique identifier of the node. Must match the node ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + attributes: { + $ref: "#/components/schemas/attributes_nodes", + }, + meta: { + type: "object", + additionalProperties: false, + properties: { + sort_order: { + description: `You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The \`sort_order\` for each node. This value determines the order of nodes in the response for the \`Get a Node’s Children\` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + +- If you don’t provide \`sort_order\` when creating nodes, all child nodes in the response for \`Get a Node’s Children\` request are ordered by the \`updated_at\` time in descending order, with the most recently updated child node first. +- If you set \`sort_order\` for only a few child nodes or not all, the child nodes with a \`sort_order\` value appear first and then other child nodes appear in the order of \`updated_at\` time. +`, + type: "integer", + }, + }, + }, + }, + }, + }, +} as const + +export const $node_children = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + required: ["id", "type"], + properties: { + id: { + type: "string", + description: + "The unique identifier of the child node. Must not match the node ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + }, + }, + }, + }, +} as const + +export const $node_parent = { + type: "object", + properties: { + data: { + type: "object", + required: ["id", "type"], + properties: { + id: { + type: "string", + description: + "The unique identifier of the new parent node. Must not match the node ID specified in the request path.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `node`.", + type: "string", + enum: ["node"], + }, + }, + }, + }, +} as const + +export const $node_products = { + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + required: ["id", "type"], + properties: { + id: { + type: "string", + description: + "The unique identifier of the product to be attached to the node.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `product`.", + type: "string", + enum: ["product"], + }, + }, + }, + }, + }, +} as const + +export const $duplicate_job = { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `hierarchy`.", + type: "string", + enum: ["hierarchy"], + }, + attributes: { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "The name of the duplicate hierarchy. The maximum length is 1000 characters.", + type: "string", + }, + description: { + description: "A description of the duplicate hierarchy.", + type: "string", + }, + include_products: { + description: + "Specify `true` if you want the product associations in the existing nodes associated in your duplicated hierarchy. If not, specify `false`.", + type: "boolean", + }, + }, + }, + }, + }, + }, +} as const + +export const $tag = { + type: "object", + properties: { + id: { + description: "A unique identifier generated when a tag is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `tag`.", + type: "string", + enum: ["tag"], + }, + attributes: { + type: "object", + properties: { + value: { + type: "string", + description: "The text value of the tag.", + }, + }, + }, + meta: { + type: "object", + properties: { + x_request_id: { + type: "string", + description: + "A unique request ID is generated when a tag is created.", + }, + created_at: { + type: "string", + description: "The date and time a tag is created.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + updated_at: { + type: "string", + description: "The date and time a tag is updated.", + example: "2020-09-22T09:00:00", + format: "date-time", + }, + owner: { + description: + "The owner of a resource, either `organization` or `store`.", + type: "string", + enum: ["store", "organization"], + }, + }, + }, + }, +} as const + +export const $multi_tag = { + type: "object", + properties: { + data: { + description: "An array of tags.", + type: "array", + items: { + $ref: "#/components/schemas/tag", + }, + }, + meta: { + type: "object", + properties: { + results: { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + example: 2, + }, + }, + }, + }, + }, + }, +} as const + +export const $single_tag = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/tag", + }, + }, +} as const + +export const $req_attributes_custom_relationship = { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "The name of the custom relationship, such as `Kitchen electrics`.", + type: "string", + }, + description: { + description: "A description of the custom relationship.", + type: "string", + }, + slug: { + description: + "A unique slug for the custom relationship. Must match the slug specified in the request path.", + type: "string", + }, + }, +} as const + +export const $create_custom_relationship = { + type: "object", + properties: { + data: { + type: "object", + required: ["type", "attributes"], + properties: { + type: { + description: + "This represents the type of resource object being returned. Always `custom-relationship`.", + type: "string", + enum: ["custom-relationship"], + }, + attributes: { + $ref: "#/components/schemas/req_attributes_custom_relationship", + }, + }, + }, + }, +} as const + +export const $attributes_custom_relationship = { + type: "object", + additionalProperties: false, + properties: { + name: { + description: + "The name of the custom relationship, such as `Kitchen electrics`.", + type: "string", + }, + description: { + description: "A description of the custom relationship.", + type: "string", + }, + slug: { + description: "A unique slug for the custom relationship.", + type: "string", + }, + }, +} as const + +export const $custom_relationship = { + type: "object", + properties: { + id: { + description: + "A unique identifier generated when a custom relationship is created.", + type: "string", + }, + type: { + description: + "This represents the type of resource object being returned. Always `hierarchy`.", + type: "string", + enum: ["custom-relationship"], + }, + attributes: { + $ref: "#/components/schemas/attributes_custom_relationship", + }, + meta: { + type: "object", + properties: { + owner: { + description: "The owner of the resource.", + type: "string", + example: "store", + }, + timestamps: { + type: "object", + properties: { + created_at: { + description: "The date and time the resource is created.", + type: "string", + example: "2024-01-10T20:16:35.343Z", + format: "date-time", + }, + updated_at: { + description: "The date and time the resource is updated.", + type: "string", + example: "2024-01-10T20:16:35.343Z", + format: "date-time", + }, + }, + }, + }, + }, + }, +} as const + +export const $single_custom_relationship = { + type: "object", + properties: { + data: { + $ref: "#/components/schemas/custom_relationship", + }, + }, +} as const + +export const $update_custom_relationship = { + type: "object", + required: ["data"], + properties: { + data: { + type: "object", + required: ["id", "type", "attributes"], + properties: { + id: { + type: "string", + description: "The unique identifier of the custom relationship.", + example: "00000000-0000-0000-0000-000000000000", + }, + type: { + description: + "This represents the type of resource object being returned. Always `custom-relationship`.", + type: "string", + enum: ["custom-relationship"], + example: "custom-relationship", + }, + attributes: { + $ref: "#/components/schemas/req_attributes_custom_relationship", + }, + }, + }, + }, +} as const diff --git a/packages/sdks/pim/src/client/services.gen.ts b/packages/sdks/pim/src/client/services.gen.ts new file mode 100644 index 00000000..c1c40147 --- /dev/null +++ b/packages/sdks/pim/src/client/services.gen.ts @@ -0,0 +1,1557 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { + client, + type Options, + formDataBodySerializer, +} from "@hey-api/client-fetch" +import { + type GetAllJobsError, + type GetAllJobsResponse, + type GetJobData, + type GetJobError, + type GetJobResponse, + type CancelJobData, + type CancelJobError, + type CancelJobResponse, + type GetJobErrorsData, + type GetJobErrorsError, + type GetJobErrorsResponse, + type CreateProductData, + type CreateProductError, + type CreateProductResponse, + type GetAllProductsData, + type GetAllProductsError, + type GetAllProductsResponse, + type ImportProductsData, + type ImportProductsError, + type ImportProductsResponse, + type ExportProductsData, + type ExportProductsError, + type ExportProductsResponse, + type GetProductData, + type GetProductError, + type GetProductResponse, + type UpdateProductData, + type UpdateProductError, + type UpdateProductResponse, + type DeleteProductData, + type DeleteProductError, + type DeleteProductResponse, + type AttachNodesData, + type AttachNodesError, + type AttachNodesResponse, + type DetachNodesData, + type DetachNodesError, + type DetachNodesResponse, + type GetProductsNodesData, + type GetProductsNodesError, + type GetProductsNodesResponse, + type BuildChildProductsData, + type BuildChildProductsError, + type BuildChildProductsResponse, + type GetChildProductsData, + type GetChildProductsError, + type GetChildProductsResponse, + type CreateProductTemplateRelationshipData, + type CreateProductTemplateRelationshipError, + type CreateProductTemplateRelationshipResponse, + type GetProductTemplateRelationshipsData, + type GetProductTemplateRelationshipsError, + type GetProductTemplateRelationshipsResponse, + type DeleteProductTemplateRelationshipData, + type DeleteProductTemplateRelationshipError, + type DeleteProductTemplateRelationshipResponse, + type GetProductComponentProductsRelationshipsData, + type GetProductComponentProductsRelationshipsError, + type GetProductComponentProductsRelationshipsResponse, + type GetProductFileRelationshipsData, + type GetProductFileRelationshipsError, + type GetProductFileRelationshipsResponse, + type CreateProductFileRelationshipsData, + type CreateProductFileRelationshipsError, + type CreateProductFileRelationshipsResponse, + type UpdateProductFileRelationshipsData, + type UpdateProductFileRelationshipsError, + type UpdateProductFileRelationshipsResponse, + type DeleteProductFileRelationshipsData, + type DeleteProductFileRelationshipsError, + type DeleteProductFileRelationshipsResponse, + type CreateProductVariationRelationshipsData, + type CreateProductVariationRelationshipsError, + type CreateProductVariationRelationshipsResponse, + type GetProductVariationRelationshipsData, + type GetProductVariationRelationshipsError, + type GetProductVariationRelationshipsResponse, + type UpdateProductVariationRelationshipsData, + type UpdateProductVariationRelationshipsError, + type UpdateProductVariationRelationshipsResponse, + type DeleteProductVariationRelationshipsData, + type DeleteProductVariationRelationshipsError, + type DeleteProductVariationRelationshipsResponse, + type CreateProductMainImageRelationshipsData, + type CreateProductMainImageRelationshipsError, + type CreateProductMainImageRelationshipsResponse, + type GetProductMainImageRelationshipsData, + type GetProductMainImageRelationshipsError, + type GetProductMainImageRelationshipsResponse, + type UpdateProductMainImageRelationshipsData, + type UpdateProductMainImageRelationshipsError, + type UpdateProductMainImageRelationshipsResponse, + type DeleteProductMainImageRelationshipsData, + type DeleteProductMainImageRelationshipsError, + type DeleteProductMainImageRelationshipsResponse, + type CreateVariationData, + type CreateVariationError, + type CreateVariationResponse, + type GetAllVariationsData, + type GetAllVariationsError, + type GetAllVariationsResponse, + type GetVariationData, + type GetVariationError, + type GetVariationResponse, + type UpdateVariationData, + type UpdateVariationError, + type UpdateVariationResponse, + type DeleteVariationData, + type DeleteVariationError, + type DeleteVariationResponse, + type CreateVariationOptionData, + type CreateVariationOptionError, + type CreateVariationOptionResponse, + type GetAllVariationOptionsData, + type GetAllVariationOptionsError, + type GetAllVariationOptionsResponse, + type GetVariationOptionData, + type GetVariationOptionError, + type GetVariationOptionResponse, + type UpdateVariationOptionData, + type UpdateVariationOptionError, + type UpdateVariationOptionResponse, + type DeleteVariationOptionData, + type DeleteVariationOptionError, + type DeleteVariationOptionResponse, + type CreateModifierData, + type CreateModifierError, + type CreateModifierResponse, + type GetAllModifiersData, + type GetAllModifiersError, + type GetAllModifiersResponse, + type GetModifierData, + type GetModifierError, + type GetModifierResponse, + type UpdateModifierData, + type UpdateModifierError, + type UpdateModifierResponse, + type DeleteModifierData, + type DeleteModifierError, + type DeleteModifierResponse, + type CreateHierarchyData, + type CreateHierarchyError, + type CreateHierarchyResponse, + type GetHierarchyData, + type GetHierarchyError, + type GetHierarchyResponse, + type GetHierarchyChildData, + type GetHierarchyChildError, + type GetHierarchyChildResponse, + type UpdateHierarchyData, + type UpdateHierarchyError, + type UpdateHierarchyResponse, + type DeleteHierarchyData, + type DeleteHierarchyError, + type DeleteHierarchyResponse, + type CreateNodeData, + type CreateNodeError, + type CreateNodeResponse, + type GetAllNodesInHierarchyData, + type GetAllNodesInHierarchyError, + type GetAllNodesInHierarchyResponse, + type GetHierarchyNodeData, + type GetHierarchyNodeError, + type GetHierarchyNodeResponse, + type UpdateNodeData, + type UpdateNodeError, + type UpdateNodeResponse, + type DeleteNodeData, + type DeleteNodeError, + type DeleteNodeResponse, + type GetAllChildrenData, + type GetAllChildrenError, + type GetAllChildrenResponse, + type CreateNodeChildRelationshipsData, + type CreateNodeChildRelationshipsError, + type CreateNodeChildRelationshipsResponse, + type GetAllNodeChildrenData, + type GetAllNodeChildrenError, + type GetAllNodeChildrenResponse, + type UpdateNodeParentData, + type UpdateNodeParentError, + type UpdateNodeParentResponse, + type DeleteNodeParentData, + type DeleteNodeParentError, + type DeleteNodeParentResponse, + type CreateNodeProductRelationshipData, + type CreateNodeProductRelationshipError, + type CreateNodeProductRelationshipResponse, + type DeleteNodeProductRelationshipsData, + type DeleteNodeProductRelationshipsError, + type DeleteNodeProductRelationshipsResponse, + type GetNodeProductsData, + type GetNodeProductsError, + type GetNodeProductsResponse, + type DuplicateHierarchyData, + type DuplicateHierarchyError, + type DuplicateHierarchyResponse, + type GetAllProductTagsError, + type GetAllProductTagsResponse, + type GetProductTagData, + type GetProductTagError, + type GetProductTagResponse, + type CreateCustomRelationshipData, + type CreateCustomRelationshipError, + type CreateCustomRelationshipResponse, + type UpdateCustomRelationshipData, + type UpdateCustomRelationshipError, + type UpdateCustomRelationshipResponse, + GetAllJobsResponseTransformer, + GetJobResponseTransformer, + CancelJobResponseTransformer, + CreateProductResponseTransformer, + GetAllProductsResponseTransformer, + ImportProductsResponseTransformer, + ExportProductsResponseTransformer, + GetProductResponseTransformer, + UpdateProductResponseTransformer, + GetProductsNodesResponseTransformer, + GetChildProductsResponseTransformer, + CreateVariationResponseTransformer, + CreateVariationOptionResponseTransformer, + GetVariationOptionResponseTransformer, + UpdateVariationOptionResponseTransformer, + CreateHierarchyResponseTransformer, + GetHierarchyResponseTransformer, + GetHierarchyChildResponseTransformer, + UpdateHierarchyResponseTransformer, + CreateNodeResponseTransformer, + GetAllNodesInHierarchyResponseTransformer, + GetHierarchyNodeResponseTransformer, + UpdateNodeResponseTransformer, + GetAllChildrenResponseTransformer, + CreateNodeChildRelationshipsResponseTransformer, + GetAllNodeChildrenResponseTransformer, + CreateNodeProductRelationshipResponseTransformer, + DeleteNodeProductRelationshipsResponseTransformer, + GetNodeProductsResponseTransformer, + DuplicateHierarchyResponseTransformer, + GetAllProductTagsResponseTransformer, + GetProductTagResponseTransformer, + CreateCustomRelationshipResponseTransformer, + UpdateCustomRelationshipResponseTransformer, +} from "./types.gen" + +/** + * Get All Jobs + * The jobs endpoints displays the status of a number of endpoints that function as jobs, for example, product import and export, price book import, building child products, and duplicating hierarchies. + */ +export const getAllJobs = (options?: Options) => { + return (options?.client ?? client).get({ + ...options, + url: "/pcm/jobs", + responseTransformer: GetAllJobsResponseTransformer, + }) +} + +/** + * Get a Job + */ +export const getJob = (options: Options) => { + return (options?.client ?? client).get({ + ...options, + url: "/pcm/jobs/{jobID}", + responseTransformer: GetJobResponseTransformer, + }) +} + +/** + * Cancel a Job + * The jobs endpoints display the status of a number of endpoints that function as jobs, for example, product import and export, and duplicating hierarchies. + * + * Jobs are processed one at a time. You can continue to send job requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. If you decide that a specific job needs to be prioritized over another, you can cancel the less critical job using the `Cancel a job` endpoint. You can only cancel jobs whose status is PENDING. + * + */ +export const cancelJob = (options: Options) => { + return (options?.client ?? client).post({ + ...options, + url: "/pcm/jobs/{jobID}/cancel", + responseTransformer: CancelJobResponseTransformer, + }) +} + +/** + * Get Job Errors + */ +export const getJobErrors = (options: Options) => { + return (options?.client ?? client).get< + GetJobErrorsResponse, + GetJobErrorsError + >({ + ...options, + url: "/pcm/jobs/{jobID}/errors", + }) +} + +/** + * Create a product or bundle + * Creates a product or bundle with the attributes that are defined in the body. + * + * #### Product Types + * + * Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + * + * Product types can also be used in catalogs. For example, in your catalog, you can filter on `parent` so that only your parent products are displayed in your storefront. + * + * See [**Product Types**](/docs/api/pxm/products/products#product-types). + * + * #### Product Tags + * + * You can use product tags to store or assign a key word against a product or service that you sell in your store. The product tag can then be used to describe or label that product. Product tags represent similarities between products who do not share the same attributes. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. + * + * See [**Product Tags**](/docs/api/pxm/products/product-tags). + * + * #### Personalizing products + * + * You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this by configuring the the `custom_inputs` attribute. + * + * When configuring the `custom_inputs` attribute: + * + * - You can rename `input` to something more representative of the input that shoppers are adding, for example, `message` or `front`. + * - `name` is the name that is displayed in your storefront. + * - You can add validation rules. For example, the input field must be a `string` and/or up to 255 characters in length. The limit is 255 characters. + * - You can specify if the input field is required. + * + * #### Curating Products + * + * You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. See [**Update a node**](/docs/api/pxm/products/update-node). + * + * #### Bundles + * + * With Product Experience Manager, you can use the products API to create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + * + * See [**Bundles**](/docs/api/pxm/products/products#bundles). + * + */ +export const createProduct = (options: Options) => { + return (options?.client ?? client).post< + CreateProductResponse, + CreateProductError + >({ + ...options, + url: "/pcm/products", + responseTransformer: CreateProductResponseTransformer, + }) +} + +/** + * Get all products + * Retrieves a list of all your products in the Product Experience Manager system. + * + * You can also use `include` to retrieve top-level resources, such as files or images, and key attribute data, such as SKU or slug for component products in a product bundle. With this option, you can get more information about the products in a product bundle in your store front, improving the buying experience for your shoppers. + * + * #### Filtering + * + * Many Commerce API endpoints support filtering. The general syntax is described in [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + * + * The following attributes and operators are supported. + * + * | Operator | Attribute | Description | Example | + * | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + * | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types`, `tags` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + * | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `tags` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + * | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types`, `tags` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + * + */ +export const getAllProducts = (options?: Options) => { + return (options?.client ?? client).get< + GetAllProductsResponse, + GetAllProductsError + >({ + ...options, + url: "/pcm/products", + responseTransformer: GetAllProductsResponseTransformer, + }) +} + +/** + * Import Products + * + * You can use the Product Import API to: + * + * - Add new products, including: + * + * - main image files. See [Importing Main Image Files](/docs/api/pxm/products/product-import-bulk-update#using-imported-main-image-files). + * - custom data. See [Importing custom data](/docs/api/pxm/products/product-import-bulk-update#importing-custom-data-flows). + * - Make bulk updates to existing products. + * + * You cannot use product import to: + * + * - Delete existing products. + * - Import product bundles. + * + * The Product Import API uses a Comma Separated Values (CSV) file to import products, main image files and custom extension data. Each row in a .csv file represents a product you want to create/update. + * + * Each file can have 50,000 rows, including the header. If a CSV file exceeds 50,000 rows, an error is displayed, and the products are not imported. A CSV file must not be larger than 50 megabytes. If a CSV file is larger than 50 megabytes, a `503 client read` error is displayed. + * + * If you want to create/update more than 50,000 products or your CSV file is larger than 50 megabytes, you must have a separate CSV file and import each CSV file one at a time. + * + * See [**Characteristics of CSV Files**](/docs/api/pxm/products/product-import-bulk-update#characteristics-of-csv-import-files). + * + */ +export const importProducts = (options?: Options) => { + return (options?.client ?? client).post< + ImportProductsResponse, + ImportProductsError + >({ + ...options, + ...formDataBodySerializer, + url: "/pcm/products/import", + responseTransformer: ImportProductsResponseTransformer, + }) +} + +/** + * Export Products + * + * The Export API is available to make bulk updates to products in Product Experience Manager. You might also export products for your personal requirements. + * + * The Export API builds a CSV file containing the product entries. A CSV file can contain up to 50,000 product entries. If you have more than 50,000 product entries, then another CSV file is created and so on, until all your products are exported. + * + * The Job endpoint response specifies the location where the CSV file is stored. See [Characteristics of CSV Files](/docs/api/pxm/products/product-export#characteristics-of-exporting-products). + * + * ### Filtering + * + * The following attributes and operators are supported. + * + * | Operator | Attribute | Description | Example | + * | :--- |:-------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------| :--- | + * | `eq` | `sku`, `slug`, `upc_ean`, `mpn`, `name`, `description`, `tags` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. When filtering on tags, you can only specify one product tag. | `filter=eq(name,some-name)` | + * | `In` | `sku`, `tags` | Checks if the values are included in the specified string. If they are, the condition is true. When filtering on tags, you can specify a list of product tags. | `filter=in(id,some-id)` | + * | `like` | `sku`, `slug`, `upc_ean`, `mpn`, `name`, `description` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,some-name)` | + * + */ +export const exportProducts = (options?: Options) => { + return (options?.client ?? client).post< + ExportProductsResponse, + ExportProductsError + >({ + ...options, + url: "/pcm/products/export", + responseTransformer: ExportProductsResponseTransformer, + }) +} + +/** + * Get a product + * Returns a product by its identifier. + * + * You can also use `include=component_products` to retrieve top-level resources, such as files or images, and key attribute data, such as SKU or slug for component products in a product bundle. With this option, you can get more information about the products in a product bundle in your store front, improving the buying experience for your shoppers. + * + */ +export const getProduct = (options: Options) => { + return (options?.client ?? client).get({ + ...options, + url: "/pcm/products/{productID}", + responseTransformer: GetProductResponseTransformer, + }) +} + +/** + * Update a product or bundle + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the product or bundle is not updated. + */ +export const updateProduct = (options: Options) => { + return (options?.client ?? client).put< + UpdateProductResponse, + UpdateProductError + >({ + ...options, + url: "/pcm/products/{productID}", + responseTransformer: UpdateProductResponseTransformer, + }) +} + +/** + * Delete a product + * Deletes the specified product. + * + * You cannot delete a product if it is part of a bundle. You must first delete the bundle before you delete the product. + * + */ +export const deleteProduct = (options: Options) => { + return (options?.client ?? client).delete< + DeleteProductResponse, + DeleteProductError + >({ + ...options, + url: "/pcm/products/{productID}", + }) +} + +/** + * Attach multiple nodes + * Assigns products to multiple hierarchies and their children nodes. You can apply a filter to search for the appropriate products to attach to a node. For general filtering syntax, see [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + * + * The following attributes and operators are supported. + * + * | Operator | Attribute | Description | Example | + * | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + * | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + * | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + * | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + * + * + */ +export const attachNodes = (options: Options) => { + return (options?.client ?? client).post< + AttachNodesResponse, + AttachNodesError + >({ + ...options, + url: "/pcm/products/attach_nodes", + }) +} + +/** + * Detach multiple nodes + * Dissociates products from multiple hierarchies and their children nodes. You can apply filters to search for the appropriate products to detach. For general filtering syntax, see [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + * + * The following attributes and operators are supported. + * + * | Operator | Attribute | Description | Example | + * | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + * | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + * | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + * | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + * + */ +export const detachNodes = (options: Options) => { + return (options?.client ?? client).post< + DetachNodesResponse, + DetachNodesError + >({ + ...options, + url: "/pcm/products/detach_nodes", + }) +} + +/** + * Get a product's nodes + * Returns the nodes associated with the product. Products must be in a `live` status. + */ +export const getProductsNodes = (options: Options) => { + return (options?.client ?? client).get< + GetProductsNodesResponse, + GetProductsNodesError + >({ + ...options, + url: "/pcm/products/{productID}/nodes", + responseTransformer: GetProductsNodesResponseTransformer, + }) +} + +/** + * Build child products + * With product variations in Product Experience Manager, you can create product variations and different options for each variation and use both to create child products for a product. Each child product is a unique combination of options associated with the product. + * + * Child products inherit attributes from their parent products. When you make changes to the attributes of the parent products, you can rebuild your child products, ensuring that changes to the parent products are propagated to the child products. + * + * Alternatively, you can modify a child product independently, without impacting its parent product. For example, you may prefer the status of your child product to be `live`, while keeping the parent product's status as `draft`. When you directly update a child product, it becomes independent of its parent product. In other words, any subsequent changes made to the parent product are not automatically reflected in the child product when you rebuild the parent product and its child products. Once a child product is independent of its parent, you cannot recreate the association between the child product and its parent. You must delete the child product and rebuild the parent to recreate the child product. + * + * Following on from that, if you add the same flow to both a parent and child product, the child flow values are not affected by changes to the parent flow values in a rebuild. + * + * ### Using Build Rules + * + * When building your child products, you can build all products related to a product. + * + * Alternatively, you can build a combination of child products associated with a product, based on build rules that you specify. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. You can do this using `build_rules`. `build_rules` are combinations of variation option IDs that you wish to include or exclude when building your child products. + * + * :::note + * + * You do not need to configure any `build_rules` in the following scenarios: + * + * - Child products must be built with all variation options. Simply, use the `Create a product` or `Update a product` endpoints with no `build_rules` specified. + * - Child products must be built apart from all options for a specific variation. In this case, you must remove the variation and use the `Create a product` or `Update a product` endpoints with no `build_rules` specified. In other words, using our example, if none of the `size` options should be included, then remove the `size` variation. + * + * ::: + * + * The `build_rules` contain: + * + * - (Required) `default`: specifies the default behavior. + * - (Optional) `include`: specifies the option IDs to include when the child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. See [**Invalid Build Rules**](#invalid-build-rules). + * - (Optional) `exclude`: specifies the option IDs to exclude when the child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. See [**Invalid build rules**](#invalid-build-rules). + * + * When building child products, Commerce compares each combination of option IDs to these rules to determine how your child products should be built, depending on how you have configured the `build_rules`. It depends on your requirements how you configure your `build_rules`. + * + * #### Invalid Build Rules + * + * The `build_rules` are invalid if both the option IDs come from the same variation. Combinations of option IDs in the nested arrays must come from different variations. + * + * If Commerce cannot resolve the `build_rules` a `could not determine whether to include or exclude a child product due to ambiguous rules` error is returned. This error can occur, for example, if you have the same number of variation option IDs in both the `include` and `exclude` arrays and the variation option IDs match. + * + * ### Building Child Products + * + * Building child products is an asynchronous operation. When you build child products, a job is created. The jobId of the job is displayed in the response. When the job is complete, the build child products operation is also complete. You can use the jobId to see the status of your job using the `Get a Job` endpoint. + * + * Jobs are processed one at a time. You can continue to send build child product requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. See Jobs. + * + * Re-building child products after adding or removing a new variation changes the total number of child products that you can generate from a parent product. When you rebuild the child products after updating variations associated with the parent product, all existing child products that belong to a parent product are deleted. New child products are created with new product IDs. + * + * If you have any bundles that reference child products directly, then you must update the bundles with the new child product IDs. + * + * However, re-building child products after adding or removing an option does not change the existing product IDs. + * + */ +export const buildChildProducts = ( + options: Options, +) => { + return (options?.client ?? client).post< + BuildChildProductsResponse, + BuildChildProductsError + >({ + ...options, + url: "/pcm/products/{productID}/build", + }) +} + +/** + * Get child products + */ +export const getChildProducts = (options: Options) => { + return (options?.client ?? client).get< + GetChildProductsResponse, + GetChildProductsError + >({ + ...options, + url: "/pcm/products/{productID}/children", + responseTransformer: GetChildProductsResponseTransformer, + }) +} + +/** + * Create a product template relationship + * Retrieves all the templates that are associated with the specified product. + */ +export const createProductTemplateRelationship = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateProductTemplateRelationshipResponse, + CreateProductTemplateRelationshipError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/templates", + }) +} + +/** + * Get all product template relationships + */ +export const getProductTemplateRelationships = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductTemplateRelationshipsResponse, + GetProductTemplateRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/templates", + }) +} + +/** + * Delete a product template relationship + */ +export const deleteProductTemplateRelationship = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteProductTemplateRelationshipResponse, + DeleteProductTemplateRelationshipError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/templates", + }) +} + +/** + * Get Bundle Component Product Relationships + * Retrieves all the products included in the specified bundle product. + */ +export const getProductComponentProductsRelationships = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductComponentProductsRelationshipsResponse, + GetProductComponentProductsRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/component_products", + }) +} + +/** + * Get all product file relationships + * Retrieves all files that are associated with the specified product. + */ +export const getProductFileRelationships = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductFileRelationshipsResponse, + GetProductFileRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/files", + }) +} + +/** + * Create a product file relationship + */ +export const createProductFileRelationships = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateProductFileRelationshipsResponse, + CreateProductFileRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/files", + }) +} + +/** + * Replace a product file relationship + */ +export const updateProductFileRelationships = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateProductFileRelationshipsResponse, + UpdateProductFileRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/files", + }) +} + +/** + * Delete a product file relationships + */ +export const deleteProductFileRelationships = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteProductFileRelationshipsResponse, + DeleteProductFileRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/files", + }) +} + +/** + * Create a product variation relationship + */ +export const createProductVariationRelationships = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateProductVariationRelationshipsResponse, + CreateProductVariationRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/variations", + }) +} + +/** + * Get all product variation relationships + */ +export const getProductVariationRelationships = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductVariationRelationshipsResponse, + GetProductVariationRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/variations", + }) +} + +/** + * Replace a product variation relationship + */ +export const updateProductVariationRelationships = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateProductVariationRelationshipsResponse, + UpdateProductVariationRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/variations", + }) +} + +/** + * Delete a product variation relationships + */ +export const deleteProductVariationRelationships = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteProductVariationRelationshipsResponse, + DeleteProductVariationRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/variations", + }) +} + +/** + * Create main image relationships + * Associates a main image with the specified product. + */ +export const createProductMainImageRelationships = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateProductMainImageRelationshipsResponse, + CreateProductMainImageRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/main_image", + }) +} + +/** + * Get Main Image Relationships + */ +export const getProductMainImageRelationships = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductMainImageRelationshipsResponse, + GetProductMainImageRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/main_image", + }) +} + +/** + * Replace Main Image Relationships + */ +export const updateProductMainImageRelationships = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateProductMainImageRelationshipsResponse, + UpdateProductMainImageRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/main_image", + }) +} + +/** + * Delete Main Image Relationships + */ +export const deleteProductMainImageRelationships = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteProductMainImageRelationshipsResponse, + DeleteProductMainImageRelationshipsError + >({ + ...options, + url: "/pcm/products/{productID}/relationships/main_image", + }) +} + +/** + * Create a variation + */ +export const createVariation = (options: Options) => { + return (options?.client ?? client).post< + CreateVariationResponse, + CreateVariationError + >({ + ...options, + url: "/pcm/variations", + responseTransformer: CreateVariationResponseTransformer, + }) +} + +/** + * Get all variations + */ +export const getAllVariations = (options?: Options) => { + return (options?.client ?? client).get< + GetAllVariationsResponse, + GetAllVariationsError + >({ + ...options, + url: "/pcm/variations", + }) +} + +/** + * Get a variation + */ +export const getVariation = (options: Options) => { + return (options?.client ?? client).get< + GetVariationResponse, + GetVariationError + >({ + ...options, + url: "/pcm/variations/{variationID}", + }) +} + +/** + * Update a variation + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the variation is not updated. + */ +export const updateVariation = (options: Options) => { + return (options?.client ?? client).put< + UpdateVariationResponse, + UpdateVariationError + >({ + ...options, + url: "/pcm/variations/{variationID}", + }) +} + +/** + * Delete a variation and all it's associated options + */ +export const deleteVariation = (options: Options) => { + return (options?.client ?? client).delete< + DeleteVariationResponse, + DeleteVariationError + >({ + ...options, + url: "/pcm/variations/{variationID}", + }) +} + +/** + * Create a variation option + */ +export const createVariationOption = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateVariationOptionResponse, + CreateVariationOptionError + >({ + ...options, + url: "/pcm/variations/{variationID}/options", + responseTransformer: CreateVariationOptionResponseTransformer, + }) +} + +/** + * Get all variation options + */ +export const getAllVariationOptions = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllVariationOptionsResponse, + GetAllVariationOptionsError + >({ + ...options, + url: "/pcm/variations/{variationID}/options", + }) +} + +/** + * Get a variation option + */ +export const getVariationOption = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetVariationOptionResponse, + GetVariationOptionError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}", + responseTransformer: GetVariationOptionResponseTransformer, + }) +} + +/** + * Update a variation option + */ +export const updateVariationOption = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateVariationOptionResponse, + UpdateVariationOptionError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}", + responseTransformer: UpdateVariationOptionResponseTransformer, + }) +} + +/** + * Delete a variation option + */ +export const deleteVariationOption = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteVariationOptionResponse, + DeleteVariationOptionError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}", + }) +} + +/** + * Create a modifier + */ +export const createModifier = (options: Options) => { + return (options?.client ?? client).post< + CreateModifierResponse, + CreateModifierError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}/modifiers", + }) +} + +/** + * Get all modifiers + */ +export const getAllModifiers = (options: Options) => { + return (options?.client ?? client).get< + GetAllModifiersResponse, + GetAllModifiersError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}/modifiers", + }) +} + +/** + * Get a modifier + */ +export const getModifier = (options: Options) => { + return (options?.client ?? client).get( + { + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}/modifiers/{modifierID}", + }, + ) +} + +/** + * Update a modifier + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the modifier is not updated. + */ +export const updateModifier = (options: Options) => { + return (options?.client ?? client).put< + UpdateModifierResponse, + UpdateModifierError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}/modifiers/{modifierID}", + }) +} + +/** + * Delete a modifier + * You cannot delete a modifier if it is in use. Deleting a modifier in us returns a `422 Failed Validation` error. + */ +export const deleteModifier = (options: Options) => { + return (options?.client ?? client).delete< + DeleteModifierResponse, + DeleteModifierError + >({ + ...options, + url: "/pcm/variations/{variationID}/options/{optionID}/modifiers/{modifierID}", + }) +} + +/** + * Create a hierarchy + * Create a hierarchy + */ +export const createHierarchy = (options: Options) => { + return (options?.client ?? client).post< + CreateHierarchyResponse, + CreateHierarchyError + >({ + ...options, + url: "/pcm/hierarchies", + responseTransformer: CreateHierarchyResponseTransformer, + }) +} + +/** + * Get all hierarchies + * Get all hierarchies + */ +export const getHierarchy = (options?: Options) => { + return (options?.client ?? client).get< + GetHierarchyResponse, + GetHierarchyError + >({ + ...options, + url: "/pcm/hierarchies", + responseTransformer: GetHierarchyResponseTransformer, + }) +} + +/** + * Get a hierarchy + * Retrieves the specified hierarchy. + */ +export const getHierarchyChild = (options: Options) => { + return (options?.client ?? client).get< + GetHierarchyChildResponse, + GetHierarchyChildError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}", + responseTransformer: GetHierarchyChildResponseTransformer, + }) +} + +/** + * Update a hierarchy + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the hierarchy is not updated. + */ +export const updateHierarchy = (options: Options) => { + return (options?.client ?? client).put< + UpdateHierarchyResponse, + UpdateHierarchyError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}", + responseTransformer: UpdateHierarchyResponseTransformer, + }) +} + +/** + * Delete a hierarchy + * Deletes the specified hierarchy and all its children. + */ +export const deleteHierarchy = (options: Options) => { + return (options?.client ?? client).delete< + DeleteHierarchyResponse, + DeleteHierarchyError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}", + }) +} + +/** + * Create a node + * Creates a node in the specified hierarchy. + * + * ### Sorting Nodes in a Hierarchy + * + * You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. + * + * You can do this by adding a `meta` object to the body of your request and specifying a `sort_order` value. + * + * The node with the highest value of `sort_order` is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + * + * - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + * - If you set `sort_order` for only a few child nodes, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + * + * You can also specify a `sort_order` when creating a node relationship. + * + * - If you create a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when creating **Node A** is overwritten. + * - If you create **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you created **Node A** is not overwritten. + * + * ### Curating Products in a node + * + * You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. + * + * You can do this by adding a `curated_products` attribute to the body of your request and adding an array of product IDs to the attribute. You should add the products IDs in the order you want them to be displayed in your node. The first product ID is displayed first in the product list. + * + * You can only curate 20 products or less. You cannot have more than 20 curated products. + * + * - The product IDs you provide must exist in the specified node. + * - If a curated product is removed from a node, the product is also removed from the curated_products list. + * - Once you have curated the products in a node, you can use the get node products endpoint to retrieve a list of curated products. + * + * You can then display your curated products in your catalogs using the following catalog endpoints. + * + * - Get a node in your latest catalog release. + * - Get a node in a catalog. + * - Get all nodes in your latest catalog release. + * - Get all nodes in a catalog. + * - Get node children in your latest catalog release. + * - Get node children in a catalog. + * + */ +export const createNode = (options: Options) => { + return (options?.client ?? client).post({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes", + responseTransformer: CreateNodeResponseTransformer, + }) +} + +/** + * Get all nodes in a hierarchy + * A fully paginated view of all nodes in a hierarchy regardless of depth. + */ +export const getAllNodesInHierarchy = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllNodesInHierarchyResponse, + GetAllNodesInHierarchyError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes", + responseTransformer: GetAllNodesInHierarchyResponseTransformer, + }) +} + +/** + * Get a node + * Retrieves a node from a hierarchy. + */ +export const getHierarchyNode = (options: Options) => { + return (options?.client ?? client).get< + GetHierarchyNodeResponse, + GetHierarchyNodeError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}", + responseTransformer: GetHierarchyNodeResponseTransformer, + }) +} + +/** + * Update a node + * Updates the specified node in a hierarchy. You can do a partial update, where you specify only the field value to change. + * + * ### Sorting Nodes in a hierarchy + * + * You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. + * + * The node with the highest value of sort_order is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + * + * - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + * - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + * + * You can also specify a sort_order when creating a node relationship. + * + * - If you update a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when updating **Node A** is overwritten. + * - If you have updated **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you updated **Node A** is not overwritten. + * + * ### Curating Products in a node + * + * You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. + * + * You can do this by adding a `curated_products` attribute to the body of your request and adding an array of product IDs to the attribute. You should add the products IDs in the order you want them to be displayed in your node. The first product ID is displayed first in the product list. + * + * You can only curate 20 products or less. You cannot have more than 20 curated products. + * + * - The product IDs you provide must exist in the specified node. + * - If a curated product is removed from a node, the product is also removed from the curated_products list. + * - Once you have curated the products in a node, you can use the get node products endpoint to retrieve a list of curated products. + * + * You can then display your curated products in your catalogs using the following catalog endpoints. + * + * - Get a node in your latest catalog release. + * - Get a node in a catalog. + * - Get all nodes in your latest catalog release. + * - Get all nodes in a catalog. + * - Get node children in your latest catalog release. + * - Get node children in a catalog. + * + */ +export const updateNode = (options: Options) => { + return (options?.client ?? client).put({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}", + responseTransformer: UpdateNodeResponseTransformer, + }) +} + +/** + * Deletes a node + * Deletes a node by the node ID + */ +export const deleteNode = (options: Options) => { + return (options?.client ?? client).delete< + DeleteNodeResponse, + DeleteNodeError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}", + }) +} + +/** + * Get a hierarchy's children + * Get a hierarchy's children + */ +export const getAllChildren = (options: Options) => { + return (options?.client ?? client).get< + GetAllChildrenResponse, + GetAllChildrenError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/children", + responseTransformer: GetAllChildrenResponseTransformer, + }) +} + +/** + * Create relationships between a node and child nodes + * Use this endpoint to create relationships between a single parent node and one or more child nodes. You can create a relationship only if: + * + * - The parent node already exists. + * - All child nodes already exist. + * - Every child node in the body of the request exists in the same hierarchy as the parent node. + * - A node is not a parent of itself. An array of child nodes request body must not contain the ID of the parent node in the path. + * - All siblings in a hierarchy must have a unique `slug`. Siblings are the child nodes that are related to the same parent. + * + * ### Sort Order + * + * You can also provide `sort_order` information when you create a relationship by adding a `meta` object to the array of node reference objects for each child node that requires sorting. + * + * The node with the highest value of `sort_order` appears at the top of the response. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + * + * - If you don’t provide `sort_order` when creating relationships, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order. The most recently updated child node appears at the top of the response. + * - If you set `sort_order` for only a few child nodes or not all, the child nodes with `sort_order` value appear first in the response and then other child nodes appear in the order of `updated_at` time. + * + * You can also specify a `sort_order` when creating and updating a node. + * + * - If you create or update a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when creating\updating **Node A** is overwritten. + * - If you create\update **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you created\updated **Node A** is not overwritten. + * + */ +export const createNodeChildRelationships = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateNodeChildRelationshipsResponse, + CreateNodeChildRelationshipsError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/children", + responseTransformer: CreateNodeChildRelationshipsResponseTransformer, + }) +} + +/** + * Get a node's children + * Retrieves the child nodes for a specified node. + */ +export const getAllNodeChildren = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllNodeChildrenResponse, + GetAllNodeChildrenError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/children", + responseTransformer: GetAllNodeChildrenResponseTransformer, + }) +} + +/** + * Update a node's parent + * Changes the parent of the specified node. The new parent node must be located within the same hierarchy as the specified node. + * + * You cannot move a node to another hierarchy. If you want to put the specified node into another hierarchy, create the node in the target hierarchy and delete it from the current hierarchy. + * + */ +export const updateNodeParent = (options: Options) => { + return (options?.client ?? client).put< + UpdateNodeParentResponse, + UpdateNodeParentError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/parent", + }) +} + +/** + * Delete a node's parent + */ +export const deleteNodeParent = (options: Options) => { + return (options?.client ?? client).delete< + DeleteNodeParentResponse, + DeleteNodeParentError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/parent", + }) +} + +/** + * Create a node's product relationships + * Creates relationships between the specified node and one or more products in a specified hierarchy. + */ +export const createNodeProductRelationship = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateNodeProductRelationshipResponse, + CreateNodeProductRelationshipError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/products", + responseTransformer: CreateNodeProductRelationshipResponseTransformer, + }) +} + +/** + * Deletes a node's product relationships + */ +export const deleteNodeProductRelationships = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteNodeProductRelationshipsResponse, + DeleteNodeProductRelationshipsError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/products", + responseTransformer: DeleteNodeProductRelationshipsResponseTransformer, + }) +} + +/** + * Get a node's products + * Returns the products associated with the specified hierarchy node from a published catalog. Products must be in a live status. If the products have been curated using the update a hierarchy node endpoint, then the products are returned in the order specified in the `curated_products` attribute in the body of the update a hierarchy node request. A product that is curated has the "curated_product": true attribute displayed. + * + */ +export const getNodeProducts = (options: Options) => { + return (options?.client ?? client).get< + GetNodeProductsResponse, + GetNodeProductsError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/products", + responseTransformer: GetNodeProductsResponseTransformer, + }) +} + +/** + * Duplicate a hierarchy + * Using this option, you can duplicate an existing hierarchy. This is useful because it enables you to quickly and easily create multiple hierarchies with the same node structure. + * + * When you duplicate a hierarchy, you can specify a new name and/or a new description for the duplicated hierarchy. All other attributes, such as slug and locales, stay the same. + * + * Any nodes in the existing hierarchy are also replicated in the duplicated hierarchy. In addition, you can optionally use the `include_products` attribute to specify whether you want products associated with the nodes in an existing hierarchy to be associated with the nodes in the duplicated hierarchy. By default, product associations in an existing hierarchy are not duplicated in a duplicate hierarchy. + * + * Duplicating a hierarchy is an asynchronous operation. When you duplicate a hierarchy, a job is created. The jobId of the job is displayed in the response. When the job is complete, the duplicate hierarchy operation is also complete. You can use the jobId to see the status of your job using Get a Job. + * + * Jobs are processed one at a time. You can continue to send duplicate hierarchy requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. + * + * Once the job is complete, run: + * + * - Get all hierarchies to retrieve the HierarchyId of your duplicated hierarchy. + * - Get a hierarchy to retrieve the nodes and (if applicable) products associated with the duplicated hierarchy. + * + */ +export const duplicateHierarchy = ( + options: Options, +) => { + return (options?.client ?? client).post< + DuplicateHierarchyResponse, + DuplicateHierarchyError + >({ + ...options, + url: "/pcm/hierarchies/{hierarchyID}/duplicate_job", + responseTransformer: DuplicateHierarchyResponseTransformer, + }) +} + +/** + * Get All Product Tags + * Retrieves all product tags for a store. A store can view the tags associated with the organization to which the store belongs. However, an organization can only view the tags associated with the organization. + * + * + */ +export const getAllProductTags = (options?: Options) => { + return (options?.client ?? client).get< + GetAllProductTagsResponse, + GetAllProductTagsError + >({ + ...options, + url: "/pcm/tags", + responseTransformer: GetAllProductTagsResponseTransformer, + }) +} + +/** + * Get a Product Tag + * Retrieves a product tag for a store. A store can view the tags associated with the organization to which the store belongs. However, an organization can only view the tags associated with the organization. + */ +export const getProductTag = (options: Options) => { + return (options?.client ?? client).get< + GetProductTagResponse, + GetProductTagError + >({ + ...options, + url: "/pcm/tags/{tagID}", + responseTransformer: GetProductTagResponseTransformer, + }) +} + +/** + * Create a custom relationship + * Create a custom relationship + */ +export const createCustomRelationship = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateCustomRelationshipResponse, + CreateCustomRelationshipError + >({ + ...options, + url: "/pcm/custom_relationships", + responseTransformer: CreateCustomRelationshipResponseTransformer, + }) +} + +/** + * Update a custom relationship + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the custom relationship is not updated. + */ +export const updateCustomRelationship = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateCustomRelationshipResponse, + UpdateCustomRelationshipError + >({ + ...options, + url: "/pcm/custom_relationships/{customRelationshipSlug}", + responseTransformer: UpdateCustomRelationshipResponseTransformer, + }) +} diff --git a/packages/sdks/pim/src/client/types.gen.ts b/packages/sdks/pim/src/client/types.gen.ts new file mode 100644 index 00000000..eedf9a86 --- /dev/null +++ b/packages/sdks/pim/src/client/types.gen.ts @@ -0,0 +1,5873 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type Job = { + /** + * A unique identifier generated when a job is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `pim-job`. + */ + type?: "pim-job" + attributes?: { + /** + * The date and time a job is started. + */ + started_at?: Date | null + /** + * The date and time a job is completed. + */ + completed_at?: Date | null + /** + * The date and time a job is created. + */ + created_at?: Date + /** + * The date and time a job is updated. + */ + updated_at?: Date + /** + * The status of a job. + * + * * `pending` - Commerce has received the request but is currently busy processing other requests. + * * `started` - Commerce has started processing the job. + * * `success` - The job has successfully completed. + * * `failed` - The job has failed. + * + */ + type?: + | "child-products" + | "product-import" + | "product-export" + | "hierarchy-duplicate" + | "price-import" + status?: "pending" | "cancelled" | "started" | "success" | "failed" + } + meta?: { + /** + * Applies to all job types. A unique request ID is generated when a job is created. + */ + x_request_id?: string + /** + * Applies to `hierarchy-duplicate` job types. The ID of the original hierarchy that you duplicated. + */ + copied_from?: string + /** + * Applies to `hierarchy-duplicate` job types. The duplicated hierarchy ID. + */ + hierarchy_id?: string + /** + * If the job type is `product_export`, a link to the file is created when running a job. + */ + file_locations?: Array | null + /** + * The entities included in the job. For example, if the job type is `product-export`, the PXM products included in the export. + */ + filter?: string + } +} + +/** + * This represents the type of resource object being returned. Always `pim-job`. + */ +export type type = "pim-job" + +export type status = "pending" | "cancelled" | "started" | "success" | "failed" + +export type Multi = { + /** + * An array of jobs. + */ + data?: Array + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +export type Error = { + errors: Array<{ + /** + * The HTTP response code of the error. + */ + status: string + /** + * A brief summary of the error. + */ + title: string + /** + * Optional additional detail about the error. + */ + detail?: string + /** + * Internal request ID. + */ + request_id?: string + /** + * Additional supporting meta data for the error. + */ + meta?: { + [key: string]: unknown + } + }> +} + +export type Single = { + data?: Job +} + +export type Errors = { + /** + * An array of job errors. + */ + data?: Array<{ + /** + * This represents the type of resource object being returned. Always `pim-job-error`. + */ + type?: "pim-job-error" + /** + * A unique identifier for a job error generated when a job error is created. + */ + id?: string + attributes?: { + /** + * A description of an error message. + */ + message?: string + } + }> +} + +/** + * You use the `custom_inputs` attribute to allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. See [Personalizing Products](/docs/api/pxm/products/create-product#personalizing-products). + */ +export type ProductCustomInputs = { + [key: string]: { + /** + * A name for the custom text field. + */ + name?: string + /** + * The validation rules for the custom text. + */ + validation_rules?: unknown[] + /** + * This represents the type of the resource being returned. + */ + type?: string + /** + * The length of the custom input text field. + */ + options?: { + [key: string]: unknown + } + /** + * The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters. + */ + max_length?: number + /** + * `true` or `false` depending on whether the custom text is required. + */ + required?: boolean + } +} + +/** + * You can build a combination of child products associated with a product, based on build rules that you specify. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. See [Using Build Rules](/docs/api/pxm/products/build-child-products#using-build-rules). + */ +export type ProductBuildRules = { + /** + * Specifies the default behaviour, either `include` or `exclude`. + */ + default?: "include" | "exclude" + /** + * An array of option IDs to include when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. + */ + include?: Array> + /** + * An array of option IDs to exclude when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. + */ + exclude?: Array> +} + +/** + * Specifies the default behaviour, either `include` or `exclude`. + */ +export type Default = "include" | "exclude" + +/** + * With Product Experience Manager, you can create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. See [Bundles](/docs/api/pxm/products/products#bundles). + */ +export type ProductBundleComponents = { + [key: string]: { + /** + * The component name. The component name is the name that is displayed in your storefront. + */ + name?: string + /** + * The product options included in a component. This can be the ID of another bundle. + */ + options?: Array<{ + /** + * The unique ID of the product you want to add to a component. + */ + id?: string + /** + * This represents the type of object being returned. Always `product`. + */ + type?: string + /** + * The number of this product option that a shopper must purchase. + */ + quantity?: number + /** + * The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want. + */ + sort_order?: number + /** + * Whether the product option is a default option in a bundle. Shoppers can select a bundle that specifies a default list of product options. See [Dynamic Bundles](/docs/api/pxm/products/products#dynamic-bundles). + */ + default?: boolean + }> + /** + * The minimum number of product options a shopper can select from this component. + */ + min?: number + /** + * The maximum number of product options a shopper can select from this component. + */ + max?: number + /** + * The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want. + */ + sort_order?: number + } +} + +export type ProductResponse = { + /** + * A unique product ID that is generated when you create the product. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product`. + */ + type?: "product" + attributes?: { + /** + * A name for the product. + */ + name?: string + /** + * A description for the product. + */ + description?: string + /** + * A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug. + */ + slug?: string + /** + * The unique stock keeping unit of the product. + */ + sku?: string + /** + * The status for the product, either `draft` or `live`. + */ + status?: "live" | "draft" + /** + * The commodity type, either `physical` or `digital`. + */ + commodity_type?: "physical" | "digital" + /** + * The universal product code or european article number of the product. + */ + upc_ean?: string + /** + * The manufacturer part number of the product. + */ + mpn?: string + /** + * The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. + */ + external_ref?: string + /** + * Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + */ + locales?: { + [key: string]: unknown + } + /** + * You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas. + */ + tags?: Array + extensions?: { + [key: string]: { + [key: string]: string | null | number | boolean + } + } + custom_inputs?: ProductCustomInputs + build_rules?: ProductBuildRules + components?: ProductBundleComponents + } + meta?: { + /** + * The date and time a product is created. + */ + created_at?: Date + /** + * The date and time a product is updated. + */ + updated_at?: Date + /** + * The resource owner, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * A product's variations and the options defined for each variation. If you have specified `build_rules`, only the child products included in the `build_rules` are specified. + */ + variations?: Array<{ + /** + * A unique ID generated when a variation is created. + */ + id?: string + /** + * The name of a variation. + */ + name?: string + options?: Array<{ + /** + * A unique ID that is generated an option is created. + */ + id?: string + /** + * The name of an option. + */ + name?: string + /** + * A description of an option. + */ + description?: string + }> + }> + /** + * One of the following product types: + * + * - `standard` - A `standard` product is a standalone product. + * - `parent` - A `parent` product is a product that has child products that have been built using the `Build Child Products` endpoint. + * - `child` - When you configure product variations and variation options for `parent` products, the `child` products derived from the `parent` products are automatically created in Commerce. + * - `bundle` - A `bundle` is a purchasable product, comprising one or more standalone products (in other words, components) to be sold together. + * + */ + product_types?: Array<"parent" | "child" | "bundle" | "standard"> + /** + * The child products defined for a product. The order of the variations in the `variation_matrix` is the order of the variations in the array when the variations were linked to the product. For example, the first variation in the `variation_matrix` corresponds to the first variation in the array, and so on. You can use the `sort_order`attribute to sort the order of your variation and variation options in the `variation_matrix` object. See [Sorting the Order of Variations and Options](/docs/api/pxm/products/variations#sorting-the-order-of-variations-and-options) If no variations are defined for a product, the `variation_matrix` is empty. + */ + variation_matrix?: { + [key: string]: unknown + } + } + /** + * Relationships are established between different product entities. For example, a `bundle` product and a `child` product are related to a `parent` product, as both are associated with it. + */ + relationships?: { + [key: string]: { + data?: + | Array<{ + /** + * A unique identifier for a resource. + */ + id?: string + /** + * This represents the type of resource object being returned. + */ + type?: string + }> + | { + /** + * A unique identifier for a resource. + */ + id?: string + /** + * This represents the type of resource object being returned. + */ + type?: string + } + | null + /** + * Links are used to allow you to move between requests. Single entities use a `self` parameter with a link to that specific resource. Sometimes, there are not enough entities for a project to fill multiple pages. In this situation, we return some defaults. + * + * | Property | Description | + * | :--- | :--- | + * | `current` | Always the current page. | + * | `first` | Always the first page. | + * | `last` | `null` if there is only one page. | + * | `prev` | `null` if the user is on the first page. | + * | `next` | `null` if there is only one page. | + * + */ + links?: { + [key: string]: string + } + } + } +} + +/** + * This represents the type of resource object being returned. Always `product`. + */ +export type type2 = "product" + +/** + * The status for the product, either `draft` or `live`. + */ +export type status2 = "live" | "draft" + +/** + * The commodity type, either `physical` or `digital`. + */ +export type commodity_type = "physical" | "digital" + +/** + * The resource owner, either `organization` or `store`. + */ +export type owner = "organization" | "store" + +export type MultiProductResponse = { + data?: Array + /** + * Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + */ + included?: { + /** + * Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + */ + component_products?: Array + } + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +/** + * Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + */ +export type ProductLocales = { + [key: string]: { + /** + * A localized name for the product. + */ + name: string + /** + * A localized description for the product. + */ + description?: string + } +} + +export type ProductAttributes = { + /** + * The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. + */ + external_ref?: string + /** + * The product name to display to customers. + */ + name?: string + /** + * A description for the product. + */ + description?: string + /** + * The unique slug of the product. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + slug?: string + /** + * The unique stock keeping unit of the product. + */ + sku?: string + /** + * The status for the product, either `draft` or `live`. Default is `draft`. + */ + status?: "live" | "draft" + /** + * The commodity type, either `physical` or `digital`. + */ + commodity_type?: "physical" | "digital" + /** + * The universal product code or european article number of the product. + */ + upc_ean?: string + /** + * The manufacturer part number of the product. + */ + mpn?: string + /** + * You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas. See [Product Tags](/docs/api/pxm/products/product-tags). + */ + tags?: Array + build_rules?: ProductBuildRules + locales?: ProductLocales + custom_inputs?: ProductCustomInputs + components?: ProductBundleComponents +} + +export type CreateProductRequest = { + data: { + /** + * This represents the type of resource being returned. Always `product`. + */ + type: "product" + attributes: ProductAttributes + /** + * Relationships are established between different product entities. + */ + relationships?: { + variations?: { + data?: Array<{ + /** + * A unique identifier for a resource. + */ + id?: string + /** + * This represents the type of resource object being returned. + */ + type?: string + }> + } + } + } +} + +export type SingleProductResponse = { + data?: ProductResponse + /** + * Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + */ + included?: { + /** + * A list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + */ + component_products?: Array + } +} + +export type UpdateProductRequest = { + data: { + /** + * This represents the type of resource object being returned. Always `product`. + */ + type: "product" + /** + * The unique identifier of the product. Must match the product ID specified in the request path. + */ + id: string + attributes: ProductAttributes + } +} + +export type Attributes = { + /** + * The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + */ + name?: string + /** + * A description for a node. + */ + description?: string + /** + * A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + */ + slug?: string + /** + * You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. + */ + curated_products?: Array + /** + * Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions. + */ + locales?: { + [key: string]: { + /** + * A localized hierarchy or node name. + */ + name?: string + /** + * A localized hierarchy or node description. + */ + description?: string + } + } +} + +/** + * Relationships allow you to move between requests. Includes links to the child nodes and products associated with a hierarchy or node. + */ +export type Relationships = { + /** + * The child nodes related to the resource. + */ + children?: { + /** + * An array of child nodes. + */ + data?: unknown[] + /** + * Links allow you to move between requests. + */ + links?: { + /** + * A link to a related resource. + */ + related?: string + } + } + /** + * The parent node related to the resource + */ + parent?: { + /** + * The parent node + */ + data?: { + /** + * This represents the type of resource object being returned. Always `node`. + */ + type: "node" + /** + * The unique identifier of a node. + */ + id: string + } + } + /** + * The products related to the resource. + */ + products?: { + /** + * An array of products. + */ + data?: unknown[] + /** + * Links allow you to move between requests. + */ + links?: { + /** + * A link to a related resource. + */ + related?: string + } + } +} + +/** + * This represents the type of resource object being returned. Always `node`. + */ +export type type3 = "node" + +export type Node = { + /** + * The unique identifier of a node. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `node`. + */ + type?: "node" + attributes?: Attributes + relationships?: Relationships + meta?: { + /** + * The sort order value. The node with the highest value of `sort_order` is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. See [Sorting Nodes in a hierarchy](/docs/api/pxm/products/create-node#sorting-nodes-in-a-hierarchy). + */ + sort_order?: number + /** + * The date and time a node is created. + */ + created_at?: Date + /** + * The date and time a node was updated. + */ + updated_at?: Date + /** + * The name of the parent of the node if one exists. + */ + parent_name?: string + /** + * The node owner, either `organization` or `store`. + */ + owner?: "store" | "organization" + } +} + +export type MultiMeta = { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } +} + +/** + * Links are used to allow you to move between requests. + */ +export type MultiLinks = { + /** + * Always the first page. + */ + first?: string + /** + * This is `null` if there is only one page. + */ + last?: string + /** + * This is `null` if there is only one page. + */ + next?: string + /** + * This is `null` if you on the first page. + */ + prev?: string +} + +export type MultiNodes = { + /** + * An array of nodes. + */ + data?: Array + meta?: MultiMeta + links?: MultiLinks +} + +export type TemplateResponse = { + data?: Array<{ + /** + * A unique identifier for a template generated when a template is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `template`. + */ + type?: "template" + }> +} + +export type ProductTemplatesRequest = { + data?: Array<{ + /** + * The unique identifier of a template. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `template'. + */ + type?: "template" + }> +} + +export type ComponentProductsResponse = { + data?: Array<{ + /** + * The unique identifier of a product component generated when a product is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product`. + */ + type?: "product" + }> +} + +export type FileResponse = { + data?: Array<{ + /** + * The unique identifier of the new file. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `file`. + */ + type?: "file" + }> +} + +export type ProductFilesRequest = { + data?: Array<{ + /** + * A unique identifier for a file generated when a file is created. + */ + id?: string + /** + * This represents the type of resource being returned. Always `file`. + */ + type?: "file" + meta?: { + /** + * The files associated with a product. + */ + tags?: Array + } + }> +} + +export type VariationsResponse = { + data?: Array<{ + /** + * A unique identifier generated when a variation is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type?: "product-variation" + meta?: { + /** + * The date and time a resource is created. + */ + created_at?: Date + } + }> +} + +export type ProductVariationsRequest = { + data?: Array<{ + /** + * The ID of the product variation. + */ + id?: string + /** + * This represents the type of resource being returned. Always `product-variation`. + */ + type?: "product-variation" + }> +} + +export type MainImageResponse = { + data?: Array<{ + /** + * A unique identifier for the image file generated automatically when a file is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `file`. + */ + type?: string + }> +} + +export type ReplaceMainImageRequest = { + data?: Array<{ + /** + * The ID of the new image file. + */ + id?: string + type?: "file" + }> +} + +export type MainImageRequest = { + data?: { + /** + * The ID of the image file. + */ + id?: string + /** + * This represents the type of resource being returned. Always `file`. + */ + type?: "file" + } +} + +/** + * This represents the type of resource being returned. Always `file`. + */ +export type type4 = "file" + +export type MultiVariations = { + data?: Array<{ + /** + * A unique identifier for a variation. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type?: "product-variation" + attributes?: { + /** + * The name of a variation. + */ + name?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta?: { + options?: Array<{ + /** + * A unique ID that is generated when an option is created. + */ + id?: string + /** + * A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * A human recognizable description of the option. + */ + description?: string + /** + * The date and time an option is created. + */ + created_at?: Date + /** + * The date and time an option is updated. + */ + updated_at?: Date + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + }> + /** + * The owner of the resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time a variation is created. + */ + created_at?: Date + /** + * The date and time a variation is updated. + */ + updated_at?: Date + } + }> + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +export type CreateVariation = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type: "product-variation" + attributes: { + /** + * The variation name. + */ + name?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + * + * The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. + * + * You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + * + * You must rebuild your products for the sort order changes to take effect. + * + */ + sort_order?: number + } + } +} + +/** + * This represents the type of resource object being returned. Always `product-variation`. + */ +export type type5 = "product-variation" + +export type CreatedVariation = { + data: { + /** + * A unique identifier generated when a variation is created. + */ + id: string + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type: "product-variation" + attributes: { + /** + * A human-recognizable identifier for a variation. + */ + name?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta: { + /** + * The owner of the resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time a variation is created. + */ + created_at?: Date + /** + * The date and time a variation is updated. + */ + updated_at?: Date + } + } +} + +export type SingleVariation = { + data: { + /** + * A unique identifier for a variation. + */ + id: string + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type: "product-variation" + attributes: { + /** + * The name for a variation. + */ + name?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta: { + /** + * A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue. + */ + options?: Array<{ + /** + * A unique ID that is generated an option is created. + */ + id?: string + /** + * A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * A description for an option. + */ + description?: string + /** + * The date and time an option is created. + */ + created_at?: Date + /** + * The date and time an option is updated. + */ + updated_at?: Date + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + }> + /** + * The owner of the resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time a variation is created. + */ + created_at?: string + /** + * The date and time a variation is updated. + */ + updated_at?: string + } + } +} + +export type UpdateVariation = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation`. + */ + type: "product-variation" + attributes: { + /** + * The variation name. + */ + name?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + * + * The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. + * + * You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + * + * You must rebuild your products for the sort order changes to take effect. + * + */ + sort_order?: number + } + /** + * The unique identifier of the variation. Must match the variation ID specified in the request path. + */ + id: string + } +} + +export type MultiOptions = { + data?: Array<{ + /** + * A unique identifier generated when an option is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ + type?: "product-variation-option" + attributes?: { + /** + * A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * A human-recognizable description for the option. + */ + description?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta?: { + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time an option is created. + */ + created_at?: Date + /** + * The date and time an option is updated. + */ + updated_at?: Date + } + }> + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +export type CreateOption = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ + type: "product-variation-option" + attributes: { + /** + * A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * By default, variations and variation options are sorted alphabetically. You can use the `sort_order` attribute to sort the order of your variation and variation options in the `variation_matrix`. + * + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + * + * The variation option with the highest value of `sort_order` is displayed first. For example, a variation option with a `sort_order` value of `3` appears before a variation option with a `sort_order` value of `2`. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + * + * You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + * + * You must rebuild your products for the sort order changes to take effect. + * + */ + sort_order?: number + /** + * A description of a product variation option. + */ + description?: string + } + } +} + +/** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ +export type type6 = "product-variation-option" + +export type CreatedOption = { + data: { + /** + * A unique identifier that is generated when an option is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ + type: "product-variation-option" + attributes: { + /** + * A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * A human-recognizable description for the option. + */ + description?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta?: { + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time an option is created. + */ + created_at?: Date + /** + * The date and time an option is updated. + */ + updated_at?: Date + } + } +} + +export type SingleOption = { + data: { + /** + * The unique identifier generated when an option is created. + */ + id: string + /** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ + type: "product-variation-option" + /** + * A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue. + */ + attributes: { + /** + * A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * A human-recognizable description for the option. + */ + description?: string + /** + * The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + */ + sort_order?: number + } + meta: { + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + /** + * The date and time an option is created. + */ + created_at?: Date + /** + * The date and time an option is updated. + */ + updated_at?: Date + } + } +} + +export type UpdateOption = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation-option`. + */ + type: "product-variation-option" + attributes: { + /** + * A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + */ + name?: string + /** + * The description of the option. + */ + description?: string + /** + * By default, variations and variation options are sorted alphabetically. You can use the `sort_order` attribute to sort the order of your variation and variation options in the `variation_matrix`. The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + * + * The variation option with the highest value of `sort_order` is displayed first. For example, a variation option with a `sort_order` value of `3` appears before a variation option with a `sort_order` value of `2`. + * + * You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + * + * You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + * + * You must rebuild your products for the sort order changes to take effect. + * + */ + sort_order?: number + } + /** + * The unique identifier of the option. Must match the option ID specified in the request path. + */ + id: string + } +} + +export type MultiModifiers = { + data?: Array<{ + /** + * A unique identifier for a modifier that is generated automatically when a modifier is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation-modifier'. + */ + type?: "product-variation-modifier" + attributes?: { + /** + * You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + * + * | Modifier | Data Type | Effect | + * | :--- | :--- | :--- | + * | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + * | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + * | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + * | `description_equals` | `string` | Overrides the description of the child product. | + * | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + * | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + * | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + * | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + * | `price_increment` | `string` | Increases the price of the child product. | + * | `price_decrement` | `string` | Decreases the price of the child product. | + * | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + * | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `sku_equals` | `string` | Sets the SKU of the child product. | + * | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + * | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + * | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + * | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + * + */ + type?: + | "commodity_type" + | "status" + | "price" + | "name_append" + | "name_prepend" + | "name_equals" + | "sku_append" + | "sku_prepend" + | "sku_equals" + | "sku_builder" + | "slug_append" + | "slug_prepend" + | "slug_equals" + | "slug_builder" + | "description_append" + | "description_prepend" + | "description_equals" + | "custom_inputs_equals" + | "build_rules_equals" + | "locales_equals" + | "upc_ean_equals" + | "mpn_equals" + | "external_ref_equals" + /** + * Required for non-builder modifiers. The value of the modifier type. + */ + value?: string + /** + * Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + */ + seek?: string + /** + * Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + */ + set?: string + /** + * The name of the modifier. + */ + reference_name?: string + } + meta?: { + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "store" | "organization" + } + }> + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +/** + * Use modifiers to change the properties of child products that are inherited from a parent product. With modifiers, you only need to have one parent product with a variation attached to the product. + */ +export type CreateModifier = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation-modifier`. + */ + type: "product-variation-modifier" + attributes: { + /** + * You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + * + * | Modifier | Data Type | Effect | + * | :--- | :--- | :--- | + * | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + * | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + * | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + * | `description_equals` | `string` | Overrides the description of the child product. | + * | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + * | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + * | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + * | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + * | `price_increment` | `string` | Increases the price of the child product. | + * | `price_decrement` | `string` | Decreases the price of the child product. | + * | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + * | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `sku_equals` | `string` | Sets the SKU of the child product. | + * | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + * | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + * | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + * | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + * + */ + type: + | "commodity_type" + | "status" + | "price" + | "name_append" + | "name_prepend" + | "name_equals" + | "sku_append" + | "sku_prepend" + | "sku_equals" + | "sku_builder" + | "slug_append" + | "slug_prepend" + | "slug_equals" + | "slug_builder" + | "description_append" + | "description_prepend" + | "description_equals" + | "custom_inputs_equals" + | "build_rules_equals" + | "locales_equals" + | "upc_ean_equals" + | "mpn_equals" + | "external_ref_equals" + /** + * Required for non-builder modifiers. The value of the modifier type. + */ + value?: string + /** + * Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + */ + seek?: string + /** + * Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + */ + set?: string + /** + * A name for the modifier. + */ + reference_name?: string + } + } +} + +/** + * This represents the type of resource object being returned. Always `product-variation-modifier`. + */ +export type type7 = "product-variation-modifier" + +export type CreatedModifier = { + data?: { + /** + * A unique identifier for a modifier that is generated automatically when a modifier is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation-modifier'. + */ + type?: "product-variation-modifier" + attributes?: { + /** + * You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + * + * | Modifier | Data Type | Effect | + * | :--- | :--- | :--- | + * | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + * | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + * | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + * | `description_equals` | `string` | Overrides the description of the child product. | + * | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + * | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + * | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + * | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + * | `price_increment` | `string` | Increases the price of the child product. | + * | `price_decrement` | `string` | Decreases the price of the child product. | + * | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + * | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `sku_equals` | `string` | Sets the SKU of the child product. | + * | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + * | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + * | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + * | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + * + */ + type?: + | "commodity_type" + | "status" + | "price" + | "name_append" + | "name_prepend" + | "name_equals" + | "sku_append" + | "sku_prepend" + | "sku_equals" + | "sku_builder" + | "slug_append" + | "slug_prepend" + | "slug_equals" + | "slug_builder" + | "description_append" + | "description_prepend" + | "description_equals" + | "custom_inputs_equals" + | "build_rules_equals" + | "locales_equals" + | "upc_ean_equals" + | "mpn_equals" + | "external_ref_equals" + /** + * Required for non-builder modifiers. The value of the modifier type. + */ + value?: string + /** + * Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + */ + seek?: string + /** + * Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + */ + set?: string + /** + * The name of the modifier. + */ + reference_name?: string + } + meta?: { + /** + * The owner of the resource, either `organization` or `store`. + */ + owner?: "organization" | "store" + } + } +} + +export type SingleModifier = { + data?: { + /** + * A unique identifier for a modifier that is generated automatically when a modifier is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `product-variation-modifier'. + */ + type?: "product-variation-modifier" + attributes?: { + /** + * You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + * + * | Modifier | Data Type | Effect | + * | :--- | :--- | :--- | + * | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + * | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + * | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + * | `description_equals` | `string` | Overrides the description of the child product. | + * | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + * | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + * | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + * | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + * | `price_increment` | `string` | Increases the price of the child product. | + * | `price_decrement` | `string` | Decreases the price of the child product. | + * | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + * | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `sku_equals` | `string` | Sets the SKU of the child product. | + * | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + * | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + * | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + * | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + * + */ + type?: + | "commodity_type" + | "status" + | "price" + | "name_append" + | "name_prepend" + | "name_equals" + | "sku_append" + | "sku_prepend" + | "sku_equals" + | "sku_builder" + | "slug_append" + | "slug_prepend" + | "slug_equals" + | "slug_builder" + | "description_append" + | "description_prepend" + | "description_equals" + | "custom_inputs_equals" + | "build_rules_equals" + | "locales_equals" + | "upc_ean_equals" + | "mpn_equals" + | "external_ref_equals" + /** + * Required for non-builder modifiers. The value of the modifier type. + */ + value?: string + /** + * Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + */ + seek?: string + /** + * Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + */ + set?: string + /** + * The name of the modifier. + */ + reference_name?: string + } + /** + * The owner of the resource, either `organization` or `store`. + */ + meta?: { + owner?: "organization" | "store" + } + } +} + +export type UpdateModifier = { + data: { + /** + * This represents the type of resource object being returned. Always `product-variation-modifier`. + */ + type: "product-variation-modifier" + attributes: { + /** + * You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + * + * | Modifier | Data Type | Effect | + * | :--- | :--- | :--- | + * | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + * | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + * | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + * | `description_equals` | `string` | Overrides the description of the child product. | + * | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + * | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + * | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + * | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + * | `price_increment` | `string` | Increases the price of the child product. | + * | `price_decrement` | `string` | Decreases the price of the child product. | + * | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + * | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + * | `sku_equals` | `string` | Sets the SKU of the child product. | + * | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + * | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + * | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + * | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + * + */ + type: + | "commodity_type" + | "status" + | "price" + | "name_append" + | "name_prepend" + | "name_equals" + | "sku_append" + | "sku_prepend" + | "sku_equals" + | "sku_builder" + | "slug_append" + | "slug_prepend" + | "slug_equals" + | "slug_builder" + | "description_append" + | "description_prepend" + | "description_equals" + | "custom_inputs_equals" + | "build_rules_equals" + | "locales_equals" + | "upc_ean_equals" + | "mpn_equals" + | "external_ref_equals" + /** + * Required for non-builder modifiers. The value of the modifier type. + */ + value?: string + /** + * Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + */ + seek?: string + /** + * Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + */ + set?: string + /** + * The name of the modifier. + */ + reference_name?: string + } + /** + * The unique identifier of the modifier. Must match the modifier ID specified in the request path. + */ + id: string + } +} + +export type AttributesHierarchy = { + /** + * The name of a hierarchy, such as `Major Appliances`. + */ + name?: string + /** + * A description for a hierarchy. + */ + description?: string + /** + * A unique slug for a hierarchy. + */ + slug?: string + /** + * Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions. + */ + locales?: { + [key: string]: { + /** + * A localized hierarchy or node name. + */ + name?: string + /** + * A localized hierarchy or node description. + */ + description?: string + } + } +} + +export type RelationshipsHierarchy = { + /** + * The child nodes related to the hierarchy. + */ + children?: { + /** + * An array of child nodes. + */ + data?: unknown[] + /** + * Links allow you to move between requests. + */ + links?: { + /** + * A link to a related resource. + */ + related?: string + } + } +} + +export type Hierarchy = { + /** + * A unique identifier generated when a hierarchy is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `hierarchy`. + */ + type?: "hierarchy" + attributes?: AttributesHierarchy + relationships?: RelationshipsHierarchy + meta?: { + /** + * The date and time a hierarchy is created. + */ + created_at?: Date + /** + * The date and time a hierarchy is updated. + */ + updated_at?: Date + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "store" | "organization" + } +} + +/** + * This represents the type of resource object being returned. Always `hierarchy`. + */ +export type type8 = "hierarchy" + +export type MultiHierarchy = { + data?: Array + links?: MultiLinks + meta?: MultiMeta +} + +export type ReqAttributesHierarchy = { + /** + * The name of the hierarchy, such as `Major Appliances`. + */ + name?: string + /** + * A description of the hierarchy. + */ + description?: string + /** + * A unique slug for the hierarchy. + */ + slug?: string + /** + * Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + */ + locales?: { + [key: string]: { + /** + * A localized name for the hierarchy. + */ + name?: string + /** + * A localized description for the hierarchy. + */ + description?: string + } + } +} + +export type CreateHierarchy = { + data?: { + /** + * This represents the type of resource object being returned. Always `hierarchy`. + */ + type: "hierarchy" + attributes: ReqAttributesHierarchy + } +} + +export type SingleHierarchy = { + data?: Hierarchy +} + +export type UpdateHierarchy = { + data: { + /** + * The unique identifier of the hierarchy. Must match the hierarchy ID specified in the request path. + */ + id: string + /** + * This represents the type of resource object being returned. Always `hierarchy`. + */ + type: "hierarchy" + attributes: ReqAttributesHierarchy + } +} + +export type AttributesNodes = { + /** + * The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + */ + name?: string + /** + * A description of the node. + */ + description?: string + /** + * A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + */ + slug?: string + /** + * You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. See [Curating Products in a node](/docs/api/pxm/products/create-node#curating-products-in-a-node). + */ + curated_products?: Array + /** + * Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + */ + locales?: { + [key: string]: { + /** + * A localized name for the node. + */ + name?: string + /** + * A localized description for the node. + */ + description?: string + } + } +} + +export type CreateNode = { + data?: { + /** + * This represents the type of resource object being returned. Always `node`. + */ + type: "node" + attributes: AttributesNodes + meta?: { + /** + * You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The `sort_order` for each node. This value determines the order of nodes in the response for the `Get a Node’s Children` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + * + * - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for `Get a Node’s Children` request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + * - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. See [Sorting Nodes in a hierarchy](). + * + */ + sort_order?: number + } + } +} + +export type SingleNode = { + data?: Node +} + +export type UpdateNode = { + data?: { + /** + * The unique identifier of the node. Must match the node ID specified in the request path. + */ + id: string + /** + * This represents the type of resource object being returned. Always `node`. + */ + type: "node" + attributes: AttributesNodes + meta?: { + /** + * You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The `sort_order` for each node. This value determines the order of nodes in the response for the `Get a Node’s Children` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + * + * - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for `Get a Node’s Children` request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + * - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + * + */ + sort_order?: number + } + } +} + +export type NodeChildren = { + data?: Array<{ + /** + * The unique identifier of the child node. Must not match the node ID specified in the request path. + */ + id: string + /** + * This represents the type of resource object being returned. Always `node`. + */ + type: "node" + }> +} + +export type NodeParent = { + data?: { + /** + * The unique identifier of the new parent node. Must not match the node ID specified in the request path. + */ + id: string + /** + * This represents the type of resource object being returned. Always `node`. + */ + type: "node" + } +} + +export type NodeProducts = { + data?: Array<{ + /** + * The unique identifier of the product to be attached to the node. + */ + id: string + /** + * This represents the type of resource object being returned. Always `product`. + */ + type: "product" + }> +} + +export type DuplicateJob = { + data?: { + /** + * This represents the type of resource object being returned. Always `hierarchy`. + */ + type?: "hierarchy" + attributes?: { + /** + * The name of the duplicate hierarchy. The maximum length is 1000 characters. + */ + name?: string + /** + * A description of the duplicate hierarchy. + */ + description?: string + /** + * Specify `true` if you want the product associations in the existing nodes associated in your duplicated hierarchy. If not, specify `false`. + */ + include_products?: boolean + } + } +} + +export type Tag = { + /** + * A unique identifier generated when a tag is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `tag`. + */ + type?: "tag" + attributes?: { + /** + * The text value of the tag. + */ + value?: string + } + meta?: { + /** + * A unique request ID is generated when a tag is created. + */ + x_request_id?: string + /** + * The date and time a tag is created. + */ + created_at?: Date + /** + * The date and time a tag is updated. + */ + updated_at?: Date + /** + * The owner of a resource, either `organization` or `store`. + */ + owner?: "store" | "organization" + } +} + +/** + * This represents the type of resource object being returned. Always `tag`. + */ +export type type9 = "tag" + +export type MultiTag = { + /** + * An array of tags. + */ + data?: Array + meta?: { + /** + * Contains the results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + } +} + +export type SingleTag = { + data?: Tag +} + +export type ReqAttributesCustomRelationship = { + /** + * The name of the custom relationship, such as `Kitchen electrics`. + */ + name?: string + /** + * A description of the custom relationship. + */ + description?: string + /** + * A unique slug for the custom relationship. Must match the slug specified in the request path. + */ + slug?: string +} + +export type CreateCustomRelationship = { + data?: { + /** + * This represents the type of resource object being returned. Always `custom-relationship`. + */ + type: "custom-relationship" + attributes: ReqAttributesCustomRelationship + } +} + +/** + * This represents the type of resource object being returned. Always `custom-relationship`. + */ +export type type10 = "custom-relationship" + +export type AttributesCustomRelationship = { + /** + * The name of the custom relationship, such as `Kitchen electrics`. + */ + name?: string + /** + * A description of the custom relationship. + */ + description?: string + /** + * A unique slug for the custom relationship. + */ + slug?: string +} + +export type CustomRelationship = { + /** + * A unique identifier generated when a custom relationship is created. + */ + id?: string + /** + * This represents the type of resource object being returned. Always `hierarchy`. + */ + type?: "custom-relationship" + attributes?: AttributesCustomRelationship + meta?: { + /** + * The owner of the resource. + */ + owner?: string + timestamps?: { + /** + * The date and time the resource is created. + */ + created_at?: Date + /** + * The date and time the resource is updated. + */ + updated_at?: Date + } + } +} + +export type SingleCustomRelationship = { + data?: CustomRelationship +} + +export type UpdateCustomRelationship = { + data: { + /** + * The unique identifier of the custom relationship. + */ + id: string + /** + * This represents the type of resource object being returned. Always `custom-relationship`. + */ + type: "custom-relationship" + attributes: ReqAttributesCustomRelationship + } +} + +/** + * A unique identifier for the job. + */ +export type ParameterJobId = string + +/** + * The number of records to offset the results by. + */ +export type ParameterPageOffset = number + +/** + * The number of records per page. The maximum limit is 100. + */ +export type ParameterPageLimit = number + +/** + * Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering). + * + * For more information about the attributes and operators that are supported, see [Get all products](/docs/api/pxm/products/get-all-products). + * + */ +export type ParameterFilterproduct = string + +/** + * Using the include parameter, you can retrieve top-level resources. + * + * - Files or main image. For example, `include=files,main_image`. + * - Component product data. For example, `include=component_products`. + * - Key attribute data, such as SKU or slug. + * + */ +export type ParameterInclude = string + +/** + * Set to `true` if you want to use a template slug instead of a template ID when exporting products that have custom data. + */ +export type ParameterUseTemplateSlugs = boolean + +/** + * + * Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. + * + * For more information about the attributes and operators that this endpoint supports, see [Export Products](/docs/api/pxm/products/export-products). + * + */ +export type ParameterFilterexport = string + +/** + * A unique identifier for the product. + */ +export type ParameterProductId = string + +/** + * A unique identifier for the variation. + */ +export type ParameterVariationId = string + +/** + * A unique identifier for the option. + */ +export type ParameterOptionId = string + +/** + * A unique identifier for the modifier. + */ +export type ParameterModifierId = string + +/** + * A unique identifier for the hierarchy. + */ +export type ParameterHierarchyId = string + +/** + * A unique identifier for the node. + */ +export type ParameterNodeId = string + +/** + * A unique identifier for the tag. + */ +export type ParameterTagId = string + +/** + * A custom relationship slug. + */ +export type ParameterCustomRelationshipSlug = string + +export type GetAllJobsResponse = Multi + +export type GetAllJobsError = Error + +export type GetJobData = { + path: { + /** + * A unique identifier for the job. + */ + jobID: string + } +} + +export type GetJobResponse = Single + +export type GetJobError = Error + +export type CancelJobData = { + body?: { + [key: string]: unknown + } + path: { + /** + * A unique identifier for the job. + */ + jobID: string + } +} + +export type CancelJobResponse = Single + +export type CancelJobError = Error + +export type GetJobErrorsData = { + path: { + /** + * A unique identifier for the job. + */ + jobID: string + } +} + +export type GetJobErrorsResponse = Errors + +export type GetJobErrorsError = Error + +export type CreateProductData = { + body: CreateProductRequest +} + +export type CreateProductResponse = SingleProductResponse + +export type CreateProductError = Error + +export type GetAllProductsData = { + query?: { + /** + * Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering). + * + * For more information about the attributes and operators that are supported, see [Get all products](/docs/api/pxm/products/get-all-products). + * + */ + filter?: string + /** + * Using the include parameter, you can retrieve top-level resources. + * + * - Files or main image. For example, `include=files,main_image`. + * - Component product data. For example, `include=component_products`. + * - Key attribute data, such as SKU or slug. + * + */ + include?: string + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllProductsResponse = MultiProductResponse + +export type GetAllProductsError = Error + +export type ImportProductsData = { + body?: { + /** + * The file you want to upload. Ensure that the file format is Comma Separated Values (CSV). + */ + file?: Blob | File + } +} + +export type ImportProductsResponse = Single + +export type ImportProductsError = Error + +export type ExportProductsData = { + body?: { + [key: string]: unknown + } + query?: { + /** + * + * Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. + * + * For more information about the attributes and operators that this endpoint supports, see [Export Products](/docs/api/pxm/products/export-products). + * + */ + filter?: string + /** + * Set to `true` if you want to use a template slug instead of a template ID when exporting products that have custom data. + */ + useTemplateSlugs?: boolean + } +} + +export type ExportProductsResponse = Single + +export type ExportProductsError = Error + +export type GetProductData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } + query?: { + /** + * Using the include parameter, you can retrieve top-level resources. + * + * - Files or main image. For example, `include=files,main_image`. + * - Component product data. For example, `include=component_products`. + * - Key attribute data, such as SKU or slug. + * + */ + include?: string + } +} + +export type GetProductResponse = SingleProductResponse + +export type GetProductError = Error + +export type UpdateProductData = { + body?: UpdateProductRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type UpdateProductResponse = SingleProductResponse + +export type UpdateProductError = Error + +export type DeleteProductData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type DeleteProductResponse = void + +export type DeleteProductError = Error + +export type AttachNodesData = { + body: { + data: { + /** + * Filters applied to search for appropriate products to attach to a node. See [Attach multiple nodes](/docs/api/pxm/products/attach-nodes). + * + */ + filter: string + /** + * A list of node unique identifiers that you want to assign to the products. + */ + node_ids: Array + } + } +} + +export type AttachNodesResponse = { + meta?: { + /** + * Number of nodes assigned to the products. + */ + nodes_attached?: number + /** + * A list of node unique identifiers that could not be identified. + */ + nodes_not_found?: Array + } +} + +export type AttachNodesError = Error + +export type DetachNodesData = { + body: { + data: { + /** + * You can apply filters to search for the appropriate products to detach. See [Detach multiple nodes](/docs/api/pxm/products/detach-nodes). + * + */ + filter: string + /** + * A list of node unique identifiers that you want to assign to the products. + */ + node_ids: Array + } + } +} + +export type DetachNodesResponse = { + meta?: { + /** + * Number of nodes dissociated from the products. + */ + nodes_detached?: number + /** + * A list of node unique identifiers that could not be identified. + */ + nodes_not_found?: Array + } +} + +export type DetachNodesError = Error + +export type GetProductsNodesData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetProductsNodesResponse = MultiNodes + +export type GetProductsNodesError = Error + +export type BuildChildProductsData = { + body?: { + [key: string]: unknown + } + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type BuildChildProductsResponse = unknown + +export type BuildChildProductsError = Error + +export type GetChildProductsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetChildProductsResponse = MultiProductResponse + +export type GetChildProductsError = Error + +export type CreateProductTemplateRelationshipData = { + body?: ProductTemplatesRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type CreateProductTemplateRelationshipResponse = TemplateResponse + +export type CreateProductTemplateRelationshipError = Error + +export type GetProductTemplateRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetProductTemplateRelationshipsResponse = TemplateResponse + +export type GetProductTemplateRelationshipsError = Error + +export type DeleteProductTemplateRelationshipData = { + body?: ProductTemplatesRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type DeleteProductTemplateRelationshipResponse = void + +export type DeleteProductTemplateRelationshipError = Error + +export type GetProductComponentProductsRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetProductComponentProductsRelationshipsResponse = + ComponentProductsResponse + +export type GetProductComponentProductsRelationshipsError = Error + +export type GetProductFileRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetProductFileRelationshipsResponse = FileResponse + +export type GetProductFileRelationshipsError = Error + +export type CreateProductFileRelationshipsData = { + body?: ProductFilesRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type CreateProductFileRelationshipsResponse = void + +export type CreateProductFileRelationshipsError = Error + +export type UpdateProductFileRelationshipsData = { + body?: ProductFilesRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type UpdateProductFileRelationshipsResponse = void + +export type UpdateProductFileRelationshipsError = Error + +export type DeleteProductFileRelationshipsData = { + body?: ProductFilesRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type DeleteProductFileRelationshipsResponse = void + +export type DeleteProductFileRelationshipsError = Error + +export type CreateProductVariationRelationshipsData = { + body?: ProductVariationsRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type CreateProductVariationRelationshipsResponse = void + +export type CreateProductVariationRelationshipsError = Error + +export type GetProductVariationRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetProductVariationRelationshipsResponse = VariationsResponse + +export type GetProductVariationRelationshipsError = Error + +export type UpdateProductVariationRelationshipsData = { + body?: ProductVariationsRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type UpdateProductVariationRelationshipsResponse = void + +export type UpdateProductVariationRelationshipsError = Error + +export type DeleteProductVariationRelationshipsData = { + body?: ProductVariationsRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type DeleteProductVariationRelationshipsResponse = void + +export type DeleteProductVariationRelationshipsError = Error + +export type CreateProductMainImageRelationshipsData = { + body?: MainImageRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type CreateProductMainImageRelationshipsResponse = void + +export type CreateProductMainImageRelationshipsError = Error + +export type GetProductMainImageRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type GetProductMainImageRelationshipsResponse = MainImageResponse + +export type GetProductMainImageRelationshipsError = Error + +export type UpdateProductMainImageRelationshipsData = { + body?: ReplaceMainImageRequest + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type UpdateProductMainImageRelationshipsResponse = void + +export type UpdateProductMainImageRelationshipsError = Error + +export type DeleteProductMainImageRelationshipsData = { + path: { + /** + * A unique identifier for the product. + */ + productID: string + } +} + +export type DeleteProductMainImageRelationshipsResponse = void + +export type DeleteProductMainImageRelationshipsError = Error + +export type CreateVariationData = { + body: CreateVariation +} + +export type CreateVariationResponse = CreatedVariation + +export type CreateVariationError = Error + +export type GetAllVariationsData = { + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllVariationsResponse = MultiVariations + +export type GetAllVariationsError = Error + +export type GetVariationData = { + path: { + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type GetVariationResponse = SingleVariation + +export type GetVariationError = Error + +export type UpdateVariationData = { + body?: UpdateVariation + path: { + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type UpdateVariationResponse = SingleVariation + +export type UpdateVariationError = Error + +export type DeleteVariationData = { + path: { + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type DeleteVariationResponse = void + +export type DeleteVariationError = Error + +export type CreateVariationOptionData = { + body?: CreateOption + path: { + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type CreateVariationOptionResponse = CreatedOption + +export type CreateVariationOptionError = Error + +export type GetAllVariationOptionsData = { + path: { + /** + * A unique identifier for the variation. + */ + variationID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllVariationOptionsResponse = MultiOptions + +export type GetAllVariationOptionsError = Error + +export type GetVariationOptionData = { + path: { + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type GetVariationOptionResponse = SingleOption + +export type GetVariationOptionError = Error + +export type UpdateVariationOptionData = { + body?: UpdateOption + path: { + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type UpdateVariationOptionResponse = SingleOption + +export type UpdateVariationOptionError = Error + +export type DeleteVariationOptionData = { + path: { + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type DeleteVariationOptionResponse = void + +export type DeleteVariationOptionError = Error + +export type CreateModifierData = { + body?: CreateModifier + path: { + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type CreateModifierResponse = CreatedModifier + +export type CreateModifierError = Error + +export type GetAllModifiersData = { + path: { + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllModifiersResponse = MultiModifiers + +export type GetAllModifiersError = Error + +export type GetModifierData = { + path: { + /** + * A unique identifier for the modifier. + */ + modifierID: string + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type GetModifierResponse = SingleModifier + +export type GetModifierError = Error + +export type UpdateModifierData = { + body?: UpdateModifier + path: { + /** + * A unique identifier for the modifier. + */ + modifierID: string + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type UpdateModifierResponse = SingleModifier + +export type UpdateModifierError = Error + +export type DeleteModifierData = { + path: { + /** + * A unique identifier for the modifier. + */ + modifierID: string + /** + * A unique identifier for the option. + */ + optionID: string + /** + * A unique identifier for the variation. + */ + variationID: string + } +} + +export type DeleteModifierResponse = void + +export type DeleteModifierError = Error + +export type CreateHierarchyData = { + body: CreateHierarchy +} + +export type CreateHierarchyResponse = SingleHierarchy + +export type CreateHierarchyError = Error + +export type GetHierarchyData = { + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetHierarchyResponse = MultiHierarchy + +export type GetHierarchyError = Error + +export type GetHierarchyChildData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } +} + +export type GetHierarchyChildResponse = SingleHierarchy + +export type GetHierarchyChildError = Error + +export type UpdateHierarchyData = { + body: UpdateHierarchy + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } +} + +export type UpdateHierarchyResponse = SingleHierarchy + +export type UpdateHierarchyError = Error + +export type DeleteHierarchyData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } +} + +export type DeleteHierarchyResponse = void + +export type DeleteHierarchyError = Error + +export type CreateNodeData = { + body?: CreateNode + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } +} + +export type CreateNodeResponse = SingleNode + +export type CreateNodeError = Error + +export type GetAllNodesInHierarchyData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllNodesInHierarchyResponse = MultiNodes + +export type GetAllNodesInHierarchyError = Error + +export type GetHierarchyNodeData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type GetHierarchyNodeResponse = SingleNode + +export type GetHierarchyNodeError = Error + +export type UpdateNodeData = { + body?: UpdateNode + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type UpdateNodeResponse = SingleNode + +export type UpdateNodeError = Error + +export type DeleteNodeData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type DeleteNodeResponse = void + +export type DeleteNodeError = Error + +export type GetAllChildrenData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllChildrenResponse = MultiNodes + +export type GetAllChildrenError = Error + +export type CreateNodeChildRelationshipsData = { + body?: NodeChildren + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type CreateNodeChildRelationshipsResponse = SingleNode + +export type CreateNodeChildRelationshipsError = Error + +export type GetAllNodeChildrenData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetAllNodeChildrenResponse = MultiNodes + +export type GetAllNodeChildrenError = Error + +export type UpdateNodeParentData = { + body?: NodeParent + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type UpdateNodeParentResponse = void + +export type UpdateNodeParentError = Error + +export type DeleteNodeParentData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type DeleteNodeParentResponse = void + +export type DeleteNodeParentError = Error + +export type CreateNodeProductRelationshipData = { + body?: NodeProducts + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type CreateNodeProductRelationshipResponse = SingleNode + +export type CreateNodeProductRelationshipError = Error + +export type DeleteNodeProductRelationshipsData = { + body?: NodeProducts + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } +} + +export type DeleteNodeProductRelationshipsResponse = SingleNode + +export type DeleteNodeProductRelationshipsError = Error + +export type GetNodeProductsData = { + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + /** + * A unique identifier for the node. + */ + nodeID: string + } + query?: { + /** + * The number of records per page. The maximum limit is 100. + */ + "page[limit]"?: number + /** + * The number of records to offset the results by. + */ + "page[offset]"?: number + } +} + +export type GetNodeProductsResponse = MultiProductResponse + +export type GetNodeProductsError = Error + +export type DuplicateHierarchyData = { + body: DuplicateJob + path: { + /** + * A unique identifier for the hierarchy. + */ + hierarchyID: string + } +} + +export type DuplicateHierarchyResponse = Single + +export type DuplicateHierarchyError = Error + +export type GetAllProductTagsResponse = MultiTag + +export type GetAllProductTagsError = Error + +export type GetProductTagData = { + path: { + /** + * A unique identifier for the tag. + */ + tagID: string + } +} + +export type GetProductTagResponse = SingleTag + +export type GetProductTagError = Error + +export type CreateCustomRelationshipData = { + body: CreateCustomRelationship +} + +export type CreateCustomRelationshipResponse = SingleCustomRelationship + +export type CreateCustomRelationshipError = Error + +export type UpdateCustomRelationshipData = { + body: UpdateCustomRelationship + path: { + /** + * A custom relationship slug. + */ + customRelationshipSlug: string + } +} + +export type UpdateCustomRelationshipResponse = SingleCustomRelationship + +export type UpdateCustomRelationshipError = Error + +export type $OpenApiTs = { + "/pcm/jobs": { + get: { + res: { + /** + * Returns all the jobs. + */ + "200": Multi + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/jobs/{jobID}": { + get: { + req: GetJobData + res: { + /** + * Returns a job with the following attributes. + */ + "200": Single + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/jobs/{jobID}/cancel": { + post: { + req: CancelJobData + res: { + /** + * Successfully cancelled job + */ + "200": Single + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/jobs/{jobID}/errors": { + get: { + req: GetJobErrorsData + res: { + /** + * Successful + */ + "200": Errors + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products": { + post: { + req: CreateProductData + res: { + /** + * Creates a product with the following attributes. + */ + "201": SingleProductResponse + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetAllProductsData + res: { + /** + * Returns a list of all products. + */ + "200": MultiProductResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/import": { + post: { + req: ImportProductsData + res: { + /** + * Import started + */ + "201": Single + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/export": { + post: { + req: ExportProductsData + res: { + /** + * Export started + */ + "201": Single + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}": { + get: { + req: GetProductData + res: { + /** + * Returns a product by its identifier. + */ + "200": SingleProductResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateProductData + res: { + /** + * Updates a product with the following attributes. + */ + "200": SingleProductResponse + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteProductData + res: { + /** + * Deletes the specified product. + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/attach_nodes": { + post: { + req: AttachNodesData + res: { + /** + * This request assigns the products that you have selected to multiple hierarchies and their children nodes and returns the following. + */ + "200": { + meta?: { + /** + * Number of nodes assigned to the products. + */ + nodes_attached?: number + /** + * A list of node unique identifiers that could not be identified. + */ + nodes_not_found?: Array + } + } + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/detach_nodes": { + post: { + req: DetachNodesData + res: { + /** + * The request dissociates the products that you have selected from multiple hierarchies and their children and returns the following. + */ + "200": { + meta?: { + /** + * Number of nodes dissociated from the products. + */ + nodes_detached?: number + /** + * A list of node unique identifiers that could not be identified. + */ + nodes_not_found?: Array + } + } + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/nodes": { + get: { + req: GetProductsNodesData + res: { + /** + * Successfully returns the product's nodes. + */ + "200": MultiNodes + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/build": { + post: { + req: BuildChildProductsData + res: { + /** + * Successfully started building child products + */ + "201": unknown + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/children": { + get: { + req: GetChildProductsData + res: { + /** + * Returns a list of child products for the specified parent product ID. + */ + "200": MultiProductResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/relationships/templates": { + post: { + req: CreateProductTemplateRelationshipData + res: { + /** + * Returns a created product template relationship. + */ + "201": TemplateResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetProductTemplateRelationshipsData + res: { + /** + * Returns all product template relationships + */ + "200": TemplateResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteProductTemplateRelationshipData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/relationships/component_products": { + get: { + req: GetProductComponentProductsRelationshipsData + res: { + /** + * Returns all Component Products relationships + */ + "200": ComponentProductsResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/relationships/files": { + get: { + req: GetProductFileRelationshipsData + res: { + /** + * Returns all product file relationships. + */ + "200": FileResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + post: { + req: CreateProductFileRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateProductFileRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteProductFileRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/relationships/variations": { + post: { + req: CreateProductVariationRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetProductVariationRelationshipsData + res: { + /** + * Returns all product variation relationships + */ + "200": VariationsResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateProductVariationRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteProductVariationRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/products/{productID}/relationships/main_image": { + post: { + req: CreateProductMainImageRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetProductMainImageRelationshipsData + res: { + /** + * Returns all product variation relationships + */ + "200": MainImageResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateProductMainImageRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteProductMainImageRelationshipsData + res: { + /** + * No Content + */ + "204": void + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations": { + post: { + req: CreateVariationData + res: { + /** + * Returns a created variation with the following attributes. + */ + "201": CreatedVariation + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetAllVariationsData + res: { + /** + * Returns all variations. + */ + "200": MultiVariations + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations/{variationID}": { + get: { + req: GetVariationData + res: { + /** + * Returns the specified variation. + */ + "200": SingleVariation + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateVariationData + res: { + /** + * Returns an updated variation with the following attributes. + */ + "200": SingleVariation + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteVariationData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations/{variationID}/options": { + post: { + req: CreateVariationOptionData + res: { + /** + * Successfully returns the created variation option + */ + "201": CreatedOption + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetAllVariationOptionsData + res: { + /** + * Successfully returns all variation options + */ + "200": MultiOptions + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations/{variationID}/options/{optionID}": { + get: { + req: GetVariationOptionData + res: { + /** + * Successfully returns the variation option + */ + "200": SingleOption + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateVariationOptionData + res: { + /** + * Successfully returns the updated variation option + */ + "200": SingleOption + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteVariationOptionData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations/{variationID}/options/{optionID}/modifiers": { + post: { + req: CreateModifierData + res: { + /** + * Successfully returns the created modifier + */ + "201": CreatedModifier + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetAllModifiersData + res: { + /** + * Successfully returns all variation modifiers + */ + "200": MultiModifiers + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/variations/{variationID}/options/{optionID}/modifiers/{modifierID}": { + get: { + req: GetModifierData + res: { + /** + * Returns the specified modifier. + */ + "200": SingleModifier + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateModifierData + res: { + /** + * Successfully returns the updated modifier + */ + "200": SingleModifier + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Write conflict detected + */ + "409": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteModifierData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies": { + post: { + req: CreateHierarchyData + res: { + /** + * Returns a created hierarchy with the following attributes. + */ + "201": SingleHierarchy + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetHierarchyData + res: { + /** + * Returns a list of all hierarchies. + */ + "200": MultiHierarchy + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}": { + get: { + req: GetHierarchyChildData + res: { + /** + * Returns a hierarchy with the following attributes. + */ + "200": SingleHierarchy + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateHierarchyData + res: { + /** + * Successfully returns the updated hierarchy + */ + "200": SingleHierarchy + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteHierarchyData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes": { + post: { + req: CreateNodeData + res: { + /** + * Successfully returns the created node + */ + "201": SingleNode + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + get: { + req: GetAllNodesInHierarchyData + res: { + /** + * Successfully returns the node's children + */ + "200": MultiNodes + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}": { + get: { + req: GetHierarchyNodeData + res: { + /** + * Returns a node with the following attributes. + */ + "200": SingleNode + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + put: { + req: UpdateNodeData + res: { + /** + * Successfully returns the updated node + */ + "200": SingleNode + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteNodeData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/children": { + get: { + req: GetAllChildrenData + res: { + /** + * Returns the hierarchy's children. + */ + "200": MultiNodes + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/children": { + post: { + req: CreateNodeChildRelationshipsData + res: { + /** + * Successfully returns the node's children + */ + "200": SingleNode + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/children": { + get: { + req: GetAllNodeChildrenData + res: { + /** + * Successfully returns the node's children + */ + "200": MultiNodes + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/parent": { + put: { + req: UpdateNodeParentData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteNodeParentData + res: { + /** + * No Content + */ + "204": void + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/products": { + post: { + req: CreateNodeProductRelationshipData + res: { + /** + * Successfully returns the updated node + */ + "201": SingleNode + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + delete: { + req: DeleteNodeProductRelationshipsData + res: { + /** + * Successfully returns the updated node + */ + "200": SingleNode + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/products": { + get: { + req: GetNodeProductsData + res: { + /** + * Successfully returns the node's products + */ + "200": MultiProductResponse + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/hierarchies/{hierarchyID}/duplicate_job": { + post: { + req: DuplicateHierarchyData + res: { + /** + * Successfully returns the duplicate hierarchy job ID + */ + "201": Single + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/tags": { + get: { + res: { + /** + * Returns all the product tags. + */ + "200": MultiTag + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/tags/{tagID}": { + get: { + req: GetProductTagData + res: { + /** + * Returns a product tag with the following attributes. + */ + "200": SingleTag + /** + * Bad request. The request failed validation. + */ + "400": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/custom_relationships": { + post: { + req: CreateCustomRelationshipData + res: { + /** + * Returns a created custom relationship with the following attributes. + */ + "201": SingleCustomRelationship + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } + "/pcm/custom_relationships/{customRelationshipSlug}": { + put: { + req: UpdateCustomRelationshipData + res: { + /** + * Successfully returns the updated custom relationship + */ + "200": SingleCustomRelationship + /** + * Forbidden + */ + "403": Error + /** + * Bad Request. Not Found. + */ + "404": Error + /** + * Bad request. The request failed validation. + */ + "422": Error + /** + * Internal server error. There was a system failure in the platform. + */ + "500": Error + } + } + } +} + +export type GetAllJobsResponseTransformer = ( + data: any, +) => Promise + +export type MultiModelResponseTransformer = (data: any) => Multi + +export type JobModelResponseTransformer = (data: any) => Job + +export const JobModelResponseTransformer: JobModelResponseTransformer = ( + data, +) => { + if (data?.attributes?.started_at) { + data.attributes.started_at = new Date(data.attributes.started_at) + } + if (data?.attributes?.completed_at) { + data.attributes.completed_at = new Date(data.attributes.completed_at) + } + if (data?.attributes?.created_at) { + data.attributes.created_at = new Date(data.attributes.created_at) + } + if (data?.attributes?.updated_at) { + data.attributes.updated_at = new Date(data.attributes.updated_at) + } + return data +} + +export const MultiModelResponseTransformer: MultiModelResponseTransformer = ( + data, +) => { + if (Array.isArray(data?.data)) { + data.data.forEach(JobModelResponseTransformer) + } + return data +} + +export const GetAllJobsResponseTransformer: GetAllJobsResponseTransformer = + async (data) => { + MultiModelResponseTransformer(data) + return data + } + +export type GetJobResponseTransformer = (data: any) => Promise + +export type SingleModelResponseTransformer = (data: any) => Single + +export const SingleModelResponseTransformer: SingleModelResponseTransformer = ( + data, +) => { + if (data?.data) { + JobModelResponseTransformer(data.data) + } + return data +} + +export const GetJobResponseTransformer: GetJobResponseTransformer = async ( + data, +) => { + SingleModelResponseTransformer(data) + return data +} + +export type CancelJobResponseTransformer = ( + data: any, +) => Promise + +export const CancelJobResponseTransformer: CancelJobResponseTransformer = + async (data) => { + SingleModelResponseTransformer(data) + return data + } + +export type CreateProductResponseTransformer = ( + data: any, +) => Promise + +export type SingleProductResponseModelResponseTransformer = ( + data: any, +) => SingleProductResponse + +export type ProductResponseModelResponseTransformer = ( + data: any, +) => ProductResponse + +export const ProductResponseModelResponseTransformer: ProductResponseModelResponseTransformer = + (data) => { + if (data?.meta?.created_at) { + data.meta.created_at = new Date(data.meta.created_at) + } + if (data?.meta?.updated_at) { + data.meta.updated_at = new Date(data.meta.updated_at) + } + return data + } + +export const SingleProductResponseModelResponseTransformer: SingleProductResponseModelResponseTransformer = + (data) => { + if (data?.data) { + ProductResponseModelResponseTransformer(data.data) + } + if (Array.isArray(data?.included?.component_products)) { + data.included.component_products.forEach( + ProductResponseModelResponseTransformer, + ) + } + return data + } + +export const CreateProductResponseTransformer: CreateProductResponseTransformer = + async (data) => { + SingleProductResponseModelResponseTransformer(data) + return data + } + +export type GetAllProductsResponseTransformer = ( + data: any, +) => Promise + +export type MultiProductResponseModelResponseTransformer = ( + data: any, +) => MultiProductResponse + +export const MultiProductResponseModelResponseTransformer: MultiProductResponseModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(ProductResponseModelResponseTransformer) + } + if (Array.isArray(data?.included?.component_products)) { + data.included.component_products.forEach( + ProductResponseModelResponseTransformer, + ) + } + return data + } + +export const GetAllProductsResponseTransformer: GetAllProductsResponseTransformer = + async (data) => { + MultiProductResponseModelResponseTransformer(data) + return data + } + +export type ImportProductsResponseTransformer = ( + data: any, +) => Promise + +export const ImportProductsResponseTransformer: ImportProductsResponseTransformer = + async (data) => { + SingleModelResponseTransformer(data) + return data + } + +export type ExportProductsResponseTransformer = ( + data: any, +) => Promise + +export const ExportProductsResponseTransformer: ExportProductsResponseTransformer = + async (data) => { + SingleModelResponseTransformer(data) + return data + } + +export type GetProductResponseTransformer = ( + data: any, +) => Promise + +export const GetProductResponseTransformer: GetProductResponseTransformer = + async (data) => { + SingleProductResponseModelResponseTransformer(data) + return data + } + +export type UpdateProductResponseTransformer = ( + data: any, +) => Promise + +export const UpdateProductResponseTransformer: UpdateProductResponseTransformer = + async (data) => { + SingleProductResponseModelResponseTransformer(data) + return data + } + +export type GetProductsNodesResponseTransformer = ( + data: any, +) => Promise + +export type MultiNodesModelResponseTransformer = (data: any) => MultiNodes + +export type NodeModelResponseTransformer = (data: any) => Node + +export const NodeModelResponseTransformer: NodeModelResponseTransformer = ( + data, +) => { + if (data?.meta?.created_at) { + data.meta.created_at = new Date(data.meta.created_at) + } + if (data?.meta?.updated_at) { + data.meta.updated_at = new Date(data.meta.updated_at) + } + return data +} + +export const MultiNodesModelResponseTransformer: MultiNodesModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(NodeModelResponseTransformer) + } + return data + } + +export const GetProductsNodesResponseTransformer: GetProductsNodesResponseTransformer = + async (data) => { + MultiNodesModelResponseTransformer(data) + return data + } + +export type GetChildProductsResponseTransformer = ( + data: any, +) => Promise + +export const GetChildProductsResponseTransformer: GetChildProductsResponseTransformer = + async (data) => { + MultiProductResponseModelResponseTransformer(data) + return data + } + +export type CreateVariationResponseTransformer = ( + data: any, +) => Promise + +export type CreatedVariationModelResponseTransformer = ( + data: any, +) => CreatedVariation + +export const CreatedVariationModelResponseTransformer: CreatedVariationModelResponseTransformer = + (data) => { + if (data?.data?.meta?.created_at) { + data.data.meta.created_at = new Date(data.data.meta.created_at) + } + if (data?.data?.meta?.updated_at) { + data.data.meta.updated_at = new Date(data.data.meta.updated_at) + } + return data + } + +export const CreateVariationResponseTransformer: CreateVariationResponseTransformer = + async (data) => { + CreatedVariationModelResponseTransformer(data) + return data + } + +export type CreateVariationOptionResponseTransformer = ( + data: any, +) => Promise + +export type CreatedOptionModelResponseTransformer = (data: any) => CreatedOption + +export const CreatedOptionModelResponseTransformer: CreatedOptionModelResponseTransformer = + (data) => { + if (data?.data?.meta?.created_at) { + data.data.meta.created_at = new Date(data.data.meta.created_at) + } + if (data?.data?.meta?.updated_at) { + data.data.meta.updated_at = new Date(data.data.meta.updated_at) + } + return data + } + +export const CreateVariationOptionResponseTransformer: CreateVariationOptionResponseTransformer = + async (data) => { + CreatedOptionModelResponseTransformer(data) + return data + } + +export type GetVariationOptionResponseTransformer = ( + data: any, +) => Promise + +export type SingleOptionModelResponseTransformer = (data: any) => SingleOption + +export const SingleOptionModelResponseTransformer: SingleOptionModelResponseTransformer = + (data) => { + if (data?.data?.meta?.created_at) { + data.data.meta.created_at = new Date(data.data.meta.created_at) + } + if (data?.data?.meta?.updated_at) { + data.data.meta.updated_at = new Date(data.data.meta.updated_at) + } + return data + } + +export const GetVariationOptionResponseTransformer: GetVariationOptionResponseTransformer = + async (data) => { + SingleOptionModelResponseTransformer(data) + return data + } + +export type UpdateVariationOptionResponseTransformer = ( + data: any, +) => Promise + +export const UpdateVariationOptionResponseTransformer: UpdateVariationOptionResponseTransformer = + async (data) => { + SingleOptionModelResponseTransformer(data) + return data + } + +export type CreateHierarchyResponseTransformer = ( + data: any, +) => Promise + +export type SingleHierarchyModelResponseTransformer = ( + data: any, +) => SingleHierarchy + +export type HierarchyModelResponseTransformer = (data: any) => Hierarchy + +export const HierarchyModelResponseTransformer: HierarchyModelResponseTransformer = + (data) => { + if (data?.meta?.created_at) { + data.meta.created_at = new Date(data.meta.created_at) + } + if (data?.meta?.updated_at) { + data.meta.updated_at = new Date(data.meta.updated_at) + } + return data + } + +export const SingleHierarchyModelResponseTransformer: SingleHierarchyModelResponseTransformer = + (data) => { + if (data?.data) { + HierarchyModelResponseTransformer(data.data) + } + return data + } + +export const CreateHierarchyResponseTransformer: CreateHierarchyResponseTransformer = + async (data) => { + SingleHierarchyModelResponseTransformer(data) + return data + } + +export type GetHierarchyResponseTransformer = ( + data: any, +) => Promise + +export type MultiHierarchyModelResponseTransformer = ( + data: any, +) => MultiHierarchy + +export const MultiHierarchyModelResponseTransformer: MultiHierarchyModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(HierarchyModelResponseTransformer) + } + return data + } + +export const GetHierarchyResponseTransformer: GetHierarchyResponseTransformer = + async (data) => { + MultiHierarchyModelResponseTransformer(data) + return data + } + +export type GetHierarchyChildResponseTransformer = ( + data: any, +) => Promise + +export const GetHierarchyChildResponseTransformer: GetHierarchyChildResponseTransformer = + async (data) => { + SingleHierarchyModelResponseTransformer(data) + return data + } + +export type UpdateHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const UpdateHierarchyResponseTransformer: UpdateHierarchyResponseTransformer = + async (data) => { + SingleHierarchyModelResponseTransformer(data) + return data + } + +export type CreateNodeResponseTransformer = ( + data: any, +) => Promise + +export type SingleNodeModelResponseTransformer = (data: any) => SingleNode + +export const SingleNodeModelResponseTransformer: SingleNodeModelResponseTransformer = + (data) => { + if (data?.data) { + NodeModelResponseTransformer(data.data) + } + return data + } + +export const CreateNodeResponseTransformer: CreateNodeResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type GetAllNodesInHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const GetAllNodesInHierarchyResponseTransformer: GetAllNodesInHierarchyResponseTransformer = + async (data) => { + MultiNodesModelResponseTransformer(data) + return data + } + +export type GetHierarchyNodeResponseTransformer = ( + data: any, +) => Promise + +export const GetHierarchyNodeResponseTransformer: GetHierarchyNodeResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type UpdateNodeResponseTransformer = ( + data: any, +) => Promise + +export const UpdateNodeResponseTransformer: UpdateNodeResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type GetAllChildrenResponseTransformer = ( + data: any, +) => Promise + +export const GetAllChildrenResponseTransformer: GetAllChildrenResponseTransformer = + async (data) => { + MultiNodesModelResponseTransformer(data) + return data + } + +export type CreateNodeChildRelationshipsResponseTransformer = ( + data: any, +) => Promise + +export const CreateNodeChildRelationshipsResponseTransformer: CreateNodeChildRelationshipsResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type GetAllNodeChildrenResponseTransformer = ( + data: any, +) => Promise + +export const GetAllNodeChildrenResponseTransformer: GetAllNodeChildrenResponseTransformer = + async (data) => { + MultiNodesModelResponseTransformer(data) + return data + } + +export type CreateNodeProductRelationshipResponseTransformer = ( + data: any, +) => Promise + +export const CreateNodeProductRelationshipResponseTransformer: CreateNodeProductRelationshipResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type DeleteNodeProductRelationshipsResponseTransformer = ( + data: any, +) => Promise + +export const DeleteNodeProductRelationshipsResponseTransformer: DeleteNodeProductRelationshipsResponseTransformer = + async (data) => { + SingleNodeModelResponseTransformer(data) + return data + } + +export type GetNodeProductsResponseTransformer = ( + data: any, +) => Promise + +export const GetNodeProductsResponseTransformer: GetNodeProductsResponseTransformer = + async (data) => { + MultiProductResponseModelResponseTransformer(data) + return data + } + +export type DuplicateHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const DuplicateHierarchyResponseTransformer: DuplicateHierarchyResponseTransformer = + async (data) => { + SingleModelResponseTransformer(data) + return data + } + +export type GetAllProductTagsResponseTransformer = ( + data: any, +) => Promise + +export type MultiTagModelResponseTransformer = (data: any) => MultiTag + +export type TagModelResponseTransformer = (data: any) => Tag + +export const TagModelResponseTransformer: TagModelResponseTransformer = ( + data, +) => { + if (data?.meta?.created_at) { + data.meta.created_at = new Date(data.meta.created_at) + } + if (data?.meta?.updated_at) { + data.meta.updated_at = new Date(data.meta.updated_at) + } + return data +} + +export const MultiTagModelResponseTransformer: MultiTagModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(TagModelResponseTransformer) + } + return data + } + +export const GetAllProductTagsResponseTransformer: GetAllProductTagsResponseTransformer = + async (data) => { + MultiTagModelResponseTransformer(data) + return data + } + +export type GetProductTagResponseTransformer = ( + data: any, +) => Promise + +export type SingleTagModelResponseTransformer = (data: any) => SingleTag + +export const SingleTagModelResponseTransformer: SingleTagModelResponseTransformer = + (data) => { + if (data?.data) { + TagModelResponseTransformer(data.data) + } + return data + } + +export const GetProductTagResponseTransformer: GetProductTagResponseTransformer = + async (data) => { + SingleTagModelResponseTransformer(data) + return data + } + +export type CreateCustomRelationshipResponseTransformer = ( + data: any, +) => Promise + +export type SingleCustomRelationshipModelResponseTransformer = ( + data: any, +) => SingleCustomRelationship + +export type CustomRelationshipModelResponseTransformer = ( + data: any, +) => CustomRelationship + +export const CustomRelationshipModelResponseTransformer: CustomRelationshipModelResponseTransformer = + (data) => { + if (data?.meta?.timestamps?.created_at) { + data.meta.timestamps.created_at = new Date( + data.meta.timestamps.created_at, + ) + } + if (data?.meta?.timestamps?.updated_at) { + data.meta.timestamps.updated_at = new Date( + data.meta.timestamps.updated_at, + ) + } + return data + } + +export const SingleCustomRelationshipModelResponseTransformer: SingleCustomRelationshipModelResponseTransformer = + (data) => { + if (data?.data) { + CustomRelationshipModelResponseTransformer(data.data) + } + return data + } + +export const CreateCustomRelationshipResponseTransformer: CreateCustomRelationshipResponseTransformer = + async (data) => { + SingleCustomRelationshipModelResponseTransformer(data) + return data + } + +export type UpdateCustomRelationshipResponseTransformer = ( + data: any, +) => Promise + +export const UpdateCustomRelationshipResponseTransformer: UpdateCustomRelationshipResponseTransformer = + async (data) => { + SingleCustomRelationshipModelResponseTransformer(data) + return data + } diff --git a/packages/sdks/pim/src/index.ts b/packages/sdks/pim/src/index.ts new file mode 100644 index 00000000..b583818f --- /dev/null +++ b/packages/sdks/pim/src/index.ts @@ -0,0 +1,3 @@ +export * from "./client" +import { createClient, client } from "@hey-api/client-fetch" +export { createClient, client } diff --git a/packages/sdks/pim/tsconfig.json b/packages/sdks/pim/tsconfig.json new file mode 100644 index 00000000..d27f8641 --- /dev/null +++ b/packages/sdks/pim/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "outDir": "dist", + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": [ + "src" + ], + "references": [{ "path": "./tsconfig.node.json"}] +} diff --git a/packages/sdks/pim/tsconfig.node.json b/packages/sdks/pim/tsconfig.node.json new file mode 100644 index 00000000..180cab8c --- /dev/null +++ b/packages/sdks/pim/tsconfig.node.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src" + ], +} diff --git a/packages/sdks/shopper/openapi-ts.config.ts b/packages/sdks/shopper/openapi-ts.config.ts new file mode 100644 index 00000000..2a9d0fad --- /dev/null +++ b/packages/sdks/shopper/openapi-ts.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from "@hey-api/openapi-ts" + +export default defineConfig({ + client: "@hey-api/client-fetch", + input: "../specs/shopper.yaml", + output: { path: "src/client", format: "prettier" }, + types: { + name: "PascalCase", + enums: false, + dates: "types+transform", + }, + plugins: ["@tanstack/react-query"], +}) diff --git a/packages/sdks/shopper/package.json b/packages/sdks/shopper/package.json new file mode 100644 index 00000000..4a88e218 --- /dev/null +++ b/packages/sdks/shopper/package.json @@ -0,0 +1,51 @@ +{ + "name": "@epcc-sdk/sdks-shopper", + "version": "0.0.1", + "description": "", + "main": "dist/index.js", + "scripts": { + "build": "pnpm oas:build && pnpm oas:openapi-ts && pnpm tsc:build", + "tsc:build": "tsc -p tsconfig.node.json", + "oas:build": "pnpm oas:redocly:bundle && pnpm oas:openapi-format:convert && pnpm oas:redocly:join:shopper", + "oas:openapi-ts": "openapi-ts", + "oas:redocly": "redocly --config ./redocly.json", + "oas:redocly:lint": "redocly lint --config ../specs/config/redocly.yaml", + "oas:redocly:join:shopper": "redocly join --config ../specs/config/redocly.yaml --output ../specs/shopper.yaml ../specs/bundled/catalog_view_3.1.yaml ../specs/bundled/cart_checkout.yaml", + "oas:redocly:bundle": "redocly bundle --config ../specs/config/redocly.yaml --output ../specs/bundled", + "oas:openapi-format:convert": "pnpm dlx openapi-format ../specs/bundled/catalog_view.yaml -o ../specs/bundled/catalog_view_3.1.yaml --convertTo \"3.1\"" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "node": { + "import": "./dist/index.js", + "require": "./dist/index.js" + }, + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist/**" + ], + "keywords": [], + "devDependencies": { + "@tanstack/react-query": "^5.52.1", + "@hey-api/openapi-ts": "^0.52.10", + "@redocly/cli": "^1.21.0", + "@redocly/openapi-core": "^1.21.0", + "lodash": "^4.17.21", + "typescript": "^5.5.3" + }, + "dependencies": { + "@hey-api/client-fetch": "^0.2.4" + }, + "peerDependencies": { + "@tanstack/react-query": "^5.52.1" + }, + "peerDependenciesMeta": { + "@tanstack/react-query": { + "optional": true + } + } +} diff --git a/packages/sdks/shopper/src/client/@tanstack/react-query.gen.ts b/packages/sdks/shopper/src/client/@tanstack/react-query.gen.ts new file mode 100644 index 00000000..3ada802e --- /dev/null +++ b/packages/sdks/shopper/src/client/@tanstack/react-query.gen.ts @@ -0,0 +1,3219 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Options } from "@hey-api/client-fetch" +import { + queryOptions, + infiniteQueryOptions, + type InfiniteData, + type UseMutationOptions, + type DefaultError, +} from "@tanstack/react-query" +import type { + GetByContextReleaseData, + GetByContextAllHierarchiesData, + GetByContextAllHierarchiesError, + GetByContextAllHierarchiesResponse, + GetByContextHierarchyData, + GetByContextHierarchyNodesData, + GetByContextHierarchyNodesError, + GetByContextHierarchyNodesResponse, + GetByContextHierarchyChildNodesData, + GetByContextHierarchyChildNodesError, + GetByContextHierarchyChildNodesResponse, + GetByContextAllNodesData, + GetByContextAllNodesError, + GetByContextAllNodesResponse, + GetByContextNodeData, + GetByContextChildNodesData, + GetByContextChildNodesError, + GetByContextChildNodesResponse, + GetByContextAllProductsData, + GetByContextAllProductsError, + GetByContextAllProductsResponse, + GetByContextProductData, + GetByContextComponentProductIdsData, + GetByContextComponentProductIdsError, + GetByContextComponentProductIdsResponse, + GetByContextChildProductsData, + GetByContextChildProductsError, + GetByContextChildProductsResponse, + GetByContextProductsForHierarchyData, + GetByContextProductsForHierarchyError, + GetByContextProductsForHierarchyResponse, + GetByContextProductsForNodeData, + GetByContextProductsForNodeError, + GetByContextProductsForNodeResponse, + ConfigureByContextProductData, + ConfigureByContextProductError, + ConfigureByContextProductResponse, + CreateCatalogData, + CreateCatalogError, + CreateCatalogResponse, + GetCatalogByIdData, + UpdateCatalogData, + UpdateCatalogError, + UpdateCatalogResponse, + DeleteCatalogByIdData, + DeleteCatalogByIdError, + DeleteCatalogByIdResponse, + PublishReleaseData, + PublishReleaseError, + PublishReleaseResponse, + GetReleasesData, + DeleteReleasesData, + DeleteReleasesError, + DeleteReleasesResponse, + GetReleaseByIdData, + DeleteReleaseByIdData, + DeleteReleaseByIdError, + DeleteReleaseByIdResponse, + CreateRuleData, + CreateRuleError, + CreateRuleResponse, + GetRulesData, + GetRulesError, + GetRulesResponse, + GetRuleByIdData, + UpdateRuleData, + UpdateRuleError, + UpdateRuleResponse, + DeleteRuleByIdData, + DeleteRuleByIdError, + DeleteRuleByIdResponse, + GetAllHierarchiesData, + GetAllHierarchiesError, + GetAllHierarchiesResponse, + GetHierarchyData, + GetHierarchyNodesData, + GetHierarchyNodesError, + GetHierarchyNodesResponse, + GetHierarchyChildNodesData, + GetHierarchyChildNodesError, + GetHierarchyChildNodesResponse, + GetAllNodesData, + GetAllNodesError, + GetAllNodesResponse, + GetNodeData, + GetChildNodesData, + GetChildNodesError, + GetChildNodesResponse, + GetAllProductsData, + GetAllProductsError, + GetAllProductsResponse, + GetProductData, + GetComponentProductIdsData, + GetComponentProductIdsError, + GetComponentProductIdsResponse, + GetChildProductsData, + GetChildProductsError, + GetChildProductsResponse, + GetProductsForHierarchyData, + GetProductsForHierarchyError, + GetProductsForHierarchyResponse, + GetProductsForNodeData, + GetProductsForNodeError, + GetProductsForNodeResponse, + GetCartsData, + CreateAcartData, + CreateAcartError, + CreateAcartResponse, + GetCartData, + UpdateAcartData, + UpdateAcartError, + UpdateAcartResponse, + DeleteAcartData, + DeleteAcartError, + DeleteAcartResponse, + GetCartItemsData, + BulkUpdateItemsInCartData, + BulkUpdateItemsInCartError, + BulkUpdateItemsInCartResponse, + ManageCartsData, + ManageCartsError, + ManageCartsResponse, + DeleteAllCartItemsData, + DeleteAllCartItemsError, + DeleteAllCartItemsResponse, + UpdateAcartItemData, + UpdateAcartItemError, + UpdateAcartItemResponse, + DeleteAcartItemData, + DeleteAcartItemError, + DeleteAcartItemResponse, + CreateAccountCartAssociationData, + CreateAccountCartAssociationError, + CreateAccountCartAssociationResponse, + DeleteAccountCartAssociationData, + DeleteAccountCartAssociationError, + DeleteAccountCartAssociationResponse, + CreateCustomerCartAssociationData, + CreateCustomerCartAssociationError, + CreateCustomerCartAssociationResponse, + DeleteCustomerCartAssociationData, + DeleteCustomerCartAssociationError, + DeleteCustomerCartAssociationResponse, + DeleteApromotionViaPromotionCodeData, + DeleteApromotionViaPromotionCodeError, + DeleteApromotionViaPromotionCodeResponse, + AddTaxItemToCartData, + AddTaxItemToCartError, + AddTaxItemToCartResponse, + BulkAddTaxItemsToCartData, + BulkAddTaxItemsToCartError, + BulkAddTaxItemsToCartResponse, + BulkDeleteTaxItemsFromCartData, + BulkDeleteTaxItemsFromCartError, + BulkDeleteTaxItemsFromCartResponse, + UpdateAtaxItemData, + UpdateAtaxItemError, + UpdateAtaxItemResponse, + DeleteAtaxItemData, + DeleteAtaxItemError, + DeleteAtaxItemResponse, + BulkAddCustomDiscountsToCartData, + BulkAddCustomDiscountsToCartError, + BulkAddCustomDiscountsToCartResponse, + BulkDeleteCustomDiscountsFromCartData, + BulkDeleteCustomDiscountsFromCartError, + BulkDeleteCustomDiscountsFromCartResponse, + UpdateCustomDiscountForCartData, + UpdateCustomDiscountForCartError, + UpdateCustomDiscountForCartResponse, + DeleteCustomDiscountFromCartData, + DeleteCustomDiscountFromCartError, + DeleteCustomDiscountFromCartResponse, + AddCustomDiscountToCartItemData, + UpdateCustomDiscountForCartItemData, + DeleteCustomDiscountFromCartItemData, + DeleteCustomDiscountFromCartItemError, + DeleteCustomDiscountFromCartItemResponse, + CreateCartPaymentIntentData, + CreateCartPaymentIntentError, + CreateCartPaymentIntentResponse, + CheckoutApiData, + CheckoutApiError, + CheckoutApiResponse, + GetCustomerOrdersData, + GetAnOrderData, + UpdateAnOrderData, + UpdateAnOrderError, + UpdateAnOrderResponse, + GetOrderItemsData, + AnonymizeOrdersData, + AnonymizeOrdersError, + AnonymizeOrdersResponse, + AuthorizeSetupData, + AuthorizeSetupError, + AuthorizeSetupResponse, + ConfirmSetupData, + ConfirmSetupError, + ConfirmSetupResponse, + CaptureAtransactionData, + CaptureAtransactionError, + CaptureAtransactionResponse, + RefundAtransactionData, + RefundAtransactionError, + RefundAtransactionResponse, + GetOrderTransactionsData, + GetAtransactionData, + CancelAtransactionData, + CancelAtransactionError, + CancelAtransactionResponse, +} from "../types.gen" +import { + client, + getByContextRelease, + getByContextAllHierarchies, + getByContextHierarchy, + getByContextHierarchyNodes, + getByContextHierarchyChildNodes, + getByContextAllNodes, + getByContextNode, + getByContextChildNodes, + getByContextAllProducts, + getByContextProduct, + getByContextComponentProductIds, + getByContextChildProducts, + getByContextProductsForHierarchy, + getByContextProductsForNode, + configureByContextProduct, + createCatalog, + getCatalogs, + getCatalogById, + updateCatalog, + deleteCatalogById, + publishRelease, + getReleases, + deleteReleases, + getReleaseById, + deleteReleaseById, + createRule, + getRules, + getRuleById, + updateRule, + deleteRuleById, + getAllHierarchies, + getHierarchy, + getHierarchyNodes, + getHierarchyChildNodes, + getAllNodes, + getNode, + getChildNodes, + getAllProducts, + getProduct, + getComponentProductIds, + getChildProducts, + getProductsForHierarchy, + getProductsForNode, + getCarts, + createAcart, + getCart, + updateAcart, + deleteAcart, + getCartItems, + bulkUpdateItemsInCart, + manageCarts, + deleteAllCartItems, + updateAcartItem, + deleteAcartItem, + createAccountCartAssociation, + deleteAccountCartAssociation, + createCustomerCartAssociation, + deleteCustomerCartAssociation, + deleteApromotionViaPromotionCode, + addTaxItemToCart, + bulkAddTaxItemsToCart, + bulkDeleteTaxItemsFromCart, + updateAtaxItem, + deleteAtaxItem, + bulkAddCustomDiscountsToCart, + bulkDeleteCustomDiscountsFromCart, + updateCustomDiscountForCart, + deleteCustomDiscountFromCart, + addCustomDiscountToCartItem, + updateCustomDiscountForCartItem, + deleteCustomDiscountFromCartItem, + createCartPaymentIntent, + checkoutApi, + getCustomerOrders, + getAnOrder, + updateAnOrder, + getOrderItems, + anonymizeOrders, + authorizeSetup, + confirmSetup, + captureAtransaction, + refundAtransaction, + getOrderTransactions, + getAtransaction, + cancelAtransaction, +} from "../services.gen" + +type QueryKey = [ + Pick & { + _id: string + _infinite?: boolean + }, +] + +const createQueryKey = ( + id: string, + options?: TOptions, + infinite?: boolean, +): QueryKey[0] => { + const params: QueryKey[0] = { + _id: id, + baseUrl: client.getConfig().baseUrl, + } as QueryKey[0] + if (infinite) { + params._infinite = infinite + } + if (options?.body) { + params.body = options.body + } + if (options?.headers) { + params.headers = options.headers + } + if (options?.path) { + params.path = options.path + } + if (options?.query) { + params.query = options.query + } + return params +} + +export const getByContextReleaseOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextRelease({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextRelease", options)], + }) +} + +export const getByContextAllHierarchiesOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextAllHierarchies({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllHierarchies", options)], + }) +} + +export const getByContextAllHierarchiesInfiniteOptions = ( + options?: Options, +) => { + return infiniteQueryOptions< + GetByContextAllHierarchiesResponse, + GetByContextAllHierarchiesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextAllHierarchies({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllHierarchies", options, true)], + }, + ) +} + +export const getByContextHierarchyOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextHierarchy({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextHierarchy", options)], + }) +} + +export const getByContextHierarchyNodesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextHierarchyNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextHierarchyNodes", options)], + }) +} + +export const getByContextHierarchyNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextHierarchyNodesResponse, + GetByContextHierarchyNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextHierarchyNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextHierarchyNodes", options, true)], + }, + ) +} + +export const getByContextHierarchyChildNodesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextHierarchyChildNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextHierarchyChildNodes", options)], + }) +} + +export const getByContextHierarchyChildNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextHierarchyChildNodesResponse, + GetByContextHierarchyChildNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextHierarchyChildNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [ + createQueryKey("getByContextHierarchyChildNodes", options, true), + ], + }, + ) +} + +export const getByContextAllNodesOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextAllNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllNodes", options)], + }) +} + +export const getByContextAllNodesInfiniteOptions = ( + options?: Options, +) => { + return infiniteQueryOptions< + GetByContextAllNodesResponse, + GetByContextAllNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextAllNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllNodes", options, true)], + }, + ) +} + +export const getByContextNodeOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextNode({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextNode", options)], + }) +} + +export const getByContextChildNodesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextChildNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextChildNodes", options)], + }) +} + +export const getByContextChildNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextChildNodesResponse, + GetByContextChildNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextChildNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextChildNodes", options, true)], + }, + ) +} + +export const getByContextAllProductsOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextAllProducts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllProducts", options)], + }) +} + +export const getByContextAllProductsInfiniteOptions = ( + options?: Options, +) => { + return infiniteQueryOptions< + GetByContextAllProductsResponse, + GetByContextAllProductsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextAllProducts({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextAllProducts", options, true)], + }, + ) +} + +export const getByContextProductOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextProduct({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextProduct", options)], + }) +} + +export const getByContextComponentProductIdsOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextComponentProductIds({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextComponentProductIds", options)], + }) +} + +export const getByContextComponentProductIdsInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextComponentProductIdsResponse, + GetByContextComponentProductIdsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextComponentProductIds({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [ + createQueryKey("getByContextComponentProductIds", options, true), + ], + }, + ) +} + +export const getByContextChildProductsOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextChildProducts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextChildProducts", options)], + }) +} + +export const getByContextChildProductsInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextChildProductsResponse, + GetByContextChildProductsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextChildProducts({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextChildProducts", options, true)], + }, + ) +} + +export const getByContextProductsForHierarchyOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextProductsForHierarchy({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextProductsForHierarchy", options)], + }) +} + +export const getByContextProductsForHierarchyInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextProductsForHierarchyResponse, + GetByContextProductsForHierarchyError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextProductsForHierarchy({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [ + createQueryKey("getByContextProductsForHierarchy", options, true), + ], + }, + ) +} + +export const getByContextProductsForNodeOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getByContextProductsForNode({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextProductsForNode", options)], + }) +} + +export const getByContextProductsForNodeInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetByContextProductsForNodeResponse, + GetByContextProductsForNodeError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getByContextProductsForNode({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getByContextProductsForNode", options, true)], + }, + ) +} + +export const configureByContextProductOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await configureByContextProduct({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("configureByContextProduct", options)], + }) +} + +export const configureByContextProductMutation = () => { + const mutationOptions: UseMutationOptions< + ConfigureByContextProductResponse, + ConfigureByContextProductError, + Options + > = { + mutationFn: async (options) => { + const { data } = await configureByContextProduct({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const createCatalogOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createCatalog({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createCatalog", options)], + }) +} + +export const createCatalogMutation = () => { + const mutationOptions: UseMutationOptions< + CreateCatalogResponse, + CreateCatalogError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createCatalog({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getCatalogsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCatalogs({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCatalogs", options)], + }) +} + +export const getCatalogByIdOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCatalogById({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCatalogById", options)], + }) +} + +export const updateCatalogMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateCatalogResponse, + UpdateCatalogError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateCatalog({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteCatalogByIdMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteCatalogByIdResponse, + DeleteCatalogByIdError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteCatalogById({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const publishReleaseOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await publishRelease({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("publishRelease", options)], + }) +} + +export const publishReleaseMutation = () => { + const mutationOptions: UseMutationOptions< + PublishReleaseResponse, + PublishReleaseError, + Options + > = { + mutationFn: async (options) => { + const { data } = await publishRelease({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getReleasesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getReleases({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getReleases", options)], + }) +} + +export const deleteReleasesMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteReleasesResponse, + DeleteReleasesError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteReleases({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getReleaseByIdOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getReleaseById({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getReleaseById", options)], + }) +} + +export const deleteReleaseByIdMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteReleaseByIdResponse, + DeleteReleaseByIdError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteReleaseById({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const createRuleOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createRule({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createRule", options)], + }) +} + +export const createRuleMutation = () => { + const mutationOptions: UseMutationOptions< + CreateRuleResponse, + CreateRuleError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createRule({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getRulesOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getRules({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getRules", options)], + }) +} + +export const getRulesInfiniteOptions = (options?: Options) => { + return infiniteQueryOptions< + GetRulesResponse, + GetRulesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getRules({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getRules", options, true)], + }, + ) +} + +export const getRuleByIdOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getRuleById({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getRuleById", options)], + }) +} + +export const updateRuleMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateRuleResponse, + UpdateRuleError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateRule({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteRuleByIdMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteRuleByIdResponse, + DeleteRuleByIdError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteRuleById({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getAllHierarchiesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getAllHierarchies({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllHierarchies", options)], + }) +} + +export const getAllHierarchiesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetAllHierarchiesResponse, + GetAllHierarchiesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getAllHierarchies({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllHierarchies", options, true)], + }, + ) +} + +export const getHierarchyOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getHierarchy({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getHierarchy", options)], + }) +} + +export const getHierarchyNodesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getHierarchyNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getHierarchyNodes", options)], + }) +} + +export const getHierarchyNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetHierarchyNodesResponse, + GetHierarchyNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getHierarchyNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getHierarchyNodes", options, true)], + }, + ) +} + +export const getHierarchyChildNodesOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getHierarchyChildNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getHierarchyChildNodes", options)], + }) +} + +export const getHierarchyChildNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetHierarchyChildNodesResponse, + GetHierarchyChildNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getHierarchyChildNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getHierarchyChildNodes", options, true)], + }, + ) +} + +export const getAllNodesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getAllNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllNodes", options)], + }) +} + +export const getAllNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetAllNodesResponse, + GetAllNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getAllNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllNodes", options, true)], + }, + ) +} + +export const getNodeOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getNode({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getNode", options)], + }) +} + +export const getChildNodesOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getChildNodes({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getChildNodes", options)], + }) +} + +export const getChildNodesInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetChildNodesResponse, + GetChildNodesError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getChildNodes({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getChildNodes", options, true)], + }, + ) +} + +export const getAllProductsOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getAllProducts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllProducts", options)], + }) +} + +export const getAllProductsInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetAllProductsResponse, + GetAllProductsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getAllProducts({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAllProducts", options, true)], + }, + ) +} + +export const getProductOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getProduct({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getProduct", options)], + }) +} + +export const getComponentProductIdsOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getComponentProductIds({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getComponentProductIds", options)], + }) +} + +export const getComponentProductIdsInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetComponentProductIdsResponse, + GetComponentProductIdsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getComponentProductIds({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getComponentProductIds", options, true)], + }, + ) +} + +export const getChildProductsOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getChildProducts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getChildProducts", options)], + }) +} + +export const getChildProductsInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetChildProductsResponse, + GetChildProductsError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getChildProducts({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getChildProducts", options, true)], + }, + ) +} + +export const getProductsForHierarchyOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getProductsForHierarchy({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getProductsForHierarchy", options)], + }) +} + +export const getProductsForHierarchyInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetProductsForHierarchyResponse, + GetProductsForHierarchyError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getProductsForHierarchy({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getProductsForHierarchy", options, true)], + }, + ) +} + +export const getProductsForNodeOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getProductsForNode({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getProductsForNode", options)], + }) +} + +export const getProductsForNodeInfiniteOptions = ( + options: Options, +) => { + return infiniteQueryOptions< + GetProductsForNodeResponse, + GetProductsForNodeError, + InfiniteData, + QueryKey>, + | number + | Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > + >( + // @ts-ignore + { + queryFn: async ({ pageParam, queryKey }) => { + // @ts-ignore + const page: Pick< + QueryKey>[0], + "body" | "headers" | "path" | "query" + > = + typeof pageParam === "object" + ? pageParam + : { + query: { + "page[limit]": pageParam, + }, + } + const { data } = await getProductsForNode({ + ...options, + ...queryKey[0], + body: { + ...(queryKey[0].body as any), + ...(page.body as any), + }, + headers: { + ...queryKey[0].headers, + ...page.headers, + }, + path: { + ...queryKey[0].path, + ...page.path, + }, + query: { + ...queryKey[0].query, + ...page.query, + }, + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getProductsForNode", options, true)], + }, + ) +} + +export const getCartsOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCarts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCarts", options)], + }) +} + +export const createAcartOptions = (options?: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createAcart({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createAcart", options)], + }) +} + +export const createAcartMutation = () => { + const mutationOptions: UseMutationOptions< + CreateAcartResponse, + CreateAcartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createAcart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getCartOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCart({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCart", options)], + }) +} + +export const updateAcartMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateAcartResponse, + UpdateAcartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateAcart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteAcartMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteAcartResponse, + DeleteAcartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteAcart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getCartItemsOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCartItems({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCartItems", options)], + }) +} + +export const bulkUpdateItemsInCartMutation = () => { + const mutationOptions: UseMutationOptions< + BulkUpdateItemsInCartResponse, + BulkUpdateItemsInCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await bulkUpdateItemsInCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const manageCartsOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await manageCarts({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("manageCarts", options)], + }) +} + +export const manageCartsMutation = () => { + const mutationOptions: UseMutationOptions< + ManageCartsResponse, + ManageCartsError, + Options + > = { + mutationFn: async (options) => { + const { data } = await manageCarts({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteAllCartItemsMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteAllCartItemsResponse, + DeleteAllCartItemsError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteAllCartItems({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const updateAcartItemMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateAcartItemResponse, + UpdateAcartItemError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateAcartItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteAcartItemMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteAcartItemResponse, + DeleteAcartItemError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteAcartItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const createAccountCartAssociationOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createAccountCartAssociation({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createAccountCartAssociation", options)], + }) +} + +export const createAccountCartAssociationMutation = () => { + const mutationOptions: UseMutationOptions< + CreateAccountCartAssociationResponse, + CreateAccountCartAssociationError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createAccountCartAssociation({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteAccountCartAssociationMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteAccountCartAssociationResponse, + DeleteAccountCartAssociationError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteAccountCartAssociation({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const createCustomerCartAssociationOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createCustomerCartAssociation({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createCustomerCartAssociation", options)], + }) +} + +export const createCustomerCartAssociationMutation = () => { + const mutationOptions: UseMutationOptions< + CreateCustomerCartAssociationResponse, + CreateCustomerCartAssociationError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createCustomerCartAssociation({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteCustomerCartAssociationMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteCustomerCartAssociationResponse, + DeleteCustomerCartAssociationError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteCustomerCartAssociation({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteApromotionViaPromotionCodeMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteApromotionViaPromotionCodeResponse, + DeleteApromotionViaPromotionCodeError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteApromotionViaPromotionCode({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const addTaxItemToCartOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await addTaxItemToCart({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("addTaxItemToCart", options)], + }) +} + +export const addTaxItemToCartMutation = () => { + const mutationOptions: UseMutationOptions< + AddTaxItemToCartResponse, + AddTaxItemToCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await addTaxItemToCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const bulkAddTaxItemsToCartOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await bulkAddTaxItemsToCart({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("bulkAddTaxItemsToCart", options)], + }) +} + +export const bulkAddTaxItemsToCartMutation = () => { + const mutationOptions: UseMutationOptions< + BulkAddTaxItemsToCartResponse, + BulkAddTaxItemsToCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await bulkAddTaxItemsToCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const bulkDeleteTaxItemsFromCartMutation = () => { + const mutationOptions: UseMutationOptions< + BulkDeleteTaxItemsFromCartResponse, + BulkDeleteTaxItemsFromCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await bulkDeleteTaxItemsFromCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const updateAtaxItemMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateAtaxItemResponse, + UpdateAtaxItemError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateAtaxItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteAtaxItemMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteAtaxItemResponse, + DeleteAtaxItemError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteAtaxItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const bulkAddCustomDiscountsToCartOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await bulkAddCustomDiscountsToCart({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("bulkAddCustomDiscountsToCart", options)], + }) +} + +export const bulkAddCustomDiscountsToCartMutation = () => { + const mutationOptions: UseMutationOptions< + BulkAddCustomDiscountsToCartResponse, + BulkAddCustomDiscountsToCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await bulkAddCustomDiscountsToCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const bulkDeleteCustomDiscountsFromCartMutation = () => { + const mutationOptions: UseMutationOptions< + BulkDeleteCustomDiscountsFromCartResponse, + BulkDeleteCustomDiscountsFromCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await bulkDeleteCustomDiscountsFromCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const updateCustomDiscountForCartMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateCustomDiscountForCartResponse, + UpdateCustomDiscountForCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateCustomDiscountForCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteCustomDiscountFromCartMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteCustomDiscountFromCartResponse, + DeleteCustomDiscountFromCartError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteCustomDiscountFromCart({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const addCustomDiscountToCartItemOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await addCustomDiscountToCartItem({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("addCustomDiscountToCartItem", options)], + }) +} + +export const addCustomDiscountToCartItemMutation = () => { + const mutationOptions: UseMutationOptions< + void, + DefaultError, + Options + > = { + mutationFn: async (options) => { + const { data } = await addCustomDiscountToCartItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const updateCustomDiscountForCartItemMutation = () => { + const mutationOptions: UseMutationOptions< + void, + DefaultError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateCustomDiscountForCartItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const deleteCustomDiscountFromCartItemMutation = () => { + const mutationOptions: UseMutationOptions< + DeleteCustomDiscountFromCartItemResponse, + DeleteCustomDiscountFromCartItemError, + Options + > = { + mutationFn: async (options) => { + const { data } = await deleteCustomDiscountFromCartItem({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const createCartPaymentIntentOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await createCartPaymentIntent({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("createCartPaymentIntent", options)], + }) +} + +export const createCartPaymentIntentMutation = () => { + const mutationOptions: UseMutationOptions< + CreateCartPaymentIntentResponse, + CreateCartPaymentIntentError, + Options + > = { + mutationFn: async (options) => { + const { data } = await createCartPaymentIntent({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const checkoutApiOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await checkoutApi({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("checkoutApi", options)], + }) +} + +export const checkoutApiMutation = () => { + const mutationOptions: UseMutationOptions< + CheckoutApiResponse, + CheckoutApiError, + Options + > = { + mutationFn: async (options) => { + const { data } = await checkoutApi({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getCustomerOrdersOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getCustomerOrders({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getCustomerOrders", options)], + }) +} + +export const getAnOrderOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getAnOrder({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAnOrder", options)], + }) +} + +export const updateAnOrderMutation = () => { + const mutationOptions: UseMutationOptions< + UpdateAnOrderResponse, + UpdateAnOrderError, + Options + > = { + mutationFn: async (options) => { + const { data } = await updateAnOrder({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getOrderItemsOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getOrderItems({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getOrderItems", options)], + }) +} + +export const anonymizeOrdersOptions = ( + options?: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await anonymizeOrders({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("anonymizeOrders", options)], + }) +} + +export const anonymizeOrdersMutation = () => { + const mutationOptions: UseMutationOptions< + AnonymizeOrdersResponse, + AnonymizeOrdersError, + Options + > = { + mutationFn: async (options) => { + const { data } = await anonymizeOrders({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const authorizeSetupOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await authorizeSetup({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("authorizeSetup", options)], + }) +} + +export const authorizeSetupMutation = () => { + const mutationOptions: UseMutationOptions< + AuthorizeSetupResponse, + AuthorizeSetupError, + Options + > = { + mutationFn: async (options) => { + const { data } = await authorizeSetup({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const confirmSetupOptions = (options: Options) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await confirmSetup({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("confirmSetup", options)], + }) +} + +export const confirmSetupMutation = () => { + const mutationOptions: UseMutationOptions< + ConfirmSetupResponse, + ConfirmSetupError, + Options + > = { + mutationFn: async (options) => { + const { data } = await confirmSetup({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const captureAtransactionOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await captureAtransaction({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("captureAtransaction", options)], + }) +} + +export const captureAtransactionMutation = () => { + const mutationOptions: UseMutationOptions< + CaptureAtransactionResponse, + CaptureAtransactionError, + Options + > = { + mutationFn: async (options) => { + const { data } = await captureAtransaction({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const refundAtransactionOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await refundAtransaction({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("refundAtransaction", options)], + }) +} + +export const refundAtransactionMutation = () => { + const mutationOptions: UseMutationOptions< + RefundAtransactionResponse, + RefundAtransactionError, + Options + > = { + mutationFn: async (options) => { + const { data } = await refundAtransaction({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} + +export const getOrderTransactionsOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getOrderTransactions({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getOrderTransactions", options)], + }) +} + +export const getAtransactionOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await getAtransaction({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("getAtransaction", options)], + }) +} + +export const cancelAtransactionOptions = ( + options: Options, +) => { + return queryOptions({ + queryFn: async ({ queryKey }) => { + const { data } = await cancelAtransaction({ + ...options, + ...queryKey[0], + throwOnError: true, + }) + return data + }, + queryKey: [createQueryKey("cancelAtransaction", options)], + }) +} + +export const cancelAtransactionMutation = () => { + const mutationOptions: UseMutationOptions< + CancelAtransactionResponse, + CancelAtransactionError, + Options + > = { + mutationFn: async (options) => { + const { data } = await cancelAtransaction({ + ...options, + throwOnError: true, + }) + return data + }, + } + return mutationOptions +} diff --git a/packages/sdks/shopper/src/client/index.ts b/packages/sdks/shopper/src/client/index.ts new file mode 100644 index 00000000..a8a3135a --- /dev/null +++ b/packages/sdks/shopper/src/client/index.ts @@ -0,0 +1,4 @@ +// This file is auto-generated by @hey-api/openapi-ts +export * from "./schemas.gen" +export * from "./services.gen" +export * from "./types.gen" diff --git a/packages/sdks/shopper/src/client/schemas.gen.ts b/packages/sdks/shopper/src/client/schemas.gen.ts new file mode 100644 index 00000000..8c4b982d --- /dev/null +++ b/packages/sdks/shopper/src/client/schemas.gen.ts @@ -0,0 +1,6057 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export const $amount = { + description: + "The three-letter ISO code for the currency associated with this price.", + type: "object", + properties: { + amount: { + description: + "The price in the lowest denomination for the specified currency. This is a product's list price.", + type: "integer", + format: "int64", + examples: [100], + "x-go-name": "Amount", + "x-omitempty": false, + }, + includes_tax: { + description: "Whether this price includes tax.", + type: "boolean", + examples: [false], + default: false, + "x-go-name": "IncludesTax", + }, + }, + title: "Amount", + "x-go-name": "PriceAmount", +} as const + +export const $prioritized_pricebooks = { + description: + "If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books.", + type: "array", + items: { + type: "object", + properties: { + id: { + description: "A unique identifier of a price book.", + type: "string", + format: "uuid", + }, + priority: { + description: + "Priority is a number and the price book with the highest number has the highest priority.", + type: "integer", + }, + }, + required: ["priority", "id"], + "x-go-name": "PrioritizedPricebook", + }, + maxItems: 5, +} as const + +export const $catalog = { + description: "Creates a catalog with the following attributes.", + type: "object", + properties: { + id: { + description: "A unique identifier of a catalog.", + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + attributes: { + type: "object", + properties: { + name: { + description: "The name of a catalog.", + type: "string", + examples: ["catalog-123"], + }, + description: { + description: + "A brief description of the catalog, such as the purpose of the catalog.", + type: "string", + examples: ["Catalog for Store 123"], + default: "", + }, + hierarchy_ids: { + description: + "The unique identifiers of the hierarchies associated with a catalog.", + type: "array", + items: { + type: "string", + }, + }, + pricebook_id: { + description: + "The unique identifier of a price book associated with a catalog. If no price book is selected, the catalog is displayed without prices.", + type: "string", + }, + pricebook_ids: { + $ref: "#/components/schemas/prioritized-pricebooks", + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "string", + }, + }, + }, + created_at: { + description: "The date and time a catalog is created.", + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + }, + updated_at: { + description: "The date and time a catalog was updated.", + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + }, + owner: { + description: + "The owner of this resource, can be either `organization` or `store`.", + type: ["string", "null"], + default: "store", + enum: ["store", "organization"], + "x-go-name": "Owner", + }, + }, + required: ["name", "hierarchy_ids", "created_at", "updated_at"], + }, + relationships: { + description: + "Relationships are established between different catalog entities. For example, a catalog rule and a price book are related to a catalog, as both are associated with it.", + type: "object", + properties: { + rules: { + description: "The catalog rules related to a catalog.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + }, + releases: { + description: + "When a catalog is published, a catalog release is created. This is a URL to all catalog published releases available for this catalog.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + meta: { + type: "object", + properties: { + count: { + description: "The number releases available for a catalog.", + type: "integer", + }, + }, + }, + }, + }, + }, + title: "CatalogRelationships", + }, + type: { + type: "string", + examples: ["catalog"], + const: "catalog", + }, + }, + required: ["id", "type", "attributes"], + title: "Catalog", +} as const + +export const $catalog_create_data = { + description: "Creates a catalog with the following attributes.", + type: "object", + properties: { + data: { + type: "object", + properties: { + attributes: { + type: "object", + properties: { + name: { + description: "The name of the catalog.", + type: "string", + examples: ["catalog-123"], + minLength: 1, + }, + description: { + description: "A brief description of the catalog.", + type: ["string", "null"], + examples: ["Catalog for Store 123"], + }, + hierarchy_ids: { + description: + "The unique identifiers of the hierarchies to associate with a catalog.", + type: "array", + items: { + type: "string", + }, + }, + pricebook_id: { + description: `The unique identifier of the price book to associate with this catalog. You can specify either a \`pricebook_id\` or \`pricebook_ids\` but not both. If you specify both a \`pricebook_id\` and \`pricebook_ids\`, a \`422 Unprocessable Entity\` error is displayed. +`, + type: "string", + }, + pricebook_ids: { + $ref: "#/components/schemas/prioritized-pricebooks", + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used.", + type: "string", + }, + }, + }, + }, + required: ["name", "hierarchy_ids"], + }, + type: { + description: + "Represents the type of object being returned. Always `Catalog`.", + type: "string", + examples: ["catalog"], + const: "catalog", + }, + }, + required: ["type", "attributes"], + }, + }, + required: ["data"], + title: "CatalogCreateData", +} as const + +export const $catalog_data = { + description: "Container for a single catalog.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/catalog", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "CatalogData", +} as const + +export const $catalog_list_data = { + description: "Container for a list of catalogs.", + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/catalog", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "CatalogListData", +} as const + +export const $catalog_update_data = { + description: + "A catalog combines price books, product lists, and hierarchies.", + type: "object", + properties: { + data: { + type: "object", + properties: { + attributes: { + type: "object", + properties: { + name: { + description: "The name of the catalog.", + type: ["string", "null"], + examples: ["catalog-123"], + minLength: 1, + }, + description: { + description: "A brief description of the catalog.", + type: ["string", "null"], + examples: ["Catalog for Store 123"], + }, + hierarchy_ids: { + description: + "The unique identifiers of the hierarchies to associate with a catalog.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + pricebook_id: { + description: + "The unique identifier of a price book to associate with a catalog. You can specify a `pricebook_id` or a `pricebook_ids` but not both. If you specify both, a `422 unprocessable entity` error is displayed.", + type: ["string", "null"], + }, + pricebook_ids: { + $ref: "#/components/schemas/prioritized-pricebooks", + }, + locales: { + description: + "Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.loc.gov/standards/iso639-2/) that represents the name of language you have used.", + type: "object", + additionalProperties: { + description: + "A [three-letter language code](https://www.loc.gov/standards/iso639-2/) that represents the name of language you have used.", + type: "string", + }, + }, + }, + }, + }, + id: { + description: "The unique identifier of the catalog to be updated.", + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + "x-go-name": "ID", + }, + type: { + description: + "This represents the type of object being returned. Always `catalog`.", + type: "string", + examples: ["catalog"], + const: "catalog", + }, + }, + required: ["type", "id", "attributes"], + }, + }, + required: ["data"], + title: "CatalogUpdateData", +} as const + +export const $component_product = { + description: "The unique identifier of the component, for example, `games`.", + type: "object", + properties: { + name: { + description: + "The component name is the name that is displayed in your storefront.", + type: "string", + "x-go-name": "Name", + }, + min: { + description: + "The minimum number of product options a shopper can select from this component.", + type: ["integer", "null"], + "x-go-name": "Min", + }, + max: { + description: + "The maximum number of product options a shopper can select from this component.", + type: ["integer", "null"], + "x-go-name": "Max", + }, + sort_order: { + description: + "The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want.", + type: ["integer", "null"], + "x-go-name": "Sort Order", + }, + options: { + description: + "The product options included in a component. This can be the ID of another bundle.", + type: "array", + items: { + $ref: "#/components/schemas/component-product-option", + }, + "x-go-name": "Options", + }, + }, + title: "Component Product", +} as const + +export const $component_product_option = { + description: + "The product options included in a component. This can be the ID of another bundle.", + type: "object", + properties: { + id: { + description: + "A unique identifier of the product you want to add to a component.", + type: "string", + format: "uuid", + "x-go-name": "ID", + }, + type: { + description: + "This represents the type of object being returned. Always `product`.", + type: "string", + examples: ["product"], + default: "product", + const: "product", + "x-go-name": "Type", + }, + quantity: { + description: + "The number of this product option that a shopper must purchase.", + type: "integer", + examples: [2], + "x-go-name": "Quantity", + }, + sort_order: { + description: + "The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want.", + type: ["integer", "null"], + examples: [15], + "x-go-name": "Sort Order", + }, + default: { + description: + "The boolean indicates whether the current option is a default option for the component.", + type: ["boolean", "null"], + examples: [true], + default: false, + "x-go-name": "Default", + }, + }, + title: "Component Product Option", +} as const + +export const $components = { + additionalProperties: { + $ref: "#/components/schemas/component-product", + }, + description: + "A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity.", + title: "Components", + type: "object", +} as const + +export const $custom_input_validation_rule_options = { + description: "The length of the custom input text field.", + type: "object", + properties: { + max_length: { + description: + "The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters.", + type: "integer", + examples: [255], + "x-go-name": "MaxLength", + }, + }, + "x-go-name": "CustomInputValidationRuleOptions", +} as const + +export const $custom_input_validation_rule = { + description: "The validation rules for the custom text.", + type: "object", + properties: { + type: { + description: + "This represents the type of object being returned. Must be `string`.", + type: "string", + examples: ["string"], + default: "string", + const: "string", + "x-go-name": "Type", + }, + options: { + $ref: "#/components/schemas/custom-input-validation-rule-options", + }, + }, + title: "Custom Input Validation Rule", + "x-go-name": "CustomInputValidationRule", +} as const + +export const $custom_input = { + description: + "The name of the custom input. You can rename the input to something more representative of the input that shoppers are adding, for example, `message` or `front`.", + type: "object", + properties: { + name: { + description: + "The name for the custom text field that is displayed in your storefront.", + type: "string", + examples: ["Message"], + "x-go-name": "Name", + }, + validation_rules: { + description: "The validation rules for the custom text.", + type: "array", + items: { + $ref: "#/components/schemas/custom-input-validation-rule", + }, + "x-go-name": "ValidationRules", + }, + required: { + description: + "This is `true` or `false` depending on whether the custom text is required.", + type: ["boolean", "null"], + examples: [false], + default: false, + "x-go-name": "Required", + }, + }, + title: "Custom Input", +} as const + +export const $custom_inputs = { + description: `You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this using the \`custom_inputs\` attribute. + + - You can rename input to something more representative of the input that shoppers are adding, for example, \`message\` or \`front\`. + - \`name\` is the name that is displayed in your storefront. + - You can add validation rules. For example, the input field must be a string and/or up to 255 characters in length. The limit is 255 characters. +`, + type: "object", + additionalProperties: { + $ref: "#/components/schemas/custom-input", + }, + title: "Custom Inputs", +} as const + +export const $currencies = { + description: + "A collection of one or more currencies objects that consists of the [**three-letter ISO code**](https://www.iso.org/iso-3166-country-codes.html) of the currencies associated with this price and the amount. This is the product's price.", + type: "object", + additionalProperties: { + $ref: "#/components/schemas/amount", + }, + title: "Currencies", +} as const + +export const $shopper_attributes = { + description: + "The optional price extension with values in string format, viewable by shoppers.", + type: "object", + additionalProperties: { + type: "string", + }, + title: "ShopperAttributes", +} as const + +export const $diff_list_data = { + description: "A list of differences between two releases.", + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/product-diff", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "DiffListData", +} as const + +export const $display_price = { + description: "A price formatted for display.", + type: "object", + properties: { + with_tax: { + $ref: "#/components/schemas/formatted-price", + }, + without_tax: { + $ref: "#/components/schemas/formatted-price", + }, + }, + "x-omitempty": true, +} as const + +export const $error = { + description: "APIError is a json-api style part of an error response.", + type: "object", + properties: { + detail: { + type: "string", + examples: ["not processable"], + "x-go-name": "Detail", + }, + status: { + type: "string", + examples: ["422"], + "x-go-name": "Status", + }, + title: { + type: "string", + examples: ["There was a problem processing your request."], + "x-go-name": "Title", + }, + }, + title: "APIError", + "x-go-name": "APIError", +} as const + +export const $error_response = { + description: "ErrorResponse is a json-api style Error response.", + type: "object", + properties: { + errors: { + type: "array", + items: { + $ref: "#/components/schemas/error", + }, + "x-go-name": "Errors", + }, + }, + title: "ErrorResponse", + "x-go-name": "ErrorResponse", +} as const + +export const $extension = { + description: "The name of the product template.", + type: "object", + additionalProperties: { + description: "The product attributes available for this template.", + type: "object", + }, + title: "Extension", +} as const + +export const $extensions = { + description: + "With extension templates, you can attach a specific set of custom fields to your products in Product Experience Manager. For example, a **Book** template might contain the attributes, such as **ISBN**, **Author**, **Number of pages**, **Year Published**, or **Condition (New/Used)**.", + type: "object", + additionalProperties: { + $ref: "#/components/schemas/extension", + }, + title: "Extensions", +} as const + +export const $file_reference = { + description: + "In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details.", + type: "object", + properties: { + type: { + description: + "This represents the type of object being returned. Always `file`.", + type: "string", + examples: ["file"], + const: "file", + }, + id: { + description: "A unique identifier for a file.", + type: "string", + format: "uuid", + }, + created_at: { + description: "The date and time a file is created.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "CreatedAt", + }, + }, + "x-go-name": "FileRelationship", +} as const + +export const $files_relationship = { + description: + "In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details.", + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/file-reference", + }, + }, + }, + "x-omitempty": true, +} as const + +export const $component_products_relationship = { + description: + "A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. You can link to the products that make up your bundle components.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product-references", + }, + links: { + $ref: "#/components/schemas/self-link", + }, + }, + "x-omitempty": true, +} as const + +export const $formatted_price = { + description: "A price formatted for display.", + type: "object", + properties: { + amount: { + description: + "The price in the lowest denomination for the specified currency. This is a product's list price.", + type: "integer", + examples: ["47500"], + "x-omitempty": false, + }, + currency: { + description: + "The three-letter ISO code of the currencies associated with this price and the amount.", + type: "string", + examples: ["USD"], + }, + formatted: { + description: "The format of the price for display.", + type: "string", + examples: ["$475.00"], + }, + }, + title: "FormattedPrice", + "x-omitempty": true, +} as const + +export const $hierarchy = { + description: + "A category hierarchy in a catalog. Hierarchies can have parent nodes and child nodes, as well as a list of attached products.", + type: "object", + properties: { + attributes: { + $ref: "#/components/schemas/hierarchy-attributes", + }, + id: { + description: "A unique identifier of a hierarchy.", + type: "string", + examples: ["e871df93-c769-49a9-9394-a6fd555b8e8a"], + "x-go-name": "ID", + }, + relationships: { + $ref: "#/components/schemas/hierarchy-relationships", + }, + type: { + description: + "This represents the type of object being returned. Always `hierarchy`.", + type: "string", + examples: ["hierarchy"], + "x-go-name": "Type", + }, + meta: { + $ref: "#/components/schemas/hierarchy-meta", + }, + }, + title: "Hierarchy", + "x-go-name": "Hierarchy", +} as const + +export const $hierarchy_meta = { + description: "A hierarchy's metadata.", + type: "object", + properties: { + language: { + description: + "Product Experience Manager supports localization of hierarchies. If your store supports multiple languages, you can localize hierarchy names and descriptions. This is [**three-letter language code**](https://www.iso.org/iso-639-language-code) that represents the name of the language you have used.", + type: "string", + examples: ["en-GB"], + }, + }, + title: "HierarchyMeta", + "x-go-name": "HierarchyMeta", + "x-omitempty": true, +} as const + +export const $hierarchy_attributes = { + description: "Resource attributes of a catalog hierarchy.", + type: "object", + properties: { + created_at: { + description: "The date and time a hierarchy is created.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "CreatedAt", + }, + published_at: { + description: "The date and time a hierarchy is published in a catalog.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + description: { + description: "A description of a hierarchy.", + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Description", + }, + name: { + description: "The name of a hierarchy.", + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Name", + }, + slug: { + description: "A unique slug for a hierarchy.", + type: "string", + examples: ["formal"], + "x-go-name": "Slug", + }, + updated_at: { + description: "The date and time a hierarchy was updated.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "UpdatedAt", + }, + }, + title: "HierarchyAttributes", + "x-go-name": "HierarchyAttributes", +} as const + +export const $hierarchy_data = { + description: "Container for hierarchies.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/hierarchy", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "HierarchyData", +} as const + +export const $hierarchy_list_data = { + description: "Container for a list of hierarchies.", + type: "object", + properties: { + meta: { + $ref: "#/components/schemas/page-meta", + }, + data: { + type: "array", + items: { + $ref: "#/components/schemas/hierarchy", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "HierarchyListData", +} as const + +export const $hierarchy_relationships = { + description: "Relationships to child nodes, and products.", + type: "object", + properties: { + products: { + description: "A URL to all the products associated with a hierarchy.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + }, + children: { + description: + "A URL to all the child products associated with a hierarchy.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["links"], + }, + nodes: { + description: "A URL to all the nodes associated with a hierarchy.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["links"], + }, + }, + title: "HierarchyRelationships", + "x-go-name": "HierarchyRelationships", +} as const + +export const $links = { + description: "Links allow you to move between requests.", + type: "object", + properties: { + self: { + description: + "Single entities use a `self` parameter with a link the specific resource.", + type: ["string", "null"], + format: "uri", + }, + first: { + description: "Always the first page.", + type: ["string", "null"], + format: "uri", + }, + last: { + description: "This is `null` if there is only one page.", + type: ["string", "null"], + format: "uri", + }, + prev: { + description: "This is `null` if there is only one page.", + type: ["string", "null"], + format: "uri", + }, + next: { + description: "This is `null` if there is only one page.", + type: ["string", "null"], + format: "uri", + }, + }, +} as const + +export const $main_image_relationship = { + description: + "In Product Experience Manager, products can also have associated product images.", + type: "object", + properties: { + data: { + description: "The images associated with a product.", + type: "object", + properties: { + type: { + description: + "This represents the type of object being returned. Always `main_image`.", + type: "string", + examples: ["main_image"], + const: "main_image", + }, + id: { + description: "A unique identifier for an image.", + type: "string", + format: "uuid", + }, + }, + "x-nullable": "true", + }, + }, + "x-omitempty": true, +} as const + +export const $node = { + description: + "A category node in a catalog. Nodes can have child nodes, as well as a list of attached products.", + type: "object", + properties: { + attributes: { + $ref: "#/components/schemas/node-attributes", + }, + id: { + description: "The unique identifier of a node.", + type: "string", + examples: ["e871df93-c769-49a9-9394-a6fd555b8e8a"], + "x-go-name": "ID", + }, + relationships: { + $ref: "#/components/schemas/node-relationships", + }, + type: { + description: + "This represents the type of object being returned. Always `node`.", + type: "string", + examples: ["node"], + "x-go-name": "Type", + }, + meta: { + $ref: "#/components/schemas/node-meta", + }, + }, + title: "Node", + "x-go-name": "Node", +} as const + +export const $node_attributes = { + description: "Resource attributes of a catalog node.", + type: "object", + properties: { + created_at: { + description: "The date and time a node was created.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "CreatedAt", + }, + published_at: { + description: "The date and time a node was published in a catalog.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + description: { + description: "A description of a node.", + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Description", + }, + label: { + type: "string", + examples: ["category"], + "x-go-name": "Label", + }, + name: { + description: + "The name of a node. Names must be unique among sibling nodes in a hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Name", + }, + slug: { + description: + "A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies.", + type: "string", + examples: ["formal"], + "x-go-name": "Slug", + }, + curated_products: { + description: + "A list of curated products for a node. You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront.", + type: "array", + items: { + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + "x-omitempty": true, + }, + status: { + type: "string", + examples: ["live"], + "x-go-name": "Status", + }, + updated_at: { + description: "The date and time a node was updated.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "UpdatedAt", + }, + }, + title: "NodeAttributes", + "x-go-name": "NodeAttributes", +} as const + +export const $node_create_data = { + description: "Container for nodes.", + type: "object", + properties: { + data: { + description: + "A node in a catalog (e.g. a category node). Nodes can have child nodes, as well as a list of attached products", + type: "object", + properties: { + attributes: { + description: "Resource attributes of a catalog node.", + type: "object", + properties: { + description: { + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Description", + }, + hierarchy_id: { + description: "hierarchy id of the node", + type: "string", + examples: ["ddd401ac-db06-4d9e-af60-cf5206abb9bc"], + }, + label: { + type: "string", + examples: ["category"], + "x-go-name": "Label", + }, + name: { + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Name", + }, + slug: { + type: "string", + examples: ["formal"], + "x-go-name": "Slug", + }, + status: { + type: "string", + examples: ["Live"], + "x-go-name": "Status", + }, + locales: { + type: "object", + additionalProperties: { + type: "object", + additionalProperties: { + type: "string", + }, + }, + }, + }, + required: ["name"], + title: "NodeCreateAttributes", + }, + relationships: { + $ref: "#/components/schemas/node-relationships", + }, + id: { + type: "string", + examples: ["8fccaa19-dba9-4621-8d11-31a222a68c7c"], + "x-go-name": "ID", + }, + type: { + type: "string", + examples: ["node"], + "x-go-name": "Type", + }, + }, + required: ["type", "attributes"], + title: "NodeCreateArgs", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "NodeCreateData", +} as const + +export const $node_data = { + description: "Container for nodes.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/node", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "NodeData", +} as const + +export const $node_list_data = { + description: "Container for a list of nodes.", + type: "object", + properties: { + meta: { + $ref: "#/components/schemas/page-meta", + }, + data: { + type: "array", + items: { + $ref: "#/components/schemas/node", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "NodeListData", +} as const + +export const $node_meta = { + description: "A node's metadata.", + type: "object", + properties: { + language: { + description: "The node details localized in the supported languages.", + type: "string", + examples: ["en-GB"], + }, + bread_crumb: { + description: + "Helps you understand the association of products with nodes. It explains how products are associated with parent nodes and the relationship among the array of nodes. This is useful if you want to improve how your shoppers search within you store.", + type: "array", + items: { + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + "x-omitempty": true, + }, + }, + title: "NodeMeta", + "x-go-name": "NodeMeta", + "x-omitempty": true, +} as const + +export const $node_reference = { + description: "Minimum set of information to identify a catalog node.", + type: "object", + properties: { + id: { + description: "The unique identifier of a hierarchy.", + type: "string", + examples: ["65477ce0-fcb8-436b-a120-3d57979421dd"], + "x-go-name": "ID", + }, + label: { + description: "A label for a hierarchy.", + type: "string", + examples: ["category"], + "x-go-name": "Label", + }, + name: { + description: "The name of a hierarchy.", + type: "string", + examples: ["Formal dresswear"], + "x-go-name": "Name", + }, + }, + title: "NodeReference", + "x-go-name": "NodeReference", +} as const + +export const $node_relationships = { + description: "Relationships to parent and child nodes, and products.", + type: "object", + properties: { + products: { + description: "A URL to all products associated with a node.", + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/product-reference", + }, + "x-omitempty": true, + }, + links: { + $ref: "#/components/schemas/related-link", + }, + }, + }, + children: { + description: "A URL to all child nodes associated with a node.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["links"], + }, + parent: { + description: "A URL to all parent nodes associated with a node.", + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + type: "string", + examples: ["node"], + const: "node", + }, + id: { + type: "string", + examples: ["8fccaa19-dba9-4621-8d11-31a222a68c7c"], + "x-go-name": "ID", + }, + }, + required: ["id", "type"], + }, + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["data"], + }, + hierarchy: { + description: "A URL to the hierarchies associated with a node.", + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + type: "string", + examples: ["hierarchy"], + const: "hierarchy", + }, + id: { + type: "string", + examples: ["8fccaa19-dba9-4621-8d11-31a222a68c7c"], + "x-go-name": "ID", + }, + }, + required: ["id", "type"], + }, + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["data"], + }, + }, + title: "NodeRelationships", + "x-go-name": "NodeRelationships", +} as const + +export const $node_relationships_data = { + description: "Container for node relationships.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/node-relationships", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "NodeRelationshipsData", +} as const + +export const $page_meta = { + description: "Contains the results for the entire collection.", + type: "object", + properties: { + results: { + description: "Total number of results for the entire collection.", + type: "object", + properties: { + total: { + description: "Total number of results for the entire collection.", + type: "integer", + format: "int64", + }, + }, + }, + page: { + type: "object", + properties: { + limit: { + description: "The maximum number of records for all pages.", + type: "integer", + format: "int64", + }, + offset: { + description: "The current offset by number of pages.", + type: "integer", + format: "int64", + }, + current: { + description: "The current number of pages.", + type: "integer", + format: "int64", + }, + total: { + description: "The total number of records for the entire collection.", + type: "integer", + format: "int64", + }, + }, + }, + }, + title: "PageMeta", +} as const + +export const $pricebook = { + description: + "Top level entity in the pricebooks domain model. It contains a list of product prices.", + type: "object", + properties: { + id: { + description: "The unique identifier of a price book.", + type: "string", + examples: ["4c45e4ec-26e0-4043-86e4-c15b9cf985a7"], + "x-go-name": "ID", + }, + type: { + description: + "This represents the type of object being returned. Always `pricebook`.", + type: "string", + examples: ["pricebook"], + default: "pricebook", + const: "pricebook", + "x-go-name": "Type", + }, + attributes: { + type: "object", + properties: { + created_at: { + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "CreatedAt", + }, + description: { + type: ["string", "null"], + examples: ["This is a pricebook"], + "x-go-name": "Description", + }, + name: { + type: ["string", "null"], + examples: ["pricebook-store-abc"], + "x-go-name": "Name", + }, + updated_at: { + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "UpdatedAt", + }, + }, + required: ["name"], + }, + }, + additionalProperties: false, + required: ["type", "attributes"], + title: "Pricebook", + "x-go-name": "Pricebook", +} as const + +export const $pricebook_create_data = { + description: "Container for pricebooks.", + type: "object", + properties: { + data: { + description: "New top level pricebook.", + type: "object", + additionalProperties: false, + properties: { + type: { + type: "string", + examples: ["pricebook"], + default: "pricebook", + const: "pricebook", + "x-go-name": "Type", + }, + attributes: { + type: "object", + properties: { + description: { + type: ["string", "null"], + examples: ["This is a pricebook"], + "x-go-name": "Description", + }, + name: { + type: ["string", "null"], + examples: ["pricebook-store-abc"], + "x-go-name": "Name", + }, + }, + required: ["name"], + }, + }, + required: ["type", "attributes"], + title: "PricebookCreateArgs", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "PricebookData", +} as const + +export const $pricebook_data = { + description: "Container for pricebooks.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/pricebook", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "PricebookData", +} as const + +export const $pricebook_price = { + description: + "ProductPrice associates a collection of locale specific prices with a product ID.", + type: "object", + properties: { + type: { + type: "string", + examples: ["product-price"], + default: "product-price", + const: "product-price", + }, + attributes: { + type: "object", + properties: { + currencies: { + $ref: "#/components/schemas/tiered-currencies", + }, + sales: { + $ref: "#/components/schemas/sales", + }, + sku: { + type: "string", + examples: ["4c45e4ec-sku"], + }, + }, + required: ["currencies", "sku"], + }, + id: { + type: "string", + examples: ["4c45e4ec-26e0-4043-86e4-c15b9cf985a7"], + "x-go-name": "ID", + }, + }, + additionalProperties: false, + required: ["type", "id", "attributes"], + title: "PricebookPrice", +} as const + +export const $pricebook_price_create_data = { + description: "Container for pricebook prices.", + type: "object", + properties: { + data: { + description: + "ProductPrice associates a collection of locale specific prices with a product ID.", + type: "object", + properties: { + type: { + type: "string", + examples: ["product-price"], + default: "product-price", + const: "product-price", + }, + attributes: { + type: "object", + properties: { + currencies: { + $ref: "#/components/schemas/tiered-currencies", + }, + sales: { + $ref: "#/components/schemas/sales", + }, + sku: { + type: "string", + examples: ["4c45e4ec-sku"], + }, + }, + required: ["currencies", "sku"], + }, + }, + required: ["type", "attributes"], + title: "PricebookPriceCreateArgs", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "PricebookPriceCreateData", +} as const + +export const $pricebook_price_data = { + description: "Container for pricebook prices.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/pricebook-price", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "PricebookPriceData", +} as const + +export const $product = { + description: "A product in a catalog with the following attributes.", + type: "object", + properties: { + attributes: { + $ref: "#/components/schemas/product-attributes", + }, + id: { + description: "A unique identifier for a product.", + type: "string", + examples: ["8fccaa19-dba9-4621-8d11-31a222a68c7c"], + "x-go-name": "ID", + }, + relationships: { + $ref: "#/components/schemas/product-relationships", + }, + type: { + description: + "This represents the type of object being returned. Always `product`.", + type: "string", + examples: ["product"], + "x-go-name": "Type", + }, + meta: { + $ref: "#/components/schemas/product-meta", + }, + }, + title: "Product", + "x-go-name": "Product", +} as const + +export const $product_attributes = { + description: "A product's attributes.", + type: "object", + properties: { + published_at: { + description: "The date and time a product was published in a catalog.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + base_product: { + description: + "If this product is a `parent` product. A `parent` product is a product that has child products that have been built using the `build child products` endpoint.", + type: "boolean", + examples: [false], + default: false, + "x-go-name": "BaseProduct", + }, + base_product_id: { + description: "The unique identifier of a `parent` product.", + type: "string", + examples: ["cdf574bc-e36e-48fc-9eac-01c87839b285"], + "x-go-name": "BaseProductID", + }, + commodity_type: { + description: "The commodity type, either `physical` or `digital`.", + type: "string", + examples: ["physical"], + "x-go-name": "CommodityType", + }, + curated_product: { + description: + "If a product is curated, then the `curated_product` attribute with a value of `true` is displayed. If a product is not curated, the `curated_product` attribute is not displayed.", + type: "boolean", + examples: [true], + "x-go-name": "CuratedProduct", + "x-omitempty": true, + }, + upc_ean: { + description: + "The universal product code or european article number of the product.", + type: "string", + examples: ["0123456"], + "x-go-name": "UpcEan", + }, + manufacturer_part_num: { + description: "The manufacturer part number of the product.", + type: "string", + examples: ["mfn1"], + "x-go-name": "ManufacturerPartNum", + }, + tags: { + description: + "A list of tags associated with the product. A tag must be HTML compatible characters excluding commas and will be stored in lowercase letters.", + type: "array", + items: { + description: "A tag associated with the product.", + type: "string", + examples: ["tag-a"], + }, + "x-go-name": "Tags", + "x-omitempty": true, + }, + price_modifiers: { + description: "A list of price modifier names.", + type: "array", + items: { + description: "A list of price modifier names.", + type: "string", + examples: ["modifier-1"], + }, + "x-go-name": "PriceModifiers", + "x-omitempty": true, + }, + created_at: { + description: "The date and time a product was created.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "CreatedAt", + }, + description: { + description: "A description of the product.", + type: "string", + examples: ["This is a product"], + "x-go-name": "Description", + }, + name: { + description: "A name of a product.", + type: "string", + examples: ["Blue shirt"], + "x-go-name": "Name", + }, + price: { + $ref: "#/components/schemas/currencies", + }, + shopper_attributes: { + $ref: "#/components/schemas/shopper_attributes", + }, + tiers: { + $ref: "#/components/schemas/tiers", + }, + components: { + $ref: "#/components/schemas/components", + }, + custom_inputs: { + $ref: "#/components/schemas/custom_inputs", + }, + sku: { + description: "The unique stock keeping unit of the product.", + type: "string", + examples: ["blue-shirt"], + "x-go-name": "Sku", + }, + slug: { + description: + "A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug.", + type: "string", + examples: ["blue-shirt"], + "x-go-name": "Slug", + }, + status: { + description: "The status of the product, either `live` or `draft`.", + type: "string", + examples: ["live"], + "x-go-name": "Status", + }, + external_ref: { + description: + "The unique attribute associated with the product. This could be an external reference from a separate company system, for example.", + type: ["string", "null"], + "x-go-name": "ExternalRef", + }, + updated_at: { + description: "The date and time a product was updated.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "UpdatedAt", + }, + extensions: { + $ref: "#/components/schemas/extensions", + }, + }, + title: "ProductAttributes", + "x-go-name": "ProductAttributes", +} as const + +export const $product_create_data = { + description: "Container for products.", + type: "object", + properties: { + data: { + description: "A new product in a catalog.", + type: "object", + properties: { + attributes: { + description: "A product's attributes.", + type: "object", + properties: { + description: { + type: "string", + examples: ["This is a product"], + }, + name: { + type: "string", + examples: ["Blue shirt"], + }, + sku: { + type: "string", + examples: ["blue-shirt"], + }, + slug: { + type: "string", + examples: ["blue-shirt"], + }, + status: { + type: "string", + examples: ["live"], + }, + locales: { + type: "object", + additionalProperties: { + type: "object", + additionalProperties: { + type: "string", + }, + }, + }, + }, + required: ["name", "status"], + title: "ProductCreateAttributes", + }, + id: { + type: "string", + examples: ["8fccaa19-dba9-4621-8d11-31a222a68c7c"], + "x-go-name": "ID", + }, + type: { + type: "string", + examples: ["product"], + "x-go-name": "Type", + }, + }, + required: ["attributes", "type"], + title: "ProductCreateArgs", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "ProductData", +} as const + +export const $product_data = { + description: "Container for products.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product", + }, + links: { + $ref: "#/components/schemas/links", + }, + included: { + $ref: "#/components/schemas/included", + }, + }, + title: "ProductData", +} as const + +export const $product_diff = { + type: "object", + properties: { + id: { + type: "string", + examples: ["e871df93-c769-49a9-9394-a6fd555b8e8a"], + "x-go-name": "ID", + }, + type: { + type: "string", + examples: ["product_diff"], + "x-go-name": "Type", + }, + attributes: { + type: "object", + properties: { + sku: { + type: "string", + }, + this_release_id: { + type: "string", + }, + other_release_id: { + type: "string", + }, + diff_created_at: { + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + exists: { + type: "object", + properties: { + this: { + type: "boolean", + }, + other: { + type: "boolean", + }, + }, + required: ["this", "other"], + "x-go-name": "ProductDiffExists", + }, + updated_at: { + type: "object", + properties: { + this: { + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-omitempty": true, + }, + other: { + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-omitempty": true, + }, + }, + "x-go-name": "ProductDiffUpdatedAt", + }, + }, + }, + }, + "x-go-name": "ProductDiff", +} as const + +export const $product_list_data = { + description: "Container for a list of products.", + type: "object", + properties: { + meta: { + $ref: "#/components/schemas/page-meta", + }, + data: { + type: "array", + items: { + $ref: "#/components/schemas/product", + }, + "x-go-name": "Data", + }, + links: { + $ref: "#/components/schemas/links", + }, + included: { + $ref: "#/components/schemas/included", + }, + }, + title: "ProductListData", +} as const + +export const $product_meta = { + description: + "A product's metadata contains information about products, for example, the nodes a product is associated with, any child products, bundle configurations, and so on.", + type: "object", + properties: { + bread_crumbs: { + description: + "The relationship among the array of nodes a product is associated with, demonstrating the linking of the children nodes with the parent nodes. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have.", + type: "object", + additionalProperties: { + type: "array", + items: { + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + }, + "x-omitempty": true, + }, + bread_crumb_nodes: { + description: + "An array of parent node IDs that a product is associated with. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have.", + type: "array", + items: { + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + "x-omitempty": true, + }, + catalog_id: { + description: + "A unique identifier of the catalog a product is associated with.", + type: "string", + examples: ["362a16dc-f7c6-4280-83d6-4fcc152af091"], + "x-go-name": "CatalogID", + }, + pricebook_id: { + description: + "The unique identifier of the price book a product is associated with.", + type: ["string", "null"], + examples: ["f5466169-0037-460c-b181-b02682b6f4de"], + "x-go-name": "PricebookID", + }, + display_price: { + $ref: "#/components/schemas/display-price", + }, + catalog_source: { + description: "The source of a catalog. Always `pim`.", + type: "string", + examples: ["pim"], + const: "pim", + "x-go-name": "CatalogSource", + }, + sale_id: { + description: + "With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale.", + type: "string", + "x-go-name": "SaleID", + }, + sale_expires: { + description: "The date and time a sale expires.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "SaleExpires", + }, + original_price: { + $ref: "#/components/schemas/currencies", + }, + original_display_price: { + $ref: "#/components/schemas/display-price", + }, + bundle_configuration: { + $ref: "#/components/schemas/bundle-configuration", + }, + component_products: { + description: + "A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity.", + type: "object", + additionalProperties: { + type: "object", + properties: { + sale_id: { + description: + "With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale.", + type: "string", + "x-go-name": "SaleID", + }, + sale_expires: { + description: "The date and time a sale expires.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "SaleExpires", + }, + price: { + $ref: "#/components/schemas/currencies", + }, + display_price: { + $ref: "#/components/schemas/display-price", + }, + original_price: { + $ref: "#/components/schemas/currencies", + }, + original_display_price: { + $ref: "#/components/schemas/display-price", + }, + pricebook_id: { + type: ["string", "null"], + examples: ["f5466169-0037-460c-b181-b02682b6f4de"], + "x-go-name": "PricebookID", + }, + }, + "x-go-name": "ComponentProductMeta", + }, + }, + price_modifiers: { + description: + "You can use price modifiers to change the price property of child products. By default, child products inherit the same price as their base products. Using price modifiers, you can enable child products to inherit a different price.", + type: "object", + additionalProperties: { + description: + "A name for the modifier. The name must be unique and is case-sensitive.", + type: "object", + properties: { + modifier_type: { + description: `There are three modifier types. + + - The \`price_increment\` type increases the prices of a product. + - The \`price_decrement\` type decreases the price of a product. + - The \`price_equals\` type sets the price of a product to an amount you specify. +`, + type: "string", + examples: ["price_equals"], + }, + currencies: { + $ref: "#/components/schemas/currencies", + }, + }, + "x-go-name": "PriceModifierMeta", + }, + }, + tiers: { + description: + "You can use tiers to allow your store to offer different pricing for minimum quantities of items that your shoppers purchase.", + type: "object", + additionalProperties: { + description: "The name of the tier, such as `Pencils`.", + type: "object", + properties: { + sale_id: { + description: "The unique identifier of a sale.", + type: "string", + "x-go-name": "SaleID", + }, + sale_expires: { + description: "The date and time a sale expires.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + "x-go-name": "SaleExpires", + }, + display_price: { + $ref: "#/components/schemas/display-price", + }, + original_price: { + $ref: "#/components/schemas/currencies", + }, + original_display_price: { + $ref: "#/components/schemas/display-price", + }, + }, + "x-go-name": "ProductMetaTier", + }, + "x-go-name": "ProductMetaTiers", + }, + variation_matrix: { + description: + "The `variation_matrix` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. If no variations are available, the `variation_matrix` is empty.", + type: "object", + }, + variations: { + description: + "If you specified `build_rules` for a product, the `variations` object lists the variation option IDs that you specified to include when building your child products. If no `build_rules` are specified, all the variation and variation options available for a product are displayed. If a product does not have any variations, then the `variations` object is not displayed.", + type: "array", + items: { + $ref: "#/components/schemas/variation", + }, + "x-omitempty": true, + }, + child_option_ids: { + description: + "An array of variation options IDs that a child product has.", + type: ["array", "null"], + items: { + type: "string", + examples: [ + [ + "8dbb35b2-ef04-477e-974d-e5f3abe6faae", + "6ddf2a66-d805-449c-a0e1-8e81335e31a6", + ], + ], + }, + "x-omitempty": true, + }, + child_variations: { + description: + "If this is a child product, the `child_variations` object lists the variation option IDs that define this child product.", + type: ["array", "null"], + items: { + $ref: "#/components/schemas/variation", + }, + "x-omitempty": true, + }, + product_types: { + description: `Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + + Product types can also be used in catalogs. For example, in your catalog, you can filter on parent so that only your parent products are displayed in your storefront. + + Products have one of the following types: + + - **standard** - Standard products are a standalone products. + - **parent** - A parent product is a product that has child products that have been built using the \`Build Child Products\` endpoint. + - **child** - When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + - **bundle** - A bundle is a purchasable product, comprising two or more standalone products (in other words, components) to be sold together. +`, + type: "array", + items: { + type: "string", + }, + "x-go-name": "ProductTypes", + "x-omitempty": true, + }, + language: { + description: + "If you storefront supports multiple languages, your storefront's preferred language and locale.", + type: "string", + examples: ["en-GB"], + }, + }, + title: "ProductMeta", + "x-go-name": "ProductMeta", + "x-omitempty": true, +} as const + +export const $variation_option = { + description: "The options available for a variation.", + type: "object", + properties: { + id: { + description: "A unique identifier for an option.", + type: "string", + format: "uuid", + "x-go-name": "ID", + }, + name: { + description: "The name of the option.", + type: "string", + }, + sort_order: { + description: + "If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want.", + type: ["integer", "null"], + "x-go-name": "Sort Order", + }, + description: { + description: "The option description to display to customers.", + type: "string", + }, + }, + "x-go-name": "ProductVariationOption", +} as const + +export const $variation = { + type: "object", + properties: { + id: { + description: "A unique identifier of a variation.", + type: "string", + format: "uuid", + "x-go-name": "ID", + }, + name: { + description: "The name of a variation.", + type: "string", + }, + sort_order: { + description: + "If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want.", + type: ["integer", "null"], + "x-go-name": "Sort Order", + }, + option: { + $ref: "#/components/schemas/variation_option", + }, + options: { + description: "The options available for this variation.", + type: "array", + items: { + $ref: "#/components/schemas/variation_option", + }, + "x-omitempty": true, + }, + }, + "x-go-name": "ProductVariation", +} as const + +export const $bundle_configuration_data = { + description: "Container for a bundle configuration.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/bundle-configuration", + }, + }, + required: ["data"], + title: "BundleConfigurationData", +} as const + +export const $bundle_configuration = { + description: + "A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity.", + type: "object", + properties: { + selected_options: { + description: + "The product options included in a component. This can be the ID of another bundle.", + type: "object", + additionalProperties: { + description: + "The unique identifier of the component, for example, `games`.", + type: "object", + additionalProperties: { + description: + "The number of this product option that a shopper must purchase.", + type: "integer", + format: "int64", + }, + }, + }, + }, + required: ["selected_options"], + title: "BundleConfiguration", + "x-go-name": "ProductBundleConfiguration", +} as const + +export const $product_reference = { + description: "A product identifier.", + type: "object", + properties: { + id: { + description: "A unique identifier for a product.", + type: "string", + format: "uuid", + "x-go-name": "ID", + }, + type: { + description: + "This represents the type of object being returned. Always `product`.", + type: "string", + examples: ["product"], + const: "product", + "x-go-name": "Type", + }, + }, + title: "ProductReference", + "x-go-name": "ProductReference", + "x-nullable": "true", +} as const + +export const $product_reference_list_data = { + description: "Container for a list of product references.", + type: "object", + properties: { + meta: { + $ref: "#/components/schemas/page-meta", + }, + data: { + $ref: "#/components/schemas/product-references", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "ProductReferenceListData", +} as const + +export const $product_references = { + description: "A list of product identifiers.", + type: "array", + items: { + $ref: "#/components/schemas/product-reference", + }, + title: "ProductReferences", + "x-go-name": "ProductReferences", +} as const + +export const $product_relationships = { + description: + "Relationships allow you to move between requests. Includes links to the parent and child products, bundle component products, files, and main images associated with a product.", + type: "object", + properties: { + parent: { + description: + "The details of a `parent` product. A `parent` product is a product that has child products that have been built using the `Build Child Products` endpoint.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product-reference", + }, + }, + "x-go-name": "Parent", + "x-omitempty": true, + }, + children: { + description: + "The details of a `child` product. When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product-references", + }, + links: { + $ref: "#/components/schemas/self-link", + }, + }, + "x-go-name": "Children", + "x-omitempty": true, + }, + files: { + $ref: "#/components/schemas/files-relationship", + }, + main_image: { + $ref: "#/components/schemas/main-image-relationship", + }, + component_products: { + $ref: "#/components/schemas/component-products-relationship", + }, + }, + title: "ProductRelationships", + "x-go-name": "ProductRelationships", + "x-omitempty": true, +} as const + +export const $product_relationships_data = { + description: "Container for product relationships.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/product-relationships", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "ProductRelationshipsData", +} as const + +export const $products_for_cart = { + description: + "A list of products to be added to cart. Can be type product-data or error-response.", + type: "object", + properties: { + data: { + type: "array", + items: {}, + "x-go-name": "Data", + }, + included: { + type: ["object", "null"], + properties: { + component_products: { + type: "array", + items: { + $ref: "#/components/schemas/product", + }, + "x-go-name": "ComponentProducts", + }, + }, + "x-go-name": "Included", + }, + }, + required: ["data"], + title: "ProductsForCart", + "x-go-name": "ProductsForCart", +} as const + +export const $products_for_cart_configuration = { + description: "A list of product id or sku and bundle configuration for cart.", + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: ["string", "null"], + format: "uuid", + "x-go-name": "ID", + }, + sku: { + type: ["string", "null"], + "x-go-name": "SKU", + }, + bundle_configuration: { + $ref: "#/components/schemas/bundle-configuration", + }, + }, + }, + minItems: 1, + "x-go-name": "Data", + }, + }, + required: ["data"], + title: "ProductsForCartConfiguration", + "x-go-name": "ProductsForCartConfiguration", +} as const + +export const $related_link = { + description: + "A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.", + type: "object", + properties: { + related: { + description: + "A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas.", + type: "string", + }, + }, + required: ["related"], +} as const + +export const $self_link = { + description: "Links are used to allow you to move between requests.", + type: "object", + properties: { + self: { + description: + "Single entities use a self parameter with a link to that specific resource.", + type: "string", + }, + }, + required: ["self"], +} as const + +export const $release = { + description: + "A catalog release represents a collection of hierarchical product data, price books and catalogs rules.", + type: "object", + properties: { + id: { + description: "A unique identifier for the catalog release.", + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + "x-go-name": "ID", + }, + attributes: { + type: "object", + properties: { + name: { + description: "The name of a release.", + type: "string", + examples: ["Clothing"], + }, + published_at: { + description: "The date and time a release was published.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + catalog_id: { + description: "A unique identifier for the catalog.", + type: "string", + examples: ["0194f54d-f2a1-4e33-9a6e-9ec366152490"], + }, + description: { + description: "A description of the catalog release.", + type: "string", + examples: ["Catalog for Store 123"], + default: "", + }, + hierarchies: { + description: "An array of hierarchy IDs associated with the release.", + type: "array", + items: { + $ref: "#/components/schemas/node-reference", + }, + "x-go-name": "RootNodes", + }, + }, + }, + relationships: { + $ref: "#/components/schemas/release-relationships", + }, + type: { + description: + "This represents the type of object being returned. Always `catalog-release`.", + type: "string", + "x-go-name": "Type", + }, + meta: { + $ref: "#/components/schemas/release-meta", + }, + }, + title: "Release", + "x-go-name": "Release", +} as const + +export const $release_data = { + description: "Container for a catalog release.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/release", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "Release Data", +} as const + +export const $release_list_data = { + description: "Container for a list of catalog releases.", + type: "object", + properties: { + data: { + type: "array", + items: { + $ref: "#/components/schemas/release", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + title: "ReleaseListData", +} as const + +export const $release_meta = { + description: "A release's metadata.", + type: "object", + properties: { + created_at: { + description: "The date and time a release is created.", + type: "string", + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + started_at: { + description: + "The date and time a release is available for use. In other words, the date and time the status of a catalog release changes to PUBLISHED, rather than IN PROGRESS.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + updated_at: { + description: "The date and time a release is updated.", + type: ["string", "null"], + format: "date-time", + examples: ["1970-01-01T00:00:00.000"], + }, + release_status: { + description: "The status of the current release.", + type: "string", + enum: ["PENDING", "IN_PROGRESS", "FAILED", "PUBLISHED"], + }, + language: { + description: "Your storefront's preferred language code and locale.", + type: "string", + examples: ["en-GB"], + }, + is_full_publish: { + description: `Indicates that a full publish was performed (either because this is the first time a catalog has been published or because of a change that occurred, for example, adding/removing a price book or hierarchy). When determining whether delta data needs to be refreshed, ignore this attribute and always use the \`is_full_delta\` attribute. +`, + type: "boolean", + examples: [false], + default: false, + "x-go-name": "IsFullPublish", + }, + is_full_delta: { + description: `Indicates whether the release delta file contains the full content of a catalog release. Using a search service as an example, if the \`is_full_delta\` attribute is \`true\`, you should remove all data about that catalog release from the search service before injecting fresh data from the delta file. If the \`is_full_delta\` attribute is \`false\`, then data from the previous catalog release overlays the existing data in the delta file. The \`is_full_delta\` attribute is always \`true\` the first time a catalog is published. +`, + type: "boolean", + examples: [false], + default: false, + "x-go-name": "IsFullDelta", + }, + total_products: { + description: + "The total number of products displayed in a catalog release.", + type: ["integer", "null"], + format: "int64", + "x-go-name": "TotalProducts", + }, + total_nodes: { + description: + "The total number of hierarchy nodes displayed in a catalog release.", + type: ["integer", "null"], + format: "int64", + "x-go-name": "TotalNodes", + }, + percent_completed: { + description: + "An integer that represents the progress of a catalog publish. The attribute starts at `0` and reaches `100` when publishing is complete.", + type: ["integer", "null"], + format: "int32", + "x-go-name": "PercentCompleted", + }, + owner: { + description: + "The owner of the resource, can be either `organization` or `store`.", + type: ["string", "null"], + enum: ["store", "organization"], + "x-go-name": "Owner", + }, + }, + title: "ReleaseMeta", + "x-go-name": "ReleaseMeta", + "x-omitempty": true, +} as const + +export const $release_relationships = { + description: + "Relationships are established between different catalog entities. For example, products, hierarchies, price books, and catalog rules are related to a catalog, as they are associated with it.", + type: "object", + properties: { + delta: { + description: + "A URL to a delta document that describes the changes between catalog releases.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + }, + products: { + description: "A URL to all products included in a catalog release.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + }, + hierarchies: { + description: "A URL to all hierarchies included in a catalog release.", + type: "object", + properties: { + links: { + $ref: "#/components/schemas/related-link", + }, + }, + required: ["links"], + }, + }, + title: "ReleaseRelationships", + "x-go-name": "ReleaseRelationships", +} as const + +export const $rule = { + description: + "A catalog rule specifies which catalog to use for a given shopper context.", + type: "object", + properties: { + id: { + description: + "The catalog rule ID. Use this to get, modify, or delete the catalog rule.", + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + attributes: { + type: "object", + properties: { + name: { + description: + "The name of a catalog rule. The name must not contain any spaces.", + type: "string", + examples: ["rule-123"], + }, + description: { + description: "A brief description of the purpose of a catalog rule.", + type: "string", + examples: ["Catalog Rule for most favored customers"], + default: "", + "x-omitempty": true, + }, + account_ids: { + description: + "The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.", + type: "array", + items: { + type: "string", + }, + "x-omitempty": true, + }, + customer_ids: { + description: + "The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.", + type: "array", + items: { + type: "string", + }, + "x-omitempty": true, + }, + channels: { + description: + "The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests.", + type: "array", + items: { + type: "string", + }, + "x-omitempty": true, + }, + tags: { + description: + "A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header.", + type: "array", + items: { + type: "string", + }, + "x-omitempty": true, + }, + schedules: { + description: `Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the \`EP-Context-Tag\` header. + +The schedules attribute must include the following. + +- \`valid_from\` matches the date and time that the catalog is displayed from. +- \`valid_to\` matches the date and time the catalog is displayed to. + +Commerce runs on UTC time. + +You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of \`"valid_from": "2022-06-01T05:00:00.000-05:00"\`, \`"valid_to": "2022-06-15T11:59:99.000-08:00"\`. +`, + type: "array", + items: { + $ref: "#/components/schemas/rule-schedule", + }, + "x-omitempty": true, + }, + catalog_id: { + description: "The unique identifier of a catalog.", + type: "string", + examples: ["d09b4e16-08a5-4f42-817c-6e0d98acbb63"], + }, + created_at: { + description: "The date and time a catalog rule was created.", + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + }, + updated_at: { + description: "The date and time a catalog release is updated.", + type: "string", + format: "date-time", + examples: ["2020-09-22T09:00:00"], + }, + }, + required: ["name", "catalog_id", "created_at", "updated_at"], + }, + type: { + description: + "This represents the type of object being returned. Always `catalog_rule`.", + type: "string", + examples: ["catalog_rule"], + const: "catalog_rule", + }, + }, + required: ["id", "type", "attributes"], + title: "Catalog Rule", +} as const + +export const $rule_create_data = { + description: + "A catalog rule specifies which catalog to use for a given shopper context.", + type: "object", + properties: { + data: { + type: "object", + properties: { + attributes: { + type: "object", + properties: { + name: { + description: + "The name of a catalog rule. The name must not contain spaces.", + type: "string", + examples: ["rule-123"], + minLength: 1, + }, + description: { + description: + "A brief description of the purpose of a catalog rule.", + type: ["string", "null"], + examples: ["Catalog Rule for most favored customers"], + default: "", + }, + account_ids: { + description: + "The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + customer_ids: { + description: + "The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + channels: { + description: + "The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + tags: { + description: + "A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + schedules: { + description: `Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the \`EP-Context-Tag\` header. + +The schedules attribute must include the following. + +- \`valid_from\` matches the date and time that the catalog is displayed from. +- \`valid_to\` matches the date and time the catalog is displayed to. + +Commerce runs on UTC time. + +You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of \`"valid_from": "2022-06-01T05:00:00.000-05:00"\`, \`"valid_to": "2022-06-15T11:59:99.000-08:00"\`. +`, + type: ["array", "null"], + items: { + $ref: "#/components/schemas/rule-schedule", + }, + }, + catalog_id: { + description: "The unique identifier of a catalog.", + type: "string", + examples: ["d09b4e16-08a5-4f42-817c-6e0d98acbb63"], + }, + }, + required: ["name", "catalog_id"], + }, + type: { + description: + "This represents the type of object being returned. Always `catalog_rule`.", + type: "string", + examples: ["catalog_rule"], + const: "catalog_rule", + }, + }, + required: ["type", "attributes"], + }, + }, + required: ["data"], + title: "CatalogRuleCreateData", +} as const + +export const $rule_data = { + description: "Container for a single catalog rule.", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/rule", + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "CatalogRuleData", +} as const + +export const $rule_list_data = { + description: "Container for a list of catalog rules.", + type: "object", + properties: { + meta: { + $ref: "#/components/schemas/page-meta", + }, + data: { + type: "array", + items: { + $ref: "#/components/schemas/rule", + }, + }, + links: { + $ref: "#/components/schemas/links", + }, + }, + required: ["data"], + title: "CatalogRuleListData", +} as const + +export const $rule_schedule = { + description: "A period of time during which a catalog is valid", + type: "object", + properties: { + valid_from: { + description: + "Matches the date and time that the catalog is displayed from.", + type: ["string", "null"], + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "ValidFrom", + }, + valid_to: { + description: "Matches the date and time the catalog is displayed to.", + type: ["string", "null"], + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "ValidTo", + }, + }, + title: "Catalog Schedule", + "x-go-name": "RuleSchedule", +} as const + +export const $rule_update_data = { + description: + "A catalog rule specifies which catalog to use for a given shopper context.", + type: "object", + properties: { + data: { + type: "object", + properties: { + id: { + description: + "The catalog rule ID. Use this to get, modify, or delete the catalog rule.", + type: "string", + examples: ["8dbb35b2-ef04-477e-974d-e5f3abe6faae"], + }, + attributes: { + type: "object", + properties: { + name: { + description: + "The name of a catalog rule. The name must not contain spaces.", + type: ["string", "null"], + examples: ["rule-123"], + minLength: 1, + }, + description: { + description: "A description of the purpose of a catalog rule.", + type: ["string", "null"], + examples: ["Catalog Rule for most favored customers"], + default: "", + }, + account_ids: { + description: + "Specifies the list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + customer_ids: { + description: + "The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + channels: { + description: + "The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + schedules: { + description: `Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the \`EP-Context-Tag\` header. + +The schedules attribute must include the following. + +- \`valid_from\` matches the date and time that the catalog is displayed from. +- \`valid_to\` matches the date and time the catalog is displayed to. + +Commerce runs on UTC time. + +You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of \`"valid_from": "2022-06-01T05:00:00.000-05:00"\`, \`"valid_to": "2022-06-15T11:59:99.000-08:00"\`. +`, + type: ["array", "null"], + items: { + $ref: "#/components/schemas/rule-schedule", + }, + }, + tags: { + description: + "A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header.", + type: ["array", "null"], + items: { + type: "string", + }, + }, + catalog_id: { + description: "The unique identifier of a catalog rule.", + type: ["string", "null"], + examples: ["d09b4e16-08a5-4f42-817c-6e0d98acbb63"], + }, + }, + }, + type: { + description: + "This represents the type of object being returned. Always `catalog_rule`.", + type: "string", + examples: ["catalog_rule"], + const: "catalog_rule", + }, + }, + required: ["id", "type"], + }, + }, + required: ["data"], + title: "CatalogRuleUpdateData", +} as const + +export const $sale = { + description: "A set of sale prices and a validity period.", + type: "object", + properties: { + schedule: { + $ref: "#/components/schemas/schedule", + }, + currencies: { + $ref: "#/components/schemas/tiered-currencies", + }, + }, +} as const + +export const $sales = { + description: "A set of sale specifications", + type: "object", + additionalProperties: { + $ref: "#/components/schemas/sale", + }, + title: "Sales", +} as const + +export const $schedule = { + description: "A definition of the times at which a sale is valid", + type: "object", + properties: { + valid_from: { + type: ["string", "null"], + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "ValidFrom", + }, + valid_to: { + type: ["string", "null"], + format: "date-time", + examples: ["2020-09-22T09:00:00"], + "x-go-name": "ValidTo", + }, + }, + "x-go-name": "Schedule", +} as const + +export const $tier = { + description: "The name of the tier, for example, `Pencils`.", + type: "object", + properties: { + minimum_quantity: { + description: + "The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned.", + type: "integer", + examples: ["5"], + }, + price: { + $ref: "#/components/schemas/currencies", + }, + }, + title: "Tier", +} as const + +export const $tiered_amount = { + description: + "The three-letter ISO code for the currency associated with this price.", + type: "object", + properties: { + amount: { + description: + "The price in the lowest denomination for the specified currency. This is a product's list price.", + type: "integer", + format: "int64", + examples: [100], + "x-go-name": "Amount", + "x-omitempty": false, + }, + includes_tax: { + description: "Whether this price includes tax.", + type: "boolean", + examples: [false], + default: false, + "x-go-name": "IncludesTax", + }, + tiers: { + description: + "The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block.", + type: "object", + additionalProperties: { + description: "The name of the tier, for example, `Pencils`.", + type: "object", + properties: { + minimum_quantity: { + description: + "The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned.", + type: "integer", + examples: [5], + "x-go-name": "MinimumQuantity", + }, + amount: { + description: "The price for each quantity.", + type: "integer", + format: "int64", + examples: [100], + "x-go-name": "Amount", + "x-omitempty": false, + }, + }, + "x-go-name": "TierAmount", + }, + "x-go-name": "Tiers", + }, + }, + title: "TieredAmount", + "x-go-name": "TieredAmount", +} as const + +export const $tiered_currencies = { + description: "Collection of currency specific prices for a product.", + type: "object", + additionalProperties: { + $ref: "#/components/schemas/tiered-amount", + }, + title: "TieredCurrencies", +} as const + +export const $tiers = { + description: + "The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block.", + type: "object", + additionalProperties: { + $ref: "#/components/schemas/tier", + }, + title: "Tiers", +} as const + +export const $catalog_release_create_data = { + description: "Creates a catalog release with the following attributes.", + type: "object", + properties: { + data: { + type: "object", + properties: { + export_full_delta: { + description: `Set to \`true\` if you want to export all the data from a catalog release in a delta link. The \`is_full_delta\` attribute is returned from the \`get a release of a catalog\` endpoint. The \`is_full_delta\` attribute tells you if the delta file contains the full content of a catalog release. You can use the \`is_full_delta\` to determine if you need to refresh the data in your company system before publishing a catalog release with fresh data in a delta link. Using a search service as an example, if the \`is_full_delta\` attribute is true, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. If the \`is_full_delta\` attribute is false, then data from the previous catalog overlays the existing data in the delta file. The \`is_full_delta\` attribute is always \`true\` the first time a catalog is published. +`, + type: "boolean", + "x-go-name": "ExportFullDelta", + }, + include_organization_resources: { + description: + "If you are publishing a catalog in a store that contains resources from an organization, you must set this to true and you must enable the **Include Organization Resources in Catalog Publishes** checkbox in Commerce Manager. See [**Multi-Store Management Solutions**](/docs/api/pxm/catalog/publish-release).", + type: ["boolean", "null"], + "x-go-name": "IncludeOrganizationResources", + }, + }, + }, + }, + title: "CatalogReleaseCreateData", +} as const + +export const $included = { + description: + "Included is an array of resources that are included in the response.", + type: "object", + properties: { + main_images: { + description: "The main images associated with a product.", + type: "array", + items: { + $ref: "#/components/schemas/elastic-path-file", + }, + }, + component_products: { + description: "The component products associated with a product.", + type: "array", + items: { + $ref: "#/components/schemas/product", + }, + }, + files: { + description: "The files associated with a product.", + type: "array", + items: { + $ref: "#/components/schemas/elastic-path-file", + }, + }, + }, +} as const + +export const $elastic_path_file = { + type: "object", + properties: { + id: { + description: "The unique identifier for this file.", + type: "string", + format: "uuid", + }, + type: { + description: "The type represents the object being returned.", + type: "string", + examples: ["file"], + }, + file_name: { + description: "The name of the file.", + type: "string", + examples: ["file_name.jpg"], + }, + mime_type: { + description: "The mime type of the file.", + type: "string", + examples: ["image/jpeg"], + }, + file_size: { + description: "The size of the file. Required when uploading files.", + type: "integer", + examples: [36000], + }, + public: { + description: + "DEPRECATED Whether the file public or not. Required when uploading files.", + type: "boolean", + examples: [true], + }, + meta: { + $ref: "#/components/schemas/file-meta", + }, + links: { + $ref: "#/components/schemas/links", + }, + link: { + $ref: "#/components/schemas/file-link", + }, + }, + title: "ElasticPathFile", +} as const + +export const $file_meta = { + properties: { + timestamps: { + description: "The date and time the file was created.", + type: "object", + properties: { + created_at: { + description: "The date and time the file was created.", + type: "string", + examples: ["2023-10-11T13:02:25.293Z"], + }, + }, + }, + dimensions: { + description: "The file dimensions.", + type: "object", + properties: { + width: { + description: "The width of the file.", + type: "integer", + examples: [1800], + }, + height: { + description: "The height of the file.", + type: "integer", + examples: [1000], + }, + }, + }, + }, +} as const + +export const $file_link = { + description: "The publicly available URL for this file.", + type: "object", + properties: { + href: { + description: "The publicly available URL for this file.", + type: "string", + examples: [ + "https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png", + ], + }, + }, +} as const + +export const $CartsRequest = { + title: "CartsRequest", + type: "object", + properties: { + description: { + type: "string", + description: "The cart description.", + example: "cart description", + }, + discount_settings: { + $ref: "#/components/schemas/DiscountSettings", + }, + name: { + description: + "The cart name provided by the shopper. A cart name must contain 1 to 255 characters. You cannot use whitespace characters, but special characters are permitted. For more information, see the [Safe Characters](/guides/Getting-Started/safe-characters) section.", + type: "string", + example: "my cart name", + }, + snapshot_date: { + description: + "This optional parameter sets a reference date for the cart. If this parameter is set, it allows the cart to act as one that might occur on that specified date. For example, such future carts might acquire future-enabled discounts, allowing users to test and validate future interactions with carts. The snapshot_date must be in the format 2026-02-21T15:07:25Z. By default, this parameter is left empty.", + type: "string", + example: "2026-09-10T00:12:00Z", + }, + custom_attributes: { + $ref: "#/components/schemas/CustomAttributes", + }, + payment_intent_id: { + description: + "To remove the Stripe payment intent from a cart, pass the empty value in the `payment_intent_id` field. You must use an empty value for this field. You cannot use this endpoint to directly update the cart to use an existing Payment Intent.", + type: "string", + example: "", + }, + }, +} as const + +export const $DiscountSettings = { + title: "DiscountSettings", + type: "object", + properties: { + custom_discounts_enabled: { + description: + "This parameter enables custom discounts for a cart. When set to true, Elastic Path promotions will not be applied to the new carts. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart).", + type: "boolean", + example: false, + }, + use_rule_promotions: { + description: + "When set to true, this parameter allows the cart to use rule promotions.", + type: "boolean", + example: false, + }, + }, +} as const + +export const $CustomAttributes = { + title: "CustomAttributes", + type: "object", + properties: { + custom_attributes: { + description: + "Specifies the custom attributes for the cart object. The attribute can be any string, numerical, and underscore. A cart can have maximum of 20 custom attributes.", + type: "object", + properties: { + attribute: { + description: "Specifies the attribute `type` and `value`.", + type: "object", + properties: { + type: { + description: + "Specifies the type of the attribute such as string, integer, boolean, and float.", + type: "string", + }, + value: { + description: "Specifies the value of the attribute.", + oneOf: [ + { + type: "string", + }, + { + type: "number", + }, + { + type: "boolean", + }, + ], + }, + }, + }, + }, + }, + }, +} as const + +export const $CartResponse = { + title: "CartResponse", + type: "object", + properties: { + id: { + description: + "The unique identifier for the cart. Use SDK or create it yourself.", + type: "string", + }, + type: { + description: "The type of object being returned.", + type: "string", + example: "cart", + }, + name: { + description: "The name of this cart.", + type: "string", + example: "cart name", + }, + description: { + description: "A description of the cart.", + type: "string", + example: "cart description", + }, + discount_settings: { + $ref: "#/components/schemas/DiscountSettings", + }, + payment_intent_id: { + description: + "Stripe-assigned unique identifier for the linked Payment Intent", + type: "string", + }, + links: { + type: "object", + properties: { + self: { + description: "A link to that specific resource.", + type: "string", + }, + }, + example: "https://useast.api.elasticpath.com/v2/carts/1", + }, + meta: { + type: "object", + properties: { + display_price: { + type: "object", + properties: { + with_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + shipping: { + $ref: "#/components/schemas/FormattedPriceData", + }, + }, + }, + timestamps: { + $ref: "#/components/schemas/Timestamps", + }, + }, + }, + relationships: { + type: "object", + properties: { + customers: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: "The type of related object.", + type: "string", + example: "customers", + }, + id: { + description: "The ID of the customer.", + type: "string", + format: "uuid", + readOnly: true, + example: "662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9", + }, + }, + }, + }, + }, + items: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: "The type of related object.", + type: "string", + example: "cart_item", + }, + id: { + description: "The unique identifier for the cart item", + type: "string", + format: "uuid", + readOnly: true, + example: "1cf8b15b-4f12-43c5-837c-dbbc09aefa55", + }, + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $CartItemsObjectRequest = { + title: "Cart Items Object Request", + oneOf: [ + { + $ref: "#/components/schemas/CartItemObject", + }, + { + $ref: "#/components/schemas/CartMergeObjectRequest", + }, + { + $ref: "#/components/schemas/CustomItemObject", + }, + { + $ref: "#/components/schemas/ReOrderObjectRequest", + }, + { + $ref: "#/components/schemas/PromotionItemObject", + }, + ], +} as const + +export const $CartItemObject = { + title: "Cart Item Object", + type: "object", + properties: { + data: { + allOf: [ + { + $ref: "#/components/schemas/CartItemObjectData", + }, + { + $ref: "#/components/schemas/CartItemResponse", + }, + ], + }, + }, +} as const + +export const $CartItemObjectData = { + title: "Cart Item Object Data", + type: "object", + required: ["type", "quantity"], + properties: { + type: { + description: "The type of object being returned.", + type: "string", + enum: ["cart_item"], + }, + quantity: { + description: "The number of items added to the cart.", + type: "number", + example: 2, + }, + id: { + type: "string", + format: "uuid", + description: + "Specifies the ID of the product you want to add to cart. (use this OR sku)", + example: "78d7b5c2-c852-40ad-87bb-beb161f61f37", + }, + sku: { + type: "string", + description: + "Specifies the item SKU that you want to add to cart. (use this OR id)", + example: "my-item", + }, + custom_inputs: { + description: "The custom text to be added to a product.", + type: "object", + }, + bundle_configuration: { + description: "Object used to describe the bundle options selected.", + type: "object", + properties: { + selected_options: { + description: "Specifies selected options.", + type: "object", + }, + }, + }, + shipping_group_id: { + description: "Identifier for a created Cart Shipping Group", + type: "string", + }, + }, +} as const + +export const $CartMergeObjectRequest = { + title: "Cart Merge Object Request", + type: "object", + properties: { + data: { + type: "array", + items: { + allOf: [ + { + $ref: "#/components/schemas/CartMergeObject", + }, + ], + }, + description: "", + }, + options: { + $ref: "#/components/schemas/AddAllOrNothingOptionsObject", + }, + }, +} as const + +export const $CartMergeObject = { + title: "Cart Merge Object", + type: "object", + required: ["type", "cart_id"], + properties: { + type: { + description: "The type of object being returned. Must be `cart_items`.", + type: "string", + enum: ["cart_items"], + }, + cart_id: { + description: "The original cart to be merged from.", + type: "string", + format: "uuid", + example: "78d7b5c2-c852-40ad-87bb-beb161f61f37", + }, + }, +} as const + +export const $CustomItemObject = { + title: "Custom Item Object", + type: "object", + properties: { + data: { + allOf: [ + { + $ref: "#/components/schemas/CustomItemObjectData", + }, + ], + description: "", + }, + }, +} as const + +export const $CustomItemObjectData = { + title: "Custom Item Object Data", + type: "object", + required: ["type", "name", "quantity", "price"], + properties: { + type: { + description: "The type of object being returned. Must be `custom_item`.", + type: "string", + enum: ["custom_item"], + }, + quantity: { + description: "The number of custom items to add to cart.", + type: "number", + example: 2, + }, + price: { + type: "object", + required: ["amount"], + properties: { + amount: { + description: "The unit price of the custom item.", + type: "number", + example: 10000, + }, + includes_tax: { + description: + "Set to`true` if relevant taxes have been included in the price, `false` if not. Defaults to `true`.", + type: "boolean", + }, + }, + }, + description: { + description: "A description of the custom item.", + type: "string", + example: "My first custom item!", + }, + sku: { + type: "string", + description: + "The `SKU` code to use for the custom item. See [best practices](https://elasticpath.dev/docs/commerce-cloud/carts/cart-items/add-custom-item-to-cart#best-practices) to use the `SKU` code.", + example: "my-custom-item", + }, + name: { + type: "string", + description: "The name of the custom item.", + example: "My Custom Item", + }, + custom_inputs: { + description: "The custom text to be added to a product.", + type: "object", + }, + shipping_group_id: { + description: "Identifier for a created Cart Shipping Group", + type: "string", + }, + }, +} as const + +export const $ReOrderObjectRequest = { + title: "Re-Order Object Request", + type: "object", + properties: { + data: { + allOf: [ + { + $ref: "#/components/schemas/ReOrderObject", + }, + ], + }, + options: { + $ref: "#/components/schemas/AddAllOrNothingOptionsObject", + }, + }, +} as const + +export const $ReOrderObject = { + title: "Re Order Object", + type: "object", + required: ["type", "order_id"], + properties: { + type: { + description: "The type of resource being returned. Use `order_items`.", + type: "string", + enum: ["order_items"], + }, + order_id: { + description: "The unique identifier of the order.", + type: "string", + format: "uuid", + example: "78d7b5c2-c852-40ad-87bb-beb161f61f37", + }, + }, +} as const + +export const $BulkAddItemsRequest = { + title: "Bulk Add Items Request", + type: "object", + properties: { + data: { + anyOf: [ + { + $ref: "#/components/schemas/CartItemsObjectRequest", + }, + { + $ref: "#/components/schemas/CartMergeObjectRequest", + }, + { + $ref: "#/components/schemas/CustomItemObject", + }, + { + $ref: "#/components/schemas/ReOrderObjectRequest", + }, + { + $ref: "#/components/schemas/PromotionItemObject", + }, + ], + }, + }, +} as const + +export const $PromotionItemObject = { + title: "Promotion Item Object", + type: "object", + properties: { + data: { + allOf: [ + { + $ref: "#/components/schemas/PromotionItemObjectData", + }, + ], + }, + }, +} as const + +export const $PromotionItemObjectData = { + title: "Promotion Item Object Data", + type: "object", + required: ["type", "code"], + properties: { + type: { + description: "Specifies the type of resource, which is `promotion_item`.", + type: "string", + enum: ["promotion_item"], + }, + code: { + description: + "Specifies the promotion code. For more information about codes[].user[], see the [Create Promotion codes](/docs/api/promotions/create-promotion-codes) section.", + type: "string", + example: "PROMO_CODE", + }, + }, +} as const + +export const $BulkUpdateCartsItems = { + title: "Bulk Update Carts Items", + type: "object", + required: ["id", "quantity"], + properties: { + data: { + type: "array", + items: { + type: "object", + properties: { + id: { + description: + "Specifies the ID of the cart item that you want to update in cart.", + type: "string", + example: "{{cartitemID}}", + }, + quantity: { + description: "Specifies the amount of items to update in the cart.", + type: "number", + example: 2, + }, + custom_inputs: { + description: + "Specifies the custom text to be added to a product. See [custom inputs](https://elasticpath.dev/docs/pxm/products/ep-pxm-products-api/update-a-product#using-custom-inputs-attribute).", + type: "object", + }, + }, + }, + }, + options: { + $ref: "#/components/schemas/UpdateAllOrNothingOptionsObject", + }, + }, +} as const + +export const $UpdateCartsItems = { + title: "Update Carts Items", + type: "object", + required: ["quantity"], + properties: { + data: { + type: "object", + properties: { + id: { + description: "The unique identifier of the cart item.", + type: "string", + format: "uuid", + example: "{{cartitemID}}", + }, + quantity: { + description: "The amount of products to add to cart.", + type: "number", + example: 2, + }, + custom_inputs: { + description: "The custom text to be added to a product.", + type: "object", + }, + shipping_group_id: { + description: + "The unique identifier of the shipping group to be added to the cart.", + type: "string", + format: "uuid", + example: "900ab9c1-4b39-43fe-b080-0dc2806065d9", + }, + }, + }, + }, +} as const + +export const $AddAllOrNothingOptionsObject = { + title: "Add All Or Nothing Options Object", + type: "object", + properties: { + add_all_or_nothing: { + description: + "When `true`, if an error occurs for any item, no items are added to the cart. When `false`, valid items are added to the cart and the items with errors are reported in the response. Default is `false`.", + type: "boolean", + example: false, + }, + }, +} as const + +export const $UpdateAllOrNothingOptionsObject = { + title: "Update All Or Nothing Options Object", + type: "object", + properties: { + update_all_or_nothing: { + description: + "When set to`true`, if an error occurs for any item, no items are updated in the cart. When set to `false`, valid items are updated in the cart and the items with errors are reported in the response. Default is `true`.", + type: "boolean", + example: false, + }, + }, +} as const + +export const $CartItemResponse = { + title: "Cart Item Relationship", + type: "object", + properties: { + product_id: { + description: "The unique ID of the product.", + type: "string", + format: "uuid", + readOnly: true, + example: "55cda543-f9d7-42a4-b40a-665f2e4ff7c5", + }, + name: { + description: "The name of this item", + type: "string", + readOnly: true, + example: "shirt", + }, + description: { + description: "A description of the cart item.", + type: "string", + readOnly: true, + example: "T-shirt.", + }, + catalog_id: { + description: + "The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set.", + type: "string", + readOnly: true, + format: "uuid", + example: "11d3f9d2-c99b-472c-96c3-51842333daea", + }, + catalog_source: { + description: "The catalog source. Always `pim` or `legacy`.", + type: "string", + readOnly: true, + example: "pim", + }, + image: { + type: "object", + readOnly: true, + properties: { + mime_type: { + description: "The MIME type for the uploaded file.", + type: "string", + readOnly: true, + example: "image/png", + }, + file_name: { + description: "The name of the image file that was uploaded.", + type: "string", + readOnly: true, + example: "shirt-trans.png", + }, + href: { + description: "The link to the image.", + type: "string", + readOnly: true, + example: + "https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/7cc08cbb-256e-4271-9b01-d03a9fac9f0a.png", + }, + }, + }, + manage_stock: { + description: null, + type: "boolean", + readOnly: true, + example: true, + }, + unit_price: { + readOnly: true, + $ref: "#/components/schemas/ItemPriceData", + }, + value: { + readOnly: true, + $ref: "#/components/schemas/ItemPriceData", + }, + links: { + type: "object", + readOnly: true, + properties: { + product: { + description: "A URL related to the resource.", + type: "string", + example: + "https://useast.api.elasticpath.com/products/9eda5ba0-4f4a-4074-8547-ccb05d1b5981", + }, + }, + }, + meta: { + type: "object", + readOnly: true, + properties: { + display_price: { + type: "object", + properties: { + with_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + }, + }, + timestamps: { + $ref: "#/components/schemas/Timestamps", + }, + }, + }, + }, +} as const + +export const $CartsResponse = { + title: "Carts Response", + type: "object", + properties: { + data: { + type: "array", + items: { + type: "object", + anyOf: [ + { + $ref: "#/components/schemas/CartItemObject", + }, + ], + }, + }, + meta: { + type: "object", + properties: { + display_price: { + type: "object", + properties: { + with_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + discounts: { + type: "object", + additionalProperties: { + type: "object", + properties: { + amount: { + type: "number", + example: -1000, + }, + currency: { + type: "string", + example: "USD", + }, + formatted: { + type: "string", + example: "-$1.00", + }, + }, + }, + }, + }, + }, + timestamps: { + $ref: "#/components/schemas/CartTimestamps", + }, + }, + }, + }, +} as const + +export const $ItemPriceData = { + title: "Order Price Data", + type: "object", + properties: { + amount: { + description: "The amount for this item as an integer.", + type: "number", + readOnly: true, + example: 10000, + }, + currency: { + description: "The currency this item was added to the cart as.", + type: "string", + readOnly: true, + example: "USD", + }, + includes_tax: { + description: "Whether or not this price is tax inclusive.", + type: "boolean", + readOnly: true, + example: false, + }, + }, +} as const + +export const $CartsRelationshipsAccountsData = { + title: "Carts Relationships Accounts Data", + type: "object", + properties: { + data: { + type: "array", + items: { + properties: { + id: { + description: "The ID of the account.", + type: "string", + example: "{{accountID}}", + }, + type: { + description: + "The type of related object. Ensure that it is account.", + type: "string", + example: "account", + }, + }, + }, + }, + }, +} as const + +export const $CartsRelationshipsCustomersData = { + title: "Carts Relationships Customers Data", + type: "object", + properties: { + data: { + type: "array", + items: { + properties: { + id: { + description: "The ID of the customer.", + type: "string", + example: "{{customerID}}", + }, + type: { + description: + "The type of related object. Ensure that it is customer.", + type: "string", + example: "customer", + }, + }, + }, + }, + }, +} as const + +export const $CartsItemsTaxesObject = { + title: "Carts Items Taxes Object", + type: "object", + required: ["type", "rate"], + properties: { + code: { + description: "A unique tax code in this jurisdiction.", + type: "string", + example: "TAX01", + }, + jurisdiction: { + description: "The relevant tax jurisdiction.", + type: "string", + example: "UK", + }, + name: { + description: "The name of the tax item.", + type: "string", + example: "Tax name", + }, + rate: { + description: "The tax rate represented as a decimal (12.5% -> 0.125).", + type: "number", + example: 0.2, + }, + type: { + description: "The type of object being returned. Use `tax_item`.", + type: "string", + example: "tax_item", + }, + id: { + description: "The unique identifier for this tax item.", + type: "string", + format: "uuid", + readOnly: true, + example: "662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9", + }, + }, +} as const + +export const $CartsBulkCustomDiscounts = { + title: "CartsBulkCustomDiscounts", + type: "object", + properties: { + data: { + type: "array", + items: { + allOf: [ + { + $ref: "#/components/schemas/CartsCustomDiscountsObject", + }, + { + $ref: "#/components/schemas/CartItemBulkCustomDiscountObject", + }, + ], + }, + }, + options: { + $ref: "#/components/schemas/AddAllOrNothingOptionsObject", + }, + }, +} as const + +export const $CartsBulkCustomDiscountsResponse = { + title: "CartsBulkCustomDiscountsResponse", + type: "object", + properties: { + data: { + type: "array", + items: { + allOf: [ + { + $ref: "#/components/schemas/CartsCustomDiscountsResponse", + }, + { + $ref: "#/components/schemas/artItemBulkCustomDiscountResponse", + }, + ], + }, + }, + options: { + $ref: "#/components/schemas/AddAllOrNothingOptionsObject", + }, + }, +} as const + +export const $CartItemBulkCustomDiscountObject = { + title: "CartItemBulkCustomDiscountObject", + type: "object", + allOf: [ + { + $ref: "#/components/schemas/CartsCustomDiscountsObject", + }, + { + $ref: "#/components/schemas/CustomDiscountRelationshipsCartItemRequest", + }, + ], +} as const + +export const $artItemBulkCustomDiscountResponse = { + title: "artItemBulkCustomDiscountResponse", + type: "object", + allOf: [ + { + $ref: "#/components/schemas/CartsCustomDiscountsResponse", + }, + { + $ref: "#/components/schemas/CustomDiscountRelationshipsCartItemRequest", + }, + ], +} as const + +export const $CartsCustomDiscountsObject = { + title: "CartsCustomDiscountsObject", + type: "object", + required: [ + "amount", + "description", + "discount_code", + "discount_engine", + "external_id", + "type", + ], + properties: { + amount: { + description: + "Specifies an amount to be applied for the custom discount. It must be less than zero.", + type: "number", + example: -1000, + }, + description: { + description: "Specifies a description for the custom discount.", + type: "string", + example: "Custom discount description", + }, + discount_code: { + description: "Specifies the discount code used for the custom discount.", + type: "string", + example: "cart-custom-promo-code", + }, + discount_engine: { + description: + "Specifies from where the custom discount is applied. For example, Talon.one.", + type: "string", + example: "Custom Discount Engine", + }, + external_id: { + description: "Specifies an external id for the custom discount.", + type: "string", + example: "custom-discount-external-id", + }, + type: { + description: + "Specifies the type of the resource. Always `custom_discount`.", + type: "string", + example: "custom_discount", + }, + }, +} as const + +export const $CartsCustomDiscountsResponse = { + title: "CartsCustomDiscountsResponse", + type: "object", + properties: { + amount: { + type: "object", + properties: { + amount: { + description: + "Specifies an amount to be applied for the custom discount. It must be less than zero.", + type: "number", + example: -1000, + }, + currency: { + description: "The currency set for the custom discount.", + type: "string", + example: "USD", + }, + formatted: { + description: "The formatted value for the custom discount.", + type: "string", + example: "-$10.00", + }, + }, + }, + description: { + description: "Specifies a description for the custom discount.", + type: "string", + example: "Custom discount description", + }, + discount_code: { + description: "Specifies the discount code used for the custom discount.", + type: "string", + example: "cart-custom-promo-code", + }, + discount_engine: { + description: + "Specifies from where the custom discount is applied. For example, Talon.one.", + type: "string", + example: "Custom Discount Engine", + }, + external_id: { + description: "Specifies an external id for the custom discount.", + type: "string", + example: "custom-discount-external-id", + }, + type: { + description: + "Specifies the type of the resource. Always `custom_discount`.", + type: "string", + example: "custom_discount", + }, + id: { + description: "Specifies the UUID of the custom discount.", + type: "string", + format: "uuid", + readOnly: true, + example: "662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9", + }, + }, +} as const + +export const $CustomDiscountRelationshipsCartItemRequest = { + title: "CustomDiscountRelationshipsCartItemRequest", + type: "object", + required: ["type", "id"], + properties: { + relationships: { + type: "object", + properties: { + item: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: + "Specifies the type of item. For example, `custom_item` or `cart_item`.", + type: "string", + example: "cart_item", + }, + id: { + description: + "Specifies the unique identifier of the `cart_item` or `custom_item` in the cart.", + type: "string", + format: "uuid", + example: "5601a4b1-9d13-42d3-8fb7-03b35169d1b6", + }, + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $CartItemRelationship = { + title: "CartItemRelationship", + type: "object", + required: ["type", "id"], + properties: { + relationships: { + type: "object", + properties: { + order: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: "This specifies the type of item.", + type: "string", + example: "order", + }, + id: { + description: + "This specifies the ID of the cart_item or custom_item in the cart.", + type: "string", + format: "uuid", + example: "5601a4b1-9d13-42d3-8fb7-03b35169d1b6", + }, + }, + }, + }, + }, + }, + }, + }, +} as const + +export const $CartsBulkTaxes = { + title: "CartsBulkTaxes", + type: "object", + properties: { + data: { + type: "array", + items: { + allOf: [ + { + $ref: "#/components/schemas/CartsItemsTaxesObject", + }, + { + $ref: "#/components/schemas/CartItemRelationship", + }, + ], + }, + }, + options: { + $ref: "#/components/schemas/AddAllOrNothingOptionsObject", + }, + }, +} as const + +export const $OrdersAnonymizeRequest = { + title: "OrdersAnonymizeRequest", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/OrdersAnonymizeData", + }, + }, +} as const + +export const $OrdersAnonymizeData = { + title: "OrdersAnonymizeData", + type: "object", + properties: { + order_ids: { + description: + "The unique identifiers of the orders to be anonymized. You can anonymize multiple orders at the same time.", + type: "array", + items: { + type: "string", + }, + example: "{{orderID}}", + }, + }, +} as const + +export const $OrdersUpdateRequest = { + title: "OrdersUpdateRequest", + type: "object", + properties: { + data: { + oneOf: [ + { + $ref: "#/components/schemas/OrdersAddressData", + }, + { + $ref: "#/components/schemas/OrdersCancelData", + }, + { + $ref: "#/components/schemas/OrdersFulfulledData", + }, + ], + }, + }, +} as const + +export const $OrdersAddressData = { + title: "OrdersAddressData", + type: "object", + required: ["type", "shipping_address"], + properties: { + external_ref: { + description: + "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system.", + type: "string", + example: "external_order_123", + }, + shipping_address: { + type: "object", + properties: { + first_name: { + description: "Specifies the first name of the address holder.", + type: "string", + example: "James", + }, + last_name: { + description: "Specifies the last name of the address holder.", + type: "string", + example: "Doe", + }, + phone_number: { + description: "Specifies the phone number of the address holder.", + type: "string", + example: 5558679305, + }, + company_name: { + description: "Specifies the company name.", + type: "string", + example: "company name", + }, + line_1: { + description: "Specifies the first line of the address.", + type: "string", + example: "1234 Disney Drive", + }, + line_2: { + description: "Specifies the second line of the address.", + type: "string", + example: "Disney Resort", + }, + city: { + description: + "Specifies the name of the city in the shipping address.", + type: "string", + example: "Anaheim", + }, + county: { + description: "Specifies the county of the shipping address.", + type: "string", + example: "Orange", + }, + region: { + description: + "Specifies the state, province, or region of the shipping address.", + type: "string", + example: "CA", + }, + postcode: { + description: "Specifies the postcode or ZIP code of the address.", + type: "string", + example: 92802, + }, + country: { + description: "Specifies the country in the shipping address.", + type: "string", + example: "US", + }, + instructions: { + description: + "Specifies any instructions provided with the shipping address.", + type: "string", + example: "Buzzer 10233", + }, + }, + }, + }, +} as const + +export const $OrdersCancelData = { + title: "OrdersCancelData", + type: "object", + required: ["type", "status"], + properties: { + status: { + description: + "The status of the order. You can only update the status to `cancelled`.", + type: "string", + example: "cancelled", + }, + type: { + description: "The type of the resource. You must use order.", + type: "string", + example: "order", + }, + external_ref: { + description: + "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system.", + type: "string", + example: "external_order_123", + }, + }, +} as const + +export const $OrdersFulfulledData = { + title: "OrdersFulfulledData", + type: "object", + required: ["type", "shipping"], + properties: { + shipping: { + description: + "The shipping status of the order. You can only update the shipping status to `fulfilled`.", + type: "string", + example: "fulfilled", + }, + type: { + description: "The type of the resource. You must use order.", + type: "string", + example: "order", + }, + external_ref: { + description: + "Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system.", + type: "string", + example: "external_order_123", + }, + }, +} as const + +export const $PaymentsRequest = { + title: "PaymentsRequest", + type: "object", + properties: { + data: { + $ref: "#/components/schemas/Data.PaymentObject", + }, + }, +} as const + +export const $Data_BasePayments = { + title: "Data.BasePayments", + type: "object", + required: ["gateway", "method"], + properties: { + gateway: { + type: "string", + enum: [ + "adyen", + "authorize_net", + "braintree", + "card_connect", + "cyber_source", + "elastic_path_payments_stripe", + "manual", + "paypal_express_checkout", + "stripe", + "stripe_connect", + "stripe_payment_intents", + ], + }, + method: { + description: + "Specifies the transaction method, such as `purchase` or `authorize`.", + type: "string", + enum: ["authorize", "purchase", "purchase_setup", "authorize_setup"], + }, + amount: { + description: "The amount to be paid for the transaction.", + type: "number", + example: 10000, + }, + }, +} as const + +export const $Data_AdyenPayment = { + title: "Data.AdyenPayment", + required: ["payment", "gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: "Specifies the gateway. You must use `adyen`.", + type: "string", + enum: ["adyen"], + }, + options: { + type: "object", + properties: { + shopper_reference: { + description: + "The shopper reference token associated with the saved payment method.", + type: "string", + }, + recurring_processing_model: { + description: "Enter CardOnFile for a one-time purchase.", + type: "string", + }, + }, + }, + payment: { + description: + "The Adyen recurringDetailReference payment method identifier.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_AuthorizeNetPayment = { + title: "Data.AuthorizeNetPayment", + required: ["payment", "gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: "Specifies the gateway. You must use `authorize_net`.", + type: "string", + enum: ["authorize_net"], + }, + options: { + type: "object", + properties: { + customer_payment_profile_id: { + description: "The Authorize.net customer payment profile ID.", + type: "string", + }, + }, + }, + payment: { + description: "The Authorize.net customer profile ID.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_BraintreePayment = { + title: "Data.BraintreePayment", + required: ["payment", "gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: "Specifies the gateway. You must use `braintree`.", + type: "string", + enum: ["braintree"], + }, + payment: { + description: "The Braintree Customer ID that you want to bill.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_CardConnectPayment = { + title: "Data.CardConnectPayment", + required: ["payment", "gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: "Specifies the gateway. You must use `card_connect`.", + type: "string", + enum: ["card_connect"], + }, + payment: { + description: + "Enter account_id, profile_id from CardPointe API. For example, 1|16178397535388255208.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_CyberSourcePayment = { + title: "Data.CyberSourcePayment", + required: ["payment", "gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: "Specifies the gateway. You must use `cyber_source`.", + type: "string", + enum: ["cyber_source"], + }, + payment: { + description: "The CyberSource token.", + type: "string", + }, + }, + }, + ], +} as const + +export const $ElasticPathPaymentsPoweredByStripePayment = { + title: "Elastic Path Payments Powered By Stripe", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the gateway. You must use `elastic_path_payments_stripe`.", + type: "string", + enum: ["elastic_path_payments_stripe"], + }, + options: { + type: "object", + properties: { + receipt_email: { + description: + "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode.", + type: "string", + }, + automatic_payment_methods: { + type: "object", + description: + "Parent object determining whether to use Stripe's `automatic_payment_methods` setting.", + properties: { + enabled: { + type: "boolean", + description: + "When set to true, it displays all enabled payment methods from the Stripe dashboard. When set to false, the Stripe default, which is card, is used.", + }, + }, + }, + }, + }, + payment_method_types: { + type: "array", + items: { + type: "string", + }, + description: + "Specifies the Stripe payment method types configured for the store. See [Stripe Documentation](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_types).", + example: "card", + }, + payment: { + description: "Specifies the Stripe token or source.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_ManualPayment = { + title: "Data.ManualPayment", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the type of payment gateway. You must use `manual`.", + type: "string", + enum: ["manual"], + }, + paymentmethod_meta: { + type: "object", + properties: { + custom_reference: { + description: + "A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend not to include personal information in this field.", + type: "string", + }, + name: { + description: "A custom name associated with the payment method.", + type: "string", + }, + }, + }, + }, + }, + ], +} as const + +export const $Data_PayPalExpressCheckoutPayment = { + title: "Data.PayPalExpressCheckoutPayment", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the type of payment gateway. You must use `paypal_express_checkout`.", + type: "string", + enum: ["paypal_express_checkout"], + }, + options: { + type: "object", + properties: { + description: { + description: "The description for the payment.", + type: "string", + }, + soft_descriptor: { + description: + "The descriptor appended to PayPal generated descriptor that is visible on the card statement of the payer.", + type: "string", + }, + application_context: { + type: "object", + properties: { + brand_name: { + description: + "The label that overrides the business name in the PayPal account on the payPal site.", + type: "string", + }, + locale: { + description: + "The locale pages that appear based on language and country code. PayPal supports a five-character code. For example, ja-JP.", + type: "string", + }, + landing_page: { + description: + "The type of landing page to show on the PayPal site for customer checkout. Use values LOGIN, BILLING, or NO_PREFERENCE.", + type: "string", + }, + shipping_preference: { + description: + "The shipping preference. Use SET_PROVIDED_ADDRESS value. This parameter does allow the user to change their address on PayPal site.", + type: "string", + }, + user_action: { + description: + "If you set `useraction=commit` in the query string, the flow redirects the buyer to the PayPal payment page and displays a Pay Now button. When the shopper clicks **Pay Now**, call `DoExpressCheckoutPayment` to complete the payment without additional interaction from the shopper. Choose this flow when you know the final payment amount when you initiate the checkout flow.", + type: "string", + }, + return_url: { + description: + "The callback URL for PayPal to redirect the user in the case of approved payment.", + type: "string", + }, + cancel_url: { + description: + "The callback URL for PayPal to redirect user in the case a cancelled payment.", + type: "string", + }, + }, + }, + }, + }, + }, + }, + ], +} as const + +export const $Data_StripePayment = { + title: "Data.StripePayment", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the type of payment gateway. You must use `stripe`.", + type: "string", + enum: ["stripe"], + }, + options: { + type: "object", + properties: { + receipt_email: { + description: + "The option to provide an email for Stripe receipts. Specify live mode to access this feature.", + type: "string", + }, + }, + }, + payment: { + description: "The Stripe token or source.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_StripeConnectPayment = { + title: "Data.StripeConnectPayment", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the type of payment gateway. You must use `stripe_connect`.", + type: "string", + enum: ["stripe_connect"], + }, + options: { + type: "object", + properties: { + receipt_email: { + description: + "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode.", + type: "string", + }, + }, + }, + payment: { + description: "Specifies the Stripe token or source.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_StripePaymentIntentsPayment = { + title: "Data.StripePaymentIntentsPayment", + required: ["gateway"], + allOf: [ + { + $ref: "#/components/schemas/Data.BasePayments", + }, + { + type: "object", + properties: { + gateway: { + description: + "Specifies the type of payment gateway. You must use `stripe_payment_intents`.", + type: "string", + enum: ["stripe_payment_intents"], + }, + options: { + type: "object", + properties: { + receipt_email: { + description: + "Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode.", + type: "string", + }, + }, + }, + payment: { + description: "Specifies the Stripe token or source.", + type: "string", + }, + }, + }, + ], +} as const + +export const $Data_PaymentObject = { + oneOf: [ + { + $ref: "#/components/schemas/Data.AdyenPayment", + }, + { + $ref: "#/components/schemas/Data.AuthorizeNetPayment", + }, + { + $ref: "#/components/schemas/Data.BraintreePayment", + }, + { + $ref: "#/components/schemas/Data.CardConnectPayment", + }, + { + $ref: "#/components/schemas/Data.CyberSourcePayment", + }, + { + $ref: "#/components/schemas/ElasticPathPaymentsPoweredByStripePayment", + }, + { + $ref: "#/components/schemas/Data.ManualPayment", + }, + { + $ref: "#/components/schemas/Data.PayPalExpressCheckoutPayment", + }, + { + $ref: "#/components/schemas/Data.StripePayment", + }, + { + $ref: "#/components/schemas/Data.StripeConnectPayment", + }, + { + $ref: "#/components/schemas/Data.StripePaymentIntentsPayment", + }, + ], +} as const + +export const $TransactionResponse = { + title: "TransactionResponse", + type: "object", + properties: { + id: { + description: "The ID of the transaction.", + type: "string", + format: "uuid", + readOnly: true, + }, + reference: { + description: "The payment gateway reference.", + type: "string", + example: "manual", + }, + name: { + description: "A custom name associated with the payment method.", + type: "string", + example: "payment method name", + }, + custom_reference: { + description: + "A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field.", + type: "string", + example: "custom reference", + }, + gateway: { + description: "The name of the payment gateway used.", + type: "string", + enum: [ + "adyen", + "authorize_net", + "braintree", + "card_connect", + "cyber_source", + "elastic_path_payments_stripe", + "manual", + "paypal_express_checkout", + "stripe", + "stripe_connect", + "stripe_payment_intents", + ], + }, + amount: { + description: "The amount for this transaction.", + type: "number", + example: 10000, + }, + refunded_amount: { + description: "The refunded amount.", + type: "number", + example: 0, + }, + currency: { + description: "The transaction currency.", + type: "string", + example: "USD", + }, + "transaction-type": { + description: + "The type of transaction, such as `purchase`, `capture`, `authorize` or `refund`.", + type: "string", + example: "capture", + }, + status: { + description: + "The status provided by the gateway for this transaction, such as `complete` or `failed`.", + type: "string", + example: "complete", + }, + relationships: { + type: "object", + properties: { + order: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: + "Represents the type of the object being returned. It is always `order`.", + type: "string", + example: "order", + }, + id: { + description: "The ID of the order.", + type: "string", + format: "uuid", + example: "5601a4b1-9d13-42d3-8fb7-03b35169d1b6", + }, + }, + }, + }, + }, + }, + }, + meta: { + type: "object", + properties: { + display_price: { + $ref: "#/components/schemas/FormattedPriceData", + }, + display_refunded_amount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + timestamps: { + $ref: "#/components/schemas/Timestamps", + }, + }, + }, + }, +} as const + +export const $OrdersTransactionsConfirmRequest = { + title: "OrdersTransactionsConfirmRequest", + type: "object", + properties: { + data: { + type: "object", + }, + }, +} as const + +export const $OrdersTransactionsCaptureRequest = { + title: "OrdersTransactionsCaptureRequest", + type: "object", + properties: { + data: { + type: "object", + properties: { + options: { + type: "object", + properties: { + soft_descriptor: { + type: "string", + }, + note_to_payer: { + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $OrdersTransactionsRefundRequest = { + title: "OrdersTransactionsRefundRequest", + type: "object", + properties: { + data: { + type: "object", + properties: { + amount: { + description: + "The amount value to be refunded. If this field is not provided, it will be considered as manual refund (Mark as Refunded) and the refund process must be manually handled via payment provider. If the amount value is same as payment value, then it will be treated as a full refund and sent to the payment provider to process refund automatically.", + type: "number", + example: 1000, + }, + options: { + type: "object", + properties: { + note: { + description: + "Provides comments about the refund. It is used by PayPal Express.", + type: "string", + }, + }, + }, + }, + }, + }, +} as const + +export const $OrdersTransactionsCancelRequest = { + title: "OrdersTransactionsCancelRequest", + type: "object", + properties: { + data: { + type: "object", + properties: { + options: { + type: "object", + }, + reason: { + description: + "Specifies the reason for canceling the transaction. The reason may include `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`.", + type: "string", + example: "requested_by_customer", + }, + }, + }, + }, +} as const + +export const $OrderPriceData = { + title: "OrderPriceData", + type: "object", + properties: { + amount: { + description: "The amount for this item.", + type: "number", + example: 10000, + }, + currency: { + description: "The currency this item.", + type: "string", + example: "USD", + }, + includes_tax: { + description: "Whether or not this price is tax inclusive.", + type: "boolean", + example: false, + }, + }, +} as const + +export const $FormattedPriceData = { + title: "FormattedPriceData", + type: "object", + properties: { + amount: { + description: "The raw total of this cart.", + type: "number", + example: 10000, + }, + currency: { + description: "The currency set for this cart.", + type: "string", + example: "USD", + }, + formatted: { + description: "The tax inclusive formatted total based on the currency.", + type: "string", + example: "$10.00", + }, + }, +} as const + +export const $OrderItemFormattedUnitPriceData = { + title: "OrderItemFormattedUnitPriceData", + type: "object", + properties: { + unit: { + $ref: "#/components/schemas/FormattedPriceData", + }, + value: { + $ref: "#/components/schemas/FormattedPriceData", + }, + }, +} as const + +export const $DiscountData = { + title: "DiscountData", + type: "object", + properties: { + amount: { + $ref: "#/components/schemas/OrderPriceData", + }, + code: { + type: "string", + example: "10_off", + }, + id: { + type: "string", + format: "uuid", + readOnly: true, + example: "a01cf221-751b-46e4-b612-57ad3c645ee6", + }, + }, +} as const + +export const $OrderItemResponse = { + title: "OrderItemResponse", + type: "object", + properties: { + type: { + description: "The type represents the object being returned.", + type: "string", + example: "order_item", + }, + id: { + description: "The unique identifier for this order item.", + type: "string", + format: "uuid", + readOnly: true, + example: "68bf8510-bebf-47b1-96ba-8a9930c7d928", + }, + quantity: { + description: "The quantity of this item were ordered.", + type: "number", + example: 1, + }, + product_id: { + description: "The unique identifier for this order item.", + type: "string", + format: "uuid", + readOnly: true, + example: "4e9c6098-9701-4839-a69c-54d8256d9012", + }, + name: { + description: "The name of this order item.", + type: "string", + example: "Product 123", + }, + sku: { + description: "The SKU code for the order item.", + type: "string", + example: "IFD-1", + }, + unit_price: { + $ref: "#/components/schemas/OrderPriceData", + }, + value: { + $ref: "#/components/schemas/OrderPriceData", + }, + discounts: { + type: "array", + items: { + $ref: "#/components/schemas/DiscountData", + }, + }, + links: { + type: "object", + }, + meta: { + type: "object", + properties: { + display_price: { + type: "object", + properties: { + with_tax: { + $ref: "#/components/schemas/OrderItemFormattedUnitPriceData", + }, + without_tax: { + $ref: "#/components/schemas/OrderItemFormattedUnitPriceData", + }, + tax: { + $ref: "#/components/schemas/OrderItemFormattedUnitPriceData", + }, + discount: { + $ref: "#/components/schemas/OrderItemFormattedUnitPriceData", + }, + without_discount: { + $ref: "#/components/schemas/OrderItemFormattedUnitPriceData", + }, + discounts: { + type: "object", + additionalProperties: { + type: "object", + properties: { + amount: { + type: "number", + example: -1000, + }, + currency: { + type: "string", + example: "USD", + }, + formatted: { + type: "string", + example: "-$1.00", + }, + }, + }, + }, + }, + }, + timestamps: { + $ref: "#/components/schemas/Timestamps", + }, + }, + }, + relationships: { + type: "object", + properties: { + cart_item: { + type: "object", + properties: { + data: { + type: "object", + properties: { + type: { + description: "The type represents the object being returned.", + type: "string", + example: "order_item", + }, + id: { + description: "The unique identifier for this item.", + type: "string", + format: "uuid", + readOnly: true, + example: "5601a4b1-9d13-42d3-8fb7-03b35169d1b6", + }, + }, + }, + }, + }, + }, + }, + catalog_id: { + description: + "The unique identifier of the catalog associated with the product is shown if `catalog_source=pim` is set.", + type: "string", + example: "default", + }, + catalog_source: { + description: "The catalog source. Always `pim` or `legacy`.", + type: "string", + example: "pim - legacy", + }, + }, +} as const + +export const $OrderResponse = { + title: "OrderResponse", + type: "object", + properties: { + type: { + description: + "Specifies the type of object being returned. You must use `order`.", + type: "string", + example: "order", + }, + id: { + description: "Specifies the unique identifier of the order.", + type: "string", + format: "uuid", + readOnly: true, + example: "aa854b8f-5930-476d-951a-e9b9cfbdefb1", + }, + status: { + description: + "Specifies the status of the order, such as `incomplete`, `complete`, `processing`, or `cancelled`.", + type: "string", + example: "complete - incomplete - cancelled", + }, + payment: { + description: + "Specifies the status of the payment, such as `unpaid`, `authorized`, `paid`, or `refunded`.", + type: "string", + example: "authorized - paid - unpaid - refunded", + }, + shipping: { + description: + "Specifies the status of the shipment, such as `fulfilled` or `unfulfilled`.", + type: "string", + example: "unfulfilled - fulfilled", + }, + anonymized: { + description: "Specifies if the order is anonymized.", + type: "boolean", + example: false, + }, + meta: { + $ref: "#/components/schemas/OrderMeta", + }, + billing_address: { + $ref: "#/components/schemas/BillingAddress", + }, + contact: { + $ref: "#/components/schemas/Contact", + }, + shipping_address: { + $ref: "#/components/schemas/ShippingAddress", + }, + }, +} as const + +export const $OrderMeta = { + title: "OrderMeta", + type: "object", + properties: { + timestamps: { + $ref: "#/components/schemas/Timestamps", + }, + with_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + tax: { + $ref: "#/components/schemas/FormattedPriceData", + }, + discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + paid: { + $ref: "#/components/schemas/FormattedPriceData", + }, + authorized: { + $ref: "#/components/schemas/FormattedPriceData", + }, + without_discount: { + $ref: "#/components/schemas/FormattedPriceData", + }, + }, +} as const + +export const $CustomerCheckout = { + title: "Customer Checkout", + type: "object", + properties: { + data: { + type: "object", + properties: { + customer: { + type: "object", + properties: { + id: { + description: "The ID of the customer.", + type: "string", + }, + }, + }, + billing_address: { + $ref: "#/components/schemas/BillingAddress", + }, + shipping_address: { + $ref: "#/components/schemas/ShippingAddress", + }, + }, + }, + }, +} as const + +export const $AccountCheckout = { + title: "Account Checkout", + type: "object", + properties: { + data: { + type: "object", + properties: { + account: { + type: "object", + properties: { + id: { + description: "The account ID.", + type: "string", + }, + member_id: { + description: "The account member ID.", + type: "string", + }, + }, + }, + contact: { + type: "object", + properties: { + name: { + description: "The name of the account member.", + type: "string", + }, + email: { + description: "The email address of the account member.", + type: "string", + format: "email", + }, + }, + }, + billing_address: { + $ref: "#/components/schemas/BillingAddress", + }, + shipping_address: { + $ref: "#/components/schemas/ShippingAddress", + }, + }, + }, + }, +} as const + +export const $BillingAddress = { + title: "BillingAddress", + type: "object", + required: [ + "first_name", + "last_name", + "line_1", + "region", + "postcode", + "country", + ], + properties: { + company_name: { + description: "Company name of the billing recipient.", + type: "string", + example: "John Doe Enterprises", + }, + country: { + description: "Specifies the country of the billing address.", + type: "string", + example: "US", + }, + county: { + description: "Specifies the county of the billing address.", + type: "string", + example: "Orange", + }, + first_name: { + description: "First name of the billing recipient.", + type: "string", + example: "John", + }, + last_name: { + description: "Last name of the billing recipient.", + type: "string", + example: "Doe", + }, + line_1: { + description: "First line of the billing address.", + type: "string", + example: "1 Sunny Street", + }, + line_2: { + description: "Second line of the billing address.", + type: "string", + }, + postcode: { + description: "Postcode of the billing address.", + type: "string", + example: "92802", + }, + region: { + description: + "Specifies state, province, or region of the billing address.", + type: "string", + example: "CA", + }, + }, +} as const + +export const $Contact = { + title: "Contact", + type: "object", + properties: { + email: { + description: "The email address of the contact.", + type: "string", + example: "johndoe@email.com", + }, + name: { + description: "The name of the contact.", + type: "string", + example: "John Doe", + }, + }, +} as const + +export const $ShippingAddress = { + title: "ShippingAddress", + type: "object", + required: [ + "first_name", + "last_name", + "line_1", + "region", + "postcode", + "country", + ], + properties: { + company_name: { + description: "Company of the shipping recipient.", + type: "string", + example: "John Doe Enterprises", + }, + country: { + description: "Specifies the country of the shipping address.", + type: "string", + example: "US", + }, + county: { + description: "Specifies the county of the shipping address.", + type: "string", + example: "Orange", + }, + first_name: { + description: "First name of the shipping recipient.", + type: "string", + example: "John", + }, + last_name: { + description: "Last name of the shipping recipient.", + type: "string", + example: "Doe", + }, + line_1: { + description: "First line of the shipping address.", + type: "string", + example: "1 Sunny Street", + }, + line_2: { + description: "Second line of the shipping address.", + type: "string", + }, + postcode: { + description: "Post code of the shipping address.", + type: "string", + example: "92802", + }, + region: { + description: + "Specifies the state, province, or region of the shipping address.", + type: "string", + example: "CA", + }, + }, +} as const + +export const $Response_Meta_Carts = { + type: "object", + properties: { + page: { + $ref: "#/components/schemas/Response.PaginationPage", + }, + results: { + $ref: "#/components/schemas/Response.PaginationResults", + }, + }, +} as const + +export const $Response_Meta_Orders = { + type: "object", + properties: { + page: { + $ref: "#/components/schemas/Response.PaginationPage", + }, + results: { + $ref: "#/components/schemas/Response.PaginationResults", + }, + }, +} as const + +export const $Response_PaginationPage = { + type: "object", + properties: { + current: { + description: "The current page.", + type: "integer", + }, + limit: { + description: + "The maximum number of records per page for this response. You can set this value up to 100.", + type: "integer", + }, + offset: { + description: + "The current offset by number of records, not pages. Offset is zero-based.", + type: "integer", + }, + total: { + description: "The total page count.", + type: "integer", + }, + }, +} as const + +export const $Response_PaginationResults = { + type: "object", + properties: { + total: { + description: "The total page count.", + type: "integer", + }, + }, +} as const + +export const $Response_PageLinks = { + type: "object", + properties: { + current: { + description: "Always the current page.", + type: "string", + }, + first: { + description: "Always the first page.", + type: "string", + }, + last: { + description: "If there is only one page, it is `null`.", + type: "string", + }, + next: { + description: "If there is only one page, it is `null`.", + type: "string", + }, + prev: { + description: "if the user is on the first page, it is `null`.", + type: "string", + }, + }, +} as const + +export const $Response_Data = { + type: "object", + properties: { + data: {}, + }, +} as const + +export const $Response_Error = { + type: "array", + properties: { + detail: { + type: "string", + }, + status: { + type: "string", + }, + title: { + type: "string", + }, + }, +} as const + +export const $Timestamps = { + type: "object", + properties: { + created_at: { + description: "The date this was created.", + type: "string", + example: "2023-11-07T23:04:18.845Z", + }, + updated_at: { + description: "The date this was last updated.", + example: "2023-11-07T23:04:18.845Z", + }, + }, +} as const + +export const $CartTimestamps = { + type: "object", + properties: { + created_at: { + type: "string", + example: "2023-11-07T23:04:18.845Z", + }, + updated_at: { + example: "2023-11-07T23:04:18.845Z", + }, + expires_at: { + example: "2023-11-12T23:04:18.845Z", + }, + }, +} as const diff --git a/packages/sdks/shopper/src/client/services.gen.ts b/packages/sdks/shopper/src/client/services.gen.ts new file mode 100644 index 00000000..1b5091be --- /dev/null +++ b/packages/sdks/shopper/src/client/services.gen.ts @@ -0,0 +1,3336 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createClient, createConfig, type Options } from "@hey-api/client-fetch" +import { + type GetByContextReleaseData, + type GetByContextReleaseError, + type GetByContextReleaseResponse, + type GetByContextAllHierarchiesData, + type GetByContextAllHierarchiesError, + type GetByContextAllHierarchiesResponse, + type GetByContextHierarchyData, + type GetByContextHierarchyError, + type GetByContextHierarchyResponse, + type GetByContextHierarchyNodesData, + type GetByContextHierarchyNodesError, + type GetByContextHierarchyNodesResponse, + type GetByContextHierarchyChildNodesData, + type GetByContextHierarchyChildNodesError, + type GetByContextHierarchyChildNodesResponse, + type GetByContextAllNodesData, + type GetByContextAllNodesError, + type GetByContextAllNodesResponse, + type GetByContextNodeData, + type GetByContextNodeError, + type GetByContextNodeResponse, + type GetByContextChildNodesData, + type GetByContextChildNodesError, + type GetByContextChildNodesResponse, + type GetByContextAllProductsData, + type GetByContextAllProductsError, + type GetByContextAllProductsResponse, + type GetByContextProductData, + type GetByContextProductError, + type GetByContextProductResponse, + type GetByContextComponentProductIdsData, + type GetByContextComponentProductIdsError, + type GetByContextComponentProductIdsResponse, + type GetByContextChildProductsData, + type GetByContextChildProductsError, + type GetByContextChildProductsResponse, + type GetByContextProductsForHierarchyData, + type GetByContextProductsForHierarchyError, + type GetByContextProductsForHierarchyResponse, + type GetByContextProductsForNodeData, + type GetByContextProductsForNodeError, + type GetByContextProductsForNodeResponse, + type ConfigureByContextProductData, + type ConfigureByContextProductError, + type ConfigureByContextProductResponse, + type CreateCatalogData, + type CreateCatalogError, + type CreateCatalogResponse, + type GetCatalogsError, + type GetCatalogsResponse, + type GetCatalogByIdData, + type GetCatalogByIdError, + type GetCatalogByIdResponse, + type UpdateCatalogData, + type UpdateCatalogError, + type UpdateCatalogResponse, + type DeleteCatalogByIdData, + type DeleteCatalogByIdError, + type DeleteCatalogByIdResponse, + type PublishReleaseData, + type PublishReleaseError, + type PublishReleaseResponse, + type GetReleasesData, + type GetReleasesError, + type GetReleasesResponse, + type DeleteReleasesData, + type DeleteReleasesError, + type DeleteReleasesResponse, + type GetReleaseByIdData, + type GetReleaseByIdError, + type GetReleaseByIdResponse, + type DeleteReleaseByIdData, + type DeleteReleaseByIdError, + type DeleteReleaseByIdResponse, + type CreateRuleData, + type CreateRuleError, + type CreateRuleResponse, + type GetRulesData, + type GetRulesError, + type GetRulesResponse, + type GetRuleByIdData, + type GetRuleByIdError, + type GetRuleByIdResponse, + type UpdateRuleData, + type UpdateRuleError, + type UpdateRuleResponse, + type DeleteRuleByIdData, + type DeleteRuleByIdError, + type DeleteRuleByIdResponse, + type GetAllHierarchiesData, + type GetAllHierarchiesError, + type GetAllHierarchiesResponse, + type GetHierarchyData, + type GetHierarchyError, + type GetHierarchyResponse, + type GetHierarchyNodesData, + type GetHierarchyNodesError, + type GetHierarchyNodesResponse, + type GetHierarchyChildNodesData, + type GetHierarchyChildNodesError, + type GetHierarchyChildNodesResponse, + type GetAllNodesData, + type GetAllNodesError, + type GetAllNodesResponse, + type GetNodeData, + type GetNodeError, + type GetNodeResponse, + type GetChildNodesData, + type GetChildNodesError, + type GetChildNodesResponse, + type GetAllProductsData, + type GetAllProductsError, + type GetAllProductsResponse, + type GetProductData, + type GetProductError, + type GetProductResponse, + type GetComponentProductIdsData, + type GetComponentProductIdsError, + type GetComponentProductIdsResponse, + type GetChildProductsData, + type GetChildProductsError, + type GetChildProductsResponse, + type GetProductsForHierarchyData, + type GetProductsForHierarchyError, + type GetProductsForHierarchyResponse, + type GetProductsForNodeData, + type GetProductsForNodeError, + type GetProductsForNodeResponse, + type GetCartsData, + type GetCartsError, + type GetCartsResponse, + type CreateAcartData, + type CreateAcartError, + type CreateAcartResponse, + type GetCartData, + type GetCartError, + type GetCartResponse, + type UpdateAcartData, + type UpdateAcartError, + type UpdateAcartResponse, + type DeleteAcartData, + type DeleteAcartError, + type DeleteAcartResponse, + type GetCartItemsData, + type GetCartItemsError, + type GetCartItemsResponse, + type BulkUpdateItemsInCartData, + type BulkUpdateItemsInCartError, + type BulkUpdateItemsInCartResponse, + type ManageCartsData, + type ManageCartsError, + type ManageCartsResponse, + type DeleteAllCartItemsData, + type DeleteAllCartItemsError, + type DeleteAllCartItemsResponse, + type UpdateAcartItemData, + type UpdateAcartItemError, + type UpdateAcartItemResponse, + type DeleteAcartItemData, + type DeleteAcartItemError, + type DeleteAcartItemResponse, + type CreateAccountCartAssociationData, + type CreateAccountCartAssociationError, + type CreateAccountCartAssociationResponse, + type DeleteAccountCartAssociationData, + type DeleteAccountCartAssociationError, + type DeleteAccountCartAssociationResponse, + type CreateCustomerCartAssociationData, + type CreateCustomerCartAssociationError, + type CreateCustomerCartAssociationResponse, + type DeleteCustomerCartAssociationData, + type DeleteCustomerCartAssociationError, + type DeleteCustomerCartAssociationResponse, + type DeleteApromotionViaPromotionCodeData, + type DeleteApromotionViaPromotionCodeError, + type DeleteApromotionViaPromotionCodeResponse, + type AddTaxItemToCartData, + type AddTaxItemToCartError, + type AddTaxItemToCartResponse, + type BulkAddTaxItemsToCartData, + type BulkAddTaxItemsToCartError, + type BulkAddTaxItemsToCartResponse, + type BulkDeleteTaxItemsFromCartData, + type BulkDeleteTaxItemsFromCartError, + type BulkDeleteTaxItemsFromCartResponse, + type UpdateAtaxItemData, + type UpdateAtaxItemError, + type UpdateAtaxItemResponse, + type DeleteAtaxItemData, + type DeleteAtaxItemError, + type DeleteAtaxItemResponse, + type BulkAddCustomDiscountsToCartData, + type BulkAddCustomDiscountsToCartError, + type BulkAddCustomDiscountsToCartResponse, + type BulkDeleteCustomDiscountsFromCartData, + type BulkDeleteCustomDiscountsFromCartError, + type BulkDeleteCustomDiscountsFromCartResponse, + type UpdateCustomDiscountForCartData, + type UpdateCustomDiscountForCartError, + type UpdateCustomDiscountForCartResponse, + type DeleteCustomDiscountFromCartData, + type DeleteCustomDiscountFromCartError, + type DeleteCustomDiscountFromCartResponse, + type AddCustomDiscountToCartItemData, + type UpdateCustomDiscountForCartItemData, + type DeleteCustomDiscountFromCartItemData, + type DeleteCustomDiscountFromCartItemError, + type DeleteCustomDiscountFromCartItemResponse, + type CreateCartPaymentIntentData, + type CreateCartPaymentIntentError, + type CreateCartPaymentIntentResponse, + type CheckoutApiData, + type CheckoutApiError, + type CheckoutApiResponse, + type GetCustomerOrdersData, + type GetCustomerOrdersError, + type GetCustomerOrdersResponse, + type GetAnOrderData, + type GetAnOrderError, + type GetAnOrderResponse, + type UpdateAnOrderData, + type UpdateAnOrderError, + type UpdateAnOrderResponse, + type GetOrderItemsData, + type GetOrderItemsError, + type GetOrderItemsResponse, + type AnonymizeOrdersData, + type AnonymizeOrdersError, + type AnonymizeOrdersResponse, + type AuthorizeSetupData, + type AuthorizeSetupError, + type AuthorizeSetupResponse, + type ConfirmSetupData, + type ConfirmSetupError, + type ConfirmSetupResponse, + type CaptureAtransactionData, + type CaptureAtransactionError, + type CaptureAtransactionResponse, + type RefundAtransactionData, + type RefundAtransactionError, + type RefundAtransactionResponse, + type GetOrderTransactionsData, + type GetOrderTransactionsError, + type GetOrderTransactionsResponse, + type GetAtransactionData, + type GetAtransactionError, + type GetAtransactionResponse, + type CancelAtransactionData, + type CancelAtransactionError, + type CancelAtransactionResponse, + GetByContextReleaseResponseTransformer, + GetByContextAllHierarchiesResponseTransformer, + GetByContextHierarchyResponseTransformer, + GetByContextHierarchyNodesResponseTransformer, + GetByContextHierarchyChildNodesResponseTransformer, + GetByContextAllNodesResponseTransformer, + GetByContextNodeResponseTransformer, + GetByContextChildNodesResponseTransformer, + GetByContextAllProductsResponseTransformer, + GetByContextProductResponseTransformer, + GetByContextChildProductsResponseTransformer, + GetByContextProductsForHierarchyResponseTransformer, + GetByContextProductsForNodeResponseTransformer, + ConfigureByContextProductResponseTransformer, + CreateCatalogResponseTransformer, + GetCatalogsResponseTransformer, + GetCatalogByIdResponseTransformer, + UpdateCatalogResponseTransformer, + PublishReleaseResponseTransformer, + GetReleasesResponseTransformer, + GetReleaseByIdResponseTransformer, + CreateRuleResponseTransformer, + GetRulesResponseTransformer, + GetRuleByIdResponseTransformer, + UpdateRuleResponseTransformer, + GetAllHierarchiesResponseTransformer, + GetHierarchyResponseTransformer, + GetHierarchyNodesResponseTransformer, + GetHierarchyChildNodesResponseTransformer, + GetAllNodesResponseTransformer, + GetNodeResponseTransformer, + GetChildNodesResponseTransformer, + GetAllProductsResponseTransformer, + GetProductResponseTransformer, + GetChildProductsResponseTransformer, + GetProductsForHierarchyResponseTransformer, + GetProductsForNodeResponseTransformer, +} from "./types.gen" + +export const client = createClient(createConfig()) + +/** + * Get the catalog release as shoppers + * Returns a list of all published releases of the specified catalog. + */ +export const getByContextRelease = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetByContextReleaseResponse, + GetByContextReleaseError, + ThrowOnError + >({ + ...options, + url: "/catalog", + responseTransformer: GetByContextReleaseResponseTransformer, + }) +} + +/** + * Get all Hierarchies + * Returns all hierarchies from a catalog. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextAllHierarchies = < + ThrowOnError extends boolean = false, +>( + options?: Options, +) => { + return (options?.client ?? client).get< + GetByContextAllHierarchiesResponse, + GetByContextAllHierarchiesError, + ThrowOnError + >({ + ...options, + url: "/catalog/hierarchies", + responseTransformer: GetByContextAllHierarchiesResponseTransformer, + }) +} + +/** + * Get a Hierarchy + * Returns a hierarchy from the catalog. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog to retrieve. For information about how catalog rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules). + * + */ +export const getByContextHierarchy = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextHierarchyResponse, + GetByContextHierarchyError, + ThrowOnError + >({ + ...options, + url: "/catalog/hierarchies/{hierarchy_id}", + responseTransformer: GetByContextHierarchyResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Nodes + * Returns all the nodes for the specified hierarchy. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextHierarchyNodes = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextHierarchyNodesResponse, + GetByContextHierarchyNodesError, + ThrowOnError + >({ + ...options, + url: "/catalog/hierarchies/{hierarchy_id}/nodes", + responseTransformer: GetByContextHierarchyNodesResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Children + * Returns the parent nodes for the specified hierarchy. + * + * ![Parent Nodes](/assets/rootnodes.PNG) + * + * If you have multiple catalog rules defined, the rule that best matches the shopperʼs context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * For more information, see [Filtering](/guides/Getting-Started/filtering). + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextHierarchyChildNodes = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextHierarchyChildNodesResponse, + GetByContextHierarchyChildNodesError, + ThrowOnError + >({ + ...options, + url: "/catalog/hierarchies/{hierarchy_id}/children", + responseTransformer: GetByContextHierarchyChildNodesResponseTransformer, + }) +} + +/** + * Get all Nodes + * Returns all nodes in the catalog. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. For more information, see [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + * + * The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + * + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + * + * | Operator | Description | Attributes | Example | + * | --- | --- | --- | --- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + * | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + * | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextAllNodes = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetByContextAllNodesResponse, + GetByContextAllNodesError, + ThrowOnError + >({ + ...options, + url: "/catalog/nodes", + responseTransformer: GetByContextAllNodesResponseTransformer, + }) +} + +/** + * Get a Node + * Returns a node from the catalog. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The response lists the products associated with a node. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your nodes, enabling you to create unique product collections in your storefront. + * + * - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + * - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - A product that is curated has the `"curated_product": true` attribute displayed. + * - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + * + */ +export const getByContextNode = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextNodeResponse, + GetByContextNodeError, + ThrowOnError + >({ + ...options, + url: "/catalog/nodes/{node_id}", + responseTransformer: GetByContextNodeResponseTransformer, + }) +} + +/** + * Get a Node's Children + * Returns the child nodes for a node in the catalog. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see which parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + * + * - If you don't provide any curated_products, products are listed by their updated_at time in descending order, with the most recently updated product first. + * - If you configure curated_products for only a few products, the curated products are displayed first and the other products are displayed in the order of updated_at time. + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - A product that is curated has the "curated_product": true attribute displayed. + * - If a curated product is removed from a node, the product is also removed from the curated_products list. + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + * + * | Operator | Description | Attributes | Example | + * | --- | --- | --- | --- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + * | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + * | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextChildNodes = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextChildNodesResponse, + GetByContextChildNodesError, + ThrowOnError + >({ + ...options, + url: "/catalog/nodes/{node_id}/relationships/children", + responseTransformer: GetByContextChildNodesResponseTransformer, + }) +} + +/** + * Get all Products + * Retrieves the list of products from the catalog. Only the products in a live status are retrieved. + * + * ### Catalog Rules + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * ### Product and Node Associations + * + * You can see the parent nodes a product is associated within the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getByContextAllProducts = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetByContextAllProductsResponse, + GetByContextAllProductsError, + ThrowOnError + >({ + ...options, + url: "/catalog/products", + responseTransformer: GetByContextAllProductsResponseTransformer, + }) +} + +/** + * Get a Product + * Returns the specified product from the catalog. The product must be in the `live` status. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getByContextProduct = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextProductResponse, + GetByContextProductError, + ThrowOnError + >({ + ...options, + url: "/catalog/products/{product_id}", + responseTransformer: GetByContextProductResponseTransformer, + }) +} + +/** + * Get a Bundle's Component Products + * With Product Experience Manager, you can [create](/docs/api/pxm/products/create-product) and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + * + * You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + * + * This endpoint returns a list of component product IDs for the specified bundle. + * + */ +export const getByContextComponentProductIds = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextComponentProductIdsResponse, + GetByContextComponentProductIdsError, + ThrowOnError + >({ + ...options, + url: "/catalog/products/{product_id}/relationships/component_products", + }) +} + +/** + * Get a Parent Product's Child Products + * For a specified product and catalog release, retrieves a list of child products from a parent product. Any product other than a base product results in a `422 Unprocessable Entity` response. Only the products in a `live` status are retrieved. + * + * If you have multiple catalog rules defined, the rule that best matches the shopperʼs context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated within the `breadcrumbs` metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getByContextChildProducts = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextChildProductsResponse, + GetByContextChildProductsError, + ThrowOnError + >({ + ...options, + url: "/catalog/products/{product_id}/relationships/children", + responseTransformer: GetByContextChildProductsResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Products + * Returns the products associated with the specified hierarchy in the catalog. The products must be in the live status. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * `files` | Optional | Any files associated with a product. | + * + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getByContextProductsForHierarchy = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextProductsForHierarchyResponse, + GetByContextProductsForHierarchyError, + ThrowOnError + >({ + ...options, + url: "/catalog/hierarchies/{hierarchy_id}/products", + responseTransformer: GetByContextProductsForHierarchyResponseTransformer, + }) +} + +/** + * Get a Node's Products + * Returns the products associated with the specified hierarchy node in the catalog. The products must be in the `live` status. If the products have been curated then the products are returned in the order specified in the `curated_products` attribute. A product that is curated has the `"curated_product": true` attribute displayed. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getByContextProductsForNode = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).get< + GetByContextProductsForNodeResponse, + GetByContextProductsForNodeError, + ThrowOnError + >({ + ...options, + url: "/catalog/nodes/{node_id}/relationships/products", + responseTransformer: GetByContextProductsForNodeResponseTransformer, + }) +} + +/** + * Configure a Shopper Bundle + * Once you have configured your product bundles, you can display them in your storefront in your published catalog. Depending on how you have configured the minimum and maximum values for the product options in your components, you can allow your shoppers to choose which products they want to select. For example, you can enable a shopper to select 1 or more product options from a list of 10, giving your shoppers greater flexibility when selecting products in your store front. + * + * - Products must be in a `live` status. + * - If you have not specified any minimum or maximum values for the product options in your components, your shoppers can select any combination of product options. + * + * If you have configured minimum and maximum values using [Create a Bundle](/docs/api/pxm/products/create-product), this becomes part of the `bundle_configuration`. You can check how your bundle is configured using [Get a product in a catalog release](/docs/api/pxm/catalog/get-product) in `bundle_configuration` under `meta`. The `bundle_configuration` forms the body of the request. + * + * The response updates the `bundle_configuration` with the product options the shopper selects. The `meta` data is updated with the `meta` data of the selected product options. In your storefront, you could display this as a summary of the product options a shopper has selected. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const configureByContextProduct = ( + options: Options, +) => { + return (options?.client ?? client).post< + ConfigureByContextProductResponse, + ConfigureByContextProductError, + ThrowOnError + >({ + ...options, + url: "/catalog/products/{product_id}/configure", + responseTransformer: ConfigureByContextProductResponseTransformer, + }) +} + +/** + * Creates a new catalog + * Before you create a catalog, you must define the following resources: + * + * - Hierarchies - hierarchies and nodes to categorize the products. + * - Products - product information, associated assets, and links to hierarchy nodes. + * - Price Books - prices for the products associated with the hierarchies. You can create multiple price books for different scenarios, such as seasonal sales, business versus retail customer pricing, and reward programs. When creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books. Priority is a number and the price book with the highest number has the highest priority. + * + */ +export const createCatalog = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateCatalogResponse, + CreateCatalogError, + ThrowOnError + >({ + ...options, + url: "/catalogs", + responseTransformer: CreateCatalogResponseTransformer, + }) +} + +/** + * Gets all authorized catalogs + * Retrieves a list of all the catalogs that you are authorized to view. Currently, published catalogs are limited to the current release and two releases prior to the current release. You can see the differences between the last 2 consecutive catalog releases using the delta link returned in the response of a [publish a catalog](/docs/api/pxm/catalog/publish-release) endpoint. + * + * You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before publishing a catalog release and injecting fresh data in a delta link. The `is_full_delta` attribute tells you if this is a full publish of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. See [Publish a catalog](/docs/api/pxm/catalog/publish-release). + * + * If the `is_full_publish` attribute returned in the response is `false`, data from the previous catalog release overlaid the existing data in the delta file. The `is_full_publish` attribute is always `true` the first time a catalog is published. + * + */ +export const getCatalogs = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetCatalogsResponse, + GetCatalogsError, + ThrowOnError + >({ + ...options, + url: "/catalogs", + responseTransformer: GetCatalogsResponseTransformer, + }) +} + +/** + * Get a catalog by ID + * Retrieves the specified catalog. + */ +export const getCatalogById = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetCatalogByIdResponse, + GetCatalogByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}", + responseTransformer: GetCatalogByIdResponseTransformer, + }) +} + +/** + * Updates a catalog + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog is not updated. + */ +export const updateCatalog = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateCatalogResponse, + UpdateCatalogError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}", + responseTransformer: UpdateCatalogResponseTransformer, + }) +} + +/** + * Deletes a catalog + * Deletes an unpublished catalog. Use [**Delete a Release**](/docs/api/pxm/catalog/delete-release-by-id) and [**Delete All Releases**](/docs/api/pxm/catalog/delete-releases) to delete releases of a catalog. If the catalog is associated with any catalog rules, you must first update the catalog rules to remove the catalog. + */ +export const deleteCatalogById = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteCatalogByIdResponse, + DeleteCatalogByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}", + }) +} + +/** + * Publishes a catalog + * Publishes a catalog. You must publish a catalog before you can retrieve that catalog in an organization or store. The hierarchies, live products, and prices associated with a published catalog are in read-only mode. If you make a change to these resources, for example, a change to your price book or hierarchies, you need to republish the catalog. + * + * You can get [a catalog release](/docs/api/pxm/catalog/get-release-by-id) to retrieve a published catalog. Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * You can see the differences between the last 2 consecutive catalog releases. This is useful if want to understand how your products have changed in your catalog, ensuring your site search integration is kept up-to-date. + * + * Once a catalog release has completed publishing, the delta relationship links to the delta document. + * + * The `delta` links are signed and only valid for 1 hour. Re-reading a catalog release, for example, using [Getting a release of a catalog](/docs/pxm/catalogs/catalog-latest-release/get-a-release-of-a-catalog) returns a fresh a link. + * + * You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before injecting fresh data in a `delta` link. The `is_full_delta` attribute tells you if this is a full publish of the catalog. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before injecting fresh data from the `delta` file. If the `is_full_delta` attribute is `false`, then data from the previous catalog overlays the existing data in the `delta` file. To publish a catalog and inject fresh data in a `delta` link, set `export_full_delta` to `true`. + * + * If a previous catalog publish date is greater than 90 days, then a full catalog publish is automatically performed. If you publish your catalogs infrequently, Commerce may perform a full publish when you are expecting a delta publish. + * + * :::caution + * + * Generating a full delta is resource intensive and slows down the publishing process and so should only be performed in certain circumstances, for example, when initializing an integration with a service like Algolia. + * + * ::: + * + * The `is_full_delta` attribute is always `true` the first time a catalog is published. The information is stored in a collection of `json` documents in a compressed file. You can either manually check the file or, for example, use them to automatically update another company system you may have. + * + * - Delta files are only available for 30 days. + * - Delta files are removed when a catalog release is deleted. + * + * Each document has a `delta_type` with one of the following values, depending on whether a product has been deleted, updated or created in a catalog release. + * + * - `delete` describes products deleted from this release of a catalog. + * - `createupdate` describes products updated in this release of a catalog. + * + * ### Multi-Store Management Solutions + * + * In a multi-store management solution. + * + * - You can create organization catalogs. Your organization catalogs are available for your stores to use. + * - Your stores can create their own catalogs. + * - Your stores can create catalogs that have a combination of organization products and store products. + * + * If you are publishing a catalog in a store that contains resources from an organization, in Commerce Manager, you must enable the **Include Organization Resources in Catalog Publishes** checkbox. + * + * 1. Go to **SYSTEM** > **Store Settings**. + * 2. Click **General Settings**. + * 3. Select **PXM** from the list. + * 4. Select the **Include Organization Resources in Catalog Publishes** checkbox. + * + */ +export const publishRelease = ( + options: Options, +) => { + return (options?.client ?? client).post< + PublishReleaseResponse, + PublishReleaseError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases", + responseTransformer: PublishReleaseResponseTransformer, + }) +} + +/** + * Gets all authorized catalog releases + * Returns a list of all published releases of the specified catalog. Currently, published catalogs are limited to the current release and two releases prior to the current release. You can see the differences between the last 2 consecutive catalog releases using the `delta` link returned in the response of a `publish a catalog` endpoint. + * + * You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before publishing a catalog release and injecting fresh data in a delta link. The `is_full_delta` attribute tells you if this is a full publish of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. + * + * If the `is_full_publish` attribute returned in the response is `false`, data from the previous catalog release overlaid the existing data in the delta file. The `is_full_publish` attribute is always `true` the first time a catalog is published. + * + */ +export const getReleases = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetReleasesResponse, + GetReleasesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases", + responseTransformer: GetReleasesResponseTransformer, + }) +} + +/** + * Deletes all releases + * Deletes all releases of the specified published catalog. + */ +export const deleteReleases = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteReleasesResponse, + DeleteReleasesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases", + }) +} + +/** + * Get a catalog release by ID + * Retrieves the specified catalog release. + */ +export const getReleaseById = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetReleaseByIdResponse, + GetReleaseByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}", + responseTransformer: GetReleaseByIdResponseTransformer, + }) +} + +/** + * Deletes a release + * Deletes the specified published catalog release. + */ +export const deleteReleaseById = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteReleaseByIdResponse, + DeleteReleaseByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}", + }) +} + +/** + * Creates a new catalog rule + * If you have multiple catalogs, create catalog rule resources. With catalog rules, you can display different catalogs to different shoppers. For example, you can display a preferred pricing catalog to a few special customers. Or you can display one catalog to shoppers using your website and a different catalog to shoppers using your mobile app. Finally, you can define custom criteria by creating tags. + * + * :::note + * + * - If you have one catalog for all customers and channels, you can omit creating this resource. + * - Due to the way catalogs are cached in Commerce, using catalog rules to display catalogs sometimes causes a 5-minute time delay before the catalogs are displayed. + * - You cannot create catalog rules for organization catalogs. + * + * ::: + * + * For ideas about the kinds of business scenarios you can achieve with catalog rules, see [Catalog Rules](/docs/api/pxm/catalog/rules). To understand how catalogs are matched to shoppers by using rules, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + */ +export const createRule = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateRuleResponse, + CreateRuleError, + ThrowOnError + >({ + ...options, + url: "/catalogs/rules", + responseTransformer: CreateRuleResponseTransformer, + }) +} + +/** + * Gets all authorized catalog rules + * Retrieves all authorized catalog rules. + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are supported. + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + */ +export const getRules = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetRulesResponse, + GetRulesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/rules", + responseTransformer: GetRulesResponseTransformer, + }) +} + +/** + * Get a catalog rule by ID + */ +export const getRuleById = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetRuleByIdResponse, + GetRuleByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/rules/{catalog_rule_id}", + responseTransformer: GetRuleByIdResponseTransformer, + }) +} + +/** + * Updates a catalog rule + * Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog rule is not updated. + */ +export const updateRule = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateRuleResponse, + UpdateRuleError, + ThrowOnError + >({ + ...options, + url: "/catalogs/rules/{catalog_rule_id}", + responseTransformer: UpdateRuleResponseTransformer, + }) +} + +/** + * Deletes a catalog rule + */ +export const deleteRuleById = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteRuleByIdResponse, + DeleteRuleByIdError, + ThrowOnError + >({ + ...options, + url: "/catalogs/rules/{catalog_rule_id}", + }) +} + +/** + * Get all Hierarchies + * Returns the hierarchies from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getAllHierarchies = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllHierarchiesResponse, + GetAllHierarchiesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/hierarchies", + responseTransformer: GetAllHierarchiesResponseTransformer, + }) +} + +/** + * Get a Hierarchy + * Returns the specified hierarchy from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + */ +export const getHierarchy = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetHierarchyResponse, + GetHierarchyError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}", + responseTransformer: GetHierarchyResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Nodes + * Returns all nodes for the specified hierarchy from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getHierarchyNodes = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetHierarchyNodesResponse, + GetHierarchyNodesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/nodes", + responseTransformer: GetHierarchyNodesResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Children + * Returns the parent nodes for the specified hierarchy from a published catalog. + * + * ![Parent Nodes](/assets/rootnodes.PNG) + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + * + * | Operator | Description | Supported Attributes | Example | + * |:--- |:--- |:--- |:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getHierarchyChildNodes = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetHierarchyChildNodesResponse, + GetHierarchyChildNodesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/children", + responseTransformer: GetHierarchyChildNodesResponseTransformer, + }) +} + +/** + * Get all Nodes + * Returns the child nodes from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. See [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + * + * The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + * + * - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + * - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + * - A product that is curated has the `"curated_product": true` attribute displayed. + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + * + * | Operator | Description | Attributes | Example | + * | --- | --- | --- | --- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + * | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + * | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getAllNodes = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllNodesResponse, + GetAllNodesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/nodes", + responseTransformer: GetAllNodesResponseTransformer, + }) +} + +/** + * Get a Node + * Returns a node from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + * + * - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + * - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + * - A product that is curated has the `"curated_product": true` attribute displayed. + * + */ +export const getNode = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetNodeResponse, + GetNodeError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}", + responseTransformer: GetNodeResponseTransformer, + }) +} + +/** + * Get a Node's Children + * Returns the child nodes for a node from a published catalog. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. For more information, see [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + * + * The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + * + * - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + * - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + * - You can only curate 20 products or less. You cannot have more than 20 curated products. + * - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + * - A product that is curated has the `"curated_product": true` attribute displayed. + * + * ### Filtering + * + * This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + * + * | Operator | Description | Attributes | Example | + * | --- | --- | --- | --- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + * | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + * | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getChildNodes = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetChildNodesResponse, + GetChildNodesError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/children", + responseTransformer: GetChildNodesResponseTransformer, + }) +} + +/** + * Get all Products + * Returns the products from a published catalog. Only the products in a `live` status are retrieved. Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the [Get a List of products in a catalog release](/docs/api/pxm/catalog/get-all-products) response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + */ +export const getAllProducts = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAllProductsResponse, + GetAllProductsError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/products", + responseTransformer: GetAllProductsResponseTransformer, + }) +} + +/** + * Get a Product + * Returns a product from a published catalog. The product must be in `live` status. Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ### Product and Node Associations in Breadcrumb Metadata + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Product Variations + * + * The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order`attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the get a product in a catalog release response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getProduct = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductResponse, + GetProductError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/products/{product_id}", + responseTransformer: GetProductResponseTransformer, + }) +} + +/** + * Get a Bundle's Component Products + * With Product Experience Manager, you can [create](/docs/api/pxm/products/create-product) and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + * + * You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + * + * This endpoint returns a list of component product IDs for the specified bundle. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getComponentProductIds = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetComponentProductIdsResponse, + GetComponentProductIdsError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/component_products", + }) +} + +/** + * Get a Parent Product's Child Products + * For a specified product and catalog release, retrieves a list of child products from a parent product. Any product other than a base product results in a `422 Unprocessable Entity` response. Only the products in a `live` status are retrieved. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated within the breadcrumbs metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getChildProducts = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetChildProductsResponse, + GetChildProductsError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/children", + responseTransformer: GetChildProductsResponseTransformer, + }) +} + +/** + * Get a Hierarchy's Products + * Returns the products associated with the specified hierarchy in the catalog. The products must be in the `live` status. + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The variations object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in variations. Once a parent product is published in a catalog, the [Get a List of products in a catalog](/docs/api/pxm/catalog/get-all-products) release response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getProductsForHierarchy = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductsForHierarchyResponse, + GetProductsForHierarchyError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/products", + responseTransformer: GetProductsForHierarchyResponseTransformer, + }) +} + +/** + * Get a Node's Products + * Returns the products associated with the specified hierarchy node in the catalog. The products must be in the `live` status. If the products have been curated, then the products are returned in the order specified in the `curated_products` attribute. A product that is curated has the `"curated_product": true` attribute displayed. + * + * :::note + * + * Currently, published catalogs are limited to the current release and two releases prior to the current release. + * + * ::: + * + * If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + * + * You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + * + * The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the [Get a List of products in a catalog release](/docs/api/pxm/catalog/get-all-products) response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + * + * ### Filtering + * + * This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + * + * | Operator | Description | Supported Attributes | Example | + * |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + * | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + * | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + * + * ### Building breadcrumbs in a storefront + * + * In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + * + * `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + * + * - Specify the node Ids in the filter expression. + * - You can have as many node Ids as you want. + * - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + * + * ### Including Resources + * + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + * + * | Parameter | Required | Description | + * | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + * | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + * | `main_image` | Optional | The main images associated with a product. | + * | `files` | Optional | Any files associated with a product. | + * + * See [**Including Resources**](/guides/Getting-Started/includes). + * + */ +export const getProductsForNode = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetProductsForNodeResponse, + GetProductsForNodeError, + ThrowOnError + >({ + ...options, + url: "/catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/products", + responseTransformer: GetProductsForNodeResponseTransformer, + }) +} + +/** + * Get Shopper Carts + * You can retrieve the carts that are associated with an [account](/docs/api/carts/account-cart-associations) or a [customer](/docs/api/carts/customer-cart-associations). + * + * When a shopper retrieves their latest carts, the carts are sorted in descending order by the updated_date. For more information, see [Pagination](/guides/Getting-Started/pagination). + * + * :::note + * + * Requires an `implicit` token with only one of [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) or [customer token](/docs/customer-management/customer-management-api/customer-tokens). + * + * ::: + * + */ +export const getCarts = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetCartsResponse, + GetCartsError, + ThrowOnError + >({ + ...options, + url: "/v2/carts", + }) +} + +/** + * Create a Cart + * + * Creates a cart. Call this endpoint each time a customer creates a cart. + * + * Each shopper can have multiple carts. Use the carts API to create a cart. The carts are distinct from one another. Shoppers can add different items to their carts. They can check out one of the carts without affecting the content or status of their other carts. + * + * After the shopper checks out the cart, the cart remains available to the shopper. The cart is persistent and stays with the shopper after it is used. + * + * You can also create a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Update Cart Settings](/docs/api/settings/put-v-2-settings-cart). + * + * ### Preview Cart + * + * You can set a future date for your shopping cart and view the promotions that will be available during that time period. This feature enables you to validate your promotion settings and observe how they will be applied in the cart. + * + * :::caution + * - Once the cart is in preview mode, you cannot revert it to a regular cart. + * - Carts with `snapshot_date` are same as preview carts. + * - You cannot checkout a cart that includes a `snapshot_date`. + * - To delete a promotion preview cart, use [Delete a cart](/docs/api/carts/delete-a-cart) endpoint. + * - The promotion preview cart has the same expiration time as a regular cart based on the store's [cart settings](/docs/api/settings/put-v-2-settings-cart). + * - Preview cart interactions skip inventory checks and events, allowing users to preview future carts without impacting related external systems. + * ::: + * + * ### Errors + * + * - `400 Bad Request` : This is returned when the submitted request does not adhere to the expected API contract for the endpoint. + * + * - For example, in the case of string fields, this error might indicate issues in the length or format of submitted strings. For more information about valid string fields, refer to Safe Characters section. + * - In the case of preview carts (those with `snapshot_date`), an error is returned for invalid actions, such as removing the preview date, setting a preview date in the past, or attempting to checkout a cart with a `snapshot_date`. + * + */ +export const createAcart = ( + options?: Options, +) => { + return (options?.client ?? client).post< + CreateAcartResponse, + CreateAcartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts", + }) +} + +/** + * Get a Cart + * Use this endpoint to retrieve a specific cart. If a cart ID does not exist, a new cart will be automatically created. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the `relationships` section. + * + * You can easily get a new or existing cart by providing the unique cart reference in the request. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the relationships section. + * + * :::note + * + * - The default cart name is Cart. However, you can update the cart name as required. Ensure that the string length of the name is greater than or equal to one. Follow the safe character guidelines for name and description naming. For more information about cart ID naming requirements, see the [Safe Characters](/guides/Getting-Started/safe-characters) section. + * - Outside of the JS-SDK, we don’t handle creating cart references. You need to create your own. + * + * ::: + * + * :::caution + * + * An empty cart is returned for any carts that don’t currently exist. For more information about the cart items object, see [Get Cart Items](/docs/api/carts/get-cart-items). + * + * ::: + * + * ### Query parameters + * + * + * | Name | Required | Type | Description | + * |:----------|:---------|:---------|:-------------------------------------------| + * | `include` | Optional | `string` | Comma-delimited string of entities that can be included. The information included are `items`,`tax_items`, `custom_discounts`, or `promotions`. | + * + */ +export const getCart = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetCartResponse, + GetCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}", + }) +} + +/** + * Update a Cart + * Updates cart properties for the specified cartID. + * + * You can also update a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + * + */ +export const updateAcart = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateAcartResponse, + UpdateAcartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}", + }) +} + +/** + * Delete a Cart + * You can delete a cart, including the items, name, description, and remove all associations. + * + * ### Errors + * + * The following error message is received when you attempt to delete a cart that is associated with a customer. Before deletion, ensure that the cart is disassociated. + * + * ```json + * message: { + * errors: [ + * { + * status: 400, + * title: 'Last cart', + * detail: 'This is the last cart associated with a customer and it cannot be deleted, try disassociating instead' + * } + * ] + * } + * ```` + * + */ +export const deleteAcart = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteAcartResponse, + DeleteAcartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}", + }) +} + +/** + * Get Cart Items + * + * Use this endpoint to retrieve cart items. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs. + * + * You can use this endpoint to retrieve the breakdown of cart items by promotion ID. For example, if you have Promotions Standard item discount with code *sale2024*, Rule Promotions item discount with code *sale2024*, and Rule Promotions cart discount with code *sale2024*, the `discounts.constituents` field in the response example will show the breakdown of the same promotion code used in both Promotions Standard and Rule Promotions. + * + * ```json + * "data": [ + * { + * "id": "98de010d-dd10-4fa5-a070-0b9bcdc72974", + * "type": "cart_item", + * "product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c", + * "name": "sku1", + * "description": "sku1", + * "sku": "sku1", + * "slug": "sku1", + * "image": { + * "mime_type": "", + * "file_name": "", + * "href": "" + * }, + * "quantity": 1, + * "manage_stock": false, + * "unit_price": { + * "amount": 10000, + * "currency": "USD", + * "includes_tax": false + * }, + * "value": { + * "amount": 10000, + * "currency": "USD", + * "includes_tax": false + * }, + * "discounts": [ + * { + * "amount": { + * "amount": -2000, + * "currency": "USD", + * "includes_tax": false + * }, + * "code": "sale2024", + * "id": "e4d929d5-f471-4317-9a86-a84a6c572b44", + * "promotion_source": "rule-promotion", + * "is_cart_discount": true + * }, + * { + * "amount": { + * "amount": -1000, + * "currency": "USD", + * "includes_tax": false + * }, + * "code": "sale2024", + * "id": "de19a043-a6da-4bde-b896-d17e16b77e25", + * "promotion_source": "rule-promotion" + * }, + * { + * "amount": { + * "amount": -1000, + * "currency": "USD", + * "includes_tax": false + * }, + * "code": "sale2024", + * "id": "509295ee-2971-45b6-801e-95df09756989" + * }, + * { + * "amount": { + * "amount": -1000, + * "currency": "USD", + * "includes_tax": false + * }, + * "code": "sale2024", + * "id": "ca79e606-7ecd-41ac-9478-af4c8c28c546", + * "promotion_source": "rule-promotion", + * "is_cart_discount": true + * } + * ], + * "links": { + * "product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c" + * }, + * "meta": { + * "display_price": { + * "with_tax": { + * "unit": { + * "amount": 5000, + * "currency": "USD", + * "formatted": "$50.00" + * }, + * "value": { + * "amount": 5000, + * "currency": "USD", + * "formatted": "$50.00" + * } + * }, + * "without_tax": { + * "unit": { + * "amount": 5000, + * "currency": "USD", + * "formatted": "$50.00" + * }, + * "value": { + * "amount": 5000, + * "currency": "USD", + * "formatted": "$50.00" + * } + * }, + * "tax": { + * "unit": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * }, + * "value": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * } + * }, + * "discount": { + * "unit": { + * "amount": -5000, + * "currency": "USD", + * "formatted": "-$50.00" + * }, + * "value": { + * "amount": -5000, + * "currency": "USD", + * "formatted": "-$50.00" + * } + * }, + * "without_discount": { + * "unit": { + * "amount": 10000, + * "currency": "USD", + * "formatted": "$100.00" + * }, + * "value": { + * "amount": 10000, + * "currency": "USD", + * "formatted": "$100.00" + * } + * }, + * "discounts": { + * "sale2024": { + * "amount": -5000, + * "currency": "USD", + * "formatted": "-$50.00", + * "constituents": { + * "509295ee-2971-45b6-801e-95df09756989": { + * "amount": -1000, + * "currency": "USD", + * "formatted": "-$10.00" + * }, + * "ca79e606-7ecd-41ac-9478-af4c8c28c546": { + * "amount": -1000, + * "currency": "USD", + * "formatted": "-$10.00" + * }, + * "de19a043-a6da-4bde-b896-d17e16b77e25": { + * "amount": -1000, + * "currency": "USD", + * "formatted": "-$10.00" + * }, + * "e4d929d5-f471-4317-9a86-a84a6c572b44": { + * "amount": -2000, + * "currency": "USD", + * "formatted": "-$20.00" + * } + * } + * } + * } + * }, + * "timestamps": { + * "created_at": "2024-05-24T18:00:58Z", + * "updated_at": "2024-05-24T18:00:58Z" + * } + * }, + * "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781", + * "catalog_source": "pim" + * } + * ``` + * + */ +export const getCartItems = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetCartItemsResponse, + GetCartItemsError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items", + }) +} + +/** + * Bulk Update Items in Cart + * The bulk update feature allows shoppers to update an array of items to their cart in one action, rather than updating each item one at a time. Shoppers can update quantity and shipping group details in bulk requests. This minimizes the time for shoppers while updating items to their cart. Shoppers can even update multiple items with the same or different shipping groups to their cart. + * + * When you update multiple items that qualify for free gifts in the cart, the corresponding free gifts for all eligible products are also automatically updated in the cart. + * + */ +export const bulkUpdateItemsInCart = ( + options: Options, +) => { + return (options?.client ?? client).put< + BulkUpdateItemsInCartResponse, + BulkUpdateItemsInCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items", + }) +} + +/** + * Manage Carts + * + * ### Add Product to Cart + * + * Adding a Product to Cart is the most common Cart action. If you want to add any custom products or promotions, you need to do that as a separate action. + * + * #### Dynamic Bundles + * + * A bundle is a purchasable product that is composed of a combination of two or more products that you want to sell together. You can create multiple components within a bundle. Each component can have one or more options. Each option is a product and a quantity. You can configure minimum and/or maximum values for the number of product options in a component that your shoppers can select. For example, you can enable a shopper to select 1 or more product options from a list of 10. These are called [dynamic bundles](/docs/api/pxm/products/products#dynamic-bundles). + * + * Your dynamic bundles are displayed in your published catalogs. + * + * 1. Use the configure a shopper endpoint to allow shoppers to make their selections from a bundle. + * 2. In the response of the configure a shopper, the `bundle_configuration` object contains the bundle selections a shopper has made. + * 3. In the add a product to cart request, use the `bundle_configuration` object to add the customers selections to a cart. + * + * ```json + * "bundle_configuration": { + * "selected_options": { + * "games": { + * "d7b79eb8-19d8-45ea-86ed-2324a604dd9c": 1 + * }, + * "toys": { + * "0192ccdd-6d33-4898-87d7-c4d87f2bf8ea": 1, + * "1aea6f97-f0d9-452c-b3c1-7fb5629ead82": 1 + * } + * } + * } + * ``` + * + * When a cart is checked out, the options a shopper selected are added to the order. See [order items](/docs/api/carts/get-order-items). + * + * #### Personalized Products + * + * You can allow shoppers to personalize their goods by adding custom text inputs to products directly. This feature is particularly useful for customizable items, such as personalized T-shirts or greeting cards. You can use this functionality by leveraging the `custom_inputs` attribute, and defining the details and validation rules for the custom text. + * + * First, you must configure a `custom_inputs` attribute when creating a new product or updating an existing product. Once you have defined your custom inputs on a product, you must configure the custom inputs in your orders. + * + * For example, you may sell T-shirts that can have personalized text on the front and back of the shirt. + * + * ```json + * { + * "data": { + * "type": "product", + * "attributes": { + * "custom_inputs": { + * "front": { + * "name": "T-Shirt Front", + * "validation_rules": [ + * { + * "type": "string", + * "options": { + * "max_length": 50 + * } + * } + * ], + * "required": false + * }, + * "back": { + * "name": "T-Shirt Back", + * "validation_rules": [ + * { + * "type": "string", + * "options": { + * "max_length": 50 + * } + * } + * ], + * "required": false + * } + * } + * } + * } + * } + * ``` + * + * If the same product has different `custom_inputs` attributes, then these are added as separate items in a cart. + * + * The `custom_inputs` attribute is stored in the cart item and the text for `custom_input` must not exceed 255 characters in length. When a cart is checked out, the `custom_inputs` attribute becomes part of the order. + * + * #### Limitations on Usage of `custom_inputs` with Specific Promotion Types + * + * When you add products to a cart with `custom_inputs`, there are certain limitations on usage of the `custom_inputs` with the following promotion types: + * + * - For [Free Gift Promotions](/docs/api/promotions/create-a-promotion), you can add `custom_inputs` to gift items. + * - For [Fixed Bundle Discount Promotions](/docs/api/promotions/create-a-promotion), the promotion applies as long as the cart contains the bundle SKUs even when there are different `custom_inputs`. + * - For [X for Y Discount Promotion and X for amount discount promotion](/docs/api/promotions/create-a-promotion), the promotion applies when there are two SKUs with the same `custom_inputs`. The promotion does not apply when there are different `custom_inputs` and the SKUs are in different line items. + * + * :::note + * + * - Any requests to add a product to cart returns the collection of cart items. + * - [Tax items](/docs/api/carts/tax-items) may optionally be added with the product. Only administrators with [client credentials](/docs/authentication/Tokens/client-credential-token) are able to do this. If included, they replace any existing taxes on the product. + * - The cart currency is set when the first item is added to the cart. + * - The product being added to the cart requires a price in the same currency as the other items in the cart. The API returns a 400 error if a price is not defined in the correct currency. + * - A cart can contain a maximum of 100 unique items. Items include products, custom items, tax items, and promotions. + * - There are a number of actions that happen to your inventory when checking out and paying for an order. For more information, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) documentation. + * + * ::: + * + * ### Add Custom Item to Cart + * + * You can add a custom item to the cart when you don't manage things like shipping, taxes and inventory in Commerce. + * + * For [Shipping Groups](/docs/ship-groups/shipping-groups), once you have created a [cart shipping group](/docs/ship-groups/shipping-groups/shipping-groups-api/create-cart-shipping-group), you need to link it to the cart items. This is important, because it is necessary to associate items with shipping groups in order to include shipping groups in the corresponding cart, order, and totals. + * + * :::note + * + * - Custom Cart Items are available through [implicit authentication](/docs/authentication/Tokens/implicit-token). Ensure that you always check each order has the correct details for each item, most importantly, price. + * + * ::: + * + * ### Add Promotion to Cart + * + * You can use the Promotions API to apply discounts to your cart as a special cart item type. Any requests to add a product to cart will return a collection of cart items. + * + * There are certain limitations on usage of the `custom_inputs` attribute with some promotion types. See [Limitations on Usage of `custom_inputs` with Specific Promotion Types](/docs/api/carts/manage-carts#limitations-on-usage-of-custom_inputs-with-specific-promotion-types). + * + * To remove promotion from the cart via the promotion code, see [Delete Promotion Code from Cart](/docs/api/carts/delete-a-promotion-via-promotion-code). + * + * ### Re-order + * + * From a shopper’s order history, they can add the items from a previous order into their carts. Shoppers can add items regardless of past order status, such as incomplete or not paid. For more information, see [Orders](/docs/api/carts/orders). + * + * :::note + * - Any requests to add an item to cart return a collection of [cart items](/docs/api/carts/cart-items). + * - A cart can contain a maximum of 100 unique items. Items include products, custom items, and promotions. + * - When a shopper creates a cart and re-orders items from an order with properties such as custom attributes, custom discounts, and payment intent ID, these properties will remain unchanged in the original cart. + * - Custom items do not exist in catalogs, and therefore cannot be reordered. + * ::: + * + * ### Merging Carts + * + * A shopper can have multiple carts, and the system may automatically merge items from an anonymous cart into the shopper's registered cart when they sign in. For example, if a shopper has an existing cart with items `A`, `B` and `C`, and later adds items `D` and `E` while not signed in, the system can merge these carts when the shopper signs in. After the carts merge, the cart contains items `A`, `B`, `C`, `D` and `E`. + * + * If any items are duplicated from the anonymous cart to the registered cart, their quantities are incremented accordingly. For example, if a shopper's existing cart with items `A`, `B` and `C`, and they later add two more `A` items and one `B` item while not signed in, the system will merge the carts when the shopper signs in. The existing cart will now contain three `A` items, two `B` items, and one `C` item. + * + * :::note + * + * When the system merges items from one cart into another cart, properties such as custom attributes, custom discounts, and payment intent ID will remain unchanged in the original cart. + * + * ::: + * + * ### Best Practices + * + * We recommend to include a unique `sku` code within the request body while adding custom items to carts. If the same `sku` is used for multiple products, they are merged into a single line item. + * + * For example, if a cart consists of the following items: + * + * - `product-1` with quantity 1 and sku code as `sku-1` + * - `product-2` with quantity 1 and sku code as `sku-1` + * - `product-3` with quantity 1 and sku code as `sku-2`. + * + * The following response is returned where it combines all products with the same sku codes into a single line item, while products with a unique sku codes are represented as separate items: + * + * ```json + * { + * "data": [ + * { + * "id": "c58760f4-8889-4719-b34d-be1f1d11ae59", + * "type": "custom_item", + * "name": "product-1", + * "description": "My first custom item!", + * "sku": "sku-1", + * "slug": "", + * "image": { + * "mime_type": "", + * "file_name": "", + * "href": "" + * }, + * "quantity": 2, + * "manage_stock": false, + * "unit_price": { + * "amount": 20000, + * "currency": "USD", + * "includes_tax": true + * }, + * "value": { + * "amount": 40000, + * "currency": "USD", + * "includes_tax": true + * }, + * "links": {}, + * "meta": { + * "display_price": { + * "with_tax": { + * "unit": { + * "amount": 20000, + * "currency": "USD", + * "formatted": "$200.00" + * }, + * "value": { + * "amount": 40000, + * "currency": "USD", + * "formatted": "$400.00" + * } + * }, + * "without_tax": { + * "unit": { + * "amount": 20000, + * "currency": "USD", + * "formatted": "$200.00" + * }, + * "value": { + * "amount": 40000, + * "currency": "USD", + * "formatted": "$400.00" + * } + * }, + * "tax": { + * "unit": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * }, + * "value": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * } + * }, + * "discount": { + * "unit": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * }, + * "value": { + * "amount": 0, + * "currency": "USD", + * "formatted": "$0.00" + * } + * }, + * "without_discount": { + * "unit": { + * "amount": 20000, + * "currency": "USD", + * "formatted": "$200.00" + * }, + * "value": { + * "amount": 40000, + * "currency": "USD", + * "formatted": "$400.00" + * } + * } + * }, + * "timestamps": { + * "created_at": "2023-05-02T16:28:11Z", + * "updated_at": "2023-05-02T16:28:18Z" + * } + * } + * } + * ``` + * + */ +export const manageCarts = ( + options: Options, +) => { + return (options?.client ?? client).post< + ManageCartsResponse, + ManageCartsError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items", + }) +} + +/** + * Delete all Cart Items + * A shopper can clean up their cart, deleting custom items, promotions, and so on, while the empty cart remains available. The cart id, name, description, and any account or customer associations persist. The shopper can continue to add items to the cart. + * + */ +export const deleteAllCartItems = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteAllCartItemsResponse, + DeleteAllCartItemsError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items", + }) +} + +/** + * Update a Cart Item + * You can easily update a cart item. A successful update returns the cart items. + */ +export const updateAcartItem = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateAcartItemResponse, + UpdateAcartItemError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}", + }) +} + +/** + * Delete a Cart Item + * Use this endpoint to delete a cart item. + */ +export const deleteAcartItem = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteAcartItemResponse, + DeleteAcartItemError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}", + }) +} + +/** + * Create an Account Cart Association + * You can create associations between an account and one or more carts. After cart associations exist for an account, the account can access those carts across any device. + */ +export const createAccountCartAssociation = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).post< + CreateAccountCartAssociationResponse, + CreateAccountCartAssociationError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/relationships/accounts", + }) +} + +/** + * Delete Account Cart Association + * You can delete an association between an account and a cart. + */ +export const deleteAccountCartAssociation = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteAccountCartAssociationResponse, + DeleteAccountCartAssociationError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/relationships/accounts", + }) +} + +/** + * Create a Customer Cart Association + * You can create associations between a customer and one or more carts. After cart associations exist for a customer, the customer can access those carts across any device. + */ +export const createCustomerCartAssociation = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).post< + CreateCustomerCartAssociationResponse, + CreateCustomerCartAssociationError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/relationships/customers", + }) +} + +/** + * Delete Customer Cart Association + * You can delete an association between a customer and a cart. + */ +export const deleteCustomerCartAssociation = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteCustomerCartAssociationResponse, + DeleteCustomerCartAssociationError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/relationships/customers", + }) +} + +/** + * Delete a Promotion via Promotion Code + * You can remove promotion code from a cart if it was applied manually. This endpoint does not work if the promotion is applied automatically. + */ +export const deleteApromotionViaPromotionCode = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteApromotionViaPromotionCodeResponse, + DeleteApromotionViaPromotionCodeError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/discounts/{promoCode}", + }) +} + +/** + * Add Tax Item to Cart + * + * Use this endpoint to add a tax item to a cart. + * + * :::note + * + * There is a soft limit of 5 unique tax items per cart item at any one time. + * + * ::: + * + */ +export const addTaxItemToCart = ( + options: Options, +) => { + return (options?.client ?? client).post< + AddTaxItemToCartResponse, + AddTaxItemToCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/taxes", + }) +} + +/** + * Bulk Add Tax Items to Cart + * :::note + * + * A cart item can only have a maximum of five tax items. + * + * ::: + * + * ### Errors + * + * `422 Unprocessable Entity` + * + * In this example, when `options.add_all_or_nothing` is set to `true` and if one of cart items is not found or or has reached its maximum tax item limit, the following error response is returned: + * + * ```json + * { + * "status": 422, + * "title": "Add all or nothing.", + * "detail": "Add all or nothing set to (true). Could not bulk add tax items to cart." + * } + * + * ``` + * + * In this example, if you add more than five tax items to the same cart item, the following error response is returned: + * + * ```json + * { + * "status": 422, + * "title": "Tax item not added to cart item.", + * "detail": "Cannot exceed tax item limit of (5) on cart item.", + * "meta": { + * "id": "f88e6370-cb35-40b2-a998-c759f31dec0a" + * } + * } + * ``` + * + * `404` + * + * In this example, if there is a mismatch between `cart_item`/`custom_item` and the `relationships.item.data.type` specified in the bulk add tax item, the following error response is returned: + * + * ```json + * { + * "data": [], + * "errors": [ + * { + * "status": 404, + * "title": "Tax item not added to cart item.", + * "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + * "meta": { + * "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + * } + * }, + * { + * "status": 404, + * "title": "Tax item not added to cart item.", + * "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + * "meta": { + * "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + * } + * } + * ] + * } + * ``` + * + */ +export const bulkAddTaxItemsToCart = ( + options: Options, +) => { + return (options?.client ?? client).post< + BulkAddTaxItemsToCartResponse, + BulkAddTaxItemsToCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/taxes", + }) +} + +/** + * Bulk Delete Tax Items from Cart + * Use this endpoint to bulk delete tax items from cart. + */ +export const bulkDeleteTaxItemsFromCart = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + BulkDeleteTaxItemsFromCartResponse, + BulkDeleteTaxItemsFromCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/taxes", + }) +} + +/** + * Update a TaxItem + * Use this endpoint to update a tax item. + */ +export const updateAtaxItem = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateAtaxItemResponse, + UpdateAtaxItemError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}", + }) +} + +/** + * Delete a Tax Item + * Use this endpoint to delete a tax item. + */ +export const deleteAtaxItem = ( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteAtaxItemResponse, + DeleteAtaxItemError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}", + }) +} + +/** + * Bulk Add Custom Discounts to Cart + * The default value for custom discounts on both the cart and cart items is set to 5 if this parameter is not configured in the store. To verify the custom discount limit value, call [Get all settings](/docs/api/settings/get-v-2-settings) endpoint. + * + * To increase the custom discount value, contact [Elastic Path Support team](https://support.elasticpath.com/hc/en-us). + * + */ +export const bulkAddCustomDiscountsToCart = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).post< + BulkAddCustomDiscountsToCartResponse, + BulkAddCustomDiscountsToCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/custom-discounts", + }) +} + +/** + * Bulk Delete Custom Discounts From Cart + * Use this endpoint to bulk delete custom discounts from cart. + */ +export const bulkDeleteCustomDiscountsFromCart = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + BulkDeleteCustomDiscountsFromCartResponse, + BulkDeleteCustomDiscountsFromCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/custom-discounts", + }) +} + +/** + * Update Custom Discount For Cart + * Use this endpoint to update a custom discount in your cart. + */ +export const updateCustomDiscountForCart = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateCustomDiscountForCartResponse, + UpdateCustomDiscountForCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/custom-discounts/{customdiscountID}", + }) +} + +/** + * Delete Custom Discount From Cart + * Use this endpoint to delete custom discount from cart. + */ +export const deleteCustomDiscountFromCart = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteCustomDiscountFromCartResponse, + DeleteCustomDiscountFromCartError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/custom-discounts/{customdiscountID}", + }) +} + +/** + * Add Custom Discount To Cart Item + * Use this endpoint to add a custom discount to cart item. + */ +export const addCustomDiscountToCartItem = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).post({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts", + }) +} + +/** + * Update Custom Discount For Cart Item + * Use this endpoint to update a custom discount in your cart item. + */ +export const updateCustomDiscountForCartItem = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).put({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}", + }) +} + +/** + * Delete Custom Discount From Cart Item + * Use this endpoint to delete custom discount from cart item. + */ +export const deleteCustomDiscountFromCartItem = < + ThrowOnError extends boolean = false, +>( + options: Options, +) => { + return (options?.client ?? client).delete< + DeleteCustomDiscountFromCartItemResponse, + DeleteCustomDiscountFromCartItemError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}", + }) +} + +/** + * Create Stripe Payment Intent for a Cart + * The Cart Payment Intent feature enables the creation of a Stripe Payment Intent specifically tied to a shopping cart and its subsequent order. This allows Payment Intent users to track payment details from the cart stage and seamlessly maintain consistency in payment information throughout the order stage. Using these features, you can create Payment Intents for their carts, update Payment Intents with final cart details, and synchronize Payment Intents from Stripe to Commerce. + * + * :::note + * + * - Typically, in Commerce, inventory is allocated at the time of payment initiation after an order is created. However, in the case of Cart Payment Intent, information about the payment is received only upon synchronizing the order from Stripe to Commerce. This may happen after the payment is completed. Therefore, there might be a delay between the payment made and allocation, increasing the chance of paying for items that are not in stock. + * - There are certain fields you can choose to set up when [creating a payment intent](https://stripe.com/docs/api/payment_intents/create). However, if you decide to update a payment intent, the available options may not be the same as those allowed while creating a payment intent. See [updating a payment intent](https://stripe.com/docs/api/payment_intents/update). + * + * ::: + * + * The following steps outline the workflow associated with the Payment Intent: + * + * 1. [Add items to cart](/docs/api/carts/manage-carts#add-custom-item-to-cart). + * 1. [Create a Payment Intent for the cart](/docs/api/carts/create-cart-payment-intent). The Payment Intent is created in Stripe, reflecting the cart and transaction details, including currency, amounts, payment type, and any optional Stripe details. The Payment Intent ID is generated and linked to the cart. + * 1. [Update a Payment Intent](/docs/carts-orders/update-cart-payment-intent). This step is optional but becomes necessary when there are changes in the cart details at the time of payment. It ensures the Payment Intent accurately reflects the current cart details when processing the payments on the front end. + * 1. [Checkout the cart](/docs/api/carts/checkout). An unpaid order is created, and the Payment Intent ID is linked to the order. + * 1. [Confirm the order](/docs/carts-orders/confirm-an-order). This is important because after checkout, it is essential to confirm the Payment Intent and synchronize it with Commerce. This results in a corresponding transaction and change in order statuses in Commerce. Additionally, the Payment Intent ID is removed from the order once it is linked via the transaction. + * + * ### Best Practices + * + * We recommend you follow these practices to maintain consistency and accuracy when using Cart Payment Intent. + * + * - After checkout, we recommend clearing the shopping cart. You can achieve this using a [Delete a cart](/docs/api/carts/delete-a-cart) endpoint or [Update a cart](/docs/api/carts/update-a-cart) to remove the Payment Intent ID. This helps to avoid potential issues where subsequent checkouts for the same cart might unintentionally use the previous Stripe Payment Intent ID. + * - If it is not reasonable to clear the cart immediately after checkout due to several subsequent, duplicate checkouts to the same cart, ensure that you only synchronize the Payment Intent when finalizing the order. Each order confirmation is unaware of the others, and syncing Payment Intent IDs for each confirmation can lead to duplicate transactions in Commerce. In other words, if you synchronize Payment Intents for earlier versions of a repeated checkout, you'll end up with multiple orders from the same cart, each having transactions linked to the same Payment Intent. + * - To pay the entire amount at once, use the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) endpoint to update the Stripe Payment Intent with the final cart details when preparing to take the payment. Doing so, ensures that the Payment Intent accurately reflects the current cart details when processing payments on the front end. We do not recommend calling the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) for each individual change in the cart, as this can lead to more requests and may slow down the front-end performance. + * + */ +export const createCartPaymentIntent = ( + options: Options, +) => { + return (options?.client ?? client).post< + CreateCartPaymentIntentResponse, + CreateCartPaymentIntentError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/payments", + }) +} + +/** + * Checkout API + * When a Cart is ready for checkout, you can convert the cart to an order. The cart remains and can be modified and checked out again if required. + * + * A cart can be checked out with a customer ID, customer object, or with an account by authenticating with the `Client Credentials Token`. + * + * After a successful checkout, a response that contains the order is returned. If the cart is linked to a shipping group, the shipping group is also associated with the order after checkout. + * + * You can checkout using one of the following methods: + * - Customer ID. You can checkout a cart with an existing customer ID. + * - Guest Checkout (Checkout with Customer Object). You can checkout a cart with an associated customer name and email. + * - Checkout with Account. The shopper authenticates with the `Client Credentials` Token. + * - Checkout with Account Management Authentication Token. The shopper authenticates with the `Implicit Token` and the `EP-Account-Management-Authentication-Token`. + * + * :::note + * + * - The cart currency is set when the first item is added to the cart. + * - The product being added to the cart requires a price in the same currency as the other items in the cart. The API returns a 400 error if a price is not defined in the correct currency. + * - To ensure that a free gift is automatically applied to an order, set the promotion to automatic. The checkout process will not be successful if free gift items are out of stock. See [Errors](#errors) section. + * + * ::: + * + * :::caution + * + * - By default, carts are automatically deleted 7 days after the last update. You can change this setting by [updating cart settings](/docs/api/settings/put-v-2-settings-cart). + * - Your inventory is modified during checkout and payment of an order. For more information about the changes in the inventory, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) section. + * + * ::: + * + * ### Next Steps + * + * After a cart has been converted to an Order using either of the previous methods, you most likely want to capture payment for order. See [Paying for an Order](/docs/api/carts/payments). + * + * ### Errors + * + * The following error response is returned during checkout when an eligible item is added to the cart, and the free gift is out of stock. + * + * ```json + * { + * "errors": [ + * { + * "status": 400, + * "title": "Insufficient stock", + * "detail": "There is not enough stock to add gift2 to your cart", + * "meta": { + * "id": "f2b68648-9621-45a3-aed6-1b526b0f5beb", + * "sku": "gift2" + * } + * } + * ] + * } + * ``` + * + */ +export const checkoutApi = ( + options: Options, +) => { + return (options?.client ?? client).post< + CheckoutApiResponse, + CheckoutApiError, + ThrowOnError + >({ + ...options, + url: "/v2/carts/{cartID}/checkout", + }) +} + +/** + * Get All Orders + * This endpoint returns all orders with custom flow fields. The pagination offset is set to fetch a maximum of 10,000 orders. If the store has 10,000 orders and you fetch the orders without using filters, an error is returned. Use a filter to view orders when the order is beyond the 10,000 mark. + * + * :::note + * + * - Pass the `X-Moltin-Customer-Token` header to limit orders to a specific customer. See [Customer Tokens](/docs/customer-management/customer-management-api/customer-tokens). + * - Pass the `EP-Account-Management-Authentication-Token` header to limit orders to a specific account. See [Account Management Token](/docs/api/accounts/post-v-2-account-members-tokens). + * - You can use pagination with this resource. For more information, see [pagination](/guides/Getting-Started/pagination). + * + * ::: + * + * ### Filtering + * + * The following operators and attributes are available for filtering orders. + * + * | Attribute | Type | Operator | Example | + * | :--- | :--- | :--- | :--- | + * | `status` | `string` | `eq` | `eq(status,complete)` | + * | `payment` | `string` | `eq` | `eq(payment,paid)` | + * | `shipping` | `string` | `eq` | `eq(shipping,unfulfilled)` | + * | `name` (`customer.name`) | `string` | `eq` / `like` | `like(name,Brad*)` | + * | `email` (`customer.email`) | `string` | `eq` / `like` | `like(email,*@elasticpath.com)` | + * | `customer_id` | `string` | `eq` / `like` | `eq(customer_id, e5a0d684-a4af-4919-a348-f66b0b4955e0)` | + * | `account_id` | `string` | `eq` / `like` | `eq(account_id,3d7200c9-a9bc-4085-9822-63e80fd94a09)` | + * | `account_member_id` | `string` | `eq` / `like` | `eq(account_member_id,2a8a3a92-2ccd-4b2b-a7af-52d3896eaecb)` | + * | `contact.name` | `string` | `eq` / `like` | `eq(name,John Doe)` | + * | `contact.email` | `string` | `eq` / `like` | `eq(email,John Doe)` | + * | `shipping_postcode` | `string` | `eq` / `like` | `like(shipping_postcode,117*)` | + * | `billing_postcode` | `string` | `eq` / `like` | `like(billing_postcode,117*)` | + * | `with_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(with_tax,10000)` | + * | `without_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(without_tax,10000)` | + * | `currency` | `string` | `eq` | `eq(currency,USD)` | + * | `product_id` | `string` | `eq` | `eq(product_id,6837058c-ae42-46db-b3c6-7f01e0c34b40)` | + * | `product_sku` | `string` | `eq` | `eq(product_sku,deck-shoe-001)` | + * | `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | `gt(created_at,YYYY-MM-DD)` | + * | `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | `lt(updated_at,YYYY-MM-DD)` | + * | `external_ref` | `string` | `eq` / `like` | `like(external_ref, 16be*)` | + * + */ +export const getCustomerOrders = ( + options?: Options, +) => { + return (options?.client ?? client).get< + GetCustomerOrdersResponse, + GetCustomerOrdersError, + ThrowOnError + >({ + ...options, + url: "/v2/orders", + }) +} + +/** + * Get an Order + * Use this endpoint to retrieve a specific order. + */ +export const getAnOrder = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAnOrderResponse, + GetAnOrderError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}", + }) +} + +/** + * Update an Order + * You can only update custom data, `shipping`, `shipping_address`, and status on orders. All other settings in the order object are immutable. + * + * :::caution + * + * You can update `shipping`, `shipping_address`, and status of an order only if the order is not fulfilled. You can use the refund API to refund an order only if the payment status is `paid`. Canceling an order does not automatically refund a payment. You must refund the orders manually. + * + * ::: + * + * :::note + * + * - This request is only accessible to client credentials token users with Seller Admin role. + * - Non client credentials token users cannot access this endpoint. See [Permissions](/docs/authentication/Tokens/permissions). + * + * ::: + * + */ +export const updateAnOrder = ( + options: Options, +) => { + return (options?.client ?? client).put< + UpdateAnOrderResponse, + UpdateAnOrderError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}", + }) +} + +/** + * Get Order Items + * Use this endpoint to retrieve order items. + */ +export const getOrderItems = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetOrderItemsResponse, + GetOrderItemsError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/items", + }) +} + +/** + * Anonymize Orders + * You can anonymize an order when it is fulfilled, canceled, or fully refunded. + * + * When anonymization is successful, Personal Identifiable Information such as customer details, `shipping_address`, and `billing_address` are replaced with *. + * + */ +export const anonymizeOrders = ( + options?: Options, +) => { + return (options?.client ?? client).post< + AnonymizeOrdersResponse, + AnonymizeOrdersError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/anonymize", + }) +} + +/** + * Authorize Setup + * Authorize setup + */ +export const authorizeSetup = ( + options: Options, +) => { + return (options?.client ?? client).post< + AuthorizeSetupResponse, + AuthorizeSetupError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/payments", + }) +} + +/** + * Confirm Setup + * Confirm setup + */ +export const confirmSetup = ( + options: Options, +) => { + return (options?.client ?? client).post< + ConfirmSetupResponse, + ConfirmSetupError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions/{transactionID}/confirm", + }) +} + +/** + * Capture a Transaction + * Use this endpoint to capture a previously authorized payment. In this step, you can also pass in a custom reference, such as the payment reference from your chosen gateway. + */ +export const captureAtransaction = ( + options: Options, +) => { + return (options?.client ?? client).post< + CaptureAtransactionResponse, + CaptureAtransactionError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions/{transactionID}/capture", + }) +} + +/** + * Refund a Transaction + * There are two ways to refund; through your payment gateway and mark it refunded in Commerce Manager, or directly through Commerce Manager or API. + * + * * Mark as Refunded: You can manually mark a transaction as refunded. Before you can mark the order as refunded, you need to handle the actual refund on your side with your payment provider. Mark as Refunded is a full refund made to the transaction. + * * Refund through Composable Commerce: You can process a full or partial refund to a supported payment provider directly from Commerce Manager or API by providing the refund amount. When you start the refund process, the request is directly sent to the payment gateway. + * + * :::caution + * + * If you use manual gateway for partial or full refund, you need to handle the actual refund on your side with your payment provider. + * + * ::: + * + */ +export const refundAtransaction = ( + options: Options, +) => { + return (options?.client ?? client).post< + RefundAtransactionResponse, + RefundAtransactionError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions/{transactionID}/refund", + }) +} + +/** + * Get Order Transactions + * Get order transactions + */ +export const getOrderTransactions = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetOrderTransactionsResponse, + GetOrderTransactionsError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions", + }) +} + +/** + * Get a Transaction + * Retrieves a transaction + */ +export const getAtransaction = ( + options: Options, +) => { + return (options?.client ?? client).get< + GetAtransactionResponse, + GetAtransactionError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions/{transactionID}", + }) +} + +/** + * Cancel a Transaction + * Use this endpoint to cancel or void a pending or authorized transaction. The transaction can be canceled or voided when it is in `pending` and `completed` statuses. + * + * :::caution + * + * This endpoint works only for Stripe and PayPal and does not work for manual gateway. + * + * ::: + * + */ +export const cancelAtransaction = ( + options: Options, +) => { + return (options?.client ?? client).post< + CancelAtransactionResponse, + CancelAtransactionError, + ThrowOnError + >({ + ...options, + url: "/v2/orders/{orderID}/transactions/{transactionID}/cancel", + }) +} diff --git a/packages/sdks/shopper/src/client/types.gen.ts b/packages/sdks/shopper/src/client/types.gen.ts new file mode 100644 index 00000000..b2fa74fd --- /dev/null +++ b/packages/sdks/shopper/src/client/types.gen.ts @@ -0,0 +1,6219 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * The three-letter ISO code for the currency associated with this price. + */ +export type Amount = { + /** + * The price in the lowest denomination for the specified currency. This is a product's list price. + */ + amount?: number + /** + * Whether this price includes tax. + */ + includes_tax?: boolean +} + +/** + * If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books. + */ +export type PrioritizedPricebooks = Array<{ + /** + * A unique identifier of a price book. + */ + id: string + /** + * Priority is a number and the price book with the highest number has the highest priority. + */ + priority: number +}> + +/** + * Creates a catalog with the following attributes. + */ +export type Catalog = { + /** + * A unique identifier of a catalog. + */ + id: string + attributes: { + /** + * The name of a catalog. + */ + name: string + /** + * A brief description of the catalog, such as the purpose of the catalog. + */ + description?: string + /** + * The unique identifiers of the hierarchies associated with a catalog. + */ + hierarchy_ids: Array + /** + * The unique identifier of a price book associated with a catalog. If no price book is selected, the catalog is displayed without prices. + */ + pricebook_id?: string + pricebook_ids?: PrioritizedPricebooks + /** + * Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + */ + locales?: { + [key: string]: { + [key: string]: string + } + } + /** + * The date and time a catalog is created. + */ + created_at: Date + /** + * The date and time a catalog was updated. + */ + updated_at: Date + /** + * The owner of this resource, can be either `organization` or `store`. + */ + owner?: ("store" | "organization") | null + } + /** + * Relationships are established between different catalog entities. For example, a catalog rule and a price book are related to a catalog, as both are associated with it. + */ + relationships?: { + /** + * The catalog rules related to a catalog. + */ + rules?: { + links?: RelatedLink + } + /** + * When a catalog is published, a catalog release is created. This is a URL to all catalog published releases available for this catalog. + */ + releases?: { + links?: RelatedLink + meta?: { + /** + * The number releases available for a catalog. + */ + count?: number + } + } + } + type: "catalog" +} + +/** + * The owner of this resource, can be either `organization` or `store`. + */ +export type owner = "store" | "organization" + +/** + * Creates a catalog with the following attributes. + */ +export type CatalogCreateData = { + data: { + attributes: { + /** + * The name of the catalog. + */ + name: string + /** + * A brief description of the catalog. + */ + description?: string | null + /** + * The unique identifiers of the hierarchies to associate with a catalog. + */ + hierarchy_ids: Array + /** + * The unique identifier of the price book to associate with this catalog. You can specify either a `pricebook_id` or `pricebook_ids` but not both. If you specify both a `pricebook_id` and `pricebook_ids`, a `422 Unprocessable Entity` error is displayed. + * + */ + pricebook_id?: string + pricebook_ids?: PrioritizedPricebooks + /** + * Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + */ + locales?: { + [key: string]: { + [key: string]: string + } + } + } + /** + * Represents the type of object being returned. Always `Catalog`. + */ + type: "catalog" + } +} + +/** + * Container for a single catalog. + */ +export type CatalogData = { + data: Catalog + links?: Links +} + +/** + * Container for a list of catalogs. + */ +export type CatalogListData = { + data: Array + links?: Links +} + +/** + * A catalog combines price books, product lists, and hierarchies. + */ +export type CatalogUpdateData = { + data: { + attributes: { + /** + * The name of the catalog. + */ + name?: string | null + /** + * A brief description of the catalog. + */ + description?: string | null + /** + * The unique identifiers of the hierarchies to associate with a catalog. + */ + hierarchy_ids?: Array | null + /** + * The unique identifier of a price book to associate with a catalog. You can specify a `pricebook_id` or a `pricebook_ids` but not both. If you specify both, a `422 unprocessable entity` error is displayed. + */ + pricebook_id?: string | null + pricebook_ids?: PrioritizedPricebooks + /** + * Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + */ + locales?: { + [key: string]: { + [key: string]: string + } + } + } + /** + * The unique identifier of the catalog to be updated. + */ + id: string + /** + * This represents the type of object being returned. Always `catalog`. + */ + type: "catalog" + } +} + +/** + * The unique identifier of the component, for example, `games`. + */ +export type ComponentProduct = { + /** + * The component name is the name that is displayed in your storefront. + */ + name?: string + /** + * The minimum number of product options a shopper can select from this component. + */ + min?: number | null + /** + * The maximum number of product options a shopper can select from this component. + */ + max?: number | null + /** + * The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want. + */ + sort_order?: number | null + /** + * The product options included in a component. This can be the ID of another bundle. + */ + options?: Array +} + +/** + * The product options included in a component. This can be the ID of another bundle. + */ +export type ComponentProductOption = { + /** + * A unique identifier of the product you want to add to a component. + */ + id?: string + /** + * This represents the type of object being returned. Always `product`. + */ + type?: "product" + /** + * The number of this product option that a shopper must purchase. + */ + quantity?: number + /** + * The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want. + */ + sort_order?: number | null + /** + * The boolean indicates whether the current option is a default option for the component. + */ + default?: boolean | null +} + +/** + * A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + */ +export type Components = { + [key: string]: ComponentProduct +} + +/** + * The length of the custom input text field. + */ +export type CustomInputValidationRuleOptions = { + /** + * The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters. + */ + max_length?: number +} + +/** + * The validation rules for the custom text. + */ +export type CustomInputValidationRule = { + /** + * This represents the type of object being returned. Must be `string`. + */ + type?: "string" + options?: CustomInputValidationRuleOptions +} + +/** + * The name of the custom input. You can rename the input to something more representative of the input that shoppers are adding, for example, `message` or `front`. + */ +export type CustomInput = { + /** + * The name for the custom text field that is displayed in your storefront. + */ + name?: string + /** + * The validation rules for the custom text. + */ + validation_rules?: Array + /** + * This is `true` or `false` depending on whether the custom text is required. + */ + required?: boolean | null +} + +/** + * You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this using the `custom_inputs` attribute. + * + * - You can rename input to something more representative of the input that shoppers are adding, for example, `message` or `front`. + * - `name` is the name that is displayed in your storefront. + * - You can add validation rules. For example, the input field must be a string and/or up to 255 characters in length. The limit is 255 characters. + * + */ +export type CustomInputs = { + [key: string]: CustomInput +} + +/** + * A collection of one or more currencies objects that consists of the [**three-letter ISO code**](https://www.iso.org/iso-3166-country-codes.html) of the currencies associated with this price and the amount. This is the product's price. + */ +export type Currencies = { + [key: string]: Amount +} + +/** + * The optional price extension with values in string format, viewable by shoppers. + */ +export type ShopperAttributes = { + [key: string]: string +} + +/** + * A list of differences between two releases. + */ +export type DiffListData = { + data?: Array + links?: Links +} + +/** + * A price formatted for display. + */ +export type DisplayPrice = { + with_tax?: FormattedPrice + without_tax?: FormattedPrice +} + +/** + * APIError is a json-api style part of an error response. + */ +export type Error = { + detail?: string + status?: string + title?: string +} + +/** + * ErrorResponse is a json-api style Error response. + */ +export type ErrorResponse = { + errors?: Array +} + +/** + * The name of the product template. + */ +export type Extension = { + [key: string]: { + [key: string]: unknown + } +} + +/** + * With extension templates, you can attach a specific set of custom fields to your products in Product Experience Manager. For example, a **Book** template might contain the attributes, such as **ISBN**, **Author**, **Number of pages**, **Year Published**, or **Condition (New/Used)**. + */ +export type Extensions = { + [key: string]: Extension +} + +/** + * In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details. + */ +export type FileReference = { + /** + * This represents the type of object being returned. Always `file`. + */ + type?: "file" + /** + * A unique identifier for a file. + */ + id?: string + /** + * The date and time a file is created. + */ + created_at?: Date +} + +/** + * In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details. + */ +export type FilesRelationship = { + data?: Array +} + +/** + * A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. You can link to the products that make up your bundle components. + */ +export type ComponentProductsRelationship = { + data?: ProductReferences + links?: SelfLink +} + +/** + * A price formatted for display. + */ +export type FormattedPrice = { + /** + * The price in the lowest denomination for the specified currency. This is a product's list price. + */ + amount?: number + /** + * The three-letter ISO code of the currencies associated with this price and the amount. + */ + currency?: string + /** + * The format of the price for display. + */ + formatted?: string +} + +/** + * A category hierarchy in a catalog. Hierarchies can have parent nodes and child nodes, as well as a list of attached products. + */ +export type Hierarchy = { + attributes?: HierarchyAttributes + /** + * A unique identifier of a hierarchy. + */ + id?: string + relationships?: HierarchyRelationships + /** + * This represents the type of object being returned. Always `hierarchy`. + */ + type?: string + meta?: HierarchyMeta +} + +/** + * A hierarchy's metadata. + */ +export type HierarchyMeta = { + /** + * Product Experience Manager supports localization of hierarchies. If your store supports multiple languages, you can localize hierarchy names and descriptions. This is [**three-letter language code**](https://www.iso.org/iso-639-language-code) that represents the name of the language you have used. + */ + language?: string +} + +/** + * Resource attributes of a catalog hierarchy. + */ +export type HierarchyAttributes = { + /** + * The date and time a hierarchy is created. + */ + created_at?: Date + /** + * The date and time a hierarchy is published in a catalog. + */ + published_at?: Date | null + /** + * A description of a hierarchy. + */ + description?: string + /** + * The name of a hierarchy. + */ + name?: string + /** + * A unique slug for a hierarchy. + */ + slug?: string + /** + * The date and time a hierarchy was updated. + */ + updated_at?: Date +} + +/** + * Container for hierarchies. + */ +export type HierarchyData = { + data?: Hierarchy + links?: Links +} + +/** + * Container for a list of hierarchies. + */ +export type HierarchyListData = { + meta?: PageMeta + data?: Array + links?: Links +} + +/** + * Relationships to child nodes, and products. + */ +export type HierarchyRelationships = { + /** + * A URL to all the products associated with a hierarchy. + */ + products?: { + links?: RelatedLink + } + /** + * A URL to all the child products associated with a hierarchy. + */ + children?: { + links: RelatedLink + } + /** + * A URL to all the nodes associated with a hierarchy. + */ + nodes?: { + links: RelatedLink + } +} + +/** + * Links allow you to move between requests. + */ +export type Links = { + /** + * Single entities use a `self` parameter with a link the specific resource. + */ + self?: string | null + /** + * Always the first page. + */ + first?: string | null + /** + * This is `null` if there is only one page. + */ + last?: string | null + /** + * This is `null` if there is only one page. + */ + prev?: string | null + /** + * This is `null` if there is only one page. + */ + next?: string | null +} + +/** + * In Product Experience Manager, products can also have associated product images. + */ +export type MainImageRelationship = { + /** + * The images associated with a product. + */ + data?: { + /** + * This represents the type of object being returned. Always `main_image`. + */ + type?: "main_image" + /** + * A unique identifier for an image. + */ + id?: string + } +} + +/** + * A category node in a catalog. Nodes can have child nodes, as well as a list of attached products. + */ +export type Node = { + attributes?: NodeAttributes + /** + * The unique identifier of a node. + */ + id?: string + relationships?: NodeRelationships + /** + * This represents the type of object being returned. Always `node`. + */ + type?: string + meta?: NodeMeta +} + +/** + * Resource attributes of a catalog node. + */ +export type NodeAttributes = { + /** + * The date and time a node was created. + */ + created_at?: Date + /** + * The date and time a node was published in a catalog. + */ + published_at?: Date | null + /** + * A description of a node. + */ + description?: string + label?: string + /** + * The name of a node. Names must be unique among sibling nodes in a hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + */ + name?: string + /** + * A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + */ + slug?: string + /** + * A list of curated products for a node. You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. + */ + curated_products?: Array + status?: string + /** + * The date and time a node was updated. + */ + updated_at?: Date +} + +/** + * Container for nodes. + */ +export type NodeCreateData = { + /** + * A node in a catalog (e.g. a category node). Nodes can have child nodes, as well as a list of attached products + */ + data: { + /** + * Resource attributes of a catalog node. + */ + attributes: { + description?: string + /** + * hierarchy id of the node + */ + hierarchy_id?: string + label?: string + name: string + slug?: string + status?: string + locales?: { + [key: string]: { + [key: string]: string + } + } + } + relationships?: NodeRelationships + id?: string + type: string + } + links?: Links +} + +/** + * Container for nodes. + */ +export type NodeData = { + data?: Node + links?: Links +} + +/** + * Container for a list of nodes. + */ +export type NodeListData = { + meta?: PageMeta + data?: Array + links?: Links +} + +/** + * A node's metadata. + */ +export type NodeMeta = { + /** + * The node details localized in the supported languages. + */ + language?: string + /** + * Helps you understand the association of products with nodes. It explains how products are associated with parent nodes and the relationship among the array of nodes. This is useful if you want to improve how your shoppers search within you store. + */ + bread_crumb?: Array +} + +/** + * Minimum set of information to identify a catalog node. + */ +export type NodeReference = { + /** + * The unique identifier of a hierarchy. + */ + id?: string + /** + * A label for a hierarchy. + */ + label?: string + /** + * The name of a hierarchy. + */ + name?: string +} + +/** + * Relationships to parent and child nodes, and products. + */ +export type NodeRelationships = { + /** + * A URL to all products associated with a node. + */ + products?: { + data?: Array + links?: RelatedLink + } + /** + * A URL to all child nodes associated with a node. + */ + children?: { + links: RelatedLink + } + /** + * A URL to all parent nodes associated with a node. + */ + parent?: { + data: { + type: "node" + id: string + } + links?: RelatedLink + } + /** + * A URL to the hierarchies associated with a node. + */ + hierarchy?: { + data: { + type: "hierarchy" + id: string + } + links?: RelatedLink + } +} + +/** + * Container for node relationships. + */ +export type NodeRelationshipsData = { + data?: NodeRelationships + links?: Links +} + +/** + * Contains the results for the entire collection. + */ +export type PageMeta = { + /** + * Total number of results for the entire collection. + */ + results?: { + /** + * Total number of results for the entire collection. + */ + total?: number + } + page?: { + /** + * The maximum number of records for all pages. + */ + limit?: number + /** + * The current offset by number of pages. + */ + offset?: number + /** + * The current number of pages. + */ + current?: number + /** + * The total number of records for the entire collection. + */ + total?: number + } +} + +/** + * Top level entity in the pricebooks domain model. It contains a list of product prices. + */ +export type Pricebook = { + /** + * The unique identifier of a price book. + */ + id?: string + /** + * This represents the type of object being returned. Always `pricebook`. + */ + type: "pricebook" + attributes: { + created_at?: Date + description?: string | null + name: string | null + updated_at?: Date + } +} + +/** + * Container for pricebooks. + */ +export type PricebookCreateData = { + /** + * New top level pricebook. + */ + data: { + type: "pricebook" + attributes: { + description?: string | null + name: string | null + } + } + links?: Links +} + +/** + * Container for pricebooks. + */ +export type PricebookData = { + data: Pricebook + links?: Links +} + +/** + * ProductPrice associates a collection of locale specific prices with a product ID. + */ +export type PricebookPrice = { + type: "product-price" + attributes: { + currencies: TieredCurrencies + sales?: Sales + sku: string + } + id: string +} + +/** + * Container for pricebook prices. + */ +export type PricebookPriceCreateData = { + /** + * ProductPrice associates a collection of locale specific prices with a product ID. + */ + data: { + type: "product-price" + attributes: { + currencies: TieredCurrencies + sales?: Sales + sku: string + } + } + links?: Links +} + +/** + * Container for pricebook prices. + */ +export type PricebookPriceData = { + data: PricebookPrice + links?: Links +} + +/** + * A product in a catalog with the following attributes. + */ +export type Product = { + attributes?: ProductAttributes + /** + * A unique identifier for a product. + */ + id?: string + relationships?: ProductRelationships + /** + * This represents the type of object being returned. Always `product`. + */ + type?: string + meta?: ProductMeta +} + +/** + * A product's attributes. + */ +export type ProductAttributes = { + /** + * The date and time a product was published in a catalog. + */ + published_at?: Date | null + /** + * If this product is a `parent` product. A `parent` product is a product that has child products that have been built using the `build child products` endpoint. + */ + base_product?: boolean + /** + * The unique identifier of a `parent` product. + */ + base_product_id?: string + /** + * The commodity type, either `physical` or `digital`. + */ + commodity_type?: string + /** + * If a product is curated, then the `curated_product` attribute with a value of `true` is displayed. If a product is not curated, the `curated_product` attribute is not displayed. + */ + curated_product?: boolean + /** + * The universal product code or european article number of the product. + */ + upc_ean?: string + /** + * The manufacturer part number of the product. + */ + manufacturer_part_num?: string + /** + * A list of tags associated with the product. A tag must be HTML compatible characters excluding commas and will be stored in lowercase letters. + */ + tags?: Array + /** + * A list of price modifier names. + */ + price_modifiers?: Array + /** + * The date and time a product was created. + */ + created_at?: Date + /** + * A description of the product. + */ + description?: string + /** + * A name of a product. + */ + name?: string + price?: Currencies + shopper_attributes?: ShopperAttributes + tiers?: Tiers + components?: Components + custom_inputs?: CustomInputs + /** + * The unique stock keeping unit of the product. + */ + sku?: string + /** + * A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug. + */ + slug?: string + /** + * The status of the product, either `live` or `draft`. + */ + status?: string + /** + * The unique attribute associated with the product. This could be an external reference from a separate company system, for example. + */ + external_ref?: string | null + /** + * The date and time a product was updated. + */ + updated_at?: Date + extensions?: Extensions +} + +/** + * Container for products. + */ +export type ProductCreateData = { + /** + * A new product in a catalog. + */ + data?: { + /** + * A product's attributes. + */ + attributes: { + description?: string + name: string + sku?: string + slug?: string + status: string + locales?: { + [key: string]: { + [key: string]: string + } + } + } + id?: string + type: string + } + links?: Links +} + +/** + * Container for products. + */ +export type ProductData = { + data?: Product + links?: Links + included?: Included +} + +export type ProductDiff = { + id?: string + type?: string + attributes?: { + sku?: string + this_release_id?: string + other_release_id?: string + diff_created_at?: Date + exists?: { + this: boolean + other: boolean + } + updated_at?: { + this?: Date | null + other?: Date | null + } + } +} + +/** + * Container for a list of products. + */ +export type ProductListData = { + meta?: PageMeta + data?: Array + links?: Links + included?: Included +} + +/** + * A product's metadata contains information about products, for example, the nodes a product is associated with, any child products, bundle configurations, and so on. + */ +export type ProductMeta = { + /** + * The relationship among the array of nodes a product is associated with, demonstrating the linking of the children nodes with the parent nodes. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have. + */ + bread_crumbs?: { + [key: string]: Array + } + /** + * An array of parent node IDs that a product is associated with. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have. + */ + bread_crumb_nodes?: Array + /** + * A unique identifier of the catalog a product is associated with. + */ + catalog_id?: string + /** + * The unique identifier of the price book a product is associated with. + */ + pricebook_id?: string | null + display_price?: DisplayPrice + /** + * The source of a catalog. Always `pim`. + */ + catalog_source?: "pim" + /** + * With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale. + */ + sale_id?: string + /** + * The date and time a sale expires. + */ + sale_expires?: Date | null + original_price?: Currencies + original_display_price?: DisplayPrice + bundle_configuration?: BundleConfiguration + /** + * A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + */ + component_products?: { + [key: string]: { + /** + * With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale. + */ + sale_id?: string + /** + * The date and time a sale expires. + */ + sale_expires?: Date | null + price?: Currencies + display_price?: DisplayPrice + original_price?: Currencies + original_display_price?: DisplayPrice + pricebook_id?: string | null + } + } + /** + * You can use price modifiers to change the price property of child products. By default, child products inherit the same price as their base products. Using price modifiers, you can enable child products to inherit a different price. + */ + price_modifiers?: { + [key: string]: { + /** + * There are three modifier types. + * + * - The `price_increment` type increases the prices of a product. + * - The `price_decrement` type decreases the price of a product. + * - The `price_equals` type sets the price of a product to an amount you specify. + * + */ + modifier_type?: string + currencies?: Currencies + } + } + /** + * You can use tiers to allow your store to offer different pricing for minimum quantities of items that your shoppers purchase. + */ + tiers?: { + [key: string]: { + /** + * The unique identifier of a sale. + */ + sale_id?: string + /** + * The date and time a sale expires. + */ + sale_expires?: Date | null + display_price?: DisplayPrice + original_price?: Currencies + original_display_price?: DisplayPrice + } + } + /** + * The `variation_matrix` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. If no variations are available, the `variation_matrix` is empty. + */ + variation_matrix?: { + [key: string]: unknown + } + /** + * If you specified `build_rules` for a product, the `variations` object lists the variation option IDs that you specified to include when building your child products. If no `build_rules` are specified, all the variation and variation options available for a product are displayed. If a product does not have any variations, then the `variations` object is not displayed. + */ + variations?: Array + /** + * An array of variation options IDs that a child product has. + */ + child_option_ids?: Array | null + /** + * If this is a child product, the `child_variations` object lists the variation option IDs that define this child product. + */ + child_variations?: Array | null + /** + * Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + * + * Product types can also be used in catalogs. For example, in your catalog, you can filter on parent so that only your parent products are displayed in your storefront. + * + * Products have one of the following types: + * + * - **standard** - Standard products are a standalone products. + * - **parent** - A parent product is a product that has child products that have been built using the `Build Child Products` endpoint. + * - **child** - When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + * - **bundle** - A bundle is a purchasable product, comprising two or more standalone products (in other words, components) to be sold together. + * + */ + product_types?: Array + /** + * If you storefront supports multiple languages, your storefront's preferred language and locale. + */ + language?: string +} + +/** + * The options available for a variation. + */ +export type VariationOption = { + /** + * A unique identifier for an option. + */ + id?: string + /** + * The name of the option. + */ + name?: string + /** + * If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want. + */ + sort_order?: number | null + /** + * The option description to display to customers. + */ + description?: string +} + +export type Variation = { + /** + * A unique identifier of a variation. + */ + id?: string + /** + * The name of a variation. + */ + name?: string + /** + * If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want. + */ + sort_order?: number | null + option?: VariationOption + /** + * The options available for this variation. + */ + options?: Array +} + +/** + * Container for a bundle configuration. + */ +export type BundleConfigurationData = { + data: BundleConfiguration +} + +/** + * A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + */ +export type BundleConfiguration = { + /** + * The product options included in a component. This can be the ID of another bundle. + */ + selected_options: { + [key: string]: { + [key: string]: number + } + } +} + +/** + * A product identifier. + */ +export type ProductReference = { + /** + * A unique identifier for a product. + */ + id?: string + /** + * This represents the type of object being returned. Always `product`. + */ + type?: "product" +} + +/** + * Container for a list of product references. + */ +export type ProductReferenceListData = { + meta?: PageMeta + data?: ProductReferences + links?: Links +} + +/** + * A list of product identifiers. + */ +export type ProductReferences = Array + +/** + * Relationships allow you to move between requests. Includes links to the parent and child products, bundle component products, files, and main images associated with a product. + */ +export type ProductRelationships = { + /** + * The details of a `parent` product. A `parent` product is a product that has child products that have been built using the `Build Child Products` endpoint. + */ + parent?: { + data?: ProductReference + } + /** + * The details of a `child` product. When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + */ + children?: { + data?: ProductReferences + links?: SelfLink + } + files?: FilesRelationship + main_image?: MainImageRelationship + component_products?: ComponentProductsRelationship +} + +/** + * Container for product relationships. + */ +export type ProductRelationshipsData = { + data?: ProductRelationships + links?: Links +} + +/** + * A list of products to be added to cart. Can be type product-data or error-response. + */ +export type ProductsForCart = { + data: Array + included?: { + component_products?: Array + } | null +} + +/** + * A list of product id or sku and bundle configuration for cart. + */ +export type ProductsForCartConfiguration = { + data: Array<{ + id?: string | null + sku?: string | null + bundle_configuration?: BundleConfiguration + }> +} + +/** + * A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas. + */ +export type RelatedLink = { + /** + * A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas. + */ + related: string +} + +/** + * Links are used to allow you to move between requests. + */ +export type SelfLink = { + /** + * Single entities use a self parameter with a link to that specific resource. + */ + self: string +} + +/** + * A catalog release represents a collection of hierarchical product data, price books and catalogs rules. + */ +export type Release = { + /** + * A unique identifier for the catalog release. + */ + id?: string + attributes?: { + /** + * The name of a release. + */ + name?: string + /** + * The date and time a release was published. + */ + published_at?: Date | null + /** + * A unique identifier for the catalog. + */ + catalog_id?: string + /** + * A description of the catalog release. + */ + description?: string + /** + * An array of hierarchy IDs associated with the release. + */ + hierarchies?: Array + } + relationships?: ReleaseRelationships + /** + * This represents the type of object being returned. Always `catalog-release`. + */ + type?: string + meta?: ReleaseMeta +} + +/** + * Container for a catalog release. + */ +export type ReleaseData = { + data?: Release + links?: Links +} + +/** + * Container for a list of catalog releases. + */ +export type ReleaseListData = { + data?: Array + links?: Links +} + +/** + * A release's metadata. + */ +export type ReleaseMeta = { + /** + * The date and time a release is created. + */ + created_at?: Date + /** + * The date and time a release is available for use. In other words, the date and time the status of a catalog release changes to PUBLISHED, rather than IN PROGRESS. + */ + started_at?: Date | null + /** + * The date and time a release is updated. + */ + updated_at?: Date | null + /** + * The status of the current release. + */ + release_status?: "PENDING" | "IN_PROGRESS" | "FAILED" | "PUBLISHED" + /** + * Your storefront's preferred language code and locale. + */ + language?: string + /** + * Indicates that a full publish was performed (either because this is the first time a catalog has been published or because of a change that occurred, for example, adding/removing a price book or hierarchy). When determining whether delta data needs to be refreshed, ignore this attribute and always use the `is_full_delta` attribute. + * + */ + is_full_publish?: boolean + /** + * Indicates whether the release delta file contains the full content of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog release from the search service before injecting fresh data from the delta file. If the `is_full_delta` attribute is `false`, then data from the previous catalog release overlays the existing data in the delta file. The `is_full_delta` attribute is always `true` the first time a catalog is published. + * + */ + is_full_delta?: boolean + /** + * The total number of products displayed in a catalog release. + */ + total_products?: number | null + /** + * The total number of hierarchy nodes displayed in a catalog release. + */ + total_nodes?: number | null + /** + * An integer that represents the progress of a catalog publish. The attribute starts at `0` and reaches `100` when publishing is complete. + */ + percent_completed?: number | null + /** + * The owner of the resource, can be either `organization` or `store`. + */ + owner?: ("store" | "organization") | null +} + +/** + * The status of the current release. + */ +export type release_status = "PENDING" | "IN_PROGRESS" | "FAILED" | "PUBLISHED" + +/** + * Relationships are established between different catalog entities. For example, products, hierarchies, price books, and catalog rules are related to a catalog, as they are associated with it. + */ +export type ReleaseRelationships = { + /** + * A URL to a delta document that describes the changes between catalog releases. + */ + delta?: { + links?: RelatedLink + } + /** + * A URL to all products included in a catalog release. + */ + products?: { + links?: RelatedLink + } + /** + * A URL to all hierarchies included in a catalog release. + */ + hierarchies?: { + links: RelatedLink + } +} + +/** + * A catalog rule specifies which catalog to use for a given shopper context. + */ +export type Rule = { + /** + * The catalog rule ID. Use this to get, modify, or delete the catalog rule. + */ + id: string + attributes: { + /** + * The name of a catalog rule. The name must not contain any spaces. + */ + name: string + /** + * A brief description of the purpose of a catalog rule. + */ + description?: string + /** + * The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + */ + account_ids?: Array + /** + * The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + */ + customer_ids?: Array + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + channels?: Array + /** + * A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + tags?: Array + /** + * Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + * + * The schedules attribute must include the following. + * + * - `valid_from` matches the date and time that the catalog is displayed from. + * - `valid_to` matches the date and time the catalog is displayed to. + * + * Commerce runs on UTC time. + * + * You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + * + */ + schedules?: Array + /** + * The unique identifier of a catalog. + */ + catalog_id: string + /** + * The date and time a catalog rule was created. + */ + created_at: Date + /** + * The date and time a catalog release is updated. + */ + updated_at: Date + } + /** + * This represents the type of object being returned. Always `catalog_rule`. + */ + type: "catalog_rule" +} + +/** + * A catalog rule specifies which catalog to use for a given shopper context. + */ +export type RuleCreateData = { + data: { + attributes: { + /** + * The name of a catalog rule. The name must not contain spaces. + */ + name: string + /** + * A brief description of the purpose of a catalog rule. + */ + description?: string | null + /** + * The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + */ + account_ids?: Array | null + /** + * The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + */ + customer_ids?: Array | null + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + channels?: Array | null + /** + * A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + tags?: Array | null + /** + * Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + * + * The schedules attribute must include the following. + * + * - `valid_from` matches the date and time that the catalog is displayed from. + * - `valid_to` matches the date and time the catalog is displayed to. + * + * Commerce runs on UTC time. + * + * You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + * + */ + schedules?: Array | null + /** + * The unique identifier of a catalog. + */ + catalog_id: string + } + /** + * This represents the type of object being returned. Always `catalog_rule`. + */ + type: "catalog_rule" + } +} + +/** + * Container for a single catalog rule. + */ +export type RuleData = { + data: Rule + links?: Links +} + +/** + * Container for a list of catalog rules. + */ +export type RuleListData = { + meta?: PageMeta + data: Array + links?: Links +} + +/** + * A period of time during which a catalog is valid + */ +export type RuleSchedule = { + /** + * Matches the date and time that the catalog is displayed from. + */ + valid_from?: Date | null + /** + * Matches the date and time the catalog is displayed to. + */ + valid_to?: Date | null +} + +/** + * A catalog rule specifies which catalog to use for a given shopper context. + */ +export type RuleUpdateData = { + data: { + /** + * The catalog rule ID. Use this to get, modify, or delete the catalog rule. + */ + id: string + attributes?: { + /** + * The name of a catalog rule. The name must not contain spaces. + */ + name?: string | null + /** + * A description of the purpose of a catalog rule. + */ + description?: string | null + /** + * Specifies the list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + */ + account_ids?: Array | null + /** + * The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + */ + customer_ids?: Array | null + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + channels?: Array | null + /** + * Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + * + * The schedules attribute must include the following. + * + * - `valid_from` matches the date and time that the catalog is displayed from. + * - `valid_to` matches the date and time the catalog is displayed to. + * + * Commerce runs on UTC time. + * + * You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + * + */ + schedules?: Array | null + /** + * A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + tags?: Array | null + /** + * The unique identifier of a catalog rule. + */ + catalog_id?: string | null + } + /** + * This represents the type of object being returned. Always `catalog_rule`. + */ + type: "catalog_rule" + } +} + +/** + * A set of sale prices and a validity period. + */ +export type Sale = { + schedule?: Schedule + currencies?: TieredCurrencies +} + +/** + * A set of sale specifications + */ +export type Sales = { + [key: string]: Sale +} + +/** + * A definition of the times at which a sale is valid + */ +export type Schedule = { + valid_from?: Date | null + valid_to?: Date | null +} + +/** + * The name of the tier, for example, `Pencils`. + */ +export type Tier = { + /** + * The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned. + */ + minimum_quantity?: number + price?: Currencies +} + +/** + * The three-letter ISO code for the currency associated with this price. + */ +export type TieredAmount = { + /** + * The price in the lowest denomination for the specified currency. This is a product's list price. + */ + amount?: number + /** + * Whether this price includes tax. + */ + includes_tax?: boolean + /** + * The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block. + */ + tiers?: { + [key: string]: { + /** + * The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned. + */ + minimum_quantity?: number + /** + * The price for each quantity. + */ + amount?: number + } + } +} + +/** + * Collection of currency specific prices for a product. + */ +export type TieredCurrencies = { + [key: string]: TieredAmount +} + +/** + * The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block. + */ +export type Tiers = { + [key: string]: Tier +} + +/** + * Creates a catalog release with the following attributes. + */ +export type CatalogReleaseCreateData = { + data?: { + /** + * Set to `true` if you want to export all the data from a catalog release in a delta link. The `is_full_delta` attribute is returned from the `get a release of a catalog` endpoint. The `is_full_delta` attribute tells you if the delta file contains the full content of a catalog release. You can use the `is_full_delta` to determine if you need to refresh the data in your company system before publishing a catalog release with fresh data in a delta link. Using a search service as an example, if the `is_full_delta` attribute is true, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. If the `is_full_delta` attribute is false, then data from the previous catalog overlays the existing data in the delta file. The `is_full_delta` attribute is always `true` the first time a catalog is published. + * + */ + export_full_delta?: boolean + /** + * If you are publishing a catalog in a store that contains resources from an organization, you must set this to true and you must enable the **Include Organization Resources in Catalog Publishes** checkbox in Commerce Manager. See [**Multi-Store Management Solutions**](/docs/api/pxm/catalog/publish-release). + */ + include_organization_resources?: boolean | null + } +} + +/** + * Included is an array of resources that are included in the response. + */ +export type Included = { + /** + * The main images associated with a product. + */ + main_images?: Array + /** + * The component products associated with a product. + */ + component_products?: Array + /** + * The files associated with a product. + */ + files?: Array +} + +export type ElasticPathFile = { + /** + * The unique identifier for this file. + */ + id?: string + /** + * The type represents the object being returned. + */ + type?: string + /** + * The name of the file. + */ + file_name?: string + /** + * The mime type of the file. + */ + mime_type?: string + /** + * The size of the file. Required when uploading files. + */ + file_size?: number + /** + * DEPRECATED Whether the file public or not. Required when uploading files. + */ + public?: boolean + meta?: FileMeta + links?: Links + link?: FileLink +} + +export type FileMeta = { + /** + * The date and time the file was created. + */ + timestamps?: { + /** + * The date and time the file was created. + */ + created_at?: string + } + /** + * The file dimensions. + */ + dimensions?: { + /** + * The width of the file. + */ + width?: number + /** + * The height of the file. + */ + height?: number + } +} + +/** + * The publicly available URL for this file. + */ +export type FileLink = { + /** + * The publicly available URL for this file. + */ + href?: string +} + +export type CartsRequest = { + /** + * The cart description. + */ + description?: string + discount_settings?: DiscountSettings + /** + * The cart name provided by the shopper. A cart name must contain 1 to 255 characters. You cannot use whitespace characters, but special characters are permitted. For more information, see the [Safe Characters](/guides/Getting-Started/safe-characters) section. + */ + name?: string + /** + * This optional parameter sets a reference date for the cart. If this parameter is set, it allows the cart to act as one that might occur on that specified date. For example, such future carts might acquire future-enabled discounts, allowing users to test and validate future interactions with carts. The snapshot_date must be in the format 2026-02-21T15:07:25Z. By default, this parameter is left empty. + */ + snapshot_date?: string + custom_attributes?: CustomAttributes + /** + * To remove the Stripe payment intent from a cart, pass the empty value in the `payment_intent_id` field. You must use an empty value for this field. You cannot use this endpoint to directly update the cart to use an existing Payment Intent. + */ + payment_intent_id?: string +} + +export type DiscountSettings = { + /** + * This parameter enables custom discounts for a cart. When set to true, Elastic Path promotions will not be applied to the new carts. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + */ + custom_discounts_enabled?: boolean + /** + * When set to true, this parameter allows the cart to use rule promotions. + */ + use_rule_promotions?: boolean +} + +export type CustomAttributes = { + /** + * Specifies the custom attributes for the cart object. The attribute can be any string, numerical, and underscore. A cart can have maximum of 20 custom attributes. + */ + custom_attributes?: { + /** + * Specifies the attribute `type` and `value`. + */ + attribute?: { + /** + * Specifies the type of the attribute such as string, integer, boolean, and float. + */ + type?: string + /** + * Specifies the value of the attribute. + */ + value?: string | number | boolean + } + } +} + +export type CartResponse = { + /** + * The unique identifier for the cart. Use SDK or create it yourself. + */ + id?: string + /** + * The type of object being returned. + */ + type?: string + /** + * The name of this cart. + */ + name?: string + /** + * A description of the cart. + */ + description?: string + discount_settings?: DiscountSettings + /** + * Stripe-assigned unique identifier for the linked Payment Intent + */ + payment_intent_id?: string + links?: { + /** + * A link to that specific resource. + */ + self?: string + } + meta?: { + display_price?: { + with_tax?: FormattedPriceData + without_tax?: FormattedPriceData + tax?: FormattedPriceData + discount?: FormattedPriceData + without_discount?: FormattedPriceData + shipping?: FormattedPriceData + } + timestamps?: Timestamps + } + relationships?: { + customers?: { + data?: { + /** + * The type of related object. + */ + type?: string + /** + * The ID of the customer. + */ + readonly id?: string + } + } + items?: { + data?: { + /** + * The type of related object. + */ + type?: string + /** + * The unique identifier for the cart item + */ + readonly id?: string + } + } + } +} + +export type CartItemsObjectRequest = + | CartItemObject + | CartMergeObjectRequest + | CustomItemObject + | ReOrderObjectRequest + | PromotionItemObject + +export type CartItemObject = { + data?: CartItemObjectData & CartItemResponse +} + +export type CartItemObjectData = { + /** + * The type of object being returned. + */ + type: "cart_item" + /** + * The number of items added to the cart. + */ + quantity: number + /** + * Specifies the ID of the product you want to add to cart. (use this OR sku) + */ + id?: string + /** + * Specifies the item SKU that you want to add to cart. (use this OR id) + */ + sku?: string + /** + * The custom text to be added to a product. + */ + custom_inputs?: { + [key: string]: unknown + } + /** + * Object used to describe the bundle options selected. + */ + bundle_configuration?: { + /** + * Specifies selected options. + */ + selected_options?: { + [key: string]: unknown + } + } + /** + * Identifier for a created Cart Shipping Group + */ + shipping_group_id?: string +} + +/** + * The type of object being returned. + */ +export type type = "cart_item" + +export type CartMergeObjectRequest = { + data?: Array + options?: AddAllOrNothingOptionsObject +} + +export type CartMergeObject = { + /** + * The type of object being returned. Must be `cart_items`. + */ + type: "cart_items" + /** + * The original cart to be merged from. + */ + cart_id: string +} + +/** + * The type of object being returned. Must be `cart_items`. + */ +export type type2 = "cart_items" + +export type CustomItemObject = { + data?: CustomItemObjectData +} + +export type CustomItemObjectData = { + /** + * The type of object being returned. Must be `custom_item`. + */ + type: "custom_item" + /** + * The number of custom items to add to cart. + */ + quantity: number + price: { + /** + * The unit price of the custom item. + */ + amount: number + /** + * Set to`true` if relevant taxes have been included in the price, `false` if not. Defaults to `true`. + */ + includes_tax?: boolean + } + /** + * A description of the custom item. + */ + description?: string + /** + * The `SKU` code to use for the custom item. See [best practices](https://elasticpath.dev/docs/commerce-cloud/carts/cart-items/add-custom-item-to-cart#best-practices) to use the `SKU` code. + */ + sku?: string + /** + * The name of the custom item. + */ + name: string + /** + * The custom text to be added to a product. + */ + custom_inputs?: { + [key: string]: unknown + } + /** + * Identifier for a created Cart Shipping Group + */ + shipping_group_id?: string +} + +/** + * The type of object being returned. Must be `custom_item`. + */ +export type type3 = "custom_item" + +export type ReOrderObjectRequest = { + data?: ReOrderObject + options?: AddAllOrNothingOptionsObject +} + +export type ReOrderObject = { + /** + * The type of resource being returned. Use `order_items`. + */ + type: "order_items" + /** + * The unique identifier of the order. + */ + order_id: string +} + +/** + * The type of resource being returned. Use `order_items`. + */ +export type type4 = "order_items" + +export type BulkAddItemsRequest = { + data?: + | CartItemsObjectRequest + | CartMergeObjectRequest + | CustomItemObject + | ReOrderObjectRequest + | PromotionItemObject +} + +export type PromotionItemObject = { + data?: PromotionItemObjectData +} + +export type PromotionItemObjectData = { + /** + * Specifies the type of resource, which is `promotion_item`. + */ + type: "promotion_item" + /** + * Specifies the promotion code. For more information about codes[].user[], see the [Create Promotion codes](/docs/api/promotions/create-promotion-codes) section. + */ + code: string +} + +/** + * Specifies the type of resource, which is `promotion_item`. + */ +export type type5 = "promotion_item" + +export type BulkUpdateCartsItems = { + data?: Array<{ + /** + * Specifies the ID of the cart item that you want to update in cart. + */ + id?: string + /** + * Specifies the amount of items to update in the cart. + */ + quantity?: number + /** + * Specifies the custom text to be added to a product. See [custom inputs](https://elasticpath.dev/docs/pxm/products/ep-pxm-products-api/update-a-product#using-custom-inputs-attribute). + */ + custom_inputs?: { + [key: string]: unknown + } + }> + options?: UpdateAllOrNothingOptionsObject +} + +export type UpdateCartsItems = { + data?: { + /** + * The unique identifier of the cart item. + */ + id?: string + /** + * The amount of products to add to cart. + */ + quantity?: number + /** + * The custom text to be added to a product. + */ + custom_inputs?: { + [key: string]: unknown + } + /** + * The unique identifier of the shipping group to be added to the cart. + */ + shipping_group_id?: string + } +} + +export type AddAllOrNothingOptionsObject = { + /** + * When `true`, if an error occurs for any item, no items are added to the cart. When `false`, valid items are added to the cart and the items with errors are reported in the response. Default is `false`. + */ + add_all_or_nothing?: boolean +} + +export type UpdateAllOrNothingOptionsObject = { + /** + * When set to`true`, if an error occurs for any item, no items are updated in the cart. When set to `false`, valid items are updated in the cart and the items with errors are reported in the response. Default is `true`. + */ + update_all_or_nothing?: boolean +} + +export type CartItemResponse = { + /** + * The unique ID of the product. + */ + readonly product_id?: string + /** + * The name of this item + */ + readonly name?: string + /** + * A description of the cart item. + */ + readonly description?: string + /** + * The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set. + */ + readonly catalog_id?: string + /** + * The catalog source. Always `pim` or `legacy`. + */ + readonly catalog_source?: string + readonly image?: { + /** + * The MIME type for the uploaded file. + */ + readonly mime_type?: string + /** + * The name of the image file that was uploaded. + */ + readonly file_name?: string + /** + * The link to the image. + */ + readonly href?: string + } + readonly manage_stock?: boolean + readonly unit_price?: ItemPriceData + readonly value?: ItemPriceData + readonly links?: { + /** + * A URL related to the resource. + */ + product?: string + } + readonly meta?: { + display_price?: { + with_tax?: FormattedPriceData + without_tax?: FormattedPriceData + tax?: FormattedPriceData + discount?: FormattedPriceData + without_discount?: FormattedPriceData + } + timestamps?: Timestamps + } +} + +export type CartsResponse = { + data?: Array + meta?: { + display_price?: { + with_tax?: FormattedPriceData + without_tax?: FormattedPriceData + tax?: FormattedPriceData + discount?: FormattedPriceData + without_discount?: FormattedPriceData + discounts?: { + [key: string]: { + amount?: number + currency?: string + formatted?: string + } + } + } + timestamps?: CartTimestamps + } +} + +export type ItemPriceData = { + /** + * The amount for this item as an integer. + */ + readonly amount?: number + /** + * The currency this item was added to the cart as. + */ + readonly currency?: string + /** + * Whether or not this price is tax inclusive. + */ + readonly includes_tax?: boolean +} + +export type CartsRelationshipsAccountsData = { + data?: Array<{ + /** + * The ID of the account. + */ + id?: string + /** + * The type of related object. Ensure that it is account. + */ + type?: string + }> +} + +export type CartsRelationshipsCustomersData = { + data?: Array<{ + /** + * The ID of the customer. + */ + id?: string + /** + * The type of related object. Ensure that it is customer. + */ + type?: string + }> +} + +export type CartsItemsTaxesObject = { + /** + * A unique tax code in this jurisdiction. + */ + code?: string + /** + * The relevant tax jurisdiction. + */ + jurisdiction?: string + /** + * The name of the tax item. + */ + name?: string + /** + * The tax rate represented as a decimal (12.5% -> 0.125). + */ + rate: number + /** + * The type of object being returned. Use `tax_item`. + */ + type: string + /** + * The unique identifier for this tax item. + */ + readonly id?: string +} + +export type CartsBulkCustomDiscounts = { + data?: Array + options?: AddAllOrNothingOptionsObject +} + +export type CartsBulkCustomDiscountsResponse = { + data?: Array + options?: AddAllOrNothingOptionsObject +} + +export type CartItemBulkCustomDiscountObject = CartsCustomDiscountsObject & + CustomDiscountRelationshipsCartItemRequest + +export type ArtItemBulkCustomDiscountResponse = CartsCustomDiscountsResponse & + CustomDiscountRelationshipsCartItemRequest + +export type CartsCustomDiscountsObject = { + /** + * Specifies an amount to be applied for the custom discount. It must be less than zero. + */ + amount: number + /** + * Specifies a description for the custom discount. + */ + description: string + /** + * Specifies the discount code used for the custom discount. + */ + discount_code: string + /** + * Specifies from where the custom discount is applied. For example, Talon.one. + */ + discount_engine: string + /** + * Specifies an external id for the custom discount. + */ + external_id: string + /** + * Specifies the type of the resource. Always `custom_discount`. + */ + type: string +} + +export type CartsCustomDiscountsResponse = { + amount?: { + /** + * Specifies an amount to be applied for the custom discount. It must be less than zero. + */ + amount?: number + /** + * The currency set for the custom discount. + */ + currency?: string + /** + * The formatted value for the custom discount. + */ + formatted?: string + } + /** + * Specifies a description for the custom discount. + */ + description?: string + /** + * Specifies the discount code used for the custom discount. + */ + discount_code?: string + /** + * Specifies from where the custom discount is applied. For example, Talon.one. + */ + discount_engine?: string + /** + * Specifies an external id for the custom discount. + */ + external_id?: string + /** + * Specifies the type of the resource. Always `custom_discount`. + */ + type?: string + /** + * Specifies the UUID of the custom discount. + */ + readonly id?: string +} + +export type CustomDiscountRelationshipsCartItemRequest = { + relationships?: { + item?: { + data?: { + /** + * Specifies the type of item. For example, `custom_item` or `cart_item`. + */ + type?: string + /** + * Specifies the unique identifier of the `cart_item` or `custom_item` in the cart. + */ + id?: string + } + } + } +} + +export type CartItemRelationship = { + relationships?: { + order?: { + data?: { + /** + * This specifies the type of item. + */ + type?: string + /** + * This specifies the ID of the cart_item or custom_item in the cart. + */ + id?: string + } + } + } +} + +export type CartsBulkTaxes = { + data?: Array + options?: AddAllOrNothingOptionsObject +} + +export type OrdersAnonymizeRequest = { + data?: OrdersAnonymizeData +} + +export type OrdersAnonymizeData = { + /** + * The unique identifiers of the orders to be anonymized. You can anonymize multiple orders at the same time. + */ + order_ids?: Array +} + +export type OrdersUpdateRequest = { + data?: OrdersAddressData | OrdersCancelData | OrdersFulfulledData +} + +export type OrdersAddressData = { + /** + * Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + */ + external_ref?: string + shipping_address: { + /** + * Specifies the first name of the address holder. + */ + first_name?: string + /** + * Specifies the last name of the address holder. + */ + last_name?: string + /** + * Specifies the phone number of the address holder. + */ + phone_number?: string + /** + * Specifies the company name. + */ + company_name?: string + /** + * Specifies the first line of the address. + */ + line_1?: string + /** + * Specifies the second line of the address. + */ + line_2?: string + /** + * Specifies the name of the city in the shipping address. + */ + city?: string + /** + * Specifies the county of the shipping address. + */ + county?: string + /** + * Specifies the state, province, or region of the shipping address. + */ + region?: string + /** + * Specifies the postcode or ZIP code of the address. + */ + postcode?: string + /** + * Specifies the country in the shipping address. + */ + country?: string + /** + * Specifies any instructions provided with the shipping address. + */ + instructions?: string + } +} + +export type OrdersCancelData = { + /** + * The status of the order. You can only update the status to `cancelled`. + */ + status: string + /** + * The type of the resource. You must use order. + */ + type: string + /** + * Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + */ + external_ref?: string +} + +export type OrdersFulfulledData = { + /** + * The shipping status of the order. You can only update the shipping status to `fulfilled`. + */ + shipping: string + /** + * The type of the resource. You must use order. + */ + type: string + /** + * Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + */ + external_ref?: string +} + +export type PaymentsRequest = { + data?: DataPaymentObject +} + +export type DataBasePayments = { + gateway: + | "adyen" + | "authorize_net" + | "braintree" + | "card_connect" + | "cyber_source" + | "elastic_path_payments_stripe" + | "manual" + | "paypal_express_checkout" + | "stripe" + | "stripe_connect" + | "stripe_payment_intents" + /** + * Specifies the transaction method, such as `purchase` or `authorize`. + */ + method: "authorize" | "purchase" | "purchase_setup" | "authorize_setup" + /** + * The amount to be paid for the transaction. + */ + amount?: number +} + +export type gateway = + | "adyen" + | "authorize_net" + | "braintree" + | "card_connect" + | "cyber_source" + | "elastic_path_payments_stripe" + | "manual" + | "paypal_express_checkout" + | "stripe" + | "stripe_connect" + | "stripe_payment_intents" + +/** + * Specifies the transaction method, such as `purchase` or `authorize`. + */ +export type method = + | "authorize" + | "purchase" + | "purchase_setup" + | "authorize_setup" + +export type DataAdyenPayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `adyen`. + */ + gateway?: "adyen" + options?: { + /** + * The shopper reference token associated with the saved payment method. + */ + shopper_reference?: string + /** + * Enter CardOnFile for a one-time purchase. + */ + recurring_processing_model?: string + } + /** + * The Adyen recurringDetailReference payment method identifier. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `adyen`. + */ + gateway: "adyen" + /** + * The Adyen recurringDetailReference payment method identifier. + */ + payment: string +} + +/** + * Specifies the gateway. You must use `adyen`. + */ +export type gateway2 = "adyen" + +export type DataAuthorizeNetPayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `authorize_net`. + */ + gateway?: "authorize_net" + options?: { + /** + * The Authorize.net customer payment profile ID. + */ + customer_payment_profile_id?: string + } + /** + * The Authorize.net customer profile ID. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `authorize_net`. + */ + gateway: "authorize_net" + /** + * The Authorize.net customer profile ID. + */ + payment: string +} + +/** + * Specifies the gateway. You must use `authorize_net`. + */ +export type gateway3 = "authorize_net" + +export type DataBraintreePayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `braintree`. + */ + gateway?: "braintree" + /** + * The Braintree Customer ID that you want to bill. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `braintree`. + */ + gateway: "braintree" + /** + * The Braintree Customer ID that you want to bill. + */ + payment: string +} + +/** + * Specifies the gateway. You must use `braintree`. + */ +export type gateway4 = "braintree" + +export type DataCardConnectPayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `card_connect`. + */ + gateway?: "card_connect" + /** + * Enter account_id, profile_id from CardPointe API. For example, 1|16178397535388255208. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `card_connect`. + */ + gateway: "card_connect" + /** + * Enter account_id, profile_id from CardPointe API. For example, 1|16178397535388255208. + */ + payment: string +} + +/** + * Specifies the gateway. You must use `card_connect`. + */ +export type gateway5 = "card_connect" + +export type DataCyberSourcePayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `cyber_source`. + */ + gateway?: "cyber_source" + /** + * The CyberSource token. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `cyber_source`. + */ + gateway: "cyber_source" + /** + * The CyberSource token. + */ + payment: string +} + +/** + * Specifies the gateway. You must use `cyber_source`. + */ +export type gateway6 = "cyber_source" + +export type ElasticPathPaymentsPoweredByStripePayment = DataBasePayments & { + /** + * Specifies the gateway. You must use `elastic_path_payments_stripe`. + */ + gateway?: "elastic_path_payments_stripe" + options?: { + /** + * Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + */ + receipt_email?: string + /** + * Parent object determining whether to use Stripe's `automatic_payment_methods` setting. + */ + automatic_payment_methods?: { + /** + * When set to true, it displays all enabled payment methods from the Stripe dashboard. When set to false, the Stripe default, which is card, is used. + */ + enabled?: boolean + } + } + /** + * Specifies the Stripe payment method types configured for the store. See [Stripe Documentation](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_types). + */ + payment_method_types?: Array + /** + * Specifies the Stripe token or source. + */ + payment?: string +} & { + /** + * Specifies the gateway. You must use `elastic_path_payments_stripe`. + */ + gateway: "elastic_path_payments_stripe" +} + +/** + * Specifies the gateway. You must use `elastic_path_payments_stripe`. + */ +export type gateway7 = "elastic_path_payments_stripe" + +export type DataManualPayment = DataBasePayments & { + /** + * Specifies the type of payment gateway. You must use `manual`. + */ + gateway?: "manual" + paymentmethod_meta?: { + /** + * A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend not to include personal information in this field. + */ + custom_reference?: string + /** + * A custom name associated with the payment method. + */ + name?: string + } +} & { + /** + * Specifies the type of payment gateway. You must use `manual`. + */ + gateway: "manual" +} + +/** + * Specifies the type of payment gateway. You must use `manual`. + */ +export type gateway8 = "manual" + +export type DataPayPalExpressCheckoutPayment = DataBasePayments & { + /** + * Specifies the type of payment gateway. You must use `paypal_express_checkout`. + */ + gateway?: "paypal_express_checkout" + options?: { + /** + * The description for the payment. + */ + description?: string + /** + * The descriptor appended to PayPal generated descriptor that is visible on the card statement of the payer. + */ + soft_descriptor?: string + application_context?: { + /** + * The label that overrides the business name in the PayPal account on the payPal site. + */ + brand_name?: string + /** + * The locale pages that appear based on language and country code. PayPal supports a five-character code. For example, ja-JP. + */ + locale?: string + /** + * The type of landing page to show on the PayPal site for customer checkout. Use values LOGIN, BILLING, or NO_PREFERENCE. + */ + landing_page?: string + /** + * The shipping preference. Use SET_PROVIDED_ADDRESS value. This parameter does allow the user to change their address on PayPal site. + */ + shipping_preference?: string + /** + * If you set `useraction=commit` in the query string, the flow redirects the buyer to the PayPal payment page and displays a Pay Now button. When the shopper clicks **Pay Now**, call `DoExpressCheckoutPayment` to complete the payment without additional interaction from the shopper. Choose this flow when you know the final payment amount when you initiate the checkout flow. + */ + user_action?: string + /** + * The callback URL for PayPal to redirect the user in the case of approved payment. + */ + return_url?: string + /** + * The callback URL for PayPal to redirect user in the case a cancelled payment. + */ + cancel_url?: string + } + } +} & { + /** + * Specifies the type of payment gateway. You must use `paypal_express_checkout`. + */ + gateway: "paypal_express_checkout" +} + +/** + * Specifies the type of payment gateway. You must use `paypal_express_checkout`. + */ +export type gateway9 = "paypal_express_checkout" + +export type DataStripePayment = DataBasePayments & { + /** + * Specifies the type of payment gateway. You must use `stripe`. + */ + gateway?: "stripe" + options?: { + /** + * The option to provide an email for Stripe receipts. Specify live mode to access this feature. + */ + receipt_email?: string + } + /** + * The Stripe token or source. + */ + payment?: string +} & { + /** + * Specifies the type of payment gateway. You must use `stripe`. + */ + gateway: "stripe" +} + +/** + * Specifies the type of payment gateway. You must use `stripe`. + */ +export type gateway10 = "stripe" + +export type DataStripeConnectPayment = DataBasePayments & { + /** + * Specifies the type of payment gateway. You must use `stripe_connect`. + */ + gateway?: "stripe_connect" + options?: { + /** + * Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + */ + receipt_email?: string + } + /** + * Specifies the Stripe token or source. + */ + payment?: string +} & { + /** + * Specifies the type of payment gateway. You must use `stripe_connect`. + */ + gateway: "stripe_connect" +} + +/** + * Specifies the type of payment gateway. You must use `stripe_connect`. + */ +export type gateway11 = "stripe_connect" + +export type DataStripePaymentIntentsPayment = DataBasePayments & { + /** + * Specifies the type of payment gateway. You must use `stripe_payment_intents`. + */ + gateway?: "stripe_payment_intents" + options?: { + /** + * Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + */ + receipt_email?: string + } + /** + * Specifies the Stripe token or source. + */ + payment?: string +} & { + /** + * Specifies the type of payment gateway. You must use `stripe_payment_intents`. + */ + gateway: "stripe_payment_intents" +} + +/** + * Specifies the type of payment gateway. You must use `stripe_payment_intents`. + */ +export type gateway12 = "stripe_payment_intents" + +export type DataPaymentObject = + | DataAdyenPayment + | DataAuthorizeNetPayment + | DataBraintreePayment + | DataCardConnectPayment + | DataCyberSourcePayment + | ElasticPathPaymentsPoweredByStripePayment + | DataManualPayment + | DataPayPalExpressCheckoutPayment + | DataStripePayment + | DataStripeConnectPayment + | DataStripePaymentIntentsPayment + +export type TransactionResponse = { + /** + * The ID of the transaction. + */ + readonly id?: string + /** + * The payment gateway reference. + */ + reference?: string + /** + * A custom name associated with the payment method. + */ + name?: string + /** + * A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field. + */ + custom_reference?: string + /** + * The name of the payment gateway used. + */ + gateway?: + | "adyen" + | "authorize_net" + | "braintree" + | "card_connect" + | "cyber_source" + | "elastic_path_payments_stripe" + | "manual" + | "paypal_express_checkout" + | "stripe" + | "stripe_connect" + | "stripe_payment_intents" + /** + * The amount for this transaction. + */ + amount?: number + /** + * The refunded amount. + */ + refunded_amount?: number + /** + * The transaction currency. + */ + currency?: string + /** + * The type of transaction, such as `purchase`, `capture`, `authorize` or `refund`. + */ + "transaction-type"?: string + /** + * The status provided by the gateway for this transaction, such as `complete` or `failed`. + */ + status?: string + relationships?: { + order?: { + data?: { + /** + * Represents the type of the object being returned. It is always `order`. + */ + type?: string + /** + * The ID of the order. + */ + id?: string + } + } + } + meta?: { + display_price?: FormattedPriceData + display_refunded_amount?: FormattedPriceData + timestamps?: Timestamps + } +} + +export type OrdersTransactionsConfirmRequest = { + data?: { + [key: string]: unknown + } +} + +export type OrdersTransactionsCaptureRequest = { + data?: { + options?: { + soft_descriptor?: string + note_to_payer?: string + } + } +} + +export type OrdersTransactionsRefundRequest = { + data?: { + /** + * The amount value to be refunded. If this field is not provided, it will be considered as manual refund (Mark as Refunded) and the refund process must be manually handled via payment provider. If the amount value is same as payment value, then it will be treated as a full refund and sent to the payment provider to process refund automatically. + */ + amount?: number + options?: { + /** + * Provides comments about the refund. It is used by PayPal Express. + */ + note?: string + } + } +} + +export type OrdersTransactionsCancelRequest = { + data?: { + options?: { + [key: string]: unknown + } + /** + * Specifies the reason for canceling the transaction. The reason may include `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. + */ + reason?: string + } +} + +export type OrderPriceData = { + /** + * The amount for this item. + */ + amount?: number + /** + * The currency this item. + */ + currency?: string + /** + * Whether or not this price is tax inclusive. + */ + includes_tax?: boolean +} + +export type FormattedPriceData = { + /** + * The raw total of this cart. + */ + amount?: number + /** + * The currency set for this cart. + */ + currency?: string + /** + * The tax inclusive formatted total based on the currency. + */ + formatted?: string +} + +export type OrderItemFormattedUnitPriceData = { + unit?: FormattedPriceData + value?: FormattedPriceData +} + +export type DiscountData = { + amount?: OrderPriceData + code?: string + readonly id?: string +} + +export type OrderItemResponse = { + /** + * The type represents the object being returned. + */ + type?: string + /** + * The unique identifier for this order item. + */ + readonly id?: string + /** + * The quantity of this item were ordered. + */ + quantity?: number + /** + * The unique identifier for this order item. + */ + readonly product_id?: string + /** + * The name of this order item. + */ + name?: string + /** + * The SKU code for the order item. + */ + sku?: string + unit_price?: OrderPriceData + value?: OrderPriceData + discounts?: Array + links?: { + [key: string]: unknown + } + meta?: { + display_price?: { + with_tax?: OrderItemFormattedUnitPriceData + without_tax?: OrderItemFormattedUnitPriceData + tax?: OrderItemFormattedUnitPriceData + discount?: OrderItemFormattedUnitPriceData + without_discount?: OrderItemFormattedUnitPriceData + discounts?: { + [key: string]: { + amount?: number + currency?: string + formatted?: string + } + } + } + timestamps?: Timestamps + } + relationships?: { + cart_item?: { + data?: { + /** + * The type represents the object being returned. + */ + type?: string + /** + * The unique identifier for this item. + */ + readonly id?: string + } + } + } + /** + * The unique identifier of the catalog associated with the product is shown if `catalog_source=pim` is set. + */ + catalog_id?: string + /** + * The catalog source. Always `pim` or `legacy`. + */ + catalog_source?: string +} + +export type OrderResponse = { + /** + * Specifies the type of object being returned. You must use `order`. + */ + type?: string + /** + * Specifies the unique identifier of the order. + */ + readonly id?: string + /** + * Specifies the status of the order, such as `incomplete`, `complete`, `processing`, or `cancelled`. + */ + status?: string + /** + * Specifies the status of the payment, such as `unpaid`, `authorized`, `paid`, or `refunded`. + */ + payment?: string + /** + * Specifies the status of the shipment, such as `fulfilled` or `unfulfilled`. + */ + shipping?: string + /** + * Specifies if the order is anonymized. + */ + anonymized?: boolean + meta?: OrderMeta + billing_address?: BillingAddress + contact?: Contact + shipping_address?: ShippingAddress +} + +export type OrderMeta = { + timestamps?: Timestamps + with_tax?: FormattedPriceData + without_tax?: FormattedPriceData + tax?: FormattedPriceData + discount?: FormattedPriceData + paid?: FormattedPriceData + authorized?: FormattedPriceData + without_discount?: FormattedPriceData +} + +export type CustomerCheckout = { + data?: { + customer?: { + /** + * The ID of the customer. + */ + id?: string + } + billing_address?: BillingAddress + shipping_address?: ShippingAddress + } +} + +export type AccountCheckout = { + data?: { + account?: { + /** + * The account ID. + */ + id?: string + /** + * The account member ID. + */ + member_id?: string + } + contact?: { + /** + * The name of the account member. + */ + name?: string + /** + * The email address of the account member. + */ + email?: string + } + billing_address?: BillingAddress + shipping_address?: ShippingAddress + } +} + +export type BillingAddress = { + /** + * Company name of the billing recipient. + */ + company_name?: string + /** + * Specifies the country of the billing address. + */ + country: string + /** + * Specifies the county of the billing address. + */ + county?: string + /** + * First name of the billing recipient. + */ + first_name: string + /** + * Last name of the billing recipient. + */ + last_name: string + /** + * First line of the billing address. + */ + line_1: string + /** + * Second line of the billing address. + */ + line_2?: string + /** + * Postcode of the billing address. + */ + postcode: string + /** + * Specifies state, province, or region of the billing address. + */ + region: string +} + +export type Contact = { + /** + * The email address of the contact. + */ + email?: string + /** + * The name of the contact. + */ + name?: string +} + +export type ShippingAddress = { + /** + * Company of the shipping recipient. + */ + company_name?: string + /** + * Specifies the country of the shipping address. + */ + country: string + /** + * Specifies the county of the shipping address. + */ + county?: string + /** + * First name of the shipping recipient. + */ + first_name: string + /** + * Last name of the shipping recipient. + */ + last_name: string + /** + * First line of the shipping address. + */ + line_1: string + /** + * Second line of the shipping address. + */ + line_2?: string + /** + * Post code of the shipping address. + */ + postcode: string + /** + * Specifies the state, province, or region of the shipping address. + */ + region: string +} + +export type ResponseMetaCarts = { + page?: ResponsePaginationPage + results?: ResponsePaginationResults +} + +export type ResponseMetaOrders = { + page?: ResponsePaginationPage + results?: ResponsePaginationResults +} + +export type ResponsePaginationPage = { + /** + * The current page. + */ + current?: number + /** + * The maximum number of records per page for this response. You can set this value up to 100. + */ + limit?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. + */ + offset?: number + /** + * The total page count. + */ + total?: number +} + +export type ResponsePaginationResults = { + /** + * The total page count. + */ + total?: number +} + +export type ResponsePageLinks = { + /** + * Always the current page. + */ + current?: string + /** + * Always the first page. + */ + first?: string + /** + * If there is only one page, it is `null`. + */ + last?: string + /** + * If there is only one page, it is `null`. + */ + next?: string + /** + * if the user is on the first page, it is `null`. + */ + prev?: string +} + +export type ResponseData = { + data?: unknown +} + +export type ResponseError = { + detail?: string + status?: string + title?: string +} + +export type Timestamps = { + /** + * The date this was created. + */ + created_at?: string + /** + * The date this was last updated. + */ + updated_at?: unknown +} + +export type CartTimestamps = { + created_at?: string + updated_at?: unknown + expires_at?: unknown +} + +/** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ +export type ParameterAcceptLanguage = string + +/** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ +export type ParameterChannel = string + +/** + * This endpoints supports filtering. See [Filtering](#filtering). + * + */ +export type ParameterFilterHierarchy = string + +/** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ +export type ParameterFilterNode = string + +/** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ +export type ParameterFilterProduct = string + +/** + * This endpoint supports filtering. See [Filtering](#filtering). + * + */ +export type ParameterFilterRule = string + +/** + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products. + * + */ +export type ParameterInclude = Array< + "main_images" | "files" | "component_products" +> + +/** + * Using the `include=component_products` parameter, you can retrieve key attribute data for the bundle component products in the product bundle, such as SKU or slug . + * + */ +export type ParameterIncludeComponentProducts = string + +/** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ +export type ParameterLimit = number + +/** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ +export type ParameterOffset = number + +/** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ +export type ParameterTag = string + +export type GetByContextReleaseData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } +} + +export type GetByContextReleaseResponse = ReleaseData + +export type GetByContextReleaseError = ErrorResponse + +export type GetByContextAllHierarchiesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + query?: { + /** + * This endpoints supports filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextAllHierarchiesResponse = HierarchyListData + +export type GetByContextAllHierarchiesError = ErrorResponse + +export type GetByContextHierarchyData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + } +} + +export type GetByContextHierarchyResponse = HierarchyData + +export type GetByContextHierarchyError = ErrorResponse + +export type GetByContextHierarchyNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextHierarchyNodesResponse = NodeListData + +export type GetByContextHierarchyNodesError = ErrorResponse + +export type GetByContextHierarchyChildNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextHierarchyChildNodesResponse = NodeListData + +export type GetByContextHierarchyChildNodesError = ErrorResponse + +export type GetByContextAllNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextAllNodesResponse = NodeListData + +export type GetByContextAllNodesError = ErrorResponse + +export type GetByContextNodeData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog node ID. + */ + node_id: string + } +} + +export type GetByContextNodeResponse = NodeData + +export type GetByContextNodeError = ErrorResponse + +export type GetByContextChildNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog node ID. + */ + node_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextChildNodesResponse = NodeListData + +export type GetByContextChildNodesError = ErrorResponse + +export type GetByContextAllProductsData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextAllProductsResponse = ProductListData + +export type GetByContextAllProductsError = ErrorResponse + +export type GetByContextProductData = { + headers?: { + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The product ID. + */ + product_id: string + } + query?: { + /** + * Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products. + * + */ + include?: Array<"main_images" | "files" | "component_products"> + } +} + +export type GetByContextProductResponse = ProductData + +export type GetByContextProductError = ErrorResponse + +export type GetByContextComponentProductIdsData = { + headers?: { + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The product ID. + */ + product_id: string + } + query?: { + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextComponentProductIdsResponse = ProductReferenceListData + +export type GetByContextComponentProductIdsError = ErrorResponse + +export type GetByContextChildProductsData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The product ID. + */ + product_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextChildProductsResponse = ProductListData + +export type GetByContextChildProductsError = ErrorResponse + +export type GetByContextProductsForHierarchyData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextProductsForHierarchyResponse = ProductListData + +export type GetByContextProductsForHierarchyError = ErrorResponse + +export type GetByContextProductsForNodeData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The catalog node ID. + */ + node_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetByContextProductsForNodeResponse = ProductListData + +export type GetByContextProductsForNodeError = ErrorResponse + +export type ConfigureByContextProductData = { + /** + * The bundle configuration. + */ + body: BundleConfigurationData + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + /** + * The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + */ + "EP-Channel"?: string + /** + * Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + */ + "EP-Context-Tag"?: string + } + path: { + /** + * The product ID. + */ + product_id: string + } +} + +export type ConfigureByContextProductResponse = ProductData + +export type ConfigureByContextProductError = ErrorResponse + +export type CreateCatalogData = { + /** + * Creates a catalog with the following attributes. + */ + body: CatalogCreateData +} + +export type CreateCatalogResponse = CatalogData + +export type CreateCatalogError = ErrorResponse + +export type GetCatalogsResponse = CatalogListData + +export type GetCatalogsError = ErrorResponse + +export type GetCatalogByIdData = { + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type GetCatalogByIdResponse = CatalogData + +export type GetCatalogByIdError = ErrorResponse + +export type UpdateCatalogData = { + /** + * Updated catalog. + */ + body: CatalogUpdateData + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type UpdateCatalogResponse = CatalogData + +export type UpdateCatalogError = ErrorResponse + +export type DeleteCatalogByIdData = { + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type DeleteCatalogByIdResponse = void + +export type DeleteCatalogByIdError = ErrorResponse + +export type PublishReleaseData = { + /** + * Options for catalog release publishing + */ + body?: CatalogReleaseCreateData + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type PublishReleaseResponse = ReleaseData + +export type PublishReleaseError = ErrorResponse + +export type GetReleasesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type GetReleasesResponse = ReleaseListData + +export type GetReleasesError = ErrorResponse + +export type DeleteReleasesData = { + path: { + /** + * The catalog ID. + */ + catalog_id: string + } +} + +export type DeleteReleasesResponse = void + +export type DeleteReleasesError = ErrorResponse + +export type GetReleaseByIdData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog release ID. + */ + release_id: string + } +} + +export type GetReleaseByIdResponse = ReleaseData + +export type GetReleaseByIdError = ErrorResponse + +export type DeleteReleaseByIdData = { + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog release ID. + */ + release_id: string + } +} + +export type DeleteReleaseByIdResponse = void + +export type DeleteReleaseByIdError = ErrorResponse + +export type CreateRuleData = { + /** + * Creates a catalog rule with the following attributes. + */ + body: RuleCreateData +} + +export type CreateRuleResponse = RuleData + +export type CreateRuleError = ErrorResponse + +export type GetRulesData = { + query?: { + /** + * This endpoint supports filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetRulesResponse = RuleListData + +export type GetRulesError = ErrorResponse + +export type GetRuleByIdData = { + path: { + /** + * The catalog rule ID. + */ + catalog_rule_id: string + } +} + +export type GetRuleByIdResponse = RuleData + +export type GetRuleByIdError = ErrorResponse + +export type UpdateRuleData = { + /** + * An updated catalog rule with the following attributes. + */ + body: RuleUpdateData + path: { + /** + * The catalog rule ID. + */ + catalog_rule_id: string + } +} + +export type UpdateRuleResponse = RuleData + +export type UpdateRuleError = ErrorResponse + +export type DeleteRuleByIdData = { + path: { + /** + * The catalog rule ID. + */ + catalog_rule_id: string + } +} + +export type DeleteRuleByIdResponse = void + +export type DeleteRuleByIdError = ErrorResponse + +export type GetAllHierarchiesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoints supports filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetAllHierarchiesResponse = HierarchyListData + +export type GetAllHierarchiesError = ErrorResponse + +export type GetHierarchyData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } +} + +export type GetHierarchyResponse = HierarchyData + +export type GetHierarchyError = ErrorResponse + +export type GetHierarchyNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + /** + * The catalog release ID. + */ + release_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetHierarchyNodesResponse = NodeListData + +export type GetHierarchyNodesError = ErrorResponse + +export type GetHierarchyChildNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetHierarchyChildNodesResponse = NodeListData + +export type GetHierarchyChildNodesError = ErrorResponse + +export type GetAllNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetAllNodesResponse = NodeListData + +export type GetAllNodesError = ErrorResponse + +export type GetNodeData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog node ID. + */ + node_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } +} + +export type GetNodeResponse = NodeData + +export type GetNodeError = ErrorResponse + +export type GetChildNodesData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog node ID. + */ + node_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoint supports filtering, see [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetChildNodesResponse = NodeListData + +export type GetChildNodesError = ErrorResponse + +export type GetAllProductsData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetAllProductsResponse = ProductListData + +export type GetAllProductsError = ErrorResponse + +export type GetProductData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The product ID. + */ + product_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } +} + +export type GetProductResponse = ProductData + +export type GetProductError = ErrorResponse + +export type GetComponentProductIdsData = { + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The product ID. + */ + product_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetComponentProductIdsResponse = ProductReferenceListData + +export type GetComponentProductIdsError = ErrorResponse + +export type GetChildProductsData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The product ID. + */ + product_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetChildProductsResponse = ProductListData + +export type GetChildProductsError = ErrorResponse + +export type GetProductsForHierarchyData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog hierarchy ID. + */ + hierarchy_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetProductsForHierarchyResponse = ProductListData + +export type GetProductsForHierarchyError = ErrorResponse + +export type GetProductsForNodeData = { + headers?: { + /** + * The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + */ + "accept-language"?: string + } + path: { + /** + * The catalog ID. + */ + catalog_id: string + /** + * The catalog node ID. + */ + node_id: string + /** + * The unique identifier of a published release of the catalog or `latest` for the most recently published version. + */ + release_id: string + } + query?: { + /** + * This endpoints support filtering. See [Filtering](#filtering). + * + */ + filter?: string + /** + * The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[limit]"?: number + /** + * The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + */ + "page[offset]"?: number + } +} + +export type GetProductsForNodeResponse = ProductListData + +export type GetProductsForNodeError = ErrorResponse + +export type GetCartsData = { + headers?: { + /** + * An Account Management Authentication token to access a specific account's carts. + */ + "EP-Account-Management-Authentication-Token"?: string + /** + * A customer token to access a specific customer's carts. + */ + "x-moltin-customer-token"?: string + } +} + +export type GetCartsResponse = ResponseData & { + data?: Array + links?: ResponsePageLinks + meta?: ResponseMetaCarts +} + +export type GetCartsError = ResponseError + +export type CreateAcartData = { + body?: CartsRequest + headers?: { + /** + * A customer token to be associated with the cart. + */ + "x-moltin-customer-token"?: string + } +} + +export type CreateAcartResponse = ResponseData & { + data?: CartResponse +} + +export type CreateAcartError = ResponseError + +export type GetCartData = { + path: { + /** + * The unique identifier for this cart that you created. + */ + cartID: string + } +} + +export type GetCartResponse = ResponseData & { + data?: CartResponse +} + +export type GetCartError = ResponseError + +export type UpdateAcartData = { + body?: CartsRequest + path: { + /** + * The unique identifier of a cart created by you. + */ + cartID: string + } +} + +export type UpdateAcartResponse = ResponseData & { + data?: CartResponse +} + +export type UpdateAcartError = ResponseError + +export type DeleteAcartData = { + path: { + /** + * The unique identifier of the cart that you want to delete. + */ + cartID: string + } +} + +export type DeleteAcartResponse = void + +export type DeleteAcartError = ResponseError + +export type GetCartItemsData = { + path: { + /** + * The unique identifier of the cart that you created. + */ + cartID: string + } +} + +export type GetCartItemsResponse = CartsResponse + +export type GetCartItemsError = ResponseError + +export type BulkUpdateItemsInCartData = { + body?: BulkUpdateCartsItems + path: { + /** + * The unique identifier of the cart that you created. + */ + cartID: string + } +} + +export type BulkUpdateItemsInCartResponse = unknown + +export type BulkUpdateItemsInCartError = ResponseError + +export type ManageCartsData = { + body?: + | CartItemsObjectRequest + | CartMergeObjectRequest + | CustomItemObject + | ReOrderObjectRequest + | PromotionItemObject + | BulkAddItemsRequest + path: { + /** + * The unique identifier of the cart that you created. + */ + cartID: string + } +} + +export type ManageCartsResponse = CartsResponse + +export type ManageCartsError = ResponseError + +export type DeleteAllCartItemsData = { + path: { + /** + * The unique identifier of the cart created by you. + */ + cartID: string + } +} + +export type DeleteAllCartItemsResponse = void + +export type DeleteAllCartItemsError = ResponseError + +export type UpdateAcartItemData = { + body?: UpdateCartsItems + path: { + /** + * A unique identifier of the cart that you created. + */ + cartID: string + /** + * A unique identifier of the cart item. + */ + cartitemID: string + } +} + +export type UpdateAcartItemResponse = CartsResponse + +export type UpdateAcartItemError = ResponseError + +export type DeleteAcartItemData = { + path: { + /** + * The unique identifier of the cart created by you. + */ + cartID: string + /** + * The unique identifier of the cart that you want to delete. + */ + cartitemID: string + } +} + +export type DeleteAcartItemResponse = void + +export type DeleteAcartItemError = ResponseError + +export type CreateAccountCartAssociationData = { + body?: CartsRelationshipsAccountsData + headers?: { + /** + * An Account Management Authentication token to access a specific account's carts. + */ + "EP-Account-Management-Authentication-Token"?: string + } + path: { + /** + * The ID for the cart created by the account. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters). + */ + cartID: string + } +} + +export type CreateAccountCartAssociationResponse = + CartsRelationshipsAccountsData | void + +export type CreateAccountCartAssociationError = ResponseError + +export type DeleteAccountCartAssociationData = { + body?: CartsRelationshipsAccountsData + headers?: { + /** + * An Account Management Authentication token to access a specific account's carts. + */ + "EP-Account-Management-Authentication-Token"?: string + } + path: { + /** + * The ID for the cart created by the account. + */ + cartID: string + } +} + +export type DeleteAccountCartAssociationResponse = void + +export type DeleteAccountCartAssociationError = ResponseError + +export type CreateCustomerCartAssociationData = { + body?: CartsRelationshipsCustomersData + headers?: { + /** + * A customer token to access a specific customer's carts. + */ + "x-moltin-customer-token"?: string + } + path: { + /** + * The ID for the cart created by the customer. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters). + */ + cartID: string + } +} + +export type CreateCustomerCartAssociationResponse = + CartsRelationshipsCustomersData + +export type CreateCustomerCartAssociationError = ResponseError + +export type DeleteCustomerCartAssociationData = { + body?: CartsRelationshipsCustomersData + headers?: { + /** + * A customer token to access a specific customer's carts. + */ + "x-moltin-customer-token"?: string + } + path: { + /** + * The ID for the cart created by the customer. + */ + cartID: string + } +} + +export type DeleteCustomerCartAssociationResponse = void + +export type DeleteCustomerCartAssociationError = ResponseError + +export type DeleteApromotionViaPromotionCodeData = { + path: { + /** + * Specifies the unique identifier of a cart created by you. + */ + cartID: string + /** + * Specifies the promotion code to be deleted. + */ + promoCode: string + } +} + +export type DeleteApromotionViaPromotionCodeResponse = void + +export type DeleteApromotionViaPromotionCodeError = ResponseError + +export type AddTaxItemToCartData = { + body?: ResponseData & { + data?: CartsItemsTaxesObject + } + path: { + /** + * The unique identifier of the cart. + */ + cartID: string + /** + * The unique identifier of the cart item. + */ + cartitemID: string + } +} + +export type AddTaxItemToCartResponse = ResponseData & { + data?: CartsItemsTaxesObject +} + +export type AddTaxItemToCartError = ResponseError + +export type BulkAddTaxItemsToCartData = { + body?: CartsBulkTaxes + path: { + /** + * The unique identifier of the cart. + */ + cartID: string + } +} + +export type BulkAddTaxItemsToCartResponse = CartsBulkTaxes + +export type BulkAddTaxItemsToCartError = ResponseError + +export type BulkDeleteTaxItemsFromCartData = { + path: { + /** + * The unique identifier of the cart. + */ + cartID: string + } +} + +export type BulkDeleteTaxItemsFromCartResponse = void + +export type BulkDeleteTaxItemsFromCartError = ResponseError + +export type UpdateAtaxItemData = { + body?: ResponseData & { + data?: CartsItemsTaxesObject + } + path: { + /** + * The unique identifier of the cart. + */ + cartID: string + /** + * The unique identifier of the cart item. + */ + cartitemID: string + /** + * The unique identifier of the tax item. + */ + taxitemID: string + } +} + +export type UpdateAtaxItemResponse = ResponseData & { + data?: CartsItemsTaxesObject +} + +export type UpdateAtaxItemError = ResponseError + +export type DeleteAtaxItemData = { + path: { + /** + * The unique identifier of the cart. + */ + cartID: string + /** + * The unique identifier of the cart item. + */ + cartitemID: string + /** + * The unique identifier of the tax item. + */ + taxitemID: string + } +} + +export type DeleteAtaxItemResponse = void + +export type DeleteAtaxItemError = ResponseError + +export type BulkAddCustomDiscountsToCartData = { + body?: CartsBulkCustomDiscounts + path: { + /** + * Specifies the system generated ID for the cart that the shopper created. + */ + cartID: string + } +} + +export type BulkAddCustomDiscountsToCartResponse = + CartsBulkCustomDiscountsResponse + +export type BulkAddCustomDiscountsToCartError = ResponseError + +export type BulkDeleteCustomDiscountsFromCartData = { + path: { + /** + * Specifies the unique ID for the cart. + */ + cartID: string + } +} + +export type BulkDeleteCustomDiscountsFromCartResponse = void + +export type BulkDeleteCustomDiscountsFromCartError = ResponseError + +export type UpdateCustomDiscountForCartData = { + body?: ResponseData & { + data?: CartsCustomDiscountsObject + } + path: { + /** + * Specifies the unique ID for the cart. + */ + cartID: string + /** + * Specifies the ID for the custom discount to be updated. + */ + customdiscountID: string + } +} + +export type UpdateCustomDiscountForCartResponse = ResponseData & { + data?: CartsCustomDiscountsResponse +} + +export type UpdateCustomDiscountForCartError = ResponseError + +export type DeleteCustomDiscountFromCartData = { + path: { + /** + * Specifies the unique ID for the cart. + */ + cartID: string + /** + * Specifies the ID for the custom discount to be deleted. + */ + customdiscountID: string + } +} + +export type DeleteCustomDiscountFromCartResponse = void + +export type DeleteCustomDiscountFromCartError = ResponseError + +export type AddCustomDiscountToCartItemData = { + body?: CartsCustomDiscountsObject + path: { + /** + * Specifies the ID for the cart. + */ + cartID: string + /** + * Specifies the unique identifier for the cart item. + */ + cartitemID: string + } +} + +export type UpdateCustomDiscountForCartItemData = { + body?: ResponseData & { + data?: CartsCustomDiscountsObject + } + path: { + /** + * Specifies the ID for the cart. + */ + cartID: string + /** + * Specifies the ID for the cart item. + */ + cartitemID: string + /** + * Specifies the ID for the custom discount to be updated. + */ + customdiscountID: string + } +} + +export type DeleteCustomDiscountFromCartItemData = { + path: { + /** + * Specifies the ID for the cart. + */ + cartID: string + /** + * Specifies the ID for the cart item. + */ + cartitemID: string + /** + * Specifies the ID for the custom discount to be deleted. + */ + customdiscountID: string + } +} + +export type DeleteCustomDiscountFromCartItemResponse = void + +export type DeleteCustomDiscountFromCartItemError = ResponseError + +export type CreateCartPaymentIntentData = { + body?: ElasticPathPaymentsPoweredByStripePayment + path: { + /** + * The universally unique identifier of the cart for which you want to create a payment intent. + */ + cartID: string + } +} + +export type CreateCartPaymentIntentResponse = CartResponse + +export type CreateCartPaymentIntentError = ResponseError + +export type CheckoutApiData = { + body?: CustomerCheckout | AccountCheckout + headers?: { + /** + * An account management authentication token that identifies the authenticated account member. + */ + "EP-Account-Management-Authentication-Token"?: string + } + path: { + /** + * The ID of the cart that you want to checkout. + */ + cartID: string + } +} + +export type CheckoutApiResponse = ResponseData & { + data?: OrderResponse +} + +export type CheckoutApiError = ResponseError + +export type GetCustomerOrdersData = { + headers?: { + /** + * A customer token to access a specific customer's orders. + */ + "x-moltin-customer-token"?: string + } +} + +export type GetCustomerOrdersResponse = ResponseData & { + data?: Array + links?: ResponsePageLinks + meta?: ResponseMetaOrders +} + +export type GetCustomerOrdersError = ResponseError + +export type GetAnOrderData = { + path: { + /** + * The ID of the order. + */ + orderID: string + } +} + +export type GetAnOrderResponse = ResponseData & { + data?: OrderResponse +} + +export type GetAnOrderError = ResponseError + +export type UpdateAnOrderData = { + body?: OrdersUpdateRequest + path: { + /** + * The unique identifier of the order. + */ + orderID: string + } +} + +export type UpdateAnOrderResponse = ResponseData & { + data?: OrderResponse +} + +export type UpdateAnOrderError = ResponseError + +export type GetOrderItemsData = { + path: { + /** + * The ID of the order. + */ + orderID: string + } +} + +export type GetOrderItemsResponse = ResponseData & { + data?: Array +} + +export type GetOrderItemsError = ResponseError + +export type AnonymizeOrdersData = { + body?: OrdersAnonymizeRequest +} + +export type AnonymizeOrdersResponse = ResponseData & { + data?: OrderResponse +} + +export type AnonymizeOrdersError = ResponseError + +export type AuthorizeSetupData = { + body?: PaymentsRequest + path: { + /** + * The Universally Unique Identifier (UUID) of the order you want to pay for. + */ + orderID: string + } +} + +export type AuthorizeSetupResponse = ResponseData & { + data?: TransactionResponse +} + +export type AuthorizeSetupError = ResponseError + +export type ConfirmSetupData = { + body?: OrdersTransactionsConfirmRequest + path: { + /** + * The unique identifier of the order. + */ + orderID: string + /** + * The unique identifier of the transaction. + */ + transactionID: string + } +} + +export type ConfirmSetupResponse = ResponseData & { + data?: TransactionResponse +} + +export type ConfirmSetupError = ResponseError + +export type CaptureAtransactionData = { + body?: OrdersTransactionsCaptureRequest + path: { + /** + * The UUID of the order. + */ + orderID: string + /** + * The UUID of the transaction to capture. + */ + transactionID: string + } +} + +export type CaptureAtransactionResponse = ResponseData & { + data?: TransactionResponse +} + +export type CaptureAtransactionError = ResponseError + +export type RefundAtransactionData = { + body?: OrdersTransactionsRefundRequest + path: { + /** + * The UUID of the order. + */ + orderID: string + /** + * The UUID of the transaction you want to refund. + */ + transactionID: string + } +} + +export type RefundAtransactionResponse = ResponseData & { + data?: TransactionResponse +} + +export type RefundAtransactionError = ResponseError + +export type GetOrderTransactionsData = { + path: { + /** + * The unique identifier of the order. + */ + orderID: string + } +} + +export type GetOrderTransactionsResponse = ResponseData & { + data?: Array +} + +export type GetOrderTransactionsError = ResponseError + +export type GetAtransactionData = { + path: { + /** + * The unique identifier of the order that you require transactions for. + */ + orderID: string + /** + * The unique identifier of the transaction. + */ + transactionID: string + } +} + +export type GetAtransactionResponse = ResponseData & { + data?: TransactionResponse +} + +export type GetAtransactionError = ResponseError + +export type CancelAtransactionData = { + body?: OrdersTransactionsCancelRequest + path: { + /** + * The unique identifier of the order. + */ + orderID: string + /** + * The unique identifier of the transaction to be canceled or voided. + */ + transactionID: string + } +} + +export type CancelAtransactionResponse = ResponseData & { + data?: TransactionResponse +} + +export type CancelAtransactionError = ResponseError + +export type GetByContextReleaseResponseTransformer = ( + data: any, +) => Promise + +export type ReleaseDataModelResponseTransformer = (data: any) => ReleaseData + +export type ReleaseModelResponseTransformer = (data: any) => Release + +export type ReleaseMetaModelResponseTransformer = (data: any) => ReleaseMeta + +export const ReleaseMetaModelResponseTransformer: ReleaseMetaModelResponseTransformer = + (data) => { + if (data?.created_at) { + data.created_at = new Date(data.created_at) + } + if (data?.started_at) { + data.started_at = new Date(data.started_at) + } + if (data?.updated_at) { + data.updated_at = new Date(data.updated_at) + } + return data + } + +export const ReleaseModelResponseTransformer: ReleaseModelResponseTransformer = + (data) => { + if (data?.attributes?.published_at) { + data.attributes.published_at = new Date(data.attributes.published_at) + } + if (data?.meta) { + ReleaseMetaModelResponseTransformer(data.meta) + } + return data + } + +export const ReleaseDataModelResponseTransformer: ReleaseDataModelResponseTransformer = + (data) => { + if (data?.data) { + ReleaseModelResponseTransformer(data.data) + } + return data + } + +export const GetByContextReleaseResponseTransformer: GetByContextReleaseResponseTransformer = + async (data) => { + ReleaseDataModelResponseTransformer(data) + return data + } + +export type GetByContextAllHierarchiesResponseTransformer = ( + data: any, +) => Promise + +export type HierarchyListDataModelResponseTransformer = ( + data: any, +) => HierarchyListData + +export type HierarchyModelResponseTransformer = (data: any) => Hierarchy + +export type HierarchyAttributesModelResponseTransformer = ( + data: any, +) => HierarchyAttributes + +export const HierarchyAttributesModelResponseTransformer: HierarchyAttributesModelResponseTransformer = + (data) => { + if (data?.created_at) { + data.created_at = new Date(data.created_at) + } + if (data?.published_at) { + data.published_at = new Date(data.published_at) + } + if (data?.updated_at) { + data.updated_at = new Date(data.updated_at) + } + return data + } + +export const HierarchyModelResponseTransformer: HierarchyModelResponseTransformer = + (data) => { + if (data?.attributes) { + HierarchyAttributesModelResponseTransformer(data.attributes) + } + return data + } + +export const HierarchyListDataModelResponseTransformer: HierarchyListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(HierarchyModelResponseTransformer) + } + return data + } + +export const GetByContextAllHierarchiesResponseTransformer: GetByContextAllHierarchiesResponseTransformer = + async (data) => { + HierarchyListDataModelResponseTransformer(data) + return data + } + +export type GetByContextHierarchyResponseTransformer = ( + data: any, +) => Promise + +export type HierarchyDataModelResponseTransformer = (data: any) => HierarchyData + +export const HierarchyDataModelResponseTransformer: HierarchyDataModelResponseTransformer = + (data) => { + if (data?.data) { + HierarchyModelResponseTransformer(data.data) + } + return data + } + +export const GetByContextHierarchyResponseTransformer: GetByContextHierarchyResponseTransformer = + async (data) => { + HierarchyDataModelResponseTransformer(data) + return data + } + +export type GetByContextHierarchyNodesResponseTransformer = ( + data: any, +) => Promise + +export type NodeListDataModelResponseTransformer = (data: any) => NodeListData + +export type NodeModelResponseTransformer = (data: any) => Node + +export type NodeAttributesModelResponseTransformer = ( + data: any, +) => NodeAttributes + +export const NodeAttributesModelResponseTransformer: NodeAttributesModelResponseTransformer = + (data) => { + if (data?.created_at) { + data.created_at = new Date(data.created_at) + } + if (data?.published_at) { + data.published_at = new Date(data.published_at) + } + if (data?.updated_at) { + data.updated_at = new Date(data.updated_at) + } + return data + } + +export const NodeModelResponseTransformer: NodeModelResponseTransformer = ( + data, +) => { + if (data?.attributes) { + NodeAttributesModelResponseTransformer(data.attributes) + } + return data +} + +export const NodeListDataModelResponseTransformer: NodeListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(NodeModelResponseTransformer) + } + return data + } + +export const GetByContextHierarchyNodesResponseTransformer: GetByContextHierarchyNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetByContextHierarchyChildNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextHierarchyChildNodesResponseTransformer: GetByContextHierarchyChildNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetByContextAllNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextAllNodesResponseTransformer: GetByContextAllNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetByContextNodeResponseTransformer = ( + data: any, +) => Promise + +export type NodeDataModelResponseTransformer = (data: any) => NodeData + +export const NodeDataModelResponseTransformer: NodeDataModelResponseTransformer = + (data) => { + if (data?.data) { + NodeModelResponseTransformer(data.data) + } + return data + } + +export const GetByContextNodeResponseTransformer: GetByContextNodeResponseTransformer = + async (data) => { + NodeDataModelResponseTransformer(data) + return data + } + +export type GetByContextChildNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextChildNodesResponseTransformer: GetByContextChildNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetByContextAllProductsResponseTransformer = ( + data: any, +) => Promise + +export type ProductListDataModelResponseTransformer = ( + data: any, +) => ProductListData + +export type ProductModelResponseTransformer = (data: any) => Product + +export type ProductAttributesModelResponseTransformer = ( + data: any, +) => ProductAttributes + +export const ProductAttributesModelResponseTransformer: ProductAttributesModelResponseTransformer = + (data) => { + if (data?.published_at) { + data.published_at = new Date(data.published_at) + } + if (data?.created_at) { + data.created_at = new Date(data.created_at) + } + if (data?.updated_at) { + data.updated_at = new Date(data.updated_at) + } + return data + } + +export type ProductRelationshipsModelResponseTransformer = ( + data: any, +) => ProductRelationships + +export type FilesRelationshipModelResponseTransformer = ( + data: any, +) => FilesRelationship + +export type FileReferenceModelResponseTransformer = (data: any) => FileReference + +export const FileReferenceModelResponseTransformer: FileReferenceModelResponseTransformer = + (data) => { + if (data?.created_at) { + data.created_at = new Date(data.created_at) + } + return data + } + +export const FilesRelationshipModelResponseTransformer: FilesRelationshipModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(FileReferenceModelResponseTransformer) + } + return data + } + +export const ProductRelationshipsModelResponseTransformer: ProductRelationshipsModelResponseTransformer = + (data) => { + if (data?.files) { + FilesRelationshipModelResponseTransformer(data.files) + } + return data + } + +export type ProductMetaModelResponseTransformer = (data: any) => ProductMeta + +export const ProductMetaModelResponseTransformer: ProductMetaModelResponseTransformer = + (data) => { + if (data?.sale_expires) { + data.sale_expires = new Date(data.sale_expires) + } + return data + } + +export const ProductModelResponseTransformer: ProductModelResponseTransformer = + (data) => { + if (data?.attributes) { + ProductAttributesModelResponseTransformer(data.attributes) + } + if (data?.relationships) { + ProductRelationshipsModelResponseTransformer(data.relationships) + } + if (data?.meta) { + ProductMetaModelResponseTransformer(data.meta) + } + return data + } + +export type IncludedModelResponseTransformer = (data: any) => Included + +export const IncludedModelResponseTransformer: IncludedModelResponseTransformer = + (data) => { + if (Array.isArray(data?.component_products)) { + data.component_products.forEach(ProductModelResponseTransformer) + } + return data + } + +export const ProductListDataModelResponseTransformer: ProductListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(ProductModelResponseTransformer) + } + if (data?.included) { + IncludedModelResponseTransformer(data.included) + } + return data + } + +export const GetByContextAllProductsResponseTransformer: GetByContextAllProductsResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetByContextProductResponseTransformer = ( + data: any, +) => Promise + +export type ProductDataModelResponseTransformer = (data: any) => ProductData + +export const ProductDataModelResponseTransformer: ProductDataModelResponseTransformer = + (data) => { + if (data?.data) { + ProductModelResponseTransformer(data.data) + } + if (data?.included) { + IncludedModelResponseTransformer(data.included) + } + return data + } + +export const GetByContextProductResponseTransformer: GetByContextProductResponseTransformer = + async (data) => { + ProductDataModelResponseTransformer(data) + return data + } + +export type GetByContextChildProductsResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextChildProductsResponseTransformer: GetByContextChildProductsResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetByContextProductsForHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextProductsForHierarchyResponseTransformer: GetByContextProductsForHierarchyResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetByContextProductsForNodeResponseTransformer = ( + data: any, +) => Promise + +export const GetByContextProductsForNodeResponseTransformer: GetByContextProductsForNodeResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type ConfigureByContextProductResponseTransformer = ( + data: any, +) => Promise + +export const ConfigureByContextProductResponseTransformer: ConfigureByContextProductResponseTransformer = + async (data) => { + ProductDataModelResponseTransformer(data) + return data + } + +export type CreateCatalogResponseTransformer = ( + data: any, +) => Promise + +export type CatalogDataModelResponseTransformer = (data: any) => CatalogData + +export type CatalogModelResponseTransformer = (data: any) => Catalog + +export const CatalogModelResponseTransformer: CatalogModelResponseTransformer = + (data) => { + if (data?.attributes?.created_at) { + data.attributes.created_at = new Date(data.attributes.created_at) + } + if (data?.attributes?.updated_at) { + data.attributes.updated_at = new Date(data.attributes.updated_at) + } + return data + } + +export const CatalogDataModelResponseTransformer: CatalogDataModelResponseTransformer = + (data) => { + if (data?.data) { + CatalogModelResponseTransformer(data.data) + } + return data + } + +export const CreateCatalogResponseTransformer: CreateCatalogResponseTransformer = + async (data) => { + CatalogDataModelResponseTransformer(data) + return data + } + +export type GetCatalogsResponseTransformer = ( + data: any, +) => Promise + +export type CatalogListDataModelResponseTransformer = ( + data: any, +) => CatalogListData + +export const CatalogListDataModelResponseTransformer: CatalogListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(CatalogModelResponseTransformer) + } + return data + } + +export const GetCatalogsResponseTransformer: GetCatalogsResponseTransformer = + async (data) => { + CatalogListDataModelResponseTransformer(data) + return data + } + +export type GetCatalogByIdResponseTransformer = ( + data: any, +) => Promise + +export const GetCatalogByIdResponseTransformer: GetCatalogByIdResponseTransformer = + async (data) => { + CatalogDataModelResponseTransformer(data) + return data + } + +export type UpdateCatalogResponseTransformer = ( + data: any, +) => Promise + +export const UpdateCatalogResponseTransformer: UpdateCatalogResponseTransformer = + async (data) => { + CatalogDataModelResponseTransformer(data) + return data + } + +export type PublishReleaseResponseTransformer = ( + data: any, +) => Promise + +export const PublishReleaseResponseTransformer: PublishReleaseResponseTransformer = + async (data) => { + ReleaseDataModelResponseTransformer(data) + return data + } + +export type GetReleasesResponseTransformer = ( + data: any, +) => Promise + +export type ReleaseListDataModelResponseTransformer = ( + data: any, +) => ReleaseListData + +export const ReleaseListDataModelResponseTransformer: ReleaseListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(ReleaseModelResponseTransformer) + } + return data + } + +export const GetReleasesResponseTransformer: GetReleasesResponseTransformer = + async (data) => { + ReleaseListDataModelResponseTransformer(data) + return data + } + +export type GetReleaseByIdResponseTransformer = ( + data: any, +) => Promise + +export const GetReleaseByIdResponseTransformer: GetReleaseByIdResponseTransformer = + async (data) => { + ReleaseDataModelResponseTransformer(data) + return data + } + +export type CreateRuleResponseTransformer = ( + data: any, +) => Promise + +export type RuleDataModelResponseTransformer = (data: any) => RuleData + +export type RuleModelResponseTransformer = (data: any) => Rule + +export type RuleScheduleModelResponseTransformer = (data: any) => RuleSchedule + +export const RuleScheduleModelResponseTransformer: RuleScheduleModelResponseTransformer = + (data) => { + if (data?.valid_from) { + data.valid_from = new Date(data.valid_from) + } + if (data?.valid_to) { + data.valid_to = new Date(data.valid_to) + } + return data + } + +export const RuleModelResponseTransformer: RuleModelResponseTransformer = ( + data, +) => { + if (Array.isArray(data?.attributes?.schedules)) { + data.attributes.schedules.forEach(RuleScheduleModelResponseTransformer) + } + if (data?.attributes?.created_at) { + data.attributes.created_at = new Date(data.attributes.created_at) + } + if (data?.attributes?.updated_at) { + data.attributes.updated_at = new Date(data.attributes.updated_at) + } + return data +} + +export const RuleDataModelResponseTransformer: RuleDataModelResponseTransformer = + (data) => { + if (data?.data) { + RuleModelResponseTransformer(data.data) + } + return data + } + +export const CreateRuleResponseTransformer: CreateRuleResponseTransformer = + async (data) => { + RuleDataModelResponseTransformer(data) + return data + } + +export type GetRulesResponseTransformer = ( + data: any, +) => Promise + +export type RuleListDataModelResponseTransformer = (data: any) => RuleListData + +export const RuleListDataModelResponseTransformer: RuleListDataModelResponseTransformer = + (data) => { + if (Array.isArray(data?.data)) { + data.data.forEach(RuleModelResponseTransformer) + } + return data + } + +export const GetRulesResponseTransformer: GetRulesResponseTransformer = async ( + data, +) => { + RuleListDataModelResponseTransformer(data) + return data +} + +export type GetRuleByIdResponseTransformer = ( + data: any, +) => Promise + +export const GetRuleByIdResponseTransformer: GetRuleByIdResponseTransformer = + async (data) => { + RuleDataModelResponseTransformer(data) + return data + } + +export type UpdateRuleResponseTransformer = ( + data: any, +) => Promise + +export const UpdateRuleResponseTransformer: UpdateRuleResponseTransformer = + async (data) => { + RuleDataModelResponseTransformer(data) + return data + } + +export type GetAllHierarchiesResponseTransformer = ( + data: any, +) => Promise + +export const GetAllHierarchiesResponseTransformer: GetAllHierarchiesResponseTransformer = + async (data) => { + HierarchyListDataModelResponseTransformer(data) + return data + } + +export type GetHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const GetHierarchyResponseTransformer: GetHierarchyResponseTransformer = + async (data) => { + HierarchyDataModelResponseTransformer(data) + return data + } + +export type GetHierarchyNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetHierarchyNodesResponseTransformer: GetHierarchyNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetHierarchyChildNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetHierarchyChildNodesResponseTransformer: GetHierarchyChildNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetAllNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetAllNodesResponseTransformer: GetAllNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetNodeResponseTransformer = (data: any) => Promise + +export const GetNodeResponseTransformer: GetNodeResponseTransformer = async ( + data, +) => { + NodeDataModelResponseTransformer(data) + return data +} + +export type GetChildNodesResponseTransformer = ( + data: any, +) => Promise + +export const GetChildNodesResponseTransformer: GetChildNodesResponseTransformer = + async (data) => { + NodeListDataModelResponseTransformer(data) + return data + } + +export type GetAllProductsResponseTransformer = ( + data: any, +) => Promise + +export const GetAllProductsResponseTransformer: GetAllProductsResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetProductResponseTransformer = ( + data: any, +) => Promise + +export const GetProductResponseTransformer: GetProductResponseTransformer = + async (data) => { + ProductDataModelResponseTransformer(data) + return data + } + +export type GetChildProductsResponseTransformer = ( + data: any, +) => Promise + +export const GetChildProductsResponseTransformer: GetChildProductsResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetProductsForHierarchyResponseTransformer = ( + data: any, +) => Promise + +export const GetProductsForHierarchyResponseTransformer: GetProductsForHierarchyResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } + +export type GetProductsForNodeResponseTransformer = ( + data: any, +) => Promise + +export const GetProductsForNodeResponseTransformer: GetProductsForNodeResponseTransformer = + async (data) => { + ProductListDataModelResponseTransformer(data) + return data + } diff --git a/packages/sdks/shopper/src/index.ts b/packages/sdks/shopper/src/index.ts new file mode 100644 index 00000000..7d27f04a --- /dev/null +++ b/packages/sdks/shopper/src/index.ts @@ -0,0 +1,5 @@ +export * from "./client" +import { Client, createClient } from "@hey-api/client-fetch" +export { createClient, Client } +export { client } from "./client/services.gen" +export { extractProductImage } from "./utils" diff --git a/packages/sdks/shopper/src/utils/extract-product-image.ts b/packages/sdks/shopper/src/utils/extract-product-image.ts new file mode 100644 index 00000000..4290be26 --- /dev/null +++ b/packages/sdks/shopper/src/utils/extract-product-image.ts @@ -0,0 +1,12 @@ +import { Included, Product } from "../client" + +export const extractProductImage = ( + product: Product, + images: Included["main_images"], +) => { + return images?.find((file) => { + if (file.id === product.relationships?.main_image?.data?.id) { + return file + } + }) +} diff --git a/packages/sdks/shopper/src/utils/index.ts b/packages/sdks/shopper/src/utils/index.ts new file mode 100644 index 00000000..a3175f1d --- /dev/null +++ b/packages/sdks/shopper/src/utils/index.ts @@ -0,0 +1 @@ +export { extractProductImage } from "./extract-product-image" diff --git a/packages/sdks/shopper/tsconfig.json b/packages/sdks/shopper/tsconfig.json new file mode 100644 index 00000000..d27f8641 --- /dev/null +++ b/packages/sdks/shopper/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "outDir": "dist", + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": [ + "src" + ], + "references": [{ "path": "./tsconfig.node.json"}] +} diff --git a/packages/sdks/shopper/tsconfig.node.json b/packages/sdks/shopper/tsconfig.node.json new file mode 100644 index 00000000..180cab8c --- /dev/null +++ b/packages/sdks/shopper/tsconfig.node.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src" + ], +} diff --git a/packages/sdks/specs/cart_checkout.yaml b/packages/sdks/specs/cart_checkout.yaml new file mode 100644 index 00000000..cba53d93 --- /dev/null +++ b/packages/sdks/specs/cart_checkout.yaml @@ -0,0 +1,4792 @@ +openapi: 3.1.0 +info: + title: Carts, Checkout, Orders Introduction + description: | + A cart contains a list of the products that a shopper adds to the cart while browsing your catalog. In the context of a cart, a selected product is called a cart item. + + A cart item identifies the product, the product price, the quantity selected, and the total price for the quantity selected. The cart displays a running total of the cost for the selected products plus the calculated tax. + + You can allow your shoppers to add custom text to a product when adding an item to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized. See [Add product to cart](/docs/api/carts/manage-carts#add-product-to-cart). + + After a shopper checks out, the cart is converted to an order, and you can manually delete the cart. If you donʼt delete the cart, it is purged automatically after seven days. + + The preview cart feature allows you to set a future date for your shopping cart and view the promotions that will be available during that time period. This feature enables you to validate your promotion settings and observe how they will be applied in the cart. See [Create a Preview Cart](/docs/api/carts/create-a-cart#preview-cart). + + The following diagram shows a typical cart workflow: + + ![Shows a cart workflow, starting from adding the first item to a cart, through cart creation and checkout](/assets/cart-workflow.png) + + ### Multiple Carts + + Buyers often make purchases based on jobs that they need to perform or outcomes they need to achieve and therefore require more than one shopping cart. For example, a corporate buyer places orders for multiple locations. Each location has a different frequency of ordering and require different products. The buyer can create one cart per location, fill the carts, and then check out the carts quickly. Similarly, shoppers can also create multiple carts for the ease of managing various shopping experiences, such as birthdays or holidays. + + Each cart is discrete and separate. Any updates or changes to one cart has no effect on the other carts. A cart persists, that is, it stays with the buyer or shopper even after they use the cart in a checkout. Carts remain available after a checkout. + contact: + name: Elastic Path + url: https://elasticpath.com + version: 1.0.0 +security: + - bearerAuth: [ ] +servers: + - url: https://useast.api.elasticpath.com + description: US East Production Server + variables: { } + - url: https://euwest.api.elasticpath.com + description: EU West Production Server + variables: { } +paths: + /v2/carts: + get: + tags: + - Cart Management + summary: Get Shopper Carts + description: | + You can retrieve the carts that are associated with an [account](/docs/api/carts/account-cart-associations) or a [customer](/docs/api/carts/customer-cart-associations). + + When a shopper retrieves their latest carts, the carts are sorted in descending order by the updated_date. For more information, see [Pagination](/guides/Getting-Started/pagination). + + :::note + + Requires an `implicit` token with only one of [Account Management Authentication Token](/docs/api/accounts/post-v-2-account-members-tokens) or [customer token](/docs/customer-management/customer-management-api/customer-tokens). + + ::: + operationId: getCarts + parameters: + - name: EP-Account-Management-Authentication-Token + in: header + description: An Account Management Authentication token to access a specific account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/CartResponse' + links: + $ref: '#/components/schemas/Response.PageLinks' + meta: + $ref: '#/components/schemas/Response.Meta.Carts' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + post: + tags: + - Cart Management + summary: Create a Cart + description: | + + Creates a cart. Call this endpoint each time a customer creates a cart. + + Each shopper can have multiple carts. Use the carts API to create a cart. The carts are distinct from one another. Shoppers can add different items to their carts. They can check out one of the carts without affecting the content or status of their other carts. + + After the shopper checks out the cart, the cart remains available to the shopper. The cart is persistent and stays with the shopper after it is used. + + You can also create a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Update Cart Settings](/docs/api/settings/put-v-2-settings-cart). + + ### Preview Cart + + You can set a future date for your shopping cart and view the promotions that will be available during that time period. This feature enables you to validate your promotion settings and observe how they will be applied in the cart. + + :::caution + - Once the cart is in preview mode, you cannot revert it to a regular cart. + - Carts with `snapshot_date` are same as preview carts. + - You cannot checkout a cart that includes a `snapshot_date`. + - To delete a promotion preview cart, use [Delete a cart](/docs/api/carts/delete-a-cart) endpoint. + - The promotion preview cart has the same expiration time as a regular cart based on the store's [cart settings](/docs/api/settings/put-v-2-settings-cart). + - Preview cart interactions skip inventory checks and events, allowing users to preview future carts without impacting related external systems. + ::: + + ### Errors + + - `400 Bad Request` : This is returned when the submitted request does not adhere to the expected API contract for the endpoint. + + - For example, in the case of string fields, this error might indicate issues in the length or format of submitted strings. For more information about valid string fields, refer to Safe Characters section. + - In the case of preview carts (those with `snapshot_date`), an error is returned for invalid actions, such as removing the preview date, setting a preview date in the past, or attempting to checkout a cart with a `snapshot_date`. + operationId: createACart + parameters: + - name: x-moltin-customer-token + in: header + description: A customer token to be associated with the cart. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRequest' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}: + get: + tags: + - Cart Management + summary: Get a Cart + description: | + Use this endpoint to retrieve a specific cart. If a cart ID does not exist, a new cart will be automatically created. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the `relationships` section. + + You can easily get a new or existing cart by providing the unique cart reference in the request. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs in the relationships section. + + :::note + + - The default cart name is Cart. However, you can update the cart name as required. Ensure that the string length of the name is greater than or equal to one. Follow the safe character guidelines for name and description naming. For more information about cart ID naming requirements, see the [Safe Characters](/guides/Getting-Started/safe-characters) section. + - Outside of the JS-SDK, we don’t handle creating cart references. You need to create your own. + + ::: + + :::caution + + An empty cart is returned for any carts that don’t currently exist. For more information about the cart items object, see [Get Cart Items](/docs/api/carts/get-cart-items). + + ::: + + ### Query parameters + + + | Name | Required | Type | Description | + |:----------|:---------|:---------|:-------------------------------------------| + | `include` | Optional | `string` | Comma-delimited string of entities that can be included. The information included are `items`,`tax_items`, `custom_discounts`, or `promotions`. | + operationId: getACart + parameters: + - name: cartID + in: path + description: The unique identifier for this cart that you created. + required: true + style: simple + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + put: + tags: + - Cart Management + summary: Update a Cart + description: | + Updates cart properties for the specified cartID. + + You can also update a cart to specify custom discounts. You can enable custom discounts when the `discount_settings.custom_discounts_enabled` field is set to `true`. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + operationId: updateACart + parameters: + - name: cartID + in: path + description: The unique identifier of a cart created by you. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRequest' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Cart Management + summary: Delete a Cart + description: | + You can delete a cart, including the items, name, description, and remove all associations. + + ### Errors + + The following error message is received when you attempt to delete a cart that is associated with a customer. Before deletion, ensure that the cart is disassociated. + + ```json + message: { + errors: [ + { + status: 400, + title: 'Last cart', + detail: 'This is the last cart associated with a customer and it cannot be deleted, try disassociating instead' + } + ] + } + ```` + operationId: deleteACart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you want to delete. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/items: + get: + tags: + - Cart Items + summary: Get Cart Items + description: | + + Use this endpoint to retrieve cart items. If the cart is associated with shipping groups, calling this endpoint displays the associated shipping group IDs. + + You can use this endpoint to retrieve the breakdown of cart items by promotion ID. For example, if you have Promotions Standard item discount with code *sale2024*, Rule Promotions item discount with code *sale2024*, and Rule Promotions cart discount with code *sale2024*, the `discounts.constituents` field in the response example will show the breakdown of the same promotion code used in both Promotions Standard and Rule Promotions. + + ```json + "data": [ + { + "id": "98de010d-dd10-4fa5-a070-0b9bcdc72974", + "type": "cart_item", + "product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c", + "name": "sku1", + "description": "sku1", + "sku": "sku1", + "slug": "sku1", + "image": { + "mime_type": "", + "file_name": "", + "href": "" + }, + "quantity": 1, + "manage_stock": false, + "unit_price": { + "amount": 10000, + "currency": "USD", + "includes_tax": false + }, + "value": { + "amount": 10000, + "currency": "USD", + "includes_tax": false + }, + "discounts": [ + { + "amount": { + "amount": -2000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "e4d929d5-f471-4317-9a86-a84a6c572b44", + "promotion_source": "rule-promotion", + "is_cart_discount": true + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "de19a043-a6da-4bde-b896-d17e16b77e25", + "promotion_source": "rule-promotion" + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "509295ee-2971-45b6-801e-95df09756989" + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "ca79e606-7ecd-41ac-9478-af4c8c28c546", + "promotion_source": "rule-promotion", + "is_cart_discount": true + } + ], + "links": { + "product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c" + }, + "meta": { + "display_price": { + "with_tax": { + "unit": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + }, + "value": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + } + }, + "without_tax": { + "unit": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + }, + "value": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + } + }, + "tax": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "discount": { + "unit": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00" + }, + "value": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00" + } + }, + "without_discount": { + "unit": { + "amount": 10000, + "currency": "USD", + "formatted": "$100.00" + }, + "value": { + "amount": 10000, + "currency": "USD", + "formatted": "$100.00" + } + }, + "discounts": { + "sale2024": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00", + "constituents": { + "509295ee-2971-45b6-801e-95df09756989": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "ca79e606-7ecd-41ac-9478-af4c8c28c546": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "de19a043-a6da-4bde-b896-d17e16b77e25": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "e4d929d5-f471-4317-9a86-a84a6c572b44": { + "amount": -2000, + "currency": "USD", + "formatted": "-$20.00" + } + } + } + } + }, + "timestamps": { + "created_at": "2024-05-24T18:00:58Z", + "updated_at": "2024-05-24T18:00:58Z" + } + }, + "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781", + "catalog_source": "pim" + } + ``` + operationId: getCartItems + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + put: + tags: + - Cart Items + summary: Bulk Update Items in Cart + description: | + The bulk update feature allows shoppers to update an array of items to their cart in one action, rather than updating each item one at a time. Shoppers can update quantity and shipping group details in bulk requests. This minimizes the time for shoppers while updating items to their cart. Shoppers can even update multiple items with the same or different shipping groups to their cart. + + When you update multiple items that qualify for free gifts in the cart, the corresponding free gifts for all eligible products are also automatically updated in the cart. + operationId: bulkUpdateItemsInCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BulkUpdateCartsItems' + required: false + responses: + '200': + description: '' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + post: + tags: + - Cart Items + summary: Manage Carts + description: | + + ### Add Product to Cart + + Adding a Product to Cart is the most common Cart action. If you want to add any custom products or promotions, you need to do that as a separate action. + + #### Dynamic Bundles + + A bundle is a purchasable product that is composed of a combination of two or more products that you want to sell together. You can create multiple components within a bundle. Each component can have one or more options. Each option is a product and a quantity. You can configure minimum and/or maximum values for the number of product options in a component that your shoppers can select. For example, you can enable a shopper to select 1 or more product options from a list of 10. These are called [dynamic bundles](/docs/api/pxm/products/products#dynamic-bundles). + + Your dynamic bundles are displayed in your published catalogs. + + 1. Use the configure a shopper endpoint to allow shoppers to make their selections from a bundle. + 2. In the response of the configure a shopper, the `bundle_configuration` object contains the bundle selections a shopper has made. + 3. In the add a product to cart request, use the `bundle_configuration` object to add the customers selections to a cart. + + ```json + "bundle_configuration": { + "selected_options": { + "games": { + "d7b79eb8-19d8-45ea-86ed-2324a604dd9c": 1 + }, + "toys": { + "0192ccdd-6d33-4898-87d7-c4d87f2bf8ea": 1, + "1aea6f97-f0d9-452c-b3c1-7fb5629ead82": 1 + } + } + } + ``` + + When a cart is checked out, the options a shopper selected are added to the order. See [order items](/docs/api/carts/get-order-items). + + #### Personalized Products + + You can allow shoppers to personalize their goods by adding custom text inputs to products directly. This feature is particularly useful for customizable items, such as personalized T-shirts or greeting cards. You can use this functionality by leveraging the `custom_inputs` attribute, and defining the details and validation rules for the custom text. + + First, you must configure a `custom_inputs` attribute when creating a new product or updating an existing product. Once you have defined your custom inputs on a product, you must configure the custom inputs in your orders. + + For example, you may sell T-shirts that can have personalized text on the front and back of the shirt. + + ```json + { + "data": { + "type": "product", + "attributes": { + "custom_inputs": { + "front": { + "name": "T-Shirt Front", + "validation_rules": [ + { + "type": "string", + "options": { + "max_length": 50 + } + } + ], + "required": false + }, + "back": { + "name": "T-Shirt Back", + "validation_rules": [ + { + "type": "string", + "options": { + "max_length": 50 + } + } + ], + "required": false + } + } + } + } + } + ``` + + If the same product has different `custom_inputs` attributes, then these are added as separate items in a cart. + + The `custom_inputs` attribute is stored in the cart item and the text for `custom_input` must not exceed 255 characters in length. When a cart is checked out, the `custom_inputs` attribute becomes part of the order. + + #### Limitations on Usage of `custom_inputs` with Specific Promotion Types + + When you add products to a cart with `custom_inputs`, there are certain limitations on usage of the `custom_inputs` with the following promotion types: + + - For [Free Gift Promotions](/docs/api/promotions/create-a-promotion), you can add `custom_inputs` to gift items. + - For [Fixed Bundle Discount Promotions](/docs/api/promotions/create-a-promotion), the promotion applies as long as the cart contains the bundle SKUs even when there are different `custom_inputs`. + - For [X for Y Discount Promotion and X for amount discount promotion](/docs/api/promotions/create-a-promotion), the promotion applies when there are two SKUs with the same `custom_inputs`. The promotion does not apply when there are different `custom_inputs` and the SKUs are in different line items. + + :::note + + - Any requests to add a product to cart returns the collection of cart items. + - [Tax items](/docs/api/carts/tax-items) may optionally be added with the product. Only administrators with [client credentials](/docs/authentication/Tokens/client-credential-token) are able to do this. If included, they replace any existing taxes on the product. + - The cart currency is set when the first item is added to the cart. + - The product being added to the cart requires a price in the same currency as the other items in the cart. The API returns a 400 error if a price is not defined in the correct currency. + - A cart can contain a maximum of 100 unique items. Items include products, custom items, tax items, and promotions. + - There are a number of actions that happen to your inventory when checking out and paying for an order. For more information, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) documentation. + + ::: + + ### Add Custom Item to Cart + + You can add a custom item to the cart when you don't manage things like shipping, taxes and inventory in Commerce. + + For [Shipping Groups](/docs/ship-groups/shipping-groups), once you have created a [cart shipping group](/docs/ship-groups/shipping-groups/shipping-groups-api/create-cart-shipping-group), you need to link it to the cart items. This is important, because it is necessary to associate items with shipping groups in order to include shipping groups in the corresponding cart, order, and totals. + + :::note + + - Custom Cart Items are available through [implicit authentication](/docs/authentication/Tokens/implicit-token). Ensure that you always check each order has the correct details for each item, most importantly, price. + + ::: + + ### Add Promotion to Cart + + You can use the Promotions API to apply discounts to your cart as a special cart item type. Any requests to add a product to cart will return a collection of cart items. + + There are certain limitations on usage of the `custom_inputs` attribute with some promotion types. See [Limitations on Usage of `custom_inputs` with Specific Promotion Types](/docs/api/carts/manage-carts#limitations-on-usage-of-custom_inputs-with-specific-promotion-types). + + To remove promotion from the cart via the promotion code, see [Delete Promotion Code from Cart](/docs/api/carts/delete-a-promotion-via-promotion-code). + + ### Re-order + + From a shopper’s order history, they can add the items from a previous order into their carts. Shoppers can add items regardless of past order status, such as incomplete or not paid. For more information, see [Orders](/docs/api/carts/orders). + + :::note + - Any requests to add an item to cart return a collection of [cart items](/docs/api/carts/cart-items). + - A cart can contain a maximum of 100 unique items. Items include products, custom items, and promotions. + - When a shopper creates a cart and re-orders items from an order with properties such as custom attributes, custom discounts, and payment intent ID, these properties will remain unchanged in the original cart. + - Custom items do not exist in catalogs, and therefore cannot be reordered. + ::: + + ### Merging Carts + + A shopper can have multiple carts, and the system may automatically merge items from an anonymous cart into the shopper's registered cart when they sign in. For example, if a shopper has an existing cart with items `A`, `B` and `C`, and later adds items `D` and `E` while not signed in, the system can merge these carts when the shopper signs in. After the carts merge, the cart contains items `A`, `B`, `C`, `D` and `E`. + + If any items are duplicated from the anonymous cart to the registered cart, their quantities are incremented accordingly. For example, if a shopper's existing cart with items `A`, `B` and `C`, and they later add two more `A` items and one `B` item while not signed in, the system will merge the carts when the shopper signs in. The existing cart will now contain three `A` items, two `B` items, and one `C` item. + + :::note + + When the system merges items from one cart into another cart, properties such as custom attributes, custom discounts, and payment intent ID will remain unchanged in the original cart. + + ::: + + ### Best Practices + + We recommend to include a unique `sku` code within the request body while adding custom items to carts. If the same `sku` is used for multiple products, they are merged into a single line item. + + For example, if a cart consists of the following items: + + - `product-1` with quantity 1 and sku code as `sku-1` + - `product-2` with quantity 1 and sku code as `sku-1` + - `product-3` with quantity 1 and sku code as `sku-2`. + + The following response is returned where it combines all products with the same sku codes into a single line item, while products with a unique sku codes are represented as separate items: + + ```json + { + "data": [ + { + "id": "c58760f4-8889-4719-b34d-be1f1d11ae59", + "type": "custom_item", + "name": "product-1", + "description": "My first custom item!", + "sku": "sku-1", + "slug": "", + "image": { + "mime_type": "", + "file_name": "", + "href": "" + }, + "quantity": 2, + "manage_stock": false, + "unit_price": { + "amount": 20000, + "currency": "USD", + "includes_tax": true + }, + "value": { + "amount": 40000, + "currency": "USD", + "includes_tax": true + }, + "links": {}, + "meta": { + "display_price": { + "with_tax": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + }, + "without_tax": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + }, + "tax": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "discount": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "without_discount": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + } + }, + "timestamps": { + "created_at": "2023-05-02T16:28:11Z", + "updated_at": "2023-05-02T16:28:18Z" + } + } + } + ``` + operationId: manageCarts + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CartItemsObjectRequest' + - $ref: "#/components/schemas/CartMergeObjectRequest" + - $ref: "#/components/schemas/CustomItemObject" + - $ref: "#/components/schemas/ReOrderObjectRequest" + - $ref: "#/components/schemas/PromotionItemObject" + - $ref: "#/components/schemas/BulkAddItemsRequest" + + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Cart Items + summary: Delete all Cart Items + description: | + A shopper can clean up their cart, deleting custom items, promotions, and so on, while the empty cart remains available. The cart id, name, description, and any account or customer associations persist. The shopper can continue to add items to the cart. + operationId: deleteAllCartItems + parameters: + - name: cartID + in: path + description: The unique identifier of the cart created by you. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/items/{cartitemID}: + put: + tags: + - Cart Items + summary: Update a Cart Item + description: You can easily update a cart item. A successful update returns the cart items. + operationId: updateACartItem + parameters: + - name: cartID + in: path + description: A unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: A unique identifier of the cart item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateCartsItems' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Cart Items + summary: Delete a Cart Item + description: Use this endpoint to delete a cart item. + operationId: deleteACartItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart created by you. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart that you want to delete. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/relationships/accounts: + post: + tags: + - Account Cart Associations + summary: Create an Account Cart Association + description: You can create associations between an account and one or more carts. After cart associations exist for an account, the account can access those carts across any device. + operationId: createAccountCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the account. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters). + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: An Account Management Authentication token to access a specific account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + required: false + responses: + '200': + description: 'OK' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + '204': + description: 'No Content is sent back in case the account has already been associated to the cart.' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Account Cart Associations + summary: Delete Account Cart Association + description: You can delete an association between an account and a cart. + operationId: deleteAccountCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the account. + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: An Account Management Authentication token to access a specific account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + required: false + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/relationships/customers: + post: + tags: + - Customer Cart Associations + summary: Create a Customer Cart Association + description: You can create associations between a customer and one or more carts. After cart associations exist for a customer, the customer can access those carts across any device. + operationId: createCustomerCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the customer. Ensure that you follow the guidelines for [Safe Characters](/guides/Getting-Started/safe-characters). + required: true + style: simple + schema: + type: string + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + required: false + responses: + '200': + description: 'OK' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Customer Cart Associations + summary: Delete Customer Cart Association + description: You can delete an association between a customer and a cart. + operationId: deleteCustomerCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the customer. + required: true + style: simple + schema: + type: string + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + required: false + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/discounts/{promoCode}: + delete: + tags: + - Cart Items + summary: Delete a Promotion via Promotion Code + description: You can remove promotion code from a cart if it was applied manually. This endpoint does not work if the promotion is applied automatically. + operationId: deleteAPromotionViaPromotionCode + parameters: + - name: cartID + in: path + description: Specifies the unique identifier of a cart created by you. + required: true + style: simple + schema: + type: string + - name: promoCode + in: path + description: Specifies the promotion code to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + + /v2/carts/{cartID}/items/{cartitemID}/taxes: + post: + tags: + - Tax Items + summary: Add Tax Item to Cart + description: | + + Use this endpoint to add a tax item to a cart. + + :::note + + There is a soft limit of 5 unique tax items per cart item at any one time. + + ::: + operationId: addTaxItemToCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + '422': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 422 + title: Unprocessable Entity + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/taxes: + post: + tags: + - Tax Items + summary: Bulk Add Tax Items to Cart + description: | + :::note + + A cart item can only have a maximum of five tax items. + + ::: + + ### Errors + + `422 Unprocessable Entity` + + In this example, when `options.add_all_or_nothing` is set to `true` and if one of cart items is not found or or has reached its maximum tax item limit, the following error response is returned: + + ```json + { + "status": 422, + "title": "Add all or nothing.", + "detail": "Add all or nothing set to (true). Could not bulk add tax items to cart." + } + + ``` + + In this example, if you add more than five tax items to the same cart item, the following error response is returned: + + ```json + { + "status": 422, + "title": "Tax item not added to cart item.", + "detail": "Cannot exceed tax item limit of (5) on cart item.", + "meta": { + "id": "f88e6370-cb35-40b2-a998-c759f31dec0a" + } + } + ``` + + `404` + + In this example, if there is a mismatch between `cart_item`/`custom_item` and the `relationships.item.data.type` specified in the bulk add tax item, the following error response is returned: + + ```json + { + "data": [], + "errors": [ + { + "status": 404, + "title": "Tax item not added to cart item.", + "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + "meta": { + "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + } + }, + { + "status": 404, + "title": "Tax item not added to cart item.", + "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + "meta": { + "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + } + } + ] + } + ``` + operationId: bulkAddTaxItemsToCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkTaxes' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkTaxes' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Tax Items + summary: Bulk Delete Tax Items from Cart + description: Use this endpoint to bulk delete tax items from cart. + operationId: bulkDeleteTaxItemsFromCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}: + put: + tags: + - Tax Items + summary: Update a TaxItem + description: Use this endpoint to update a tax item. + operationId: updateATaxItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + - name: taxitemID + in: path + description: The unique identifier of the tax item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Tax Items + summary: Delete a Tax Item + description: Use this endpoint to delete a tax item. + operationId: deleteATaxItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + - name: taxitemID + in: path + description: The unique identifier of the tax item. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/custom-discounts: + post: + tags: + - Custom Discounts + summary: Bulk Add Custom Discounts to Cart + description: | + The default value for custom discounts on both the cart and cart items is set to 5 if this parameter is not configured in the store. To verify the custom discount limit value, call [Get all settings](/docs/api/settings/get-v-2-settings) endpoint. + + To increase the custom discount value, contact [Elastic Path Support team](https://support.elasticpath.com/hc/en-us). + + + operationId: bulkAddCustomDiscountsToCart + parameters: + - name: cartID + in: path + description: Specifies the system generated ID for the cart that the shopper created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkCustomDiscounts' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Custom Discounts + summary: Bulk Delete Custom Discounts From Cart + description: Use this endpoint to bulk delete custom discounts from cart. + operationId: bulkDeleteCustomDiscountsFromCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/custom-discounts/{customdiscountID}: + put: + tags: + - Custom Discounts + summary: Update Custom Discount For Cart + description: Use this endpoint to update a custom discount in your cart. + operationId: updateCustomDiscountForCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be updated. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Custom Discounts + summary: Delete Custom Discount From Cart + description: Use this endpoint to delete custom discount from cart. + operationId: deleteCustomDiscountFromCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/items/{cartitemID}/custom-discounts: + post: + tags: + - Custom Discounts + summary: Add Custom Discount To Cart Item + description: Use this endpoint to add a custom discount to cart item. + operationId: addCustomDiscountToCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the unique identifier for the cart item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}: + put: + tags: + - Custom Discounts + summary: Update Custom Discount For Cart Item + description: Use this endpoint to update a custom discount in your cart item. + operationId: updateCustomDiscountForCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the ID for the cart item. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be updated. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + delete: + tags: + - Custom Discounts + summary: Delete Custom Discount From Cart Item + description: Use this endpoint to delete custom discount from cart item. + operationId: deleteCustomDiscountFromCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the ID for the cart item. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: 'No Content' + headers: { } + content: { } + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + + /v2/carts/{cartID}/payments: + post: + tags: + - Payments + summary: Create Stripe Payment Intent for a Cart + description: | + The Cart Payment Intent feature enables the creation of a Stripe Payment Intent specifically tied to a shopping cart and its subsequent order. This allows Payment Intent users to track payment details from the cart stage and seamlessly maintain consistency in payment information throughout the order stage. Using these features, you can create Payment Intents for their carts, update Payment Intents with final cart details, and synchronize Payment Intents from Stripe to Commerce. + + :::note + + - Typically, in Commerce, inventory is allocated at the time of payment initiation after an order is created. However, in the case of Cart Payment Intent, information about the payment is received only upon synchronizing the order from Stripe to Commerce. This may happen after the payment is completed. Therefore, there might be a delay between the payment made and allocation, increasing the chance of paying for items that are not in stock. + - There are certain fields you can choose to set up when [creating a payment intent](https://stripe.com/docs/api/payment_intents/create). However, if you decide to update a payment intent, the available options may not be the same as those allowed while creating a payment intent. See [updating a payment intent](https://stripe.com/docs/api/payment_intents/update). + + ::: + + The following steps outline the workflow associated with the Payment Intent: + + 1. [Add items to cart](/docs/api/carts/manage-carts#add-custom-item-to-cart). + 1. [Create a Payment Intent for the cart](/docs/api/carts/create-cart-payment-intent). The Payment Intent is created in Stripe, reflecting the cart and transaction details, including currency, amounts, payment type, and any optional Stripe details. The Payment Intent ID is generated and linked to the cart. + 1. [Update a Payment Intent](/docs/carts-orders/update-cart-payment-intent). This step is optional but becomes necessary when there are changes in the cart details at the time of payment. It ensures the Payment Intent accurately reflects the current cart details when processing the payments on the front end. + 1. [Checkout the cart](/docs/api/carts/checkout). An unpaid order is created, and the Payment Intent ID is linked to the order. + 1. [Confirm the order](/docs/carts-orders/confirm-an-order). This is important because after checkout, it is essential to confirm the Payment Intent and synchronize it with Commerce. This results in a corresponding transaction and change in order statuses in Commerce. Additionally, the Payment Intent ID is removed from the order once it is linked via the transaction. + + ### Best Practices + + We recommend you follow these practices to maintain consistency and accuracy when using Cart Payment Intent. + + - After checkout, we recommend clearing the shopping cart. You can achieve this using a [Delete a cart](/docs/api/carts/delete-a-cart) endpoint or [Update a cart](/docs/api/carts/update-a-cart) to remove the Payment Intent ID. This helps to avoid potential issues where subsequent checkouts for the same cart might unintentionally use the previous Stripe Payment Intent ID. + - If it is not reasonable to clear the cart immediately after checkout due to several subsequent, duplicate checkouts to the same cart, ensure that you only synchronize the Payment Intent when finalizing the order. Each order confirmation is unaware of the others, and syncing Payment Intent IDs for each confirmation can lead to duplicate transactions in Commerce. In other words, if you synchronize Payment Intents for earlier versions of a repeated checkout, you'll end up with multiple orders from the same cart, each having transactions linked to the same Payment Intent. + - To pay the entire amount at once, use the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) endpoint to update the Stripe Payment Intent with the final cart details when preparing to take the payment. Doing so, ensures that the Payment Intent accurately reflects the current cart details when processing payments on the front end. We do not recommend calling the [Update Cart Payment Intent](/docs/carts-orders/update-cart-payment-intent) for each individual change in the cart, as this can lead to more requests and may slow down the front-end performance. + operationId: createCartPaymentIntent + parameters: + - name: cartID + in: path + required: true + style: simple + schema: + type: string + description: The universally unique identifier of the cart for which you want to create a payment intent. + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/ElasticPathPaymentsPoweredByStripePayment' + responses: + '201': + description: Payment Intent created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + + /v2/carts/{cartID}/checkout: + post: + tags: + - Checkout + summary: Checkout API + description: | + When a Cart is ready for checkout, you can convert the cart to an order. The cart remains and can be modified and checked out again if required. + + A cart can be checked out with a customer ID, customer object, or with an account by authenticating with the `Client Credentials Token`. + + After a successful checkout, a response that contains the order is returned. If the cart is linked to a shipping group, the shipping group is also associated with the order after checkout. + + You can checkout using one of the following methods: + - Customer ID. You can checkout a cart with an existing customer ID. + - Guest Checkout (Checkout with Customer Object). You can checkout a cart with an associated customer name and email. + - Checkout with Account. The shopper authenticates with the `Client Credentials` Token. + - Checkout with Account Management Authentication Token. The shopper authenticates with the `Implicit Token` and the `EP-Account-Management-Authentication-Token`. + + :::note + + - The cart currency is set when the first item is added to the cart. + - The product being added to the cart requires a price in the same currency as the other items in the cart. The API returns a 400 error if a price is not defined in the correct currency. + - To ensure that a free gift is automatically applied to an order, set the promotion to automatic. The checkout process will not be successful if free gift items are out of stock. See [Errors](#errors) section. + + ::: + + :::caution + + - By default, carts are automatically deleted 7 days after the last update. You can change this setting by [updating cart settings](/docs/api/settings/put-v-2-settings-cart). + - Your inventory is modified during checkout and payment of an order. For more information about the changes in the inventory, see the [Inventory](/docs/api/pxm/inventory/inventories-introduction) section. + + ::: + + ### Next Steps + + After a cart has been converted to an Order using either of the previous methods, you most likely want to capture payment for order. See [Paying for an Order](/docs/api/carts/payments). + + ### Errors + + The following error response is returned during checkout when an eligible item is added to the cart, and the free gift is out of stock. + + ```json + { + "errors": [ + { + "status": 400, + "title": "Insufficient stock", + "detail": "There is not enough stock to add gift2 to your cart", + "meta": { + "id": "f2b68648-9621-45a3-aed6-1b526b0f5beb", + "sku": "gift2" + } + } + ] + } + ``` + operationId: checkoutAPI + parameters: + - name: cartID + in: path + description: The ID of the cart that you want to checkout. + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: An account management authentication token that identifies the authenticated account member. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CustomerCheckout' + - $ref: '#/components/schemas/AccountCheckout' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders: + get: + tags: + - Orders + summary: Get All Orders + description: | + This endpoint returns all orders with custom flow fields. The pagination offset is set to fetch a maximum of 10,000 orders. If the store has 10,000 orders and you fetch the orders without using filters, an error is returned. Use a filter to view orders when the order is beyond the 10,000 mark. + + :::note + + - Pass the `X-Moltin-Customer-Token` header to limit orders to a specific customer. See [Customer Tokens](/docs/customer-management/customer-management-api/customer-tokens). + - Pass the `EP-Account-Management-Authentication-Token` header to limit orders to a specific account. See [Account Management Token](/docs/api/accounts/post-v-2-account-members-tokens). + - You can use pagination with this resource. For more information, see [pagination](/guides/Getting-Started/pagination). + + ::: + + ### Filtering + + The following operators and attributes are available for filtering orders. + + | Attribute | Type | Operator | Example | + | :--- | :--- | :--- | :--- | + | `status` | `string` | `eq` | `eq(status,complete)` | + | `payment` | `string` | `eq` | `eq(payment,paid)` | + | `shipping` | `string` | `eq` | `eq(shipping,unfulfilled)` | + | `name` (`customer.name`) | `string` | `eq` / `like` | `like(name,Brad*)` | + | `email` (`customer.email`) | `string` | `eq` / `like` | `like(email,*@elasticpath.com)` | + | `customer_id` | `string` | `eq` / `like` | `eq(customer_id, e5a0d684-a4af-4919-a348-f66b0b4955e0)` | + | `account_id` | `string` | `eq` / `like` | `eq(account_id,3d7200c9-a9bc-4085-9822-63e80fd94a09)` | + | `account_member_id` | `string` | `eq` / `like` | `eq(account_member_id,2a8a3a92-2ccd-4b2b-a7af-52d3896eaecb)` | + | `contact.name` | `string` | `eq` / `like` | `eq(name,John Doe)` | + | `contact.email` | `string` | `eq` / `like` | `eq(email,John Doe)` | + | `shipping_postcode` | `string` | `eq` / `like` | `like(shipping_postcode,117*)` | + | `billing_postcode` | `string` | `eq` / `like` | `like(billing_postcode,117*)` | + | `with_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(with_tax,10000)` | + | `without_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(without_tax,10000)` | + | `currency` | `string` | `eq` | `eq(currency,USD)` | + | `product_id` | `string` | `eq` | `eq(product_id,6837058c-ae42-46db-b3c6-7f01e0c34b40)` | + | `product_sku` | `string` | `eq` | `eq(product_sku,deck-shoe-001)` | + | `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | `gt(created_at,YYYY-MM-DD)` | + | `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | `lt(updated_at,YYYY-MM-DD)` | + | `external_ref` | `string` | `eq` / `like` | `like(external_ref, 16be*)` | + + operationId: getCustomerOrders + parameters: + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's orders. + style: simple + schema: + type: string + example: '{{customerToken}}' + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/OrderResponse' + links: + $ref: '#/components/schemas/Response.PageLinks' + meta: + $ref: '#/components/schemas/Response.Meta.Orders' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}: + get: + tags: + - Orders + summary: Get an Order + description: Use this endpoint to retrieve a specific order. + operationId: getAnOrder + parameters: + - name: orderID + in: path + description: The ID of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + put: + tags: + - Orders + summary: Update an Order + description: | + You can only update custom data, `shipping`, `shipping_address`, and status on orders. All other settings in the order object are immutable. + + :::caution + + You can update `shipping`, `shipping_address`, and status of an order only if the order is not fulfilled. You can use the refund API to refund an order only if the payment status is `paid`. Canceling an order does not automatically refund a payment. You must refund the orders manually. + + ::: + + :::note + + - This request is only accessible to client credentials token users with Seller Admin role. + - Non client credentials token users cannot access this endpoint. See [Permissions](/docs/authentication/Tokens/permissions). + + ::: + operationId: updateAnOrder + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersUpdateRequest' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/items: + get: + tags: + - Orders + summary: Get Order Items + description: Use this endpoint to retrieve order items. + operationId: getOrderItems + parameters: + - name: orderID + in: path + description: The ID of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/OrderItemResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/anonymize: + post: + tags: + - Orders + summary: Anonymize Orders + description: | + You can anonymize an order when it is fulfilled, canceled, or fully refunded. + + When anonymization is successful, Personal Identifiable Information such as customer details, `shipping_address`, and `billing_address` are replaced with *. + operationId: anonymizeOrders + parameters: [ ] + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersAnonymizeRequest' + contentMediaType: application/json + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + '422': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + detail: "Order has status: order:incomplete, payment:unpaid, shipping:unfulfilled; only fulfilled or refunded or cancelled orders may be anonymized" + status: 422 + title: "Could not anonymize orders" + meta: + order_id: "496c29a1-6e7a-4ab6-a4e7-d1ec9a08b85e" + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/payments: + post: + tags: + - Payments + summary: Authorize Setup + description: Authorize setup + operationId: authorizeSetup + parameters: + - name: orderID + in: path + description: The Universally Unique Identifier (UUID) of the order you want to pay for. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PaymentsRequest' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions/{transactionID}/confirm: + post: + tags: + - Payments + summary: Confirm Setup + description: Confirm setup + operationId: confirmSetup + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsConfirmRequest' + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions/{transactionID}/capture: + post: + tags: + - Transactions + summary: Capture a Transaction + description: Use this endpoint to capture a previously authorized payment. In this step, you can also pass in a custom reference, such as the payment reference from your chosen gateway. + operationId: captureATransaction + parameters: + - name: orderID + in: path + description: The UUID of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The UUID of the transaction to capture. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsCaptureRequest' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions/{transactionID}/refund: + post: + tags: + - Transactions + summary: Refund a Transaction + description: | + There are two ways to refund; through your payment gateway and mark it refunded in Commerce Manager, or directly through Commerce Manager or API. + + * Mark as Refunded: You can manually mark a transaction as refunded. Before you can mark the order as refunded, you need to handle the actual refund on your side with your payment provider. Mark as Refunded is a full refund made to the transaction. + * Refund through Composable Commerce: You can process a full or partial refund to a supported payment provider directly from Commerce Manager or API by providing the refund amount. When you start the refund process, the request is directly sent to the payment gateway. + + :::caution + + If you use manual gateway for partial or full refund, you need to handle the actual refund on your side with your payment provider. + + ::: + operationId: refundATransaction + parameters: + - name: orderID + in: path + description: The UUID of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The UUID of the transaction you want to refund. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsRefundRequest' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions: + get: + tags: + - Transactions + summary: Get Order Transactions + description: Get order transactions + operationId: getOrderTransactions + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions/{transactionID}: + get: + tags: + - Transactions + summary: Get a Transaction + description: Retrieves a transaction + operationId: getATransaction + parameters: + - name: orderID + in: path + description: The unique identifier of the order that you require transactions for. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] + /v2/orders/{orderID}/transactions/{transactionID}/cancel: + post: + tags: + - Transactions + summary: Cancel a Transaction + description: | + Use this endpoint to cancel or void a pending or authorized transaction. The transaction can be canceled or voided when it is in `pending` and `completed` statuses. + + :::caution + + This endpoint works only for Stripe and PayPal and does not work for manual gateway. + + ::: + operationId: cancelATransaction + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction to be canceled or voided. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsCancelRequest' + required: false + responses: + '200': + description: '' + headers: { } + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + parameters: [ ] +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + schemas: + CartsRequest: + title: CartsRequest + type: object + properties: + description: + type: string + description: The cart description. + example: cart description + discount_settings: + $ref: '#/components/schemas/DiscountSettings' + name: + description: The cart name provided by the shopper. A cart name must contain 1 to 255 characters. You cannot use whitespace characters, but special characters are permitted. For more information, see the [Safe Characters](/guides/Getting-Started/safe-characters) section. + type: string + example: my cart name + snapshot_date: + description: This optional parameter sets a reference date for the cart. If this parameter is set, it allows the cart to act as one that might occur on that specified date. For example, such future carts might acquire future-enabled discounts, allowing users to test and validate future interactions with carts. The snapshot_date must be in the format 2026-02-21T15:07:25Z. By default, this parameter is left empty. + type: string + example: "2026-09-10T00:12:00Z" + custom_attributes: + $ref: '#/components/schemas/CustomAttributes' + payment_intent_id: + description: To remove the Stripe payment intent from a cart, pass the empty value in the `payment_intent_id` field. You must use an empty value for this field. You cannot use this endpoint to directly update the cart to use an existing Payment Intent. + type: string + example: '' + DiscountSettings: + title: DiscountSettings + type: object + properties: + custom_discounts_enabled: + description: This parameter enables custom discounts for a cart. When set to true, Elastic Path promotions will not be applied to the new carts. Default is set from cart discount settings for the store. See [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + type: boolean + example: false + use_rule_promotions: + description: When set to true, this parameter allows the cart to use rule promotions. + type: boolean + example: false + CustomAttributes: + title: CustomAttributes + type: object + properties: + custom_attributes: + description: Specifies the custom attributes for the cart object. The attribute can be any string, numerical, and underscore. A cart can have maximum of 20 custom attributes. + type: object + properties: + attribute: + description: Specifies the attribute `type` and `value`. + type: object + properties: + type: + description: Specifies the type of the attribute such as string, integer, boolean, and float. + type: string + value: + description: Specifies the value of the attribute. + oneOf: + - type: string + - type: number + - type: boolean + CartResponse: + title: CartResponse + type: object + properties: + id: + description: The unique identifier for the cart. Use SDK or create it yourself. + type: string + type: + description: The type of object being returned. + type: string + example: cart + name: + description: The name of this cart. + type: string + example: cart name + description: + description: A description of the cart. + type: string + example: cart description + discount_settings: + $ref: '#/components/schemas/DiscountSettings' + payment_intent_id: + description: Stripe-assigned unique identifier for the linked Payment Intent + type: string + links: + type: object + properties: + self: + description: A link to that specific resource. + type: string + example: https://useast.api.elasticpath.com/v2/carts/1 + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + shipping: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + relationships: + type: object + properties: + customers: + type: object + properties: + data: + type: object + properties: + type: + description: The type of related object. + type: string + example: customers + id: + description: The ID of the customer. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + items: + type: object + properties: + data: + type: object + properties: + type: + description: The type of related object. + type: string + example: cart_item + id: + description: The unique identifier for the cart item + type: string + format: uuid + readOnly: true + example: 1cf8b15b-4f12-43c5-837c-dbbc09aefa55 + CartItemsObjectRequest: + title: Cart Items Object Request + oneOf: + - $ref: "#/components/schemas/CartItemObject" + - $ref: "#/components/schemas/CartMergeObjectRequest" + - $ref: "#/components/schemas/CustomItemObject" + - $ref: "#/components/schemas/ReOrderObjectRequest" + - $ref: "#/components/schemas/PromotionItemObject" + CartItemObject: + title: Cart Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/CartItemObjectData' + - $ref: '#/components/schemas/CartItemResponse' + CartItemObjectData: + title: Cart Item Object Data + type: object + required: + - type + - quantity + properties: + type: + description: The type of object being returned. + type: string + enum: + - cart_item + quantity: + description: The number of items added to the cart. + type: number + example: 2 + id: + type: string + format: uuid + description: Specifies the ID of the product you want to add to cart. (use this OR sku) + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + sku: + type: string + description: Specifies the item SKU that you want to add to cart. (use this OR id) + example: my-item + custom_inputs: + description: The custom text to be added to a product. + type: object + bundle_configuration: + description: Object used to describe the bundle options selected. + type: object + properties: + selected_options: + description: Specifies selected options. + type: object + shipping_group_id: + description: Identifier for a created Cart Shipping Group + type: string + CartMergeObjectRequest: + title: Cart Merge Object Request + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartMergeObject' + description: '' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartMergeObject: + title: Cart Merge Object + type: object + required: + - type + - cart_id + properties: + type: + description: The type of object being returned. Must be `cart_items`. + type: string + enum: + - cart_items + cart_id: + description: The original cart to be merged from. + type: string + format: uuid + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + CustomItemObject: + title: Custom Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/CustomItemObjectData' + description: '' + CustomItemObjectData: + title: Custom Item Object Data + type: object + required: + - type + - name + - quantity + - price + properties: + type: + description: The type of object being returned. Must be `custom_item`. + type: string + enum: + - custom_item + quantity: + description: The number of custom items to add to cart. + type: number + example: 2 + price: + type: object + required: + - amount + properties: + amount: + description: The unit price of the custom item. + type: number + example: 10000 + includes_tax: + description: Set to`true` if relevant taxes have been included in the price, `false` if not. Defaults to `true`. + type: boolean + description: + description: A description of the custom item. + type: string + example: My first custom item! + sku: + type: string + description: The `SKU` code to use for the custom item. See [best practices](https://elasticpath.dev/docs/commerce-cloud/carts/cart-items/add-custom-item-to-cart#best-practices) to use the `SKU` code. + example: my-custom-item + name: + type: string + description: The name of the custom item. + example: My Custom Item + custom_inputs: + description: The custom text to be added to a product. + type: object + shipping_group_id: + description: Identifier for a created Cart Shipping Group + type: string + ReOrderObjectRequest: + title: Re-Order Object Request + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/ReOrderObject' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + + ReOrderObject: + title: Re Order Object + type: object + required: + - type + - order_id + properties: + type: + description: The type of resource being returned. Use `order_items`. + type: string + enum: + - order_items + order_id: + description: The unique identifier of the order. + type: string + format: uuid + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + BulkAddItemsRequest: + title: Bulk Add Items Request + type: object + properties: + data: + anyOf: + - $ref: '#/components/schemas/CartItemsObjectRequest' + - $ref: "#/components/schemas/CartMergeObjectRequest" + - $ref: "#/components/schemas/CustomItemObject" + - $ref: "#/components/schemas/ReOrderObjectRequest" + - $ref: "#/components/schemas/PromotionItemObject" + PromotionItemObject: + title: Promotion Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/PromotionItemObjectData' + PromotionItemObjectData: + title: Promotion Item Object Data + type: object + required: + - type + - code + properties: + type: + description: Specifies the type of resource, which is `promotion_item`. + type: string + enum: + - promotion_item + code: + description: Specifies the promotion code. For more information about codes[].user[], see the [Create Promotion codes](/docs/api/promotions/create-promotion-codes) section. + type: string + example: PROMO_CODE + BulkUpdateCartsItems: + title: Bulk Update Carts Items + type: object + required: + - id + - quantity + properties: + data: + type: array + items: + type: object + properties: + id: + description: Specifies the ID of the cart item that you want to update in cart. + type: string + example: '{{cartitemID}}' + quantity: + description: Specifies the amount of items to update in the cart. + type: number + example: 2 + custom_inputs: + description: Specifies the custom text to be added to a product. See [custom inputs](https://elasticpath.dev/docs/pxm/products/ep-pxm-products-api/update-a-product#using-custom-inputs-attribute). + type: object + options: + $ref: '#/components/schemas/UpdateAllOrNothingOptionsObject' + UpdateCartsItems: + title: Update Carts Items + type: object + required: + - quantity + properties: + data: + type: object + properties: + id: + description: The unique identifier of the cart item. + type: string + format: uuid + example: '{{cartitemID}}' + quantity: + description: The amount of products to add to cart. + type: number + example: 2 + custom_inputs: + description: The custom text to be added to a product. + type: object + shipping_group_id: + description: The unique identifier of the shipping group to be added to the cart. + type: string + format: uuid + example: 900ab9c1-4b39-43fe-b080-0dc2806065d9 + + AddAllOrNothingOptionsObject: + title: Add All Or Nothing Options Object + type: object + properties: + add_all_or_nothing: + description: When `true`, if an error occurs for any item, no items are added to the cart. When `false`, valid items are added to the cart and the items with errors are reported in the response. Default is `false`. + type: boolean + example: false + UpdateAllOrNothingOptionsObject: + title: Update All Or Nothing Options Object + type: object + properties: + update_all_or_nothing: + description: When set to`true`, if an error occurs for any item, no items are updated in the cart. When set to `false`, valid items are updated in the cart and the items with errors are reported in the response. Default is `true`. + type: boolean + example: false + CartItemResponse: + title: Cart Item Relationship + type: object + properties: + product_id: + description: The unique ID of the product. + type: string + format: uuid + readOnly: true + example: 55cda543-f9d7-42a4-b40a-665f2e4ff7c5 + name: + description: The name of this item + type: string + readOnly: true + example: shirt + description: + description: A description of the cart item. + type: string + readOnly: true + example: T-shirt. + catalog_id: + description: The unique identifier of the catalog associated with the product is shown if catalog_source=pim is set. + type: string + readOnly: true + format: uuid + example: 11d3f9d2-c99b-472c-96c3-51842333daea + catalog_source: + description: The catalog source. Always `pim` or `legacy`. + type: string + readOnly: true + example: pim + image: + type: object + readOnly: true + properties: + mime_type: + description: The MIME type for the uploaded file. + type: string + readOnly: true + example: image/png + file_name: + description: The name of the image file that was uploaded. + type: string + readOnly: true + example: shirt-trans.png + href: + description: The link to the image. + type: string + readOnly: true + example: https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/7cc08cbb-256e-4271-9b01-d03a9fac9f0a.png + manage_stock: + description: + type: boolean + readOnly: true + example: true + unit_price: + readOnly: true + $ref: '#/components/schemas/ItemPriceData' + value: + readOnly: true + $ref: '#/components/schemas/ItemPriceData' + links: + type: object + readOnly: true + properties: + product: + description: A URL related to the resource. + type: string + example: https://useast.api.elasticpath.com/products/9eda5ba0-4f4a-4074-8547-ccb05d1b5981 + meta: + type: object + readOnly: true + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + CartsResponse: + title: Carts Response + type: object + properties: + data: + type: array + items: + type: object + anyOf: + - $ref: '#/components/schemas/CartItemObject' + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + discounts: + type: object + additionalProperties: + type: object + properties: + amount: + type: number + example: -1000 + currency: + type: string + example: USD + formatted: + type: string + example: -$1.00 + timestamps: + $ref: '#/components/schemas/CartTimestamps' + ItemPriceData: + title: Order Price Data + type: object + properties: + amount: + description: The amount for this item as an integer. + type: number + readOnly: true + example: 10000 + currency: + description: The currency this item was added to the cart as. + type: string + readOnly: true + example: USD + includes_tax: + description: Whether or not this price is tax inclusive. + type: boolean + readOnly: true + example: false + CartsRelationshipsAccountsData: + title: Carts Relationships Accounts Data + type: object + properties: + data: + type: array + items: + properties: + id: + description: The ID of the account. + type: string + example: '{{accountID}}' + type: + description: The type of related object. Ensure that it is account. + type: string + example: account + CartsRelationshipsCustomersData: + title: Carts Relationships Customers Data + type: object + properties: + data: + type: array + items: + properties: + id: + description: The ID of the customer. + type: string + example: '{{customerID}}' + type: + description: The type of related object. Ensure that it is customer. + type: string + example: customer + CartsItemsTaxesObject: + title: Carts Items Taxes Object + type: object + required: + - type + - rate + properties: + code: + description: A unique tax code in this jurisdiction. + type: string + example: TAX01 + jurisdiction: + description: The relevant tax jurisdiction. + type: string + example: UK + name: + description: The name of the tax item. + type: string + example: Tax name + rate: + description: The tax rate represented as a decimal (12.5% -> 0.125). + type: number + example: 0.2 + type: + description: The type of object being returned. Use `tax_item`. + type: string + example: tax_item + id: + description: The unique identifier for this tax item. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + CartsBulkCustomDiscounts: + title: CartsBulkCustomDiscounts + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + - $ref: '#/components/schemas/CartItemBulkCustomDiscountObject' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartsBulkCustomDiscountsResponse: + title: CartsBulkCustomDiscountsResponse + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + - $ref: '#/components/schemas/artItemBulkCustomDiscountResponse' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartItemBulkCustomDiscountObject: + title: CartItemBulkCustomDiscountObject + type: object + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + - $ref: '#/components/schemas/CustomDiscountRelationshipsCartItemRequest' + artItemBulkCustomDiscountResponse: + title: artItemBulkCustomDiscountResponse + type: object + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + - $ref: '#/components/schemas/CustomDiscountRelationshipsCartItemRequest' + CartsCustomDiscountsObject: + title: CartsCustomDiscountsObject + type: object + required: + - amount + - description + - discount_code + - discount_engine + - external_id + - type + properties: + amount: + description: Specifies an amount to be applied for the custom discount. It must be less than zero. + type: number + example: -1000 + description: + description: Specifies a description for the custom discount. + type: string + example: Custom discount description + discount_code: + description: Specifies the discount code used for the custom discount. + type: string + example: cart-custom-promo-code + discount_engine: + description: Specifies from where the custom discount is applied. For example, Talon.one. + type: string + example: Custom Discount Engine + external_id: + description: Specifies an external id for the custom discount. + type: string + example: custom-discount-external-id + type: + description: Specifies the type of the resource. Always `custom_discount`. + type: string + example: custom_discount + CartsCustomDiscountsResponse: + title: CartsCustomDiscountsResponse + type: object + properties: + amount: + type: object + properties: + amount: + description: Specifies an amount to be applied for the custom discount. It must be less than zero. + type: number + example: -1000 + currency: + description: The currency set for the custom discount. + type: string + example: USD + formatted: + description: The formatted value for the custom discount. + type: string + example: -$10.00 + description: + description: Specifies a description for the custom discount. + type: string + example: Custom discount description + discount_code: + description: Specifies the discount code used for the custom discount. + type: string + example: cart-custom-promo-code + discount_engine: + description: Specifies from where the custom discount is applied. For example, Talon.one. + type: string + example: Custom Discount Engine + external_id: + description: Specifies an external id for the custom discount. + type: string + example: custom-discount-external-id + type: + description: Specifies the type of the resource. Always `custom_discount`. + type: string + example: custom_discount + id: + description: Specifies the UUID of the custom discount. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + CustomDiscountRelationshipsCartItemRequest: + title: CustomDiscountRelationshipsCartItemRequest + type: object + required: + - type + - id + properties: + relationships: + type: object + properties: + item: + type: object + properties: + data: + type: object + properties: + type: + description: Specifies the type of item. For example, `custom_item` or `cart_item`. + type: string + example: cart_item + id: + description: Specifies the unique identifier of the `cart_item` or `custom_item` in the cart. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + CartItemRelationship: + title: CartItemRelationship + type: object + required: + - type + - id + properties: + relationships: + type: object + properties: + order: + type: object + properties: + data: + type: object + properties: + type: + description: This specifies the type of item. + type: string + example: order + id: + description: This specifies the ID of the cart_item or custom_item in the cart. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + CartsBulkTaxes: + title: CartsBulkTaxes + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsItemsTaxesObject' + - $ref: '#/components/schemas/CartItemRelationship' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + OrdersAnonymizeRequest: + title: OrdersAnonymizeRequest + type: object + properties: + data: + $ref: '#/components/schemas/OrdersAnonymizeData' + OrdersAnonymizeData: + title: OrdersAnonymizeData + type: object + properties: + order_ids: + description: The unique identifiers of the orders to be anonymized. You can anonymize multiple orders at the same time. + type: array + items: + type: string + example: '{{orderID}}' + + OrdersUpdateRequest: + title: OrdersUpdateRequest + type: object + properties: + data: + oneOf: + - $ref: '#/components/schemas/OrdersAddressData' + - $ref: '#/components/schemas/OrdersCancelData' + - $ref: '#/components/schemas/OrdersFulfulledData' + OrdersAddressData: + title: OrdersAddressData + type: object + required: + - type + - shipping_address + properties: + external_ref: + description: Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + type: string + example: external_order_123 + shipping_address: + type: object + properties: + first_name: + description: Specifies the first name of the address holder. + type: string + example: James + last_name: + description: Specifies the last name of the address holder. + type: string + example: Doe + phone_number: + description: Specifies the phone number of the address holder. + type: string + example: 5558679305 + company_name: + description: Specifies the company name. + type: string + example: company name + line_1: + description: Specifies the first line of the address. + type: string + example: 1234 Disney Drive + line_2: + description: Specifies the second line of the address. + type: string + example: Disney Resort + city: + description: Specifies the name of the city in the shipping address. + type: string + example: Anaheim + county: + description: Specifies the county of the shipping address. + type: string + example: Orange + region: + description: Specifies the state, province, or region of the shipping address. + type: string + example: CA + postcode: + description: Specifies the postcode or ZIP code of the address. + type: string + example: 92802 + country: + description: Specifies the country in the shipping address. + type: string + example: US + instructions: + description: Specifies any instructions provided with the shipping address. + type: string + example: Buzzer 10233 + OrdersCancelData: + title: OrdersCancelData + type: object + required: + - type + - status + properties: + status: + description: The status of the order. You can only update the status to `cancelled`. + type: string + example: cancelled + type: + description: The type of the resource. You must use order. + type: string + example: order + external_ref: + description: Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + type: string + example: external_order_123 + OrdersFulfulledData: + title: OrdersFulfulledData + type: object + required: + - type + - shipping + properties: + shipping: + description: The shipping status of the order. You can only update the shipping status to `fulfilled`. + type: string + example: fulfilled + type: + description: The type of the resource. You must use order. + type: string + example: order + external_ref: + description: Represents an optional external ID reference for an order. It can contain alphanumeric characters, special characters, and spaces, and does not required to be unique. The maximum allowed length is 64 characters. It can be used to include an external reference from a separate company system. + type: string + example: external_order_123 + PaymentsRequest: + title: PaymentsRequest + type: object + properties: + data: + $ref: '#/components/schemas/Data.PaymentObject' + Data.BasePayments: + title: Data.BasePayments + type: object + required: + - gateway + - method + properties: + gateway: + type: string + enum: + - adyen + - authorize_net + - braintree + - card_connect + - cyber_source + - elastic_path_payments_stripe + - manual + - paypal_express_checkout + - stripe + - stripe_connect + - stripe_payment_intents + method: + description: Specifies the transaction method, such as `purchase` or `authorize`. + type: string + enum: + - authorize + - purchase + - purchase_setup + - authorize_setup + amount: + description: The amount to be paid for the transaction. + type: number + example: 10000 + Data.AdyenPayment: + title: Data.AdyenPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `adyen`. + type: string + enum: + - adyen + options: + type: object + properties: + shopper_reference: + description: The shopper reference token associated with the saved payment method. + type: string + recurring_processing_model: + description: Enter CardOnFile for a one-time purchase. + type: string + payment: + description: The Adyen recurringDetailReference payment method identifier. + type: string + Data.AuthorizeNetPayment: + title: Data.AuthorizeNetPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `authorize_net`. + type: string + enum: + - authorize_net + options: + type: object + properties: + customer_payment_profile_id: + description: The Authorize.net customer payment profile ID. + type: string + payment: + description: The Authorize.net customer profile ID. + type: string + Data.BraintreePayment: + title: Data.BraintreePayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `braintree`. + type: string + enum: + - braintree + payment: + description: The Braintree Customer ID that you want to bill. + type: string + Data.CardConnectPayment: + title: Data.CardConnectPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `card_connect`. + type: string + enum: + - card_connect + payment: + description: Enter account_id, profile_id from CardPointe API. For example, 1|16178397535388255208. + type: string + Data.CyberSourcePayment: + title: Data.CyberSourcePayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `cyber_source`. + type: string + enum: + - cyber_source + payment: + description: The CyberSource token. + type: string + ElasticPathPaymentsPoweredByStripePayment: + title: Elastic Path Payments Powered By Stripe + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `elastic_path_payments_stripe`. + type: string + enum: + - elastic_path_payments_stripe + options: + type: object + properties: + receipt_email: + description: Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + type: string + automatic_payment_methods: + type: object + description: Parent object determining whether to use Stripe's `automatic_payment_methods` setting. + properties: + enabled: + type: boolean + description: When set to true, it displays all enabled payment methods from the Stripe dashboard. When set to false, the Stripe default, which is card, is used. + payment_method_types: + type: array + items: + type: string + description: Specifies the Stripe payment method types configured for the store. See [Stripe Documentation](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_types). + example: card + payment: + description: Specifies the Stripe token or source. + type: string + Data.ManualPayment: + title: Data.ManualPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `manual`. + type: string + enum: + - manual + paymentmethod_meta: + type: object + properties: + custom_reference: + description: A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend not to include personal information in this field. + type: string + name: + description: A custom name associated with the payment method. + type: string + Data.PayPalExpressCheckoutPayment: + title: Data.PayPalExpressCheckoutPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `paypal_express_checkout`. + type: string + enum: + - paypal_express_checkout + options: + type: object + properties: + description: + description: The description for the payment. + type: string + soft_descriptor: + description: The descriptor appended to PayPal generated descriptor that is visible on the card statement of the payer. + type: string + application_context: + type: object + properties: + brand_name: + description: The label that overrides the business name in the PayPal account on the payPal site. + type: string + locale: + description: The locale pages that appear based on language and country code. PayPal supports a five-character code. For example, ja-JP. + type: string + landing_page: + description: The type of landing page to show on the PayPal site for customer checkout. Use values LOGIN, BILLING, or NO_PREFERENCE. + type: string + shipping_preference: + description: The shipping preference. Use SET_PROVIDED_ADDRESS value. This parameter does allow the user to change their address on PayPal site. + type: string + user_action: + description: If you set `useraction=commit` in the query string, the flow redirects the buyer to the PayPal payment page and displays a Pay Now button. When the shopper clicks **Pay Now**, call `DoExpressCheckoutPayment` to complete the payment without additional interaction from the shopper. Choose this flow when you know the final payment amount when you initiate the checkout flow. + type: string + return_url: + description: The callback URL for PayPal to redirect the user in the case of approved payment. + type: string + cancel_url: + description: The callback URL for PayPal to redirect user in the case a cancelled payment. + type: string + Data.StripePayment: + title: Data.StripePayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `stripe`. + type: string + enum: + - stripe + options: + type: object + properties: + receipt_email: + description: The option to provide an email for Stripe receipts. Specify live mode to access this feature. + type: string + payment: + description: The Stripe token or source. + type: string + Data.StripeConnectPayment: + title: Data.StripeConnectPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `stripe_connect`. + type: string + enum: + - stripe_connect + options: + type: object + properties: + receipt_email: + description: Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + type: string + payment: + description: Specifies the Stripe token or source. + type: string + Data.StripePaymentIntentsPayment: + title: Data.StripePaymentIntentsPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `stripe_payment_intents`. + type: string + enum: + - stripe_payment_intents + options: + type: object + properties: + receipt_email: + description: Provides the email address to which you want to send the Stripe receipts for the transactions within the store. This feature is available only in the live mode. + type: string + payment: + description: Specifies the Stripe token or source. + type: string + Data.PaymentObject: + oneOf: + - $ref: "#/components/schemas/Data.AdyenPayment" + - $ref: "#/components/schemas/Data.AuthorizeNetPayment" + - $ref: "#/components/schemas/Data.BraintreePayment" + - $ref: "#/components/schemas/Data.CardConnectPayment" + - $ref: "#/components/schemas/Data.CyberSourcePayment" + - $ref: "#/components/schemas/ElasticPathPaymentsPoweredByStripePayment" + - $ref: "#/components/schemas/Data.ManualPayment" + - $ref: "#/components/schemas/Data.PayPalExpressCheckoutPayment" + - $ref: "#/components/schemas/Data.StripePayment" + - $ref: "#/components/schemas/Data.StripeConnectPayment" + - $ref: "#/components/schemas/Data.StripePaymentIntentsPayment" + TransactionResponse: + title: TransactionResponse + type: object + properties: + id: + description: The ID of the transaction. + type: string + format: uuid + readOnly: true + reference: + description: The payment gateway reference. + type: string + example: manual + name: + description: A custom name associated with the payment method. + type: string + example: payment method name + custom_reference: + description: A reference associated with the payment method. This might include loyalty points or gift card identifiers. We recommend you not to include personal information in this field. + type: string + example: custom reference + gateway: + description: The name of the payment gateway used. + type: string + enum: + - adyen + - authorize_net + - braintree + - card_connect + - cyber_source + - elastic_path_payments_stripe + - manual + - paypal_express_checkout + - stripe + - stripe_connect + - stripe_payment_intents + amount: + description: The amount for this transaction. + type: number + example: 10000 + refunded_amount: + description: The refunded amount. + type: number + example: 0 + currency: + description: The transaction currency. + type: string + example: USD + transaction-type: + description: The type of transaction, such as `purchase`, `capture`, `authorize` or `refund`. + type: string + example: capture + status: + description: The status provided by the gateway for this transaction, such as `complete` or `failed`. + type: string + example: complete + relationships: + type: object + properties: + order: + type: object + properties: + data: + type: object + properties: + type: + description: Represents the type of the object being returned. It is always `order`. + type: string + example: order + id: + description: The ID of the order. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + meta: + type: object + properties: + display_price: + $ref: '#/components/schemas/FormattedPriceData' + display_refunded_amount: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + OrdersTransactionsConfirmRequest: + title: OrdersTransactionsConfirmRequest + type: object + properties: + data: + type: object + OrdersTransactionsCaptureRequest: + title: OrdersTransactionsCaptureRequest + type: object + properties: + data: + type: object + properties: + options: + type: object + properties: + soft_descriptor: + type: string + note_to_payer: + type: string + OrdersTransactionsRefundRequest: + title: OrdersTransactionsRefundRequest + type: object + properties: + data: + type: object + properties: + amount: + description: The amount value to be refunded. If this field is not provided, it will be considered as manual refund (Mark as Refunded) and the refund process must be manually handled via payment provider. If the amount value is same as payment value, then it will be treated as a full refund and sent to the payment provider to process refund automatically. + type: number + example: 1000 + options: + type: object + properties: + note: + description: Provides comments about the refund. It is used by PayPal Express. + type: string + OrdersTransactionsCancelRequest: + title: OrdersTransactionsCancelRequest + type: object + properties: + data: + type: object + properties: + options: + type: object + reason: + description: Specifies the reason for canceling the transaction. The reason may include `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. + type: string + example: requested_by_customer + OrderPriceData: + title: OrderPriceData + type: object + properties: + amount: + description: The amount for this item. + type: number + example: 10000 + currency: + description: The currency this item. + type: string + example: USD + includes_tax: + description: Whether or not this price is tax inclusive. + type: boolean + example: false + FormattedPriceData: + title: FormattedPriceData + type: object + properties: + amount: + description: The raw total of this cart. + type: number + example: 10000 + currency: + description: The currency set for this cart. + type: string + example: USD + formatted: + description: The tax inclusive formatted total based on the currency. + type: string + example: $10.00 + OrderItemFormattedUnitPriceData: + title: OrderItemFormattedUnitPriceData + type: object + properties: + unit: + $ref: '#/components/schemas/FormattedPriceData' + value: + $ref: '#/components/schemas/FormattedPriceData' + DiscountData: + title: DiscountData + type: object + properties: + amount: + $ref: '#/components/schemas/OrderPriceData' + code: + type: string + example: 10_off + id: + type: string + format: uuid + readOnly: true + example: a01cf221-751b-46e4-b612-57ad3c645ee6 + OrderItemResponse: + title: OrderItemResponse + type: object + properties: + type: + description: The type represents the object being returned. + type: string + example: order_item + id: + description: The unique identifier for this order item. + type: string + format: uuid + readOnly: true + example: 68bf8510-bebf-47b1-96ba-8a9930c7d928 + quantity: + description: The quantity of this item were ordered. + type: number + example: 1 + product_id: + description: The unique identifier for this order item. + type: string + format: uuid + readOnly: true + example: 4e9c6098-9701-4839-a69c-54d8256d9012 + name: + description: The name of this order item. + type: string + example: Product 123 + sku: + description: The SKU code for the order item. + type: string + example: IFD-1 + unit_price: + $ref: '#/components/schemas/OrderPriceData' + value: + + $ref: '#/components/schemas/OrderPriceData' + discounts: + type: array + items: + $ref: '#/components/schemas/DiscountData' + links: + type: object + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + without_tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + discount: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + without_discount: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + discounts: + type: object + additionalProperties: + type: object + properties: + amount: + type: number + example: -1000 + currency: + type: string + example: USD + formatted: + type: string + example: -$1.00 + timestamps: + $ref: '#/components/schemas/Timestamps' + relationships: + type: object + properties: + cart_item: + type: object + properties: + data: + type: object + properties: + type: + description: The type represents the object being returned. + type: string + example: order_item + id: + description: The unique identifier for this item. + type: string + format: uuid + readOnly: true + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + catalog_id: + description: The unique identifier of the catalog associated with the product is shown if `catalog_source=pim` is set. + type: string + example: default + catalog_source: + description: The catalog source. Always `pim` or `legacy`. + type: string + example: pim + - legacy + + OrderResponse: + title: OrderResponse + type: object + properties: + type: + description: Specifies the type of object being returned. You must use `order`. + type: string + example: order + id: + description: Specifies the unique identifier of the order. + type: string + format: uuid + readOnly: true + example: aa854b8f-5930-476d-951a-e9b9cfbdefb1 + status: + description: Specifies the status of the order, such as `incomplete`, `complete`, `processing`, or `cancelled`. + type: string + example: complete + - incomplete + - cancelled + payment: + description: Specifies the status of the payment, such as `unpaid`, `authorized`, `paid`, or `refunded`. + type: string + example: authorized + - paid + - unpaid + - refunded + shipping: + description: Specifies the status of the shipment, such as `fulfilled` or `unfulfilled`. + type: string + example: unfulfilled + - fulfilled + anonymized: + description: Specifies if the order is anonymized. + type: boolean + example: false + meta: + $ref: '#/components/schemas/OrderMeta' + billing_address: + $ref: '#/components/schemas/BillingAddress' + contact: + $ref: '#/components/schemas/Contact' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + OrderMeta: + title: OrderMeta + type: object + properties: + timestamps: + $ref: '#/components/schemas/Timestamps' + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + paid: + $ref: '#/components/schemas/FormattedPriceData' + authorized: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + CustomerCheckout: + title: Customer Checkout + type: object + properties: + data: + type: object + properties: + customer: + type: object + properties: + id: + description: The ID of the customer. + type: string + billing_address: + $ref: '#/components/schemas/BillingAddress' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + AccountCheckout: + title: Account Checkout + type: object + properties: + data: + type: object + properties: + account: + type: object + properties: + id: + description: The account ID. + type: string + member_id: + description: The account member ID. + type: string + contact: + type: object + properties: + name: + description: The name of the account member. + type: string + email: + description: The email address of the account member. + type: string + format: email + billing_address: + $ref: '#/components/schemas/BillingAddress' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + BillingAddress: + title: BillingAddress + type: object + required: + - first_name + - last_name + - line_1 + - region + - postcode + - country + properties: + company_name: + description: Company name of the billing recipient. + type: string + example: John Doe Enterprises + country: + description: Specifies the country of the billing address. + type: string + example: US + county: + description: Specifies the county of the billing address. + type: string + example: Orange + first_name: + description: First name of the billing recipient. + type: string + example: John + last_name: + description: Last name of the billing recipient. + type: string + example: Doe + line_1: + description: First line of the billing address. + type: string + example: 1 Sunny Street + line_2: + description: Second line of the billing address. + type: string + postcode: + description: Postcode of the billing address. + type: string + example: '92802' + region: + description: Specifies state, province, or region of the billing address. + type: string + example: CA + Contact: + title: Contact + type: object + properties: + email: + description: The email address of the contact. + type: string + example: johndoe@email.com + name: + description: The name of the contact. + type: string + example: John Doe + ShippingAddress: + title: ShippingAddress + type: object + required: + - first_name + - last_name + - line_1 + - region + - postcode + - country + properties: + company_name: + description: Company of the shipping recipient. + type: string + example: John Doe Enterprises + country: + description: Specifies the country of the shipping address. + type: string + example: US + county: + description: Specifies the county of the shipping address. + type: string + example: Orange + first_name: + description: First name of the shipping recipient. + type: string + example: John + last_name: + description: Last name of the shipping recipient. + type: string + example: Doe + line_1: + description: First line of the shipping address. + type: string + example: 1 Sunny Street + line_2: + description: Second line of the shipping address. + type: string + postcode: + description: Post code of the shipping address. + type: string + example: '92802' + region: + description: Specifies the state, province, or region of the shipping address. + type: string + example: CA + Response.Meta.Carts: + type: object + properties: + page: + $ref: '#/components/schemas/Response.PaginationPage' + results: + $ref: '#/components/schemas/Response.PaginationResults' + Response.Meta.Orders: + type: object + properties: + page: + $ref: '#/components/schemas/Response.PaginationPage' + results: + $ref: '#/components/schemas/Response.PaginationResults' + Response.PaginationPage: + type: object + properties: + current: + description: The current page. + type: integer + limit: + description: The maximum number of records per page for this response. You can set this value up to 100. + type: integer + offset: + description: The current offset by number of records, not pages. Offset is zero-based. + type: integer + total: + description: The total page count. + type: integer + Response.PaginationResults: + type: object + properties: + total: + description: The total page count. + type: integer + Response.PageLinks: + type: object + properties: + current: + description: Always the current page. + type: string + first: + description: Always the first page. + type: string + last: + description: If there is only one page, it is `null`. + type: string + next: + description: If there is only one page, it is `null`. + type: string + prev: + description: if the user is on the first page, it is `null`. + type: string + Response.Data: + type: object + properties: + data: { } + Response.Error: + type: array + properties: + detail: + type: string + status: + type: string + title: + type: string + Timestamps: + type: object + properties: + created_at: + description: The date this was created. + type: string + example: '2023-11-07T23:04:18.845Z' + updated_at: + description: The date this was last updated. + example: '2023-11-07T23:04:18.845Z' + CartTimestamps: + type: object + properties: + created_at: + type: string + example: '2023-11-07T23:04:18.845Z' + updated_at: + example: '2023-11-07T23:04:18.845Z' + expires_at: + example: '2023-11-12T23:04:18.845Z' +tags: + - name: Cart Management + description: | + A Cart contains the product and custom cart items that a user intends to purchase. After a Cart is ready for Checkout, you can use the [Checkout endpoint](/docs/api/carts/checkout) to convert the cart to an order. + + :::note + + - Adding, modifying, or removing any cart items, custom items, or promotions always returns the cart meta, calculated using the calculation method. This is useful to update the client with up-to-date totals. + - We will automatically delete carts 7 days after they were last updated. + - If you do not pass a `X-MOLTIN-CURRENCY` header specifying what currency you would like the cart to use, the products in the cart are converted to your default currency. + + ::: + - name: Account Cart Associations + description: | + You can create associations between an account and one or more carts. After cart associations exist for a account, those carts are accessible across any device. You can delete associations as required. + + There are two ways to access the cart: with an [Account Management Authentication Tokens](/docs/api/accounts/post-v-2-account-members-tokens) and without one. + + ### With an `Account Management Authentication` token + + These endpoints are for users who authenticated implicitly and require a Account Management Authentication token in the header to access the account cart associations APIs. For more information, see the [Account Token](/docs/api/accounts/post-v-2-account-members-tokens) documentation. + + #### Cart creation + + Shoppers create carts and can use any of the carts that they created to check out an order. + + :::note + + You can create a cart id, name, and description for the cart. The cart requires a name. Ensure that the string length is greater than or equal to one. Use any symbol in the name and description. For cart id, ensure that you follow the guidelines for safe characters. For more information about cart id naming requirements, see [Safe Characters](/guides/Getting-Started/safe-characters). + + ::: + + ### Without an `Account Management Authentication` token + + These endpoints are for users who use the Client Credentials Token and do not require an account management authentication token in the header to access the account cart associations APIs. For more information, see the [Authentication](/docs/authentication/security) documentation. + + This user acts as a system administrator and can call any account cart association operations for any account and cart. + + ### Error Codes + + You might encounter the following response codes, depending on the scenario: + + * `400` - `The type does not exist or is not listed as account` - Ensure that the type is `account` and is present. + + * `403` - `Cannot associate more than one account`. + + * `403` - `Account does not have the required permissions to fulfill this request`. + + * `403` - `Invalid json payload` - Check JSON input. The request body must be an array `[]`. If the request body is an object, the error is generated. + - name: Customer Cart Associations + description: | + You can create associations between a customer and one or more carts. After cart associations exist for a customer, those carts are accessible across any device. You can delete associations as required. + + There are two ways to access the cart: with a customer token and without one. + + ### With a `customer` token + + These endpoints are for users who authenticated implicitly and require a customer token in the header to access the customer cart associations APIs. For more information, see the [Customer Token](/docs/customer-management/customer-management-api/customer-tokens) documentation. + + #### Cart creation + + Shoppers create carts and can use any of the carts that they created to check out an order. + + :::note + + You can create a cart id, name, and description for the cart. The cart requires a name. Ensure that the string length is greater than or equal to one. Use any symbol in the name and description. For cart id, ensure that you follow the guidelines for safe characters. For more information about cart id naming requirements, see [Safe Characters](/guides/Getting-Started/safe-characters). + + ::: + + ### Without a `customer` token + + These endpoints are for users who use the Client Credentials Token and do not require a Customer token in the header to access the customer cart associations APIs. For more information, see the [Authentication](/docs/authentication/security) documentation. + + This user acts as a system administrator and can call any customer cart association operations for any customer and cart. + + ### Error Codes + + You might encounter the following response codes, depending on the scenario: + + * `400` - `The type does not exist or is not listed as customer` - Ensure that the type is `customer` and is present. + + * `403` - `Cannot associate more than one customer`. + + * `403` - `Customer does not have the required permissions to fulfill this request`. + + * `403` - `Invalid json payload` - Check JSON input. The request body must be an array `[]`. If the request body is an object, the error is generated. + - name: Cart Items + description: Products added to a cart are referred to as a `cart_item`. + - name: Checkout + description: | + + The checkout workflow ties together many of the key concepts covered in this section. When a customer initiates the checkout process, an order is created from the cart. The order is incomplete until after a successful payment is made. A complete order can be shipped and the product deducted from inventory counts. + + ![Checkout workflow](/assets/checkout-flow.png) + + ### Summary of the checkout workflow + + 1. Add a product to a cart. A cart and its reference number is generated. + 2. Manage the cart items. For example, you might add items, remove items, and change quantities. + 3. Check out the cart. An incomplete order is created. + 4. Pay for an order: provide billing and shipping details, if you are a new customer. The order is now in the processing status. + 5. If using a manual gateway, after you authorize and capture it, Composable Commerce considers the order complete. If you use a third-party integration supported by Composable Commerce (such as Stripe), after the third-party gateway authorizes and captures the payment, the order becomes complete. Usually capture does not occur at the same time as authorization. For more information, see the Capture section. + 6. After the order is shipped, you can manually flag it as fulfilled. + + ### Carts + + When a product is added to a cart, a cart is generated together with its unique reference ID that on checkout becomes a part of the order ID. If you are using our JavaScript software development kit, generating a cart reference ID is done for you; otherwise, add a cart reference generator to your functionality. + + ### Promotions and custom items + + Optionally, apply a promotion code on a cart, or add custom_items to modify the product price (typically to handle taxes, customs, or shipping). + + ### Checkout + + You can checkout a cart with an associated customer name and email (customer object). Typically, this would be used for new customers or ones that prefer to shop as guests. Use the customer.id checkout option to checkout for an existing customer. After a successful checkout is completed, the response contains an order. + + Email addresses that either begin or end with a period, or contain consecutive periods, are considered invalid, resulting in the following error: + ```json + "errors": [ + { + "status": 400, + "source": "data.customer.email", + "title": "format", + "detail": "Does not match format 'email" + } + ] + ``` + + ### Payments + + On checkout, an incomplete order is created. You can then use a third-party integration to handle your payment gateway. If the payment gateway is supported by Composable Commerce, such as Stripe, the payment is processed externally but handled internally. When a successful validation is returned, Composable Commerce flags the order as complete. + + If you are using a payment method not officially supported by Composable Commerce, the gateway needs to be implemented and handled manually. After the payment has been authorized and captured either through Commerce Manager or API, the status of an order becomes complete. + + ### Shipping + + The status of an order and the status of shipping are handled separately, and so an order can be complete but not shipped. Orders that have not been shipped yet have a status of unfulfilled. This flag is generated automatically by Composable Commerce when an order is created. Currently, you can only update the shipping status manually, through the API. After the order is shipped, flag its shipping status as fulfilled. + + ### Inventory + + If enabled, you can manage your stock. As such, your stock is automatically updated as soon as a product is checked out. + + - name: Orders + description: | + An Order is created through the [checkout](/docs/api/carts/checkout) endpoint within the Carts API. + + An order is created after a customer checks out their cart. On creation, the order is marked unpaid. The customer is prompted for a shipping address, a billing address, and a payment method. After the order is successfully paid, you can trigger an inventory process and a shipping process. + + You can keep a history of orders associated with the customer account. + + ### Reorder + + A re-order is when a shopper copies items from a previous order from their order history into a cart of their choice. If a shopper re-orders to an empty cart, the same quantities as the past order are applied. If the shopper re-orders to an existing cart, and orders the same item, the quantity increases. If an item is out of stock, the item is not added to the cart, and the shopper sees an insufficient stock error. The tax for the items in a re-order is not applied. For more information, see [Tax Items](/docs/api/carts/tax-items). + - name: Payments + description: | + When you [checkout](/docs/api/carts/checkout) a [cart](/docs/api/carts/cart-management), an unpaid [order](/docs/api/carts/orders) is returned. You can process the payment for the order though a payment gateway. + + :::note + + - You need to configure and enable a payment gateway before you can accept payments for orders. + - Configure your store to use [Manual Gateway](/docs/api/payments/update-manual-gateway) to process payments if the order total is zero or the payment is through non-supported payment providers. + - There are a number of actions that happen to your inventory when checking out and paying for an order. For more information, see [Inventory](/docs/api/pxm/inventory/inventories-introduction). + - We recommend to wait until the payment confirmation process is fully completed before proceeding with any additional updates to the order. Making simultaneous updates to the same entity immediately after payment confirmation can lead to a race condition. To learn more information on handling parallel calls to API objects, see [Parallel Calls to API Objects](https://beta.elasticpath.dev/guides/Getting-Started/api-contract#parallel-calls-to-api-objects). + + ::: + + ### Payment Methods + + Depending on the chosen gateway, you may or may not have access to capture funds immediately or authorize for later payment. For more information, see [Transactions](/docs/api/carts/transactions). + + To make a partial payment in Postman through any payment gateway, specify the desired payment amount in the amount field within the request body. To learn about Split Payments, see the [Split Payments](/docs/api/payments/payment-gateways-introduction#split-payments) section. + + #### Purchase + + The simplest method is purchase. The gateway attempts to charge the customer immediately, and the result of the attempt is returned. + + You can partially pay funds using purchase method. The gateway attempts to charge the customer immediately, and the payment status for an order shows `partially_paid`. + + When you Get an order, you can see the following fields in the meta object: + + - `balance_owing`: Specifies the outstanding funds required to complete an order. It considers all complete or pending transactions, including authorized, paid, and captured transactions. (`balance_owing` = order total - `authorized` amount - `paid` amount). + - `paid`: Specifies the total amount of purchased or captured transactions. + - `authorized`: Specifies the total amount of completed or pending authorized transactions for an order. + + #### Authorize + + You can `authorize` a payment so funds can later be captured when an item is dispatched or restocked. + + You can partially pay for an order using `authorize` payment method so that the order is `partially_authorized`. The transaction must be complete for the order status to be `partially_authorized`. + + For more information about order and payment statuses for split payments, see [Split Payments](/docs/api/payments/payment-gateways-introduction#split-payments). + + #### Capture + + After authorizing a transaction, you have to capture the authorized funds. + + :::note + + We recommend capturing payments several hours to days after the authorization to mitigate risks of fraud and chargebacks. When you sell digital goods that are delivered immediately, we recommend using a single purchase call instead of separate authorize and capture calls. + + ::: + + After the payment is `partially_authorized`, you must `capture` the authorized transaction later. Once you capture the authorized transactions, the order payment status will change to `partially_paid`. + + #### Refunds + + You can use either the Refund through Composable Commerce or use the Mark as Refunded capability, or a combination of both capabilities. + + For more information about refund for split payments, see [Refund a Payment](/docs/api/carts/refund-a-transaction). + + #### Refund through Composable Commerce + + You can start a full or partial refund to a supported payment provider directly from Commerce Manager or the API. When you start the refund process, the refund request is sent to the payment gateway. You no longer have to log on to your payment gateway’s console to process the refund. + + When you process a refund, use the refund endpoint to pass the refund amount. If you don’t pass an amount, the refund is processed as Mark as refunded. For more information, see the Mark as Refunded section. + + Each time a partial refund is triggered, the transaction.updated event is generated and updated with refunded.amount. The `order.updated` event is also triggered. The `order.refunded` event generates when the full amount is refunded. + + + #### Mark as Refunded + + You can use your payment gateway’s console to process a refund. Process the refund first in the payment gateway and then use the **Mark as Refunded** capability in Composable Commerce to complete the process. + + When an order is **Marked as refunded**, the payment status `order.payment.status` is set to refunded. In this case, the `order.updated`, `transaction.updated` and `order.refunded` events are generated. + - name: Transactions + - name: Custom Discounts + description: | + With custom discounts, you can allow your shoppers to apply discounts from external services to their purchases. To apply custom discounts to carts and cart items, you need to set `custom_discounts_enabled` field to `true` in your [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + + You cannot add custom discounts to an empty cart. + + :::caution + + - You can apply up to five custom discounts to cart and cart item. + - The stores that use [simple calculation method](/guides/How-To/Carts/calculate-totals) do not support custom discounts. + + ::: + - name: Tax Items + description: | + Taxes differ by country and can differ within the country by region, state, or province. Each jurisdiction has a unique tax code and rate. If your store serves many jurisdictions, integrate a third-party tax generator to manage taxes. If your store serves a few jurisdictions, you can use the API to define the tax codes and rates in Composable Commerce. + + Taxes are calculated after all promotional discounts have been applied. When calculating taxes on a cart or order, you can choose from the following methods for calculating taxes: + + - Simple calculation method: Taxes are calculated at the unit level and are rounded to the nearest penny for the unit. + - Line calculation method: Default. Taxes are calculated at the line level and are rounded to the nearest penny for the line. + For more information about calculation methods, see [Calculate cart and order totals](/guides/How-To/Carts/calculate-totals). + + :::note + Tax items can be added and removed using [client credentials tokens](/docs/authentication/Tokens/client-credential-token). Only administrators with `client-credentials` are able to manage tax items. + ::: + diff --git a/packages/sdks/specs/catalog_view.yaml b/packages/sdks/specs/catalog_view.yaml new file mode 100644 index 00000000..b6145a3e --- /dev/null +++ b/packages/sdks/specs/catalog_view.yaml @@ -0,0 +1,4954 @@ +# GENERATED FILE - DO NOT EDIT +openapi: 3.0.0 +info: + title: Catalogs Introduction + description: | + Use the catalog-view Service API to create your catalogs. + + You also have the flexibility to create catalogs for different scenarios by combining hierarchies of products with a price book. Scenarios might include: + + - Multiple geographical regions. Display different catalogs in different regions with suitable pricing or combine product hierarchies from two different regions to display in a third region. + - Multiple channels. Display different catalogs based on how a shopper accesses your store, such as through a mobile app or a web storefront. + - Direct to business versus direct to customers. Offer different products and prices for business customers versus retail customers. + - Preferred customers. Offer special pricing to preferred customers while displaying a standard price catalog to all other shoppers. + - Reward programs. Enable reward programs where catalog prices drop after a certain spending level is reached. + - Product sales. Offer sale items for a limited time. + + Scenarios are created by defining the context within which a catalog is displays. Contexts can be a customer ID, a channel, or any other user-defined tag that can be passed to the APIs from the front-end shopper experiences. + version: 1.0.0 +servers: + - url: https://euwest.api.elasticpath.com + description: EU West Production Server + - url: https://useast.api.elasticpath.com + description: US East Production Server +security: + - bearerAuth: [] +tags: + - name: Catalogs + description: | + A catalog contains the products available for sale either in your organization or store. A catalog also contains information about how to organize those products for navigation menus and search facets in a shopper experience. + + Before you create a catalog you must define the following resources: + + - Hierarchies: hierarchies and nodes to categorize the products. See [**Hierarchies**](/docs/api/pxm/products/hierarchies). + - Products: product information, associated assets, and links to hierarchy nodes. See [**Products**](/docs/api/pxm/products/products). + - Price Books: prices for the products associated with the hierarchies. See [**Price Books**](/docs/api/pxm/pricebooks). + + A catalog is a combination of hierarchies and a price book. + + ### Products + + Commerce automatically assigns types to the products you create. Product types can be used in catalogs. For example, in your catalog, you can filter on `parent` so that only your parent products are displayed in your storefront. + + You can use product tags to store or assign a key word against a product or service that you sell in your store. The product tag can then be used to describe or label that product. Product tags represent similarities between products who do not share the same attributes. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. Product tags can be used in catalogs. For example, you can categorize your products based on color. Your shoppers can then search your products by color, enabling shoppers to quickly find what they are looking for, increasing the likelihood of a purchase, and boosting conversion rates. + + ### Hierarchies + + The hierarchies determine which products appear in the catalog, that is, only the products that are associated with the selected hierarchies are included in the catalog. You can also specify the order you want your hierarchies to display in a published catalog. You can order your hierarchies on a catalog-by-catalog basis. + + ![Hierarchy_sorting](/assets/hierarchy_sorting.png) + + For more information, see [**create a Catalog**](/docs/api/pxm/catalog/create-catalog). + + #### Understanding How Products And Nodes Are Associated + + You can use `breadcrumb` metadata to understand how products and nodes are associated. it explains how products are associated with parent nodes and the relationship among the array of nodes. This is useful if you want to improve how your shoppers search within your store. + + The `breadcrumb` information that you get in an endpoint response depends on whether the endpoint is retrieving product or node details. + + | Object | Product/Node | Description | + | --- | --- | --- | + | `breadcrumb` | Node | A list of nodes that a product is associated with. Up to 10 levels of nodes are displayed, depending on the number of levels of nodes you have. | + | `bread_crumbs` | Product | The relationship among the array of nodes a product is associated with, demonstrating the linking of the children nodes with the parent nodes. Up to 10 levels of nodes are displayed, depending on the number of levels of nodes you have. | + | `bread_crumb_nodes` | Product | An array of parent node IDs that a product is associated with. The `bread_crumb_node` metadata lists up to 10 levels of parent nodes, depending on the number of levels of parent nodes you have. | + + #### Understanding `bread_crumbs` Metadata + + The following diagram illustrates a parent and child nodes. + + ![Breadcrumbs](/assets/breadcrumbs.PNG) + + 1. The product is in **Node 2**. The ID for **Node 2** is shown first in the first set of breadcrumbs. + 1. **Node 2** is part of **Hierarchy 1**. The ID for **Hierarchy 1** is shown second. + 1. **Node 1** is the parent node of **Node 2**. The ID for **Node 1** is shown last. + 1. The product is also in **Node 3**. The ID for **Node 3** is shown first in the second set of breadcrumbs. + 1. **Node 3** is in the root of **Hierarchy 1**. The ID for **Hierarchy 1** is shown last. + + In the `bread_crumb_nodes` metadata, you can see a list of parent nodes a product is associated with. + + If you subsequently add a product to a new node, then the `bread_crumb_nodes` metadata appends the new node to the top of the list. Using the example above, if we add the product to **Node 1**: + + 1. The `bread_crumb_nodes` metadata is generated to show the new node appended to the top of the list. + 1. The `bread_crumbs` metadata is updated with the new node. + + #### Understanding Breadcrumb Metadata for Child Products + + When a catalog is published, the breadcrumb information for a child product includes the metadata mentioned for the parent product, in addition to the information specific to the child product. For example, **Product A** is the parent product, associated with **Node 1** and **Node 2**. The metadata for child **Product B** includes **Node 1** and **Node 2**, in addition to its own metadata information. + + ### Nodes + + The nodes determine which products appear under this in the catalog, that is, only the products that are associated with the selected node are shown under this node. + + ### Price books + + A price book contains the prices for each of the products in the catalog. You can create multiple price books for different scenarios, such as seasonal sales, business versus retail customer pricing, and reward programs. When creating a catalog, you can specify up to five price books. You must set a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books. See [Create a catalog](/docs/api/pxm/catalog/create-catalog). + - name: Releases + description: | + When a catalog is published, a catalog release is created. A catalog release provides a snapshot of the product information taken at the time of publication. You can have one or more catalog releases available in your organization or in your store. If you publish a catalog for your organization, the catalog is available when the store is launched. + + If you have more than one catalog published for your store, use catalog rules to specify when to display each catalog. For example, you can use [**catalog rules**](/docs/api/pxm/catalog/rules) to schedule a catalog to appear during a particular date and time, such as a seasonal catalog. The catalog may have different pricing than the other catalogs. + + When a catalog is ready to be used in a store, you publish it. You can create and publish catalogs for different contexts and channels. + + Here are some pointers to understand a catalogs' lifecycle. + + - The default catalog is always the oldest published catalog and must have have at least one release. + - At any time, the most recent three catalog releases are maintained. Hence, if there is a fourth catalog release, the first catalog release is automatically removed. + - Until the catalog is published again, the previously created three catalog releases stay permanently. + - If you want any other catalog to become the default catalog, you must create a catalog rule. + - If you want the oldest published catalog to become the default catalog, you must remove the catalog rule. + - Use the `sort_order` value in the `variations` to program your storefront to display the variation options in the order that you want. + + Here is a diagram that describes a catalogs' lifecycle: + + ![Catalogs' Lifecycle](/assets/catalog-lifecycle.png) + + ### Publishing catalogs + + When you publish a catalog, the `live` products in the hierarchies appear in a catalog release. A catalog release provides a snapshot of product information taken at the time of publication. You can have one or more catalog releases available in your organization or in your store. If you publish a catalog for your organization, the catalog is available when the store is launched. + + If you have more than one catalog published for your store, use catalog rules to specify when to display each catalog. For example, you can use [catalog rules](/docs/api/pxm/catalog/rules) to schedule a catalog to appear during a particular date and time, such as a seasonal catalog. The catalog may have different pricing than the other catalogs. You can have multiple published catalogs. + + When a catalog is ready to be used in a store, you publish it. You can create and publish catalogs for different contexts and channels. You can see the differences between the last two consecutive catalog releases. See [Publish a catalog](/docs/api/pxm/catalog/publish-release). + + You retrieve catalogs for your shopper experience by using the [Catalog View API](/docs/api/pxm/catalog/releases). + - name: Rules + description: | + If your store requires multiple catalogs, add catalog rules to control when a catalog is displayed. A catalog rule contains a catalog plus the criteria under which to display the catalog. + + :::caution + + You cannot create catalog rules for organization catalogs. + + ::: + + You can use catalog rules to schedule a catalog to appear during a particular period, such as on a specific date or during summer. The catalog might offer different pricing during this period. The pricing depends on the associated price book. + + The following scenarios provides a few examples for using catalog rules. + + - **Multiple geographical regions**. Display different catalogs in different regions with suitable pricing or combine product hierarchies from two different regions to display in a third region. + - **Multiple channels**. Display different catalogs based on how a shopper accesses your store, such as through a mobile app or a web storefront. + - **Direct to business versus direct to customers**. Offer different products and prices for business customers versus retail customers. + - **Preferred accounts**. Offer special pricing to a group of users while displaying a standard price catalog to other users. + - **Preferred customers**. Offer special pricing to preferred customers while displaying a standard price catalog to all other shoppers. + - **Reward programs**. Enable reward programs where catalog prices drop after a certain spending level is reached. + - **Product sales**. Offer sale items for a limited time. + - **Standard pricing**. Display a default catalog to the shoppers who do not meet the criteria of the other catalog rules. + + You can define a catalog rule with any of the following criteria. + + - **Accounts**. List the accounts that should see a catalog. When a user has logged in with the account, they see the configured catalog. + - **Customers**. List the customers that should see a catalog. When the customer is logged in, they see the configured catalog. + - **Channel**. Specify a shopper experience, such as web storefront or mobile app. Set up the channel to retrieve the catalog from the catalog rule that matches that channel. + - **Other tags**. Create your own user-defined tags. For example, you might want to tag by regions or you might want to distinguish between business and consumer customers. + + If a catalog rule has no criteria defined, it is the default catalog rule. + + ### Resolving catalog rules + + When there is a request for a catalog, the store displays the catalog with the rule that matches the most attributes of the shoppers context. + + The request triggers the following steps: + + 1. Compares the shoppers context against the defined catalog rules. + 1. Determines the best match. + 1. Retrieves the catalog associated with the matching catalog rule. + + The follow examples show how the best match might be resolved: + + - A shopper matches one of the `customer_ids` in one catalog rule only. The catalog for that catalog rule is displayed. + - A shopper matches one of the `customer_ids` in one catalog rule only, but doesnʼt match any of the `tags` specified in that catalog rule. Because there are no other catalog rules for this `customer_id`, the catalog for the catalog rule is displayed because it is the best match. + - A shopper is browsing a store using the stores mobile app, which matches `channel=mobile` in two catalog rules. The catalog displayed depends on matches with the `tags` or `customer_ids` attributes. If there is no other matching attribute, the first catalog rule found by the store is used. The best practice is to create catalog rules that cover all cases so that you avoid this situation. + - An unknown shopper is browsing the only channel offered by the seller. The store displays the base catalog. + - name: Administrator Latest Releases Catalog API + description: | + Use the Administrator Latest Releases Catalog View API to retrieve product, hierarchy and node information. + + :::danger + + The Administrator Latest Releases Catalog View API is for Administrator use only. Do not use these endpoints on your customer-facing frontends. + + ::: + + Publishing a catalog creates a release of that catalog that you can use in an organization or in a specific store or other shopper experience. You can retrieve the hierarchies, nodes, and the `live` products associated with a catalog release. You can see which parent nodes a product is associated with. This is useful if want to improve how your shoppers search your store, for example. + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + - name: Shopper Catalog API + description: | + Use the Shopper Catalog View API to retrieve hierarchy, node and product information for a catalog release. When you publish a catalog for a store, you can define catalog rules so that you can show catalogs with different pricing or different products to preferred customers or channels. These endpoints can be used in your customer-facing frontends. + + A catalog is a combination of one or more hierarchies, products, and a price book. Use the Products API and Hierarchies API to create a hierarchy of products that can be included in a catalog. Use the Price Book API to associate prices with products. + + ### Characteristics of Shopper Catalogs + + Shopper catalogs can have the following characteristics. + + - Use catalog rules to schedule a catalog to appear during a particular date and time, such as a seasonal catalog. The catalog may have different pricing than the other catalogs. You can have multiple published catalogs. + - If you have defined catalog rules and you want to retrieve a published catalog for a particular channel or a user-defined tag, you must set the appropriate headers in the request: + - `EP-Channel` - The channel, such as website or mobile app. See [**Create a Catalog Rule**](/docs/api/pxm/catalog/create-rule). + - `EP-Context-Tag` - A tag defined in the store, such as `clearance`. See [**Create a Catalog Rule**](/docs/api/pxm/catalog/create-rule). + * When a catalog is ready to be used in a store, you publish it. See [**Publish a Catalog**](/docs/api/pxm/catalog/publish-release). + * You can create and publish catalogs for different contexts and channels. You can see the differences between the last 2 consecutive catalog releases. See [**Publish a Catalog**](/docs/api/pxm/catalog/publish-release). + * You retrieve catalogs for your shopper experience by using the Shopper Catalog View API. For more information on how you can retrieve a catalog as a shopper using the Catalog API. + * When a catalog is published for a store, the corresponding events contain `store_id` and `org_id`. + * When a catalog is published for an organization, the corresponding events contain `org_id`. + * Use the `sort_order` value in `variations` to program your storefront to display the variation options in the order that you want. + + ### Shopper Catalog Caching + + When conducting a `GET` on `catalog` endpoints, all data returned, including catalog releases, products, nodes and hierarchies, are cached for 5 minutes. This means, if you call the same endpoint again, the catalog data is retrieved from the cached objects pool, optimizing the performance and efficiency of your store front. + + If you use any of the `catalog` endpoints with a `filter` or `include` query parameter, these are cached separately. + + The cached entries disappear from the cached objects pool after 5 minutes. +paths: + /catalog: + get: + tags: + - Releases + summary: Get the catalog release as shoppers + description: Returns a list of all published releases of the specified catalog. + operationId: getByContextRelease + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/hierarchies: + get: + tags: + - Shopper Catalog API + summary: Get all Hierarchies + description: | + Returns all hierarchies from a catalog. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextAllHierarchies + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-hierarchy' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The hierarchies of the catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/hierarchies/{hierarchy_id}: + get: + tags: + - Shopper Catalog API + summary: Get a Hierarchy + description: | + Returns a hierarchy from the catalog. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog to retrieve. For information about how catalog rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules). + operationId: getByContextHierarchy + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/hierarchies/{hierarchy_id}/nodes: + get: + tags: + - Shopper Catalog API + summary: Get a Hierarchy's Nodes + description: | + Returns all the nodes for the specified hierarchy. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextHierarchyNodes + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/hierarchies/{hierarchy_id}/children: + get: + tags: + - Shopper Catalog API + summary: Get a Hierarchy's Children + description: | + Returns the parent nodes for the specified hierarchy. + + ![Parent Nodes](/assets/rootnodes.PNG) + + If you have multiple catalog rules defined, the rule that best matches the shopperʼs context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + For more information, see [Filtering](/guides/Getting-Started/filtering). + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextHierarchyChildNodes + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/nodes: + get: + tags: + - Shopper Catalog API + summary: Get all Nodes + description: | + Returns all nodes in the catalog. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. For more information, see [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + + The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + + | Operator | Description | Attributes | Example | + | --- | --- | --- | --- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextAllNodes + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The nodes of the catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/nodes/{node_id}: + get: + tags: + - Shopper Catalog API + summary: Get a Node + description: | + Returns a node from the catalog. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The response lists the products associated with a node. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your nodes, enabling you to create unique product collections in your storefront. + + - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - A product that is curated has the `"curated_product": true` attribute displayed. + - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + operationId: getByContextNode + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/nodes/{node_id}/relationships/children: + get: + tags: + - Shopper Catalog API + summary: Get a Node's Children + description: | + Returns the child nodes for a node in the catalog. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see which parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + + - If you don't provide any curated_products, products are listed by their updated_at time in descending order, with the most recently updated product first. + - If you configure curated_products for only a few products, the curated products are displayed first and the other products are displayed in the order of updated_at time. + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - A product that is curated has the "curated_product": true attribute displayed. + - If a curated product is removed from a node, the product is also removed from the curated_products list. + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + + | Operator | Description | Attributes | Example | + | --- | --- | --- | --- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextChildNodes + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/products: + get: + tags: + - Shopper Catalog API + summary: Get all Products + description: | + Retrieves the list of products from the catalog. Only the products in a live status are retrieved. + + ### Catalog Rules + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + ### Product and Node Associations + + You can see the parent nodes a product is associated within the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getByContextAllProducts + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/products/{product_id}: + get: + tags: + - Shopper Catalog API + summary: Get a Product + description: | + Returns the specified product from the catalog. The product must be in the `live` status. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getByContextProduct + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/products/{product_id}/relationships/component_products: + get: + tags: + - Shopper Catalog API + summary: Get a Bundle's Component Products + description: | + With Product Experience Manager, you can [create](/docs/api/pxm/products/create-product) and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + + You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + + This endpoint returns a list of component product IDs for the specified bundle. + operationId: getByContextComponentProductIDs + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of component product IDs of a bundle product from a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-reference-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/products/{product_id}/relationships/children: + get: + tags: + - Shopper Catalog API + summary: Get a Parent Product's Child Products + description: | + For a specified product and catalog release, retrieves a list of child products from a parent product. Any product other than a base product results in a `422 Unprocessable Entity` response. Only the products in a `live` status are retrieved. + + If you have multiple catalog rules defined, the rule that best matches the shopperʼs context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated within the `breadcrumbs` metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getByContextChildProducts + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of child products of a parent product from a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/hierarchies/{hierarchy_id}/products: + get: + tags: + - Shopper Catalog API + summary: Get a Hierarchy's Products + description: | + Returns the products associated with the specified hierarchy in the catalog. The products must be in the live status. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + `files` | Optional | Any files associated with a product. | + + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getByContextProductsForHierarchy + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The products of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/nodes/{node_id}/relationships/products: + get: + tags: + - Shopper Catalog API + summary: Get a Node's Products + description: | + Returns the products associated with the specified hierarchy node in the catalog. The products must be in the `live` status. If the products have been curated then the products are returned in the order specified in the `curated_products` attribute. A product that is curated has the `"curated_product": true` attribute displayed. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getByContextProductsForNode + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalog/products/{product_id}/configure: + post: + tags: + - Shopper Catalog API + summary: Configure a Shopper Bundle + description: | + Once you have configured your product bundles, you can display them in your storefront in your published catalog. Depending on how you have configured the minimum and maximum values for the product options in your components, you can allow your shoppers to choose which products they want to select. For example, you can enable a shopper to select 1 or more product options from a list of 10, giving your shoppers greater flexibility when selecting products in your store front. + + - Products must be in a `live` status. + - If you have not specified any minimum or maximum values for the product options in your components, your shoppers can select any combination of product options. + + If you have configured minimum and maximum values using [Create a Bundle](/docs/api/pxm/products/create-product), this becomes part of the `bundle_configuration`. You can check how your bundle is configured using [Get a product in a catalog release](/docs/api/pxm/catalog/get-product) in `bundle_configuration` under `meta`. The `bundle_configuration` forms the body of the request. + + The response updates the `bundle_configuration` with the product options the shopper selects. The `meta` data is updated with the `meta` data of the selected product options. In your storefront, you could display this as a summary of the product options a shopper has selected. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: configureByContextProduct + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + requestBody: + $ref: '#/components/requestBodies/bundle-configuration-data' + responses: + '200': + description: The configured product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs: + post: + tags: + - Catalogs + summary: Creates a new catalog + description: | + Before you create a catalog, you must define the following resources: + + - Hierarchies - hierarchies and nodes to categorize the products. + - Products - product information, associated assets, and links to hierarchy nodes. + - Price Books - prices for the products associated with the hierarchies. You can create multiple price books for different scenarios, such as seasonal sales, business versus retail customer pricing, and reward programs. When creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books. Priority is a number and the price book with the highest number has the highest priority. + operationId: createCatalog + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-create-data' + description: Creates a catalog with the following attributes. + required: true + responses: + '201': + description: The created catalog + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + get: + tags: + - Catalogs + summary: Gets all authorized catalogs + description: | + Retrieves a list of all the catalogs that you are authorized to view. Currently, published catalogs are limited to the current release and two releases prior to the current release. You can see the differences between the last 2 consecutive catalog releases using the delta link returned in the response of a [publish a catalog](/docs/api/pxm/catalog/publish-release) endpoint. + + You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before publishing a catalog release and injecting fresh data in a delta link. The `is_full_delta` attribute tells you if this is a full publish of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. See [Publish a catalog](/docs/api/pxm/catalog/publish-release). + + If the `is_full_publish` attribute returned in the response is `false`, data from the previous catalog release overlaid the existing data in the delta file. The `is_full_publish` attribute is always `true` the first time a catalog is published. + operationId: getCatalogs + responses: + '200': + description: The list of catalogs. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}: + get: + tags: + - Catalogs + summary: Get a catalog by ID + description: Retrieves the specified catalog. + operationId: getCatalogByID + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + put: + tags: + - Catalogs + summary: Updates a catalog + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog is not updated. + operationId: updateCatalog + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-update-data' + description: Updated catalog. + required: true + responses: + '200': + description: An updated catalog with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + delete: + tags: + - Catalogs + summary: Deletes a catalog + description: Deletes an unpublished catalog. Use [**Delete a Release**](/docs/api/pxm/catalog/delete-release-by-id) and [**Delete All Releases**](/docs/api/pxm/catalog/delete-releases) to delete releases of a catalog. If the catalog is associated with any catalog rules, you must first update the catalog rules to remove the catalog. + operationId: deleteCatalogByID + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the catalog has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases: + post: + tags: + - Releases + summary: Publishes a catalog + description: | + + Publishes a catalog. You must publish a catalog before you can retrieve that catalog in an organization or store. The hierarchies, live products, and prices associated with a published catalog are in read-only mode. If you make a change to these resources, for example, a change to your price book or hierarchies, you need to republish the catalog. + + You can get [a catalog release](/docs/api/pxm/catalog/get-release-by-id) to retrieve a published catalog. Currently, published catalogs are limited to the current release and two releases prior to the current release. + + You can see the differences between the last 2 consecutive catalog releases. This is useful if want to understand how your products have changed in your catalog, ensuring your site search integration is kept up-to-date. + + Once a catalog release has completed publishing, the delta relationship links to the delta document. + + The `delta` links are signed and only valid for 1 hour. Re-reading a catalog release, for example, using [Getting a release of a catalog](/docs/pxm/catalogs/catalog-latest-release/get-a-release-of-a-catalog) returns a fresh a link. + + You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before injecting fresh data in a `delta` link. The `is_full_delta` attribute tells you if this is a full publish of the catalog. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before injecting fresh data from the `delta` file. If the `is_full_delta` attribute is `false`, then data from the previous catalog overlays the existing data in the `delta` file. To publish a catalog and inject fresh data in a `delta` link, set `export_full_delta` to `true`. + + If a previous catalog publish date is greater than 90 days, then a full catalog publish is automatically performed. If you publish your catalogs infrequently, Commerce may perform a full publish when you are expecting a delta publish. + + :::caution + + Generating a full delta is resource intensive and slows down the publishing process and so should only be performed in certain circumstances, for example, when initializing an integration with a service like Algolia. + + ::: + + The `is_full_delta` attribute is always `true` the first time a catalog is published. The information is stored in a collection of `json` documents in a compressed file. You can either manually check the file or, for example, use them to automatically update another company system you may have. + + - Delta files are only available for 30 days. + - Delta files are removed when a catalog release is deleted. + + Each document has a `delta_type` with one of the following values, depending on whether a product has been deleted, updated or created in a catalog release. + + - `delete` describes products deleted from this release of a catalog. + - `createupdate` describes products updated in this release of a catalog. + + ### Multi-Store Management Solutions + + In a multi-store management solution. + + - You can create organization catalogs. Your organization catalogs are available for your stores to use. + - Your stores can create their own catalogs. + - Your stores can create catalogs that have a combination of organization products and store products. + + If you are publishing a catalog in a store that contains resources from an organization, in Commerce Manager, you must enable the **Include Organization Resources in Catalog Publishes** checkbox. + + 1. Go to **SYSTEM** > **Store Settings**. + 2. Click **General Settings**. + 3. Select **PXM** from the list. + 4. Select the **Include Organization Resources in Catalog Publishes** checkbox. + operationId: publishRelease + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-release-create-data' + description: Options for catalog release publishing + responses: + '201': + description: Publishes a catalog release with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + get: + tags: + - Releases + summary: Gets all authorized catalog releases + description: | + Returns a list of all published releases of the specified catalog. Currently, published catalogs are limited to the current release and two releases prior to the current release. You can see the differences between the last 2 consecutive catalog releases using the `delta` link returned in the response of a `publish a catalog` endpoint. + + You can use the `is_full_delta` attribute returned from the `get a release of a catalog` endpoint to determine if you need to refresh the data in your company system before publishing a catalog release and injecting fresh data in a delta link. The `is_full_delta` attribute tells you if this is a full publish of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. + + If the `is_full_publish` attribute returned in the response is `false`, data from the previous catalog release overlaid the existing data in the delta file. The `is_full_publish` attribute is always `true` the first time a catalog is published. + operationId: getReleases + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The list of catalogs. + content: + application/json: + schema: + $ref: '#/components/schemas/release-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + delete: + tags: + - Releases + summary: Deletes all releases + description: Deletes all releases of the specified published catalog. + operationId: deleteReleases + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the releases have been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}: + get: + tags: + - Releases + summary: Get a catalog release by ID + description: Retrieves the specified catalog release. + operationId: getReleaseByID + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The catalog release ID. + name: release_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + delete: + tags: + - Releases + summary: Deletes a release + description: Deletes the specified published catalog release. + operationId: deleteReleaseByID + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The catalog release ID. + name: release_id + in: path + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the release has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/rules: + post: + tags: + - Rules + summary: Creates a new catalog rule + description: | + If you have multiple catalogs, create catalog rule resources. With catalog rules, you can display different catalogs to different shoppers. For example, you can display a preferred pricing catalog to a few special customers. Or you can display one catalog to shoppers using your website and a different catalog to shoppers using your mobile app. Finally, you can define custom criteria by creating tags. + + :::note + + - If you have one catalog for all customers and channels, you can omit creating this resource. + - Due to the way catalogs are cached in Commerce, using catalog rules to display catalogs sometimes causes a 5-minute time delay before the catalogs are displayed. + - You cannot create catalog rules for organization catalogs. + + ::: + + For ideas about the kinds of business scenarios you can achieve with catalog rules, see [Catalog Rules](/docs/api/pxm/catalog/rules). To understand how catalogs are matched to shoppers by using rules, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + operationId: createRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/rule-create-data' + description: Creates a catalog rule with the following attributes. + required: true + responses: + '201': + description: The created catalog rule + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + get: + tags: + - Rules + summary: Gets all authorized catalog rules + description: | + Retrieves all authorized catalog rules. + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are supported. + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + operationId: getRules + parameters: + - $ref: '#/components/parameters/filter-rule' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of catalog rules. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/rules/{catalog_rule_id}: + get: + tags: + - Rules + summary: Get a catalog rule by ID + operationId: getRuleByID + parameters: + - description: The catalog rule ID. + name: catalog_rule_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog rile. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + put: + tags: + - Rules + summary: Updates a catalog rule + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog rule is not updated. + operationId: updateRule + parameters: + - description: The catalog rule ID. + name: catalog_rule_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/rule-update-data' + description: An updated catalog rule with the following attributes. + required: true + responses: + '200': + description: An Updated catalog rule with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + delete: + tags: + - Rules + summary: Deletes a catalog rule + operationId: deleteRuleByID + parameters: + - description: The catalog rule ID. + name: catalog_rule_id + in: path + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the catalog rule has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/hierarchies: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get all Hierarchies + description: | + Returns the hierarchies from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getAllHierarchies + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/filter-hierarchy' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The hierarchies of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Hierarchy + description: | + Returns the specified hierarchy from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + operationId: getHierarchy + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/nodes: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Hierarchy's Nodes + description: | + Returns all nodes for the specified hierarchy from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getHierarchyNodes + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The catalog release ID. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/children: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Hierarchy's Children + description: | + Returns the parent nodes for the specified hierarchy from a published catalog. + + ![Parent Nodes](/assets/rootnodes.PNG) + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + In the `bread_crumb` metadata, you can identify the parent nodes that a node is associated with. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). + + | Operator | Description | Supported Attributes | Example | + |:--- |:--- |:--- |:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getHierarchyChildNodes + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/nodes: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get all Nodes + description: | + Returns the child nodes from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. See [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + + The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + + - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + - A product that is curated has the `"curated_product": true` attribute displayed. + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + + | Operator | Description | Attributes | Example | + | --- | --- | --- | --- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getAllNodes + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The nodes of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Node + description: | + Returns a node from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + + - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + - A product that is curated has the `"curated_product": true` attribute displayed. + operationId: getNode + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/children: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Node's Children + description: | + Returns the child nodes for a node from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + You can see the parent nodes a node is associated with in the `bread_crumb` metadata for each node. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. For more information, see [Building breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + + The response lists the products associated with the nodes. If products are [curated](/guides/How-To/Products/curating-products), they are displayed in `curated_products`. Product curation allows you to promote specific products within each of your hierarchies, enabling you to create unique product collections in your storefront. + + - If you don't provide any `curated_products`, products are listed by their `updated_at` time in descending order, with the most recently updated product first. + - If you configure `curated_products` for only a few products, the curated products are displayed first and the other products are displayed in the order of `updated_at` time. + - You can only curate 20 products or less. You cannot have more than 20 curated products. + - If a curated product is removed from a node, the product is also removed from the `curated_products` list. + - A product that is curated has the `"curated_product": true` attribute displayed. + + ### Filtering + + This endpoint supports filtering. For general syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available. + + | Operator | Description | Attributes | Example | + | --- | --- | --- | --- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + | `in` | Checks if the values are included in the specified string. If they are, the condition is true. + | `Id` | `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getChildNodes + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/products: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get all Products + description: | + Returns the products from a published catalog. Only the products in a `live` status are retrieved. Currently, published catalogs are limited to the current release and two releases prior to the current release. + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the [Get a List of products in a catalog release](/docs/api/pxm/catalog/get-all-products) response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. + + See [**Including Resources**](/guides/Getting-Started/includes). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + operationId: getAllProducts + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Product + description: | + Returns a product from a published catalog. The product must be in `live` status. Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ### Product and Node Associations in Breadcrumb Metadata + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Product Variations + + The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order`attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the get a product in a catalog release response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getProduct + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/component_products: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Bundle's Component Products + description: | + With Product Experience Manager, you can [create](/docs/api/pxm/products/create-product) and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + + You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + + This endpoint returns a list of component product IDs for the specified bundle. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getComponentProductIDs + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of component product IDs of a specific bundle product from a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-reference-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/children: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Parent Product's Child Products + description: | + For a specified product and catalog release, retrieves a list of child products from a parent product. Any product other than a base product results in a `422 Unprocessable Entity` response. Only the products in a `live` status are retrieved. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. If no catalog rules are configured, the first catalog found is returned. For information about how rules are matched, see [Resolving Catalog Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated within the breadcrumbs metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getChildProducts + parameters: + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The product ID. + name: product_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of child products of a specific base product from a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/products: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Hierarchy's Products + description: | + Returns the products associated with the specified hierarchy in the catalog. The products must be in the `live` status. + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The variations object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in variations. Once a parent product is published in a catalog, the [Get a List of products in a catalog](/docs/api/pxm/catalog/get-all-products) release response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getProductsForHierarchy + parameters: + - $ref: '#/components/parameters/accept-language' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog hierarchy ID. + name: hierarchy_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/products: + get: + tags: + - Administrator Latest Releases Catalog API + summary: Get a Node's Products + description: | + Returns the products associated with the specified hierarchy node in the catalog. The products must be in the `live` status. If the products have been curated, then the products are returned in the order specified in the `curated_products` attribute. A product that is curated has the `"curated_product": true` attribute displayed. + + :::note + + Currently, published catalogs are limited to the current release and two releases prior to the current release. + + ::: + + If you have multiple catalog rules defined, the rule that best matches the shoppers context is used to determine which catalog is retrieved. See [Resolving catalog rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated with in the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This is useful if you want to improve how your shoppers search your store, for example. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The `variations` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variations` object can then be added to your catalogs. By default, variations and variation options are sorted randomly. You can use the `sort_order` attribute to sort the order of your variation and variation options in `variations`. Once a parent product is published in a catalog, the [Get a List of products in a catalog release](/docs/api/pxm/catalog/get-all-products) response displays the sorted variations and variation options. Variations and variation options are displayed in descending order according to their `sort_order` values. + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see [Filtering](/guides/Getting-Started/filtering). The following operators and attributes are available when filtering on this endpoint. + + | Operator | Description | Supported Attributes | Example | + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- | + | `Eq` | Checks if the values of two operands are equal. If they are, the condition is true. For `product_types` and `tags`, you can only specify one. For example, `filter=eq(product_types,child)`. | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=eq(name,some-name)` | + | `In` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types` and `tags`, you can specify more than one. For example, `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a hierarchy structure that a product belongs to. You can use this to build breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + - You can have as many node Ids as you want. + - It does not matter what order you specify the node Ids. The nodes are returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products and product attributes, such as SKU or slug. + + | Parameter | Required | Description | + | :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + | `component_products` | Optional | The component product data and key attribute data, such as SKU or slug, to return for component products in a product bundle. | + | `main_image` | Optional | The main images associated with a product. | + | `files` | Optional | Any files associated with a product. | + + See [**Including Resources**](/guides/Getting-Started/includes). + operationId: getProductsForNode + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - description: The catalog ID. + name: catalog_id + in: path + required: true + schema: + type: string + - description: The unique identifier of a published release of the catalog or `latest` for the most recently published version. + name: release_id + in: path + required: true + schema: + type: string + - description: The catalog node ID. + name: node_id + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' +components: + parameters: + channel: + description: The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + in: header + name: EP-Channel + required: false + schema: + type: string + accept-language: + description: The language and locale your storefront prefers. See [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + in: header + name: accept-language + required: false + schema: + type: string + tag: + description: Product tags are used to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. You can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Tags are used to refine the eligibility criteria for a rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + in: header + name: EP-Context-Tag + required: false + schema: + type: string + limit: + description: The maximum number of records per page for this response. You can set this value up to 100. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + name: page[limit] + in: query + required: false + schema: + type: integer + format: int64 + minimum: 1 + offset: + description: The current offset by number of records, not pages. Offset is zero-based. The maximum records you can offset is 10,000. If no page size is set, the [page length](/docs/api/settings/settings-introduction#page-length) store setting is used. + name: page[offset] + in: query + required: false + schema: + type: integer + format: int64 + minimum: 0 + maximum: 10000 + filter-rule: + name: filter + in: query + description: | + This endpoint supports filtering. See [Filtering](#filtering). + required: false + schema: + type: string + filter-hierarchy: + name: filter + in: query + description: | + + This endpoints supports filtering. See [Filtering](#filtering). + required: false + schema: + type: string + filter-node: + name: filter + in: query + description: | + This endpoint supports filtering, see [Filtering](#filtering). + required: false + schema: + type: string + filter-product: + name: filter + in: query + description: | + This endpoints support filtering. See [Filtering](#filtering). + required: false + schema: + type: string + include-component-products: + name: include + in: query + description: | + Using the `include=component_products` parameter, you can retrieve key attribute data for the bundle component products in the product bundle, such as SKU or slug . + required: false + schema: + type: string + requestBodies: + bundle-configuration-data: + content: + application/json: + schema: + $ref: '#/components/schemas/bundle-configuration-data' + description: The bundle configuration. + required: true + products-for-cart-configuration: + content: + application/json: + schema: + $ref: '#/components/schemas/products-for-cart-configuration' + description: A list of product id or sku and bundle configuration for cart. + required: true + securitySchemes: + bearerAuth: + type: http + name: Authorization + in: header + scheme: bearer + schemas: + amount: + type: object + description: The three-letter ISO code for the currency associated with this price. + title: Amount + properties: + amount: + description: The price in the lowest denomination for the specified currency. This is a product's list price. + type: integer + example: 100 + format: int64 + x-omitempty: false + x-go-name: Amount + includes_tax: + description: Whether this price includes tax. + type: boolean + example: false + default: false + x-go-name: IncludesTax + x-go-name: PriceAmount + prioritized-pricebooks: + description: If you want multiple price books for different scenarios, such as seasonal sales, business versus retail pricing, and reward programs, when creating a catalog, you can specify up to five price books. You must configure a priority for your price books. Product prices are displayed in the catalog according to the priority of the price books. + type: array + maxItems: 5 + items: + type: object + properties: + id: + description: A unique identifier of a price book. + type: string + format: uuid + priority: + description: Priority is a number and the price book with the highest number has the highest priority. + type: integer + required: + - priority + - id + x-go-name: PrioritizedPricebook + catalog: + type: object + title: Catalog + description: Creates a catalog with the following attributes. + properties: + id: + type: string + description: A unique identifier of a catalog. + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: The name of a catalog. + type: string + example: catalog-123 + description: + description: A brief description of the catalog, such as the purpose of the catalog. + type: string + example: Catalog for Store 123 + default: '' + hierarchy_ids: + description: The unique identifiers of the hierarchies associated with a catalog. + type: array + items: + type: string + pricebook_id: + description: The unique identifier of a price book associated with a catalog. If no price book is selected, the catalog is displayed without prices. + type: string + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: string + created_at: + description: The date and time a catalog is created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + description: The date and time a catalog was updated. + type: string + example: '2020-09-22T09:00:00' + format: date-time + owner: + description: The owner of this resource, can be either `organization` or `store`. + type: string + enum: + - store + - organization + x-go-name: Owner + default: store + nullable: true + required: + - name + - hierarchy_ids + - created_at + - updated_at + relationships: + description: Relationships are established between different catalog entities. For example, a catalog rule and a price book are related to a catalog, as both are associated with it. + type: object + title: CatalogRelationships + properties: + rules: + description: The catalog rules related to a catalog. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + releases: + description: When a catalog is published, a catalog release is created. This is a URL to all catalog published releases available for this catalog. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + meta: + type: object + properties: + count: + description: The number releases available for a catalog. + type: integer + type: + type: string + example: catalog + enum: + - catalog + required: + - id + - type + - attributes + catalog-create-data: + type: object + title: CatalogCreateData + description: Creates a catalog with the following attributes. + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: The name of the catalog. + type: string + minLength: 1 + example: catalog-123 + description: + description: A brief description of the catalog. + type: string + example: Catalog for Store 123 + nullable: true + hierarchy_ids: + description: The unique identifiers of the hierarchies to associate with a catalog. + type: array + items: + type: string + pricebook_id: + description: | + The unique identifier of the price book to associate with this catalog. You can specify either a `pricebook_id` or `pricebook_ids` but not both. If you specify both a `pricebook_id` and `pricebook_ids`, a `422 Unprocessable Entity` error is displayed. + type: string + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: string + required: + - name + - hierarchy_ids + type: + description: Represents the type of object being returned. Always `Catalog`. + type: string + example: catalog + enum: + - catalog + required: + - type + - attributes + required: + - data + catalog-data: + type: object + title: CatalogData + description: Container for a single catalog. + properties: + data: + $ref: '#/components/schemas/catalog' + links: + $ref: '#/components/schemas/links' + required: + - data + catalog-list-data: + type: object + title: CatalogListData + description: Container for a list of catalogs. + properties: + data: + type: array + items: + $ref: '#/components/schemas/catalog' + links: + $ref: '#/components/schemas/links' + required: + - data + catalog-update-data: + type: object + title: CatalogUpdateData + description: A catalog combines price books, product lists, and hierarchies. + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: The name of the catalog. + type: string + minLength: 1 + example: catalog-123 + nullable: true + description: + description: A brief description of the catalog. + type: string + example: Catalog for Store 123 + nullable: true + hierarchy_ids: + description: The unique identifiers of the hierarchies to associate with a catalog. + type: array + items: + type: string + nullable: true + pricebook_id: + description: The unique identifier of a price book to associate with a catalog. You can specify a `pricebook_id` or a `pricebook_ids` but not both. If you specify both, a `422 unprocessable entity` error is displayed. + type: string + nullable: true + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: Product Experience Manager supports localization of products and hierarchies. If you store supports multiple languages, you can localize product names and descriptions. + type: object + additionalProperties: + description: A [three-letter language code](https://www.loc.gov/standards/iso639-2/) that represents the name of language you have used. + type: object + additionalProperties: + description: A [three-letter language code](https://www.loc.gov/standards/iso639-2/) that represents the name of language you have used. + type: string + id: + description: The unique identifier of the catalog to be updated. + type: string + x-go-name: ID + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + type: + description: This represents the type of object being returned. Always `catalog`. + type: string + example: catalog + enum: + - catalog + required: + - type + - id + - attributes + required: + - data + component-product: + type: object + title: Component Product + description: The unique identifier of the component, for example, `games`. + properties: + name: + description: The component name is the name that is displayed in your storefront. + type: string + x-go-name: Name + min: + description: The minimum number of product options a shopper can select from this component. + type: integer + x-go-name: Min + nullable: true + max: + description: The maximum number of product options a shopper can select from this component. + type: integer + x-go-name: Max + nullable: true + sort_order: + description: The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want. + type: integer + x-go-name: Sort Order + nullable: true + options: + description: The product options included in a component. This can be the ID of another bundle. + type: array + items: + $ref: '#/components/schemas/component-product-option' + x-go-name: Options + component-product-option: + type: object + title: Component Product Option + description: The product options included in a component. This can be the ID of another bundle. + properties: + id: + description: A unique identifier of the product you want to add to a component. + type: string + format: uuid + x-go-name: ID + type: + description: This represents the type of object being returned. Always `product`. + type: string + x-go-name: Type + default: product + example: product + enum: + - product + quantity: + description: The number of this product option that a shopper must purchase. + type: integer + example: 2 + x-go-name: Quantity + sort_order: + description: The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want. + type: integer + example: 15 + x-go-name: Sort Order + nullable: true + default: + description: The boolean indicates whether the current option is a default option for the component. + type: boolean + example: true + default: false + x-go-name: Default + nullable: true + components: + type: object + title: Components + description: A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + additionalProperties: + $ref: '#/components/schemas/component-product' + custom-input-validation-rule-options: + type: object + description: The length of the custom input text field. + x-go-name: CustomInputValidationRuleOptions + properties: + max_length: + description: The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters. + type: integer + x-go-name: MaxLength + example: 255 + custom-input-validation-rule: + type: object + title: Custom Input Validation Rule + description: The validation rules for the custom text. + x-go-name: CustomInputValidationRule + properties: + type: + description: This represents the type of object being returned. Must be `string`. + type: string + x-go-name: Type + default: string + example: string + enum: + - string + options: + $ref: '#/components/schemas/custom-input-validation-rule-options' + custom-input: + type: object + title: Custom Input + description: The name of the custom input. You can rename the input to something more representative of the input that shoppers are adding, for example, `message` or `front`. + properties: + name: + description: The name for the custom text field that is displayed in your storefront. + type: string + x-go-name: Name + example: Message + validation_rules: + description: The validation rules for the custom text. + type: array + x-go-name: ValidationRules + items: + $ref: '#/components/schemas/custom-input-validation-rule' + required: + description: This is `true` or `false` depending on whether the custom text is required. + type: boolean + x-go-name: Required + example: false + default: false + nullable: true + custom_inputs: + type: object + title: Custom Inputs + description: | + You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this using the `custom_inputs` attribute. + + - You can rename input to something more representative of the input that shoppers are adding, for example, `message` or `front`. + - `name` is the name that is displayed in your storefront. + - You can add validation rules. For example, the input field must be a string and/or up to 255 characters in length. The limit is 255 characters. + additionalProperties: + $ref: '#/components/schemas/custom-input' + currencies: + type: object + description: A collection of one or more currencies objects that consists of the [**three-letter ISO code**](https://www.iso.org/iso-3166-country-codes.html) of the currencies associated with this price and the amount. This is the product's price. + title: Currencies + additionalProperties: + $ref: '#/components/schemas/amount' + shopper_attributes: + type: object + description: The optional price extension with values in string format, viewable by shoppers. + title: ShopperAttributes + additionalProperties: + type: string + diff-list-data: + type: object + title: DiffListData + description: A list of differences between two releases. + properties: + data: + type: array + items: + $ref: '#/components/schemas/product-diff' + links: + $ref: '#/components/schemas/links' + display-price: + type: object + description: A price formatted for display. + x-omitempty: true + properties: + with_tax: + $ref: '#/components/schemas/formatted-price' + without_tax: + $ref: '#/components/schemas/formatted-price' + error: + type: object + title: APIError + description: APIError is a json-api style part of an error response. + properties: + detail: + type: string + example: not processable + x-go-name: Detail + status: + type: string + example: '422' + x-go-name: Status + title: + type: string + example: There was a problem processing your request. + x-go-name: Title + x-go-name: APIError + error-response: + type: object + title: ErrorResponse + description: ErrorResponse is a json-api style Error response. + properties: + errors: + type: array + items: + $ref: '#/components/schemas/error' + x-go-name: Errors + x-go-name: ErrorResponse + extension: + type: object + title: Extension + description: The name of the product template. + additionalProperties: + description: The product attributes available for this template. + type: object + extensions: + type: object + title: Extensions + description: With extension templates, you can attach a specific set of custom fields to your products in Product Experience Manager. For example, a **Book** template might contain the attributes, such as **ISBN**, **Author**, **Number of pages**, **Year Published**, or **Condition (New/Used)**. + additionalProperties: + $ref: '#/components/schemas/extension' + file-reference: + description: In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details. + type: object + properties: + type: + description: This represents the type of object being returned. Always `file`. + type: string + example: file + enum: + - file + id: + description: A unique identifier for a file. + type: string + format: uuid + created_at: + description: The date and time a file is created. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + x-go-name: FileRelationship + files-relationship: + description: In Product Experience Manager, products can have associated rich media assets, such as product images or a file containing additional product details. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/file-reference' + x-omitempty: true + component-products-relationship: + description: A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. You can link to the products that make up your bundle components. + type: object + properties: + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/self-link' + x-omitempty: true + formatted-price: + type: object + title: FormattedPrice + x-omitempty: true + description: A price formatted for display. + properties: + amount: + description: The price in the lowest denomination for the specified currency. This is a product's list price. + type: integer + x-omitempty: false + example: '47500' + currency: + description: The three-letter ISO code of the currencies associated with this price and the amount. + type: string + example: USD + formatted: + description: The format of the price for display. + type: string + example: $475.00 + hierarchy: + type: object + title: Hierarchy + description: A category hierarchy in a catalog. Hierarchies can have parent nodes and child nodes, as well as a list of attached products. + properties: + attributes: + $ref: '#/components/schemas/hierarchy-attributes' + id: + description: A unique identifier of a hierarchy. + type: string + example: e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + relationships: + $ref: '#/components/schemas/hierarchy-relationships' + type: + description: This represents the type of object being returned. Always `hierarchy`. + type: string + example: hierarchy + x-go-name: Type + meta: + $ref: '#/components/schemas/hierarchy-meta' + x-go-name: Hierarchy + hierarchy-meta: + type: object + title: HierarchyMeta + description: A hierarchy's metadata. + properties: + language: + description: Product Experience Manager supports localization of hierarchies. If your store supports multiple languages, you can localize hierarchy names and descriptions. This is [**three-letter language code**](https://www.iso.org/iso-639-language-code) that represents the name of the language you have used. + type: string + example: en-GB + x-go-name: HierarchyMeta + x-omitempty: true + hierarchy-attributes: + type: object + title: HierarchyAttributes + description: Resource attributes of a catalog hierarchy. + properties: + created_at: + description: The date and time a hierarchy is created. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + published_at: + description: The date and time a hierarchy is published in a catalog. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + description: + description: A description of a hierarchy. + type: string + example: Formal dresswear + x-go-name: Description + name: + description: The name of a hierarchy. + type: string + example: Formal dresswear + x-go-name: Name + slug: + description: A unique slug for a hierarchy. + type: string + example: formal + x-go-name: Slug + updated_at: + description: The date and time a hierarchy was updated. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: UpdatedAt + x-go-name: HierarchyAttributes + hierarchy-data: + type: object + title: HierarchyData + description: Container for hierarchies. + properties: + data: + $ref: '#/components/schemas/hierarchy' + links: + $ref: '#/components/schemas/links' + hierarchy-list-data: + type: object + title: HierarchyListData + description: Container for a list of hierarchies. + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/hierarchy' + links: + $ref: '#/components/schemas/links' + hierarchy-relationships: + type: object + title: HierarchyRelationships + description: Relationships to child nodes, and products. + properties: + products: + description: A URL to all the products associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + children: + description: A URL to all the child products associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + nodes: + description: A URL to all the nodes associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + x-go-name: HierarchyRelationships + links: + description: Links allow you to move between requests. + type: object + properties: + self: + description: Single entities use a `self` parameter with a link the specific resource. + type: string + format: uri + nullable: true + first: + description: Always the first page. + type: string + format: uri + nullable: true + last: + description: This is `null` if there is only one page. + type: string + format: uri + nullable: true + prev: + description: This is `null` if there is only one page. + type: string + format: uri + nullable: true + next: + description: This is `null` if there is only one page. + type: string + format: uri + nullable: true + main-image-relationship: + type: object + description: In Product Experience Manager, products can also have associated product images. + properties: + data: + description: The images associated with a product. + type: object + x-nullable: 'true' + properties: + type: + description: This represents the type of object being returned. Always `main_image`. + type: string + example: main_image + enum: + - main_image + id: + description: A unique identifier for an image. + type: string + format: uuid + x-omitempty: true + node: + type: object + title: Node + description: A category node in a catalog. Nodes can have child nodes, as well as a list of attached products. + properties: + attributes: + $ref: '#/components/schemas/node-attributes' + id: + description: The unique identifier of a node. + type: string + example: e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + relationships: + $ref: '#/components/schemas/node-relationships' + type: + description: This represents the type of object being returned. Always `node`. + type: string + example: node + x-go-name: Type + meta: + $ref: '#/components/schemas/node-meta' + x-go-name: Node + node-attributes: + type: object + title: NodeAttributes + description: Resource attributes of a catalog node. + properties: + created_at: + description: The date and time a node was created. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + published_at: + description: The date and time a node was published in a catalog. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + description: + type: string + description: A description of a node. + example: Formal dresswear + x-go-name: Description + label: + type: string + example: category + x-go-name: Label + name: + description: The name of a node. Names must be unique among sibling nodes in a hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + type: string + example: Formal dresswear + x-go-name: Name + slug: + description: A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + type: string + example: formal + x-go-name: Slug + curated_products: + description: A list of curated products for a node. You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. + type: array + items: + type: string + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + status: + type: string + example: live + x-go-name: Status + updated_at: + description: The date and time a node was updated. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: UpdatedAt + x-go-name: NodeAttributes + node-create-data: + type: object + title: NodeCreateData + description: Container for nodes. + properties: + data: + type: object + title: NodeCreateArgs + description: A node in a catalog (e.g. a category node). Nodes can have child nodes, as well as a list of attached products + properties: + attributes: + type: object + title: NodeCreateAttributes + description: Resource attributes of a catalog node. + properties: + description: + type: string + example: Formal dresswear + x-go-name: Description + hierarchy_id: + type: string + description: hierarchy id of the node + example: ddd401ac-db06-4d9e-af60-cf5206abb9bc + label: + type: string + example: category + x-go-name: Label + name: + type: string + example: Formal dresswear + x-go-name: Name + slug: + type: string + example: formal + x-go-name: Slug + status: + type: string + example: Live + x-go-name: Status + locales: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + required: + - name + relationships: + $ref: '#/components/schemas/node-relationships' + id: + type: string + example: 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + type: + type: string + example: node + x-go-name: Type + required: + - type + - attributes + links: + $ref: '#/components/schemas/links' + required: + - data + node-data: + type: object + title: NodeData + description: Container for nodes. + properties: + data: + $ref: '#/components/schemas/node' + links: + $ref: '#/components/schemas/links' + node-list-data: + type: object + title: NodeListData + description: Container for a list of nodes. + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/node' + links: + $ref: '#/components/schemas/links' + node-meta: + type: object + title: NodeMeta + description: A node's metadata. + properties: + language: + description: The node details localized in the supported languages. + type: string + example: en-GB + bread_crumb: + description: Helps you understand the association of products with nodes. It explains how products are associated with parent nodes and the relationship among the array of nodes. This is useful if you want to improve how your shoppers search within you store. + type: array + items: + type: string + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + x-go-name: NodeMeta + x-omitempty: true + node-reference: + type: object + title: NodeReference + description: Minimum set of information to identify a catalog node. + properties: + id: + description: The unique identifier of a hierarchy. + type: string + example: 65477ce0-fcb8-436b-a120-3d57979421dd + x-go-name: ID + label: + description: A label for a hierarchy. + type: string + example: category + x-go-name: Label + name: + description: The name of a hierarchy. + type: string + example: Formal dresswear + x-go-name: Name + x-go-name: NodeReference + node-relationships: + type: object + title: NodeRelationships + description: Relationships to parent and child nodes, and products. + properties: + products: + description: A URL to all products associated with a node. + type: object + properties: + data: + type: array + x-omitempty: true + items: + $ref: '#/components/schemas/product-reference' + links: + $ref: '#/components/schemas/related-link' + children: + description: A URL to all child nodes associated with a node. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + parent: + description: A URL to all parent nodes associated with a node. + type: object + properties: + data: + type: object + properties: + type: + type: string + example: node + enum: + - node + id: + type: string + example: 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + required: + - id + - type + links: + $ref: '#/components/schemas/related-link' + required: + - data + hierarchy: + description: A URL to the hierarchies associated with a node. + type: object + properties: + data: + type: object + properties: + type: + type: string + example: hierarchy + enum: + - hierarchy + id: + type: string + example: 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + required: + - id + - type + links: + $ref: '#/components/schemas/related-link' + required: + - data + x-go-name: NodeRelationships + node-relationships-data: + type: object + title: NodeRelationshipsData + description: Container for node relationships. + properties: + data: + $ref: '#/components/schemas/node-relationships' + links: + $ref: '#/components/schemas/links' + page-meta: + type: object + description: Contains the results for the entire collection. + title: PageMeta + properties: + results: + description: Total number of results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + format: int64 + page: + type: object + properties: + limit: + description: The maximum number of records for all pages. + type: integer + format: int64 + offset: + description: The current offset by number of pages. + type: integer + format: int64 + current: + description: The current number of pages. + type: integer + format: int64 + total: + description: The total number of records for the entire collection. + type: integer + format: int64 + pricebook: + type: object + title: Pricebook + description: Top level entity in the pricebooks domain model. It contains a list of product prices. + properties: + id: + description: The unique identifier of a price book. + type: string + example: 4c45e4ec-26e0-4043-86e4-c15b9cf985a7 + x-go-name: ID + type: + description: This represents the type of object being returned. Always `pricebook`. + type: string + x-go-name: Type + default: pricebook + example: pricebook + enum: + - pricebook + attributes: + type: object + properties: + created_at: + type: string + format: date-time + example: '2020-09-22T09:00:00' + x-go-name: CreatedAt + description: + type: string + example: This is a pricebook + x-go-name: Description + nullable: true + name: + type: string + example: pricebook-store-abc + x-go-name: Name + nullable: true + updated_at: + type: string + example: '2020-09-22T09:00:00' + format: date-time + x-go-name: UpdatedAt + required: + - name + required: + - type + - attributes + additionalProperties: false + x-go-name: Pricebook + pricebook-create-data: + type: object + title: PricebookData + description: Container for pricebooks. + properties: + data: + type: object + description: New top level pricebook. + title: PricebookCreateArgs + properties: + type: + type: string + x-go-name: Type + default: pricebook + example: pricebook + enum: + - pricebook + attributes: + type: object + properties: + description: + type: string + example: This is a pricebook + x-go-name: Description + nullable: true + name: + type: string + example: pricebook-store-abc + x-go-name: Name + nullable: true + required: + - name + required: + - type + - attributes + additionalProperties: false + links: + $ref: '#/components/schemas/links' + required: + - data + pricebook-data: + type: object + title: PricebookData + description: Container for pricebooks. + properties: + data: + $ref: '#/components/schemas/pricebook' + links: + $ref: '#/components/schemas/links' + required: + - data + pricebook-price: + type: object + title: PricebookPrice + description: ProductPrice associates a collection of locale specific prices with a product ID. + properties: + type: + type: string + example: product-price + default: product-price + enum: + - product-price + attributes: + type: object + properties: + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + $ref: '#/components/schemas/sales' + sku: + type: string + example: 4c45e4ec-sku + required: + - currencies + - sku + id: + type: string + example: 4c45e4ec-26e0-4043-86e4-c15b9cf985a7 + x-go-name: ID + required: + - type + - id + - attributes + additionalProperties: false + pricebook-price-create-data: + type: object + title: PricebookPriceCreateData + description: Container for pricebook prices. + properties: + data: + type: object + title: PricebookPriceCreateArgs + description: ProductPrice associates a collection of locale specific prices with a product ID. + properties: + type: + type: string + example: product-price + default: product-price + enum: + - product-price + attributes: + type: object + properties: + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + $ref: '#/components/schemas/sales' + sku: + type: string + example: 4c45e4ec-sku + required: + - currencies + - sku + required: + - type + - attributes + links: + $ref: '#/components/schemas/links' + required: + - data + pricebook-price-data: + type: object + title: PricebookPriceData + description: Container for pricebook prices. + properties: + data: + $ref: '#/components/schemas/pricebook-price' + links: + $ref: '#/components/schemas/links' + required: + - data + product: + type: object + title: Product + description: A product in a catalog with the following attributes. + properties: + attributes: + $ref: '#/components/schemas/product-attributes' + id: + description: A unique identifier for a product. + type: string + example: 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + relationships: + $ref: '#/components/schemas/product-relationships' + type: + description: This represents the type of object being returned. Always `product`. + type: string + example: product + x-go-name: Type + meta: + $ref: '#/components/schemas/product-meta' + x-go-name: Product + product-attributes: + type: object + title: ProductAttributes + description: A product's attributes. + properties: + published_at: + description: The date and time a product was published in a catalog. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + base_product: + description: If this product is a `parent` product. A `parent` product is a product that has child products that have been built using the `build child products` endpoint. + type: boolean + example: false + default: false + x-go-name: BaseProduct + base_product_id: + description: The unique identifier of a `parent` product. + type: string + example: cdf574bc-e36e-48fc-9eac-01c87839b285 + x-go-name: BaseProductID + commodity_type: + description: The commodity type, either `physical` or `digital`. + type: string + example: physical + x-go-name: CommodityType + curated_product: + description: If a product is curated, then the `curated_product` attribute with a value of `true` is displayed. If a product is not curated, the `curated_product` attribute is not displayed. + type: boolean + example: true + x-omitempty: true + x-go-name: CuratedProduct + upc_ean: + description: The universal product code or european article number of the product. + type: string + example: '0123456' + x-go-name: UpcEan + manufacturer_part_num: + description: The manufacturer part number of the product. + type: string + example: mfn1 + x-go-name: ManufacturerPartNum + tags: + type: array + description: A list of tags associated with the product. A tag must be HTML compatible characters excluding commas and will be stored in lowercase letters. + items: + description: A tag associated with the product. + type: string + example: tag-a + x-go-name: Tags + x-omitempty: true + price_modifiers: + type: array + description: A list of price modifier names. + items: + description: A list of price modifier names. + type: string + example: modifier-1 + x-go-name: PriceModifiers + x-omitempty: true + created_at: + description: The date and time a product was created. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + description: + description: A description of the product. + type: string + example: This is a product + x-go-name: Description + name: + description: A name of a product. + type: string + example: Blue shirt + x-go-name: Name + price: + $ref: '#/components/schemas/currencies' + shopper_attributes: + $ref: '#/components/schemas/shopper_attributes' + tiers: + $ref: '#/components/schemas/tiers' + components: + $ref: '#/components/schemas/components' + custom_inputs: + $ref: '#/components/schemas/custom_inputs' + sku: + description: The unique stock keeping unit of the product. + type: string + example: blue-shirt + x-go-name: Sku + slug: + description: A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug. + type: string + example: blue-shirt + x-go-name: Slug + status: + description: The status of the product, either `live` or `draft`. + type: string + example: live + x-go-name: Status + external_ref: + description: The unique attribute associated with the product. This could be an external reference from a separate company system, for example. + type: string + x-go-name: ExternalRef + nullable: true + updated_at: + description: The date and time a product was updated. + type: string + example: '1970-01-01T00:00:00.000' + format: date-time + x-go-name: UpdatedAt + extensions: + $ref: '#/components/schemas/extensions' + x-go-name: ProductAttributes + product-create-data: + type: object + title: ProductData + description: Container for products. + properties: + data: + type: object + title: ProductCreateArgs + description: A new product in a catalog. + properties: + attributes: + type: object + title: ProductCreateAttributes + description: A product's attributes. + properties: + description: + type: string + example: This is a product + name: + type: string + example: Blue shirt + sku: + type: string + example: blue-shirt + slug: + type: string + example: blue-shirt + status: + type: string + example: live + locales: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + required: + - name + - status + id: + type: string + example: 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + type: + type: string + example: product + x-go-name: Type + required: + - attributes + - type + links: + $ref: '#/components/schemas/links' + product-data: + type: object + title: ProductData + description: Container for products. + properties: + data: + $ref: '#/components/schemas/product' + links: + $ref: '#/components/schemas/links' + product-diff: + x-go-name: ProductDiff + type: object + properties: + id: + type: string + example: e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + type: + type: string + example: product_diff + x-go-name: Type + attributes: + type: object + properties: + sku: + type: string + this_release_id: + type: string + other_release_id: + type: string + diff_created_at: + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + exists: + x-go-name: ProductDiffExists + type: object + properties: + this: + type: boolean + other: + type: boolean + required: + - this + - other + updated_at: + x-go-name: ProductDiffUpdatedAt + type: object + properties: + this: + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-omitempty: true + nullable: true + other: + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-omitempty: true + nullable: true + product-list-data: + type: object + title: ProductListData + description: Container for a list of products. + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/product' + x-go-name: Data + links: + $ref: '#/components/schemas/links' + product-meta: + type: object + title: ProductMeta + description: A product's metadata contains information about products, for example, the nodes a product is associated with, any child products, bundle configurations, and so on. + properties: + bread_crumbs: + description: The relationship among the array of nodes a product is associated with, demonstrating the linking of the children nodes with the parent nodes. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have. + type: object + additionalProperties: + type: array + items: + type: string + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + bread_crumb_nodes: + description: An array of parent node IDs that a product is associated with. Up to 10 levels of parent nodes are displayed, depending on the number of levels of parent nodes you have. + type: array + items: + type: string + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + catalog_id: + description: A unique identifier of the catalog a product is associated with. + type: string + example: 362a16dc-f7c6-4280-83d6-4fcc152af091 + x-go-name: CatalogID + pricebook_id: + description: The unique identifier of the price book a product is associated with. + type: string + example: f5466169-0037-460c-b181-b02682b6f4de + x-go-name: PricebookID + nullable: true + display_price: + $ref: '#/components/schemas/display-price' + catalog_source: + description: The source of a catalog. Always `pim`. + type: string + example: pim + enum: + - pim + x-go-name: CatalogSource + sale_id: + description: With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + nullable: true + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + bundle_configuration: + $ref: '#/components/schemas/bundle-configuration' + component_products: + description: A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + type: object + additionalProperties: + type: object + properties: + sale_id: + description: With sales pricing, a store can optionally add a sale price to a product price. For example, a store can schedule seasonal pricing on products without creating a new price book and catalog ruleset. Optionally, a store can schedule the date ranges for the sale products. This is the unique identifier of a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + nullable: true + price: + $ref: '#/components/schemas/currencies' + display_price: + $ref: '#/components/schemas/display-price' + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + pricebook_id: + type: string + example: f5466169-0037-460c-b181-b02682b6f4de + x-go-name: PricebookID + nullable: true + x-go-name: ComponentProductMeta + price_modifiers: + type: object + description: You can use price modifiers to change the price property of child products. By default, child products inherit the same price as their base products. Using price modifiers, you can enable child products to inherit a different price. + additionalProperties: + description: A name for the modifier. The name must be unique and is case-sensitive. + type: object + properties: + modifier_type: + description: | + There are three modifier types. + + - The `price_increment` type increases the prices of a product. + - The `price_decrement` type decreases the price of a product. + - The `price_equals` type sets the price of a product to an amount you specify. + type: string + example: price_equals + currencies: + $ref: '#/components/schemas/currencies' + x-go-name: PriceModifierMeta + tiers: + description: You can use tiers to allow your store to offer different pricing for minimum quantities of items that your shoppers purchase. + type: object + additionalProperties: + description: The name of the tier, such as `Pencils`. + type: object + properties: + sale_id: + description: The unique identifier of a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + nullable: true + display_price: + $ref: '#/components/schemas/display-price' + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + x-go-name: ProductMetaTier + x-go-name: ProductMetaTiers + variation_matrix: + description: The `variation_matrix` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. If no variations are available, the `variation_matrix` is empty. + type: object + variations: + description: If you specified `build_rules` for a product, the `variations` object lists the variation option IDs that you specified to include when building your child products. If no `build_rules` are specified, all the variation and variation options available for a product are displayed. If a product does not have any variations, then the `variations` object is not displayed. + type: array + items: + $ref: '#/components/schemas/variation' + x-omitempty: true + child_option_ids: + description: An array of variation options IDs that a child product has. + type: array + items: + type: string + example: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + - 6ddf2a66-d805-449c-a0e1-8e81335e31a6 + x-omitempty: true + nullable: true + child_variations: + description: If this is a child product, the `child_variations` object lists the variation option IDs that define this child product. + type: array + items: + $ref: '#/components/schemas/variation' + x-omitempty: true + nullable: true + product_types: + description: | + Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + + Product types can also be used in catalogs. For example, in your catalog, you can filter on parent so that only your parent products are displayed in your storefront. + + Products have one of the following types: + + - **standard** - Standard products are a standalone products. + - **parent** - A parent product is a product that has child products that have been built using the `Build Child Products` endpoint. + - **child** - When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + - **bundle** - A bundle is a purchasable product, comprising two or more standalone products (in other words, components) to be sold together. + type: array + items: + type: string + x-omitempty: true + x-go-name: ProductTypes + language: + description: If you storefront supports multiple languages, your storefront's preferred language and locale. + type: string + example: en-GB + x-go-name: ProductMeta + x-omitempty: true + variation_option: + description: The options available for a variation. + type: object + properties: + id: + description: A unique identifier for an option. + type: string + format: uuid + x-go-name: ID + name: + description: The name of the option. + type: string + sort_order: + description: If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want. + type: integer + x-go-name: Sort Order + nullable: true + description: + description: The option description to display to customers. + type: string + x-go-name: ProductVariationOption + variation: + type: object + properties: + id: + description: A unique identifier of a variation. + type: string + format: uuid + x-go-name: ID + name: + description: The name of a variation. + type: string + sort_order: + description: If you specified a `sort_order` when creating your variations and variation options, then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want. + type: integer + x-go-name: Sort Order + nullable: true + option: + $ref: '#/components/schemas/variation_option' + options: + description: The options available for this variation. + type: array + x-omitempty: true + items: + $ref: '#/components/schemas/variation_option' + x-go-name: ProductVariation + bundle-configuration-data: + type: object + title: BundleConfigurationData + description: Container for a bundle configuration. + properties: + data: + $ref: '#/components/schemas/bundle-configuration' + required: + - data + bundle-configuration: + type: object + title: BundleConfiguration + description: A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + properties: + selected_options: + type: object + description: The product options included in a component. This can be the ID of another bundle. + additionalProperties: + description: The unique identifier of the component, for example, `games`. + type: object + additionalProperties: + description: The number of this product option that a shopper must purchase. + type: integer + format: int64 + required: + - selected_options + x-go-name: ProductBundleConfiguration + product-reference: + type: object + title: ProductReference + description: A product identifier. + x-nullable: 'true' + properties: + id: + description: A unique identifier for a product. + type: string + format: uuid + x-go-name: ID + type: + description: This represents the type of object being returned. Always `product`. + type: string + x-go-name: Type + example: product + enum: + - product + x-go-name: ProductReference + product-reference-list-data: + type: object + title: ProductReferenceListData + description: Container for a list of product references. + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/links' + product-references: + type: array + title: ProductReferences + description: A list of product identifiers. + items: + $ref: '#/components/schemas/product-reference' + x-go-name: ProductReferences + product-relationships: + type: object + title: ProductRelationships + description: Relationships allow you to move between requests. Includes links to the parent and child products, bundle component products, files, and main images associated with a product. + properties: + parent: + description: The details of a `parent` product. A `parent` product is a product that has child products that have been built using the `Build Child Products` endpoint. + type: object + properties: + data: + $ref: '#/components/schemas/product-reference' + x-go-name: Parent + x-omitempty: true + children: + description: The details of a `child` product. When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + type: object + properties: + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/self-link' + x-go-name: Children + x-omitempty: true + files: + $ref: '#/components/schemas/files-relationship' + main_image: + $ref: '#/components/schemas/main-image-relationship' + component_products: + $ref: '#/components/schemas/component-products-relationship' + x-go-name: ProductRelationships + x-omitempty: true + product-relationships-data: + type: object + title: ProductRelationshipsData + description: Container for product relationships. + properties: + data: + $ref: '#/components/schemas/product-relationships' + links: + $ref: '#/components/schemas/links' + products-for-cart: + type: object + title: ProductsForCart + description: A list of products to be added to cart. Can be type product-data or error-response. + properties: + data: + type: array + items: {} + x-go-name: Data + included: + type: object + x-go-name: Included + properties: + component_products: + type: array + items: + $ref: '#/components/schemas/product' + x-go-name: ComponentProducts + nullable: true + required: + - data + x-go-name: ProductsForCart + products-for-cart-configuration: + type: object + title: ProductsForCartConfiguration + description: A list of product id or sku and bundle configuration for cart. + properties: + data: + type: array + minItems: 1 + items: + type: object + properties: + id: + type: string + format: uuid + x-go-name: ID + nullable: true + sku: + type: string + x-go-name: SKU + nullable: true + bundle_configuration: + $ref: '#/components/schemas/bundle-configuration' + x-go-name: Data + required: + - data + x-go-name: ProductsForCartConfiguration + related-link: + description: A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas. + type: object + properties: + related: + description: A URL to a related object, for example, catalog rules, hierarchies, price books, products and deltas. + type: string + required: + - related + self-link: + description: Links are used to allow you to move between requests. + type: object + properties: + self: + description: Single entities use a self parameter with a link to that specific resource. + type: string + required: + - self + release: + type: object + title: Release + description: A catalog release represents a collection of hierarchical product data, price books and catalogs rules. + properties: + id: + description: A unique identifier for the catalog release. + type: string + x-go-name: ID + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: The name of a release. + type: string + example: Clothing + published_at: + description: The date and time a release was published. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + catalog_id: + description: A unique identifier for the catalog. + type: string + example: 0194f54d-f2a1-4e33-9a6e-9ec366152490 + description: + description: A description of the catalog release. + type: string + example: Catalog for Store 123 + default: '' + hierarchies: + description: An array of hierarchy IDs associated with the release. + type: array + items: + $ref: '#/components/schemas/node-reference' + x-go-name: RootNodes + relationships: + $ref: '#/components/schemas/release-relationships' + type: + description: This represents the type of object being returned. Always `catalog-release`. + type: string + x-go-name: Type + meta: + $ref: '#/components/schemas/release-meta' + x-go-name: Release + release-data: + type: object + title: Release Data + description: Container for a catalog release. + properties: + data: + $ref: '#/components/schemas/release' + links: + $ref: '#/components/schemas/links' + release-list-data: + type: object + title: ReleaseListData + description: Container for a list of catalog releases. + properties: + data: + type: array + items: + $ref: '#/components/schemas/release' + links: + $ref: '#/components/schemas/links' + release-meta: + type: object + title: ReleaseMeta + description: A release's metadata. + properties: + created_at: + description: The date and time a release is created. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + started_at: + description: The date and time a release is available for use. In other words, the date and time the status of a catalog release changes to PUBLISHED, rather than IN PROGRESS. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + updated_at: + description: The date and time a release is updated. + type: string + format: date-time + example: '1970-01-01T00:00:00.000' + nullable: true + release_status: + description: The status of the current release. + type: string + enum: + - PENDING + - IN_PROGRESS + - FAILED + - PUBLISHED + language: + description: Your storefront's preferred language code and locale. + type: string + example: en-GB + is_full_publish: + description: | + Indicates that a full publish was performed (either because this is the first time a catalog has been published or because of a change that occurred, for example, adding/removing a price book or hierarchy). When determining whether delta data needs to be refreshed, ignore this attribute and always use the `is_full_delta` attribute. + type: boolean + example: false + default: false + x-go-name: IsFullPublish + is_full_delta: + description: | + Indicates whether the release delta file contains the full content of a catalog release. Using a search service as an example, if the `is_full_delta` attribute is `true`, you should remove all data about that catalog release from the search service before injecting fresh data from the delta file. If the `is_full_delta` attribute is `false`, then data from the previous catalog release overlays the existing data in the delta file. The `is_full_delta` attribute is always `true` the first time a catalog is published. + type: boolean + example: false + default: false + x-go-name: IsFullDelta + total_products: + description: The total number of products displayed in a catalog release. + type: integer + format: int64 + x-go-name: TotalProducts + nullable: true + total_nodes: + description: The total number of hierarchy nodes displayed in a catalog release. + type: integer + format: int64 + x-go-name: TotalNodes + nullable: true + percent_completed: + description: An integer that represents the progress of a catalog publish. The attribute starts at `0` and reaches `100` when publishing is complete. + type: integer + format: int32 + x-go-name: PercentCompleted + nullable: true + owner: + description: The owner of the resource, can be either `organization` or `store`. + type: string + enum: + - store + - organization + x-go-name: Owner + nullable: true + x-go-name: ReleaseMeta + x-omitempty: true + release-relationships: + type: object + title: ReleaseRelationships + description: Relationships are established between different catalog entities. For example, products, hierarchies, price books, and catalog rules are related to a catalog, as they are associated with it. + properties: + delta: + description: A URL to a delta document that describes the changes between catalog releases. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + products: + description: A URL to all products included in a catalog release. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + hierarchies: + description: A URL to all hierarchies included in a catalog release. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + x-go-name: ReleaseRelationships + rule: + type: object + title: Catalog Rule + description: A catalog rule specifies which catalog to use for a given shopper context. + properties: + id: + type: string + description: The catalog rule ID. Use this to get, modify, or delete the catalog rule. + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: The name of a catalog rule. The name must not contain any spaces. + type: string + example: rule-123 + description: + description: A brief description of the purpose of a catalog rule. + type: string + example: Catalog Rule for most favored customers + default: '' + x-omitempty: true + account_ids: + description: The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + type: array + items: + type: string + x-omitempty: true + customer_ids: + description: The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + type: array + items: + type: string + x-omitempty: true + channels: + description: The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + type: array + items: + type: string + x-omitempty: true + tags: + description: A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + type: array + items: + type: string + x-omitempty: true + schedules: + description: | + Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + + The schedules attribute must include the following. + + - `valid_from` matches the date and time that the catalog is displayed from. + - `valid_to` matches the date and time the catalog is displayed to. + + Commerce runs on UTC time. + + You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + type: array + items: + $ref: '#/components/schemas/rule-schedule' + x-omitempty: true + catalog_id: + type: string + description: The unique identifier of a catalog. + example: d09b4e16-08a5-4f42-817c-6e0d98acbb63 + created_at: + description: The date and time a catalog rule was created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + description: The date and time a catalog release is updated. + type: string + example: '2020-09-22T09:00:00' + format: date-time + required: + - name + - catalog_id + - created_at + - updated_at + type: + description: This represents the type of object being returned. Always `catalog_rule`. + type: string + example: catalog_rule + enum: + - catalog_rule + required: + - id + - type + - attributes + rule-create-data: + type: object + title: CatalogRuleCreateData + description: A catalog rule specifies which catalog to use for a given shopper context. + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: The name of a catalog rule. The name must not contain spaces. + type: string + minLength: 1 + example: rule-123 + description: + description: A brief description of the purpose of a catalog rule. + type: string + example: Catalog Rule for most favored customers + default: '' + nullable: true + account_ids: + description: The list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + type: array + items: + type: string + nullable: true + customer_ids: + description: The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + type: array + items: + type: string + nullable: true + channels: + description: The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + type: array + items: + type: string + nullable: true + tags: + description: A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + type: array + items: + type: string + nullable: true + schedules: + description: | + Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + + The schedules attribute must include the following. + + - `valid_from` matches the date and time that the catalog is displayed from. + - `valid_to` matches the date and time the catalog is displayed to. + + Commerce runs on UTC time. + + You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + type: array + items: + $ref: '#/components/schemas/rule-schedule' + nullable: true + catalog_id: + type: string + description: The unique identifier of a catalog. + example: d09b4e16-08a5-4f42-817c-6e0d98acbb63 + required: + - name + - catalog_id + type: + description: This represents the type of object being returned. Always `catalog_rule`. + type: string + example: catalog_rule + enum: + - catalog_rule + required: + - type + - attributes + required: + - data + rule-data: + type: object + title: CatalogRuleData + description: Container for a single catalog rule. + properties: + data: + $ref: '#/components/schemas/rule' + links: + $ref: '#/components/schemas/links' + required: + - data + rule-list-data: + type: object + title: CatalogRuleListData + description: Container for a list of catalog rules. + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/rule' + links: + $ref: '#/components/schemas/links' + required: + - data + rule-schedule: + type: object + title: Catalog Schedule + description: A period of time during which a catalog is valid + properties: + valid_from: + description: Matches the date and time that the catalog is displayed from. + type: string + example: '2020-09-22T09:00:00' + format: date-time + x-go-name: ValidFrom + nullable: true + valid_to: + description: Matches the date and time the catalog is displayed to. + type: string + example: '2020-09-22T09:00:00' + format: date-time + x-go-name: ValidTo + nullable: true + x-go-name: RuleSchedule + rule-update-data: + type: object + title: CatalogRuleUpdateData + description: A catalog rule specifies which catalog to use for a given shopper context. + properties: + data: + type: object + properties: + id: + type: string + description: The catalog rule ID. Use this to get, modify, or delete the catalog rule. + example: 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: The name of a catalog rule. The name must not contain spaces. + type: string + minLength: 1 + example: rule-123 + nullable: true + description: + description: A description of the purpose of a catalog rule. + type: string + example: Catalog Rule for most favored customers + default: '' + nullable: true + account_ids: + description: Specifies the list of accounts who are eligible to see this catalog. If this field is empty, the rule matches all accounts. + type: array + items: + type: string + nullable: true + customer_ids: + description: The list of customers who are eligible to see this catalog. If empty, the rule matches all customers. + type: array + items: + type: string + nullable: true + channels: + description: The list of channels in which this catalog can be displayed. A channel is the shopping experience, such as a mobile app or web storefront. If empty, the catalog rule matches all channels. The channel will eventually be included in the bearer token that is used for authorization, but currently, you must set the `EP-Channel` header in your requests. + type: array + items: + type: string + nullable: true + schedules: + description: | + Specifies a time period when a catalog is displayed, such as on a specific date or during summer. Requests populate the rule tag using the `EP-Context-Tag` header. + + The schedules attribute must include the following. + + - `valid_from` matches the date and time that the catalog is displayed from. + - `valid_to` matches the date and time the catalog is displayed to. + + Commerce runs on UTC time. + + You can offset the timezone by adding the offset to the end of the date and time. For example, a catalog which contains a sale hierarchy that should appear for a set timeframe may be scheduled to publish on a given date and time within a given timezone. For instance, a sale that should begin on 1st of June 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would have a valid schedule of `"valid_from": "2022-06-01T05:00:00.000-05:00"`, `"valid_to": "2022-06-15T11:59:99.000-08:00"`. + type: array + items: + $ref: '#/components/schemas/rule-schedule' + nullable: true + tags: + description: A list of user-defined tags that can be used to further restrict the eligibility criteria for this rule. Requests populate the catalog rule tag using the `EP-Context-Tag` header. + type: array + items: + type: string + nullable: true + catalog_id: + type: string + description: The unique identifier of a catalog rule. + example: d09b4e16-08a5-4f42-817c-6e0d98acbb63 + nullable: true + type: + description: This represents the type of object being returned. Always `catalog_rule`. + type: string + example: catalog_rule + enum: + - catalog_rule + required: + - id + - type + required: + - data + sale: + type: object + description: A set of sale prices and a validity period. + properties: + schedule: + $ref: '#/components/schemas/schedule' + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + type: object + title: Sales + description: A set of sale specifications + additionalProperties: + $ref: '#/components/schemas/sale' + schedule: + type: object + description: A definition of the times at which a sale is valid + properties: + valid_from: + type: string + example: '2020-09-22T09:00:00' + format: date-time + x-go-name: ValidFrom + nullable: true + valid_to: + type: string + example: '2020-09-22T09:00:00' + format: date-time + x-go-name: ValidTo + nullable: true + x-go-name: Schedule + tier: + type: object + title: Tier + description: The name of the tier, for example, `Pencils`. + properties: + minimum_quantity: + description: The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned. + type: integer + example: '5' + price: + $ref: '#/components/schemas/currencies' + tiered-amount: + type: object + title: TieredAmount + description: The three-letter ISO code for the currency associated with this price. + properties: + amount: + description: The price in the lowest denomination for the specified currency. This is a product's list price. + type: integer + example: 100 + format: int64 + x-omitempty: false + x-go-name: Amount + includes_tax: + description: Whether this price includes tax. + type: boolean + example: false + default: false + x-go-name: IncludesTax + tiers: + description: The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block. + type: object + additionalProperties: + description: The name of the tier, for example, `Pencils`. + type: object + properties: + minimum_quantity: + description: The minimum quantity of 1 or more defined for the specified price. If a minimum quantity is not specified, an error is returned. + type: integer + example: 5 + x-go-name: MinimumQuantity + amount: + description: The price for each quantity. + type: integer + example: 100 + format: int64 + x-omitempty: false + x-go-name: Amount + x-go-name: TierAmount + x-go-name: Tiers + x-go-name: TieredAmount + tiered-currencies: + type: object + title: TieredCurrencies + description: Collection of currency specific prices for a product. + additionalProperties: + $ref: '#/components/schemas/tiered-amount' + tiers: + type: object + title: Tiers + description: The price tier that an item is eligible for based on the quantity purchased. You cannot have conflicting tiers within the same currencies block. + additionalProperties: + $ref: '#/components/schemas/tier' + catalog-release-create-data: + type: object + title: CatalogReleaseCreateData + description: Creates a catalog release with the following attributes. + properties: + data: + type: object + properties: + export_full_delta: + type: boolean + description: | + Set to `true` if you want to export all the data from a catalog release in a delta link. The `is_full_delta` attribute is returned from the `get a release of a catalog` endpoint. The `is_full_delta` attribute tells you if the delta file contains the full content of a catalog release. You can use the `is_full_delta` to determine if you need to refresh the data in your company system before publishing a catalog release with fresh data in a delta link. Using a search service as an example, if the `is_full_delta` attribute is true, you should remove all data about that catalog from the search service before publishing a catalog release and injecting fresh data from the delta file. If the `is_full_delta` attribute is false, then data from the previous catalog overlays the existing data in the delta file. The `is_full_delta` attribute is always `true` the first time a catalog is published. + x-go-name: ExportFullDelta + include_organization_resources: + type: boolean + description: If you are publishing a catalog in a store that contains resources from an organization, you must set this to true and you must enable the **Include Organization Resources in Catalog Publishes** checkbox in Commerce Manager. See [**Multi-Store Management Solutions**](/docs/api/pxm/catalog/publish-release). + x-go-name: IncludeOrganizationResources + nullable: true diff --git a/packages/sdks/specs/config/redocly.yaml b/packages/sdks/specs/config/redocly.yaml new file mode 100644 index 00000000..236b4c75 --- /dev/null +++ b/packages/sdks/specs/config/redocly.yaml @@ -0,0 +1,26 @@ +extends: + - recommended + +apis: + cart-checkout@v1: + root: ../cart_checkout.yaml + decorators: + override/operation-property-override: + operationIds: + getACart: /Users/robert.field/Documents/Projects/EP/muse/composable-frontend/packages/sdks/specs/overrides/getACart.yaml + catalog_view@v1: + root: ../catalog_view.yaml + decorators: + override/component-merge: + mergeRef: /Users/robert.field/Documents/Projects/EP/muse/composable-frontend/packages/sdks/specs/overrides/catalog_view_components.yaml + override/operation-property-override: + operationIds: + getByContextProduct: /Users/robert.field/Documents/Projects/EP/muse/composable-frontend/packages/sdks/specs/overrides/getByContextProduct.yaml + + +plugins: + - ../plugins/override.js + +decorators: + override/component-merge: + mergeRef: /Users/robert.field/Documents/Projects/EP/muse/composable-frontend/packages/sdks/specs/overrides/security-schemes.yaml \ No newline at end of file diff --git a/packages/sdks/specs/overrides/catalog_view_components.yaml b/packages/sdks/specs/overrides/catalog_view_components.yaml new file mode 100644 index 00000000..9a6bd4cf --- /dev/null +++ b/packages/sdks/specs/overrides/catalog_view_components.yaml @@ -0,0 +1,105 @@ +components: + parameters: + include: + name: include + in: query + description: | + Using the `include` parameter, you can retrieve top-level resources, such as, files or main image, bundle component products. + required: false + schema: + type: array + items: + type: string + enum: [ main_images, files, component_products ] + schemas: + included: + description: Included is an array of resources that are included in the response. + type: object + properties: + main_images: + description: The main images associated with a product. + type: array + items: + $ref: '#/components/schemas/elastic-path-file' + component_products: + description: The component products associated with a product. + type: array + items: + $ref: '#/components/schemas/product' + files: + description: The files associated with a product. + type: array + items: + $ref: '#/components/schemas/elastic-path-file' + product-data: + properties: + included: + $ref: '#/components/schemas/included' + product-list-data: + properties: + included: + $ref: '#/components/schemas/included' + elastic-path-file: + type: object + title: ElasticPathFile + properties: + id: + type: string + description: The unique identifier for this file. + format: uuid + type: + description: The type represents the object being returned. + type: string + example: file + file_name: + description: The name of the file. + type: string + example: file_name.jpg + mime_type: + description: The mime type of the file. + type: string + example: image/jpeg + file_size: + description: The size of the file. Required when uploading files. + type: integer + example: 36000 + public: + description: DEPRECATED Whether the file public or not. Required when uploading files. + type: boolean + example: true + meta: + $ref: '#/components/schemas/file-meta' + links: + $ref: '#/components/schemas/links' + link: + $ref: '#/components/schemas/file-link' + file-meta: + properties: + timestamps: + type: object + description: The date and time the file was created. + properties: + created_at: + description: The date and time the file was created. + type: string + example: '2023-10-11T13:02:25.293Z' + dimensions: + description: The file dimensions. + type: object + properties: + width: + description: The width of the file. + type: integer + example: 1800 + height: + description: The height of the file. + type: integer + example: 1000 + file-link: + type: object + description: The publicly available URL for this file. + properties: + href: + description: The publicly available URL for this file. + type: string + example: https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png diff --git a/packages/sdks/specs/overrides/getACart.yaml b/packages/sdks/specs/overrides/getACart.yaml new file mode 100644 index 00000000..7edc9a10 --- /dev/null +++ b/packages/sdks/specs/overrides/getACart.yaml @@ -0,0 +1 @@ +operationId: getCart \ No newline at end of file diff --git a/packages/sdks/specs/overrides/getByContextProduct.yaml b/packages/sdks/specs/overrides/getByContextProduct.yaml new file mode 100644 index 00000000..5dc6a942 --- /dev/null +++ b/packages/sdks/specs/overrides/getByContextProduct.yaml @@ -0,0 +1,2 @@ +parameters: + - $ref: '#/components/parameters/include' \ No newline at end of file diff --git a/packages/sdks/specs/overrides/security-schemes.yaml b/packages/sdks/specs/overrides/security-schemes.yaml new file mode 100644 index 00000000..be2c3cce --- /dev/null +++ b/packages/sdks/specs/overrides/security-schemes.yaml @@ -0,0 +1,7 @@ +components: + securitySchemes: + bearerAuth: + type: http + name: Authorization + in: header + scheme: bearer \ No newline at end of file diff --git a/packages/sdks/specs/pim.yaml b/packages/sdks/specs/pim.yaml new file mode 100644 index 00000000..27804715 --- /dev/null +++ b/packages/sdks/specs/pim.yaml @@ -0,0 +1,7664 @@ +# GENERATED FILE - DO NOT EDIT +openapi: 3.0.3 +info: + title: Product Experience Manager Introduction + description: | + + Product Experience Manager uses the PIM service to manage product information, hierarchies, and price books. Ideally, Product Experience Manager becomes the single source of truth for product data across your organization. + + In Commerce, the product data is stored separately from pricing, catalogs, and inventory. This separation means that you retrieve all product data only when you are managing product data and assets. Otherwise, when setting prices or managing inventory, you retrieve a reference to the product rather than the entire product, which makes the response times very fast. + + You also have the flexibility to create catalogs for different scenarios by combining hierarchies of products with a price book. Scenarios might include: + + - **Multiple geographical regions**. Display different catalogs in different regions with suitable pricing or combine product hierarchies from two different regions to display in a third region. + - **Multiple channels**. Display different catalogs based on how a shopper accesses your store, such as through a mobile app or a web storefront. + - **Direct to business versus direct to customers**. Offer different products and prices for business customers versus retail customers. + - **Preferred customers**. Offer special pricing to preferred customers while displaying a standard price catalog to all other shoppers. + - **Reward programs**. Enable reward programs where catalog prices drop after a certain spending level is reached. + - **Product sales**. Offer sale items for a limited time. + + Scenarios are created by defining the context within which a catalog is displays. Contexts can be a customer ID, a channel, or any other user-defined tag that can be passed to the APIs from the front-end shopper experiences. + version: 1.0.0 +servers: + - url: https://euwest.api.elasticpath.com + description: EU West Production Server + - url: https://useast.api.elasticpath.com + description: US East Production Server +security: + - bearerAuth: [] +tags: + - name: Products + description: | + Products are the items or services that you might want to sell in your store. In Product Experience Manager, a product has a name, description, ID, and SKU. Products can also have additional attributes and associated rich media assets, such as product images or a file containing additional product details. If your store supports multiple languages, you can localize product names and descriptions. + + Product data is stored in a database. After you add products, you can update product information, add images and other assets, and associate products with one or more hierarchy nodes. You can export the updated product information back to other business systems so that your organization sees a consistent view of products. + + While defining products, the products are in a draft state. Your organization can develop the criteria and business processes to help determine when a product is ready to go live and appear in a catalog. + + To appear in a catalog, a product must meet the following criteria: + + - The product is live. + - The product is associated with at least one hierarchy. + - The catalog references a hierarchy that includes the product. + + ### Product Types + + Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + + Product types can also be used in catalogs. For example, in your catalog, you can filter on `parent` so that only your parent products are displayed in your storefront. + + Products have one of the following types: + + * `standard` - Standard products are a standalone products. + * `parent` - A parent product is a product that has child products that have been built using the [**Build Child Products**](/docs/api/pxm/products/build-child-products) endpoint. + * `child` - When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + * `bundle` - A bundle is a purchasable product, comprising one or more standalone products (in other words, `components`) to be sold together. See [**Bundle Components and Options**](#bundle-components-and-options). + + :::note + In Commerce Manager, `standard` products are called **Product**. + ::: + + ### Product Tags + + You can use product tags to store or assign a key word against a product or service that you sell in your store. The product tag can then be used to describe or label that product. Product tags represent similarities between products who do not share the same attributes. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. + + See [**Product Tags**](/docs/api/pxm/products/product-tags). + + ### Personalizing Products + + You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this by configuring the the `custom_inputs` attribute. See [**Create a product**](/docs/api/pxm/products/create-product). + + ### Bundles + + With Product Experience Manager, you can use the products API to create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + + You can use bundles in different ways. For example, a consumer electronics and video game company, *Playtend Games* can sell a *Playtend* video game console as a bundle that includes the console, controller, and game. The price of the bundle might be different from the total of the individual products. + + Alternatively, you may have a fixed, marketable banner product featuring only one item, such as a 'product of the week.' In this use case, the banner bundle description remains constant, while the product within the bundle can be easily swapped in and out. + + You must not assign a product to a bundle if the product is in draft status as this invalidates the bundle. + + You can have: + + - Dynamic bundles. Dynamic bundles allow your shoppers to choose their own options in a bundle. See [**Dynamic Bundles**](#dynamic-bundles). + - Bundles of bundles. Your bundle consists of child bundles. See [**Bundles of Bundles**](#bundles-of-bundles). + + #### Bundle Components and Options + + You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + + :::caution + + You cannot have more than 1500 options in a bundle. + + ::: + + For example, *Playtend Games* can create a bundle where the total bundle price is calculated based on the options that the buyers choose. Shoppers can select a base console option, two games options, and a controller option as in the following example: + + 1. Select one of the following options in the gaming console component. + + - Gaming Console 512 MB Storage. Regular price is $500, selling for $475. + - Gaming Console 1 GB Storage. Regular price is $750, selling for $725. + + 1. From each component, select an option: + + - Component 1: + + - Playtend Roboselect Game, selling for $50 + - Playtend Burndown Game, selling for $45 + - Playtend Invaders Game, selling for $50 + + - Component 2: + + - Playtend Doomsday Game, selling for $35 + - Playtend Happyday Game, selling for $35 + - Playtend Birthday Game, selling for $40 + + 1. Select one of the following options in the controllers component: + + - Red Controller, selling for $40 + - Blue Controller, selling for $40 + - Green Controller, selling for $40 + - Invaders Controller, selling for $75 + + If the shopper chooses the following options for their bundle, the total is $885: + + - Gaming Console 1 GB Storage ($725) + - Playtend Burndown Game ($45) + - Playtend Birthday Game ($40) + - Invaders Controller ($75) + + #### Bundle Pricing + + Bundles can have: + + - Fixed pricing - enables you to assign a fixed price for all products in a bundle. + - Automatic/cumulative pricing - the price of a bundle is generated automatically based on the sum of the component products. + + The following table describes the capabilities and pricing that bundles can have. + + | Pricing | Requires SKU? | Price Book Entry | Capabilities | + |:----|:----- |:---- |:------ | + | **Fixed** - enables you to assign a fixed price for all the products in a bundle. The bundle can contain items that are available for individual purchase, however, when purchased in a fixed-price bundle, are offered at a discounted price. | Yes | Mandatory | **[Sale Pricing](#sale-pricing)** - defines reduced pricing for the total price of the bundle. **[Volume Pricing](#volume-pricing)** - offers promotional prices for products bought in bulk. [**Bundle Inventory Management**](#bundle-inventory) - bundle inventory can be tracked based on the availability of individual items in the bundle. In this case, the maximum number of bundles you can sell is equal to the number of the option that is least available. | + | **Automatic/cumulative** - the price of a bundle can be generated automatically based on the sum of the component products. Ensure that you set a price for each product within the bundle. If a component product does not have a price, the bundle price cannot be set and customers cannot purchase the bundle. | Optional | Not available when SKU is present | **[Sale Pricing](#sale-pricing)** - define reduced pricing for the total price of the bundle. | + + #### Examples of Bundles + + The following table describes some examples of bundles. + + | Bundle Type | Pricing | Description | + |:--------------------------|:----------------------------|:-------------------| + | **Pure bundles** | Fixed | Products are available only as a bundle. | + | **Joint bundles** | Fixed, Automatic/cumulative | A bundled price offered for two or more products. | + | **Gift sets** | Fixed, Automatic/cumulative | A bundle created from a set of predefined items. | + | **Leader bundle** | Automatic/cumulative | A popular product is offered for a discount if you buy it with another less popular product. | + | **Mix and Match bundles** | Automatic/cumulative | Bundle products are selected from a predetermined list of items that you can bundle together. | + | **Upsell bundles** | Automatic/cumulative | Discounted price for the current product when bought together with an accessory as a related item. | + + For example, *Playtend Games* has a bundle that consists of a game console, the Playtend Invaders Game, and the Invaders Controller, and the bundle is available for purchase at $500. The individual price of the products in the bundle are $500 for the game console, $50 for the Playtend Invaders Game, and $75 for the Invaders Controller. This makes the total of the products $625 when bought individually. The price of the bundle is defined in the price books associated with the bundle SKU and the sale price depends on the pricing configuration for the SKU. + + #### Sale Pricing + + You can set a sale price for an item within a bundle so that the product is sold at the sale price when sold as a part of the bundle. For example, if you have a bundle consisting of four items, you can apply a discounted price to an item within the bundle to get a bundle sales price. Both list and sale price (or was/is prices) are available in the catalog response, enabling you to display slash pricing on your storefront, depending on your requirements. + + | Product | Regular product price | Bundle sales price | + |:----------|:----------------------|:-------------------| + | Product A | $100 | $80 | + | Product B | $50 | $50 | + | Product C | $30 | $30 | + | Product D | $130 | $130 | + | **Total** | **$310** | **$290** | + + #### Volume Pricing + + You can configure volume pricing for minimum quantities of products. When a customer adds sufficient quantity of an item and meets the minimum required quantity for different pricing, all products with that item SKU are discounted in the cart. You can define the price range for different quantities of different items, as explained in the following example. + + | Quantity | Price/Each | + |:---------|:-----------| + | 1-5 | $10.50 | + | 6-10 | $10.00 | + | 11-20 | $9.50 | + | 21-50 | $8.50 | + | 51+ | $7.90 | + + #### Dynamic Bundles + + A dynamic bundle allows you to create a bundle where shoppers can choose products from a list of options. For example, a shopper can select 0 or more products from a list of 10. You can also configure some products as default options. A shopper can either select the bundle with the default products or choose products from all the components. Shoppers must either select products for all components or use the default options for all components; they cannot choose products for only one component and leave the others with default options. + + For example, a shopper can select 0 or more product options from a list of 10. When purchasing a monitor, you might want to offer additional optional items that a shopper can select like monitor lamps, extendable arms, or screen wipes. + + You can do this by configuring minimum and/or maximum values for the product options in a component. For example, to sell 4 books for a fixed price from a list of 10, set both minimum and maximum selections to 4. + + When minimum is 0, it means that component product lists are optional for your shoppers. + + If you do not specify any minimum or maximum values for the product options in your components, your shoppers can select any combination of product options. + + To configure default product options, add `"default": true` to all the product options in the bundle that you want to be the defaults. Each component in the bundle must have a default product option. For example, you may have some products in a bundle that are performing better than others. For the products that are not performing as well, you can promote them above the rest by configuring a default product option. Moreover, you may have a default set of products that make sense for a given context. For example, when adding a new fragrance to a fragrance bundle, you may want the new addition to appear as the default option. + + :::caution + + Your shoppers cannot change the quantities of a product. They must purchase the quantity of products that you have specified when you created your components and options. + + ::: + + #### Bundle configuration + + Dynamic bundles have a `bundle_configuration` which describe the options selected. + + 1. Once your bundles are [published in a catalog](/docs/api/pxm/catalog/publish-release), a shopper can select the products they want. + 1. Use [Get a product in a catalog release](/docs/api/pxm/catalog/get-by-context-all-products) to check a `bundle_configuration`. + 1. Use the [configure a shopper bundle](/docs/api/pxm/catalog/configure-by-context-product) endpoint to store a shopper's selections. The response from the [configure a shopper bundle](/docs/api/pxm/catalog/configure-by-context-product) endpoint updates the `bundle_configuration` with the product options a shopper selects. In your storefront, you can display this as a summary of the product options a shopper has selected. + + #### Creating Dynamic Bundles: An Overview + + The following steps are an overview of how to use dynamic bundles. + + 1. Create your products using [**create a product**](/docs/api/pxm/products/create-product). + 1. Create a bundle using [**create a bundle**](/docs/api/pxm/products/create-product). + 1. Specify minimum and/or maximum values for the number of product options that can be selected within the bundle. For example, if you want the shopper to select exactly 4 out of 10 options, set both the minimum and maximum values to 4 for each of the 10 product options. + 1. For each product option in the bundle, specify if it is a default option by adding `"default": true` to the product options that you want to be pre-selected for the shopper. + 1. Publish the bundle to your catalog using the [Publish a catalog](/docs/api/pxm/catalog/publish-release) endpoint so you can display the products to your shoppers in your storefront. + 1. When a shopper interacts with the bundle on your storefront, they can select the products they want from the list of options. Use the [configure a shopper bundle](/docs/api/pxm/catalog/configure-by-context-product) endpoint to capture the shoppers selections. This updates the `bundle_configuration` with the product options chosen by a shopper. + 1. Once a shopper has configured their bundle, use the add a product to a cart endpoint to add the selected bundle to the shopper’s cart. + 1. When the shopper proceeds to checkout, the selected product options from the bundle are included in the order. + + #### Bundles of Bundles + + Your bundle can consist of child bundles. This is useful if you have a base product that is made-up of child products and the pricing of the base product changes, depending on the child products a customer chooses. This can be represented by creating a parent bundle that is made-up of other child bundles. + + ![Bundle of bundles](/assets/bundle-of-bundles.png) + + For example, you may sell sofas. For each sofa that you sell, your customers can choose a fabric, a sofa size, and a leg color. The sofas are the parent bundle. The sofa size, fabric, and leg color are the child bundles. If a customer chooses a large sofa, then the cost of the fabric increases. + + ![sofa bundle](/assets/sofa-bundle.png) + + You create a bundle of bundles by adding a child bundle as an option of a component of another bundle. + + - You cannot have more than one level of child bundles. In other words, a child bundle cannot have a child bundle as a component. + - A parent bundle can contain both bundle and product components. + - Both parent and child bundles can be either [**fixed**](#bundles) or [**dynamic**](#dynamic-bundles) in a bundle of bundles. + + #### Adding Products From Bundles of Bundles to Carts + + When using bundles of bundles, only products from child bundles should be added to a cart. This is because if you add a parent bundle to a cart and call the cart, the cart returns information about the parent bundle and the name of the child bundle, but no child bundle components are returned. + + When designing your storefront, you must only allow child bundles to be added to carts. + + #### Creating bundles of bundles: an overview + + To create a bundle of bundles, simply add a bundle as a component to another bundle. + + 1. Create your products using [**create a product**](/docs/api/pxm/products/create-product). + 1. Create all your child bundles using [**create a bundle**](/docs/api/pxm/products/create-product). + 1. [**Create a parent bundle**](/docs/api/pxm/products/create-product) and specify the product ID of your child bundle as an option of a component in your bundle. You cannot have more than 1500 options in a bundle. + + #### Bundle inventory + + The Inventory service allows you and your business to keep track of inventory, including a transaction-historic log. + + You can track the number of bundles by SKU, if you set the number of bundles available in store. Bundle inventory can be tracked based on the availability of individual items in the bundle. In this case, the maximum number of bundles you can sell is equal to the number of the option that is least available. + + You cannot track the inventory of a bundle without a SKU. However, you can track the inventory based on the availability of individual items. + + Whether your bundle has a SKU or is SKU-less depends on your bundle's pricing. See [**Bundle Pricing**](#bundle-pricing). + - name: Product Tags + description: | + You can use product tags to store or assign a key word against a product or service that you sell in your store. The product tag can then be used to describe or label that product. Product tags represent similarities between products who do not share the same attributes. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. For example, a 3rd party manufacturer may sell cases for Apple iPads whose products would not be returned when filtering on the **Apple** brand. However, merchandizers can tag the cases with **Apple** so that the cases are returned along with other **Apple** products. + + - As a merchandizer, you can enhance your product list using tags, enabling you to refine your product list and run targeted promotions. Using the example above, you can have a clearance sale of **Apple** accessories, by tagging your products accordingly. + - As developers, you can use tags to enrich your search solution, reducing the amount of time and effort needed to keep your search solution up to date. + + A typical use case for product tags is to categorize your products based on color. For example, you could tag the products that you sell in your storefront with a color. Your shoppers can then search your products by color, enabling shoppers to quickly find what they are looking for, increasing the likelihood of a purchase, and boosting conversion rates. + + ### Characteristics of Product Tags + + Product tags have the following characteristics: + + - A product can have up to 20 tags. + - A product tag can be up to 255 characters. + - Product tags must not contain any spaces or commas. + - name: Extending Products with Templates + description: | + With extension templates, you can attach a specific set of custom fields to your products in Product Experience Manager. You can create templates for your products at both the organization and store level. + + ### Product Templates + + Templates are a collection of attributes. Attributes are grouped together to match a particular product type or to provide an input for other purposes, such as Search Engine Optimization (SEO) or product specification. For example, a *Book* template might contain the attributes, such as *ISBN*, *Author*, *Number of pages*, *Year Published*, or *Condition (New/Used)*. + + You can create product templates for both organization and store. However, stores can use organization templates for store level products. + + ### Product Attributes + + Use attributes to define the characteristics of products in a store. For example, you can assign attributes such as, *care instructions* or *fabric*, to a shirt. When a shopper searches for a specific item, attributes help stores to return the products that match the search criteria. For example, when a shopper searches for a large blue shirt, all shirts that are large and blue are returned as the search result. + - name: Bundle Component Products Relationships + description: | + With Product Experience Manager, you can create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + + You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. + - name: Variations + description: | + Product variations are the product options available for a base product that your shoppers can choose. As a merchandiser, you want to be able to present all the options you have available for your products to make it easier for your shoppers to visualize them and influence a potential sale. Product Variations allow you to create and manage up to 10,000 unique combinations of options for variations of a product. You can then use PXM Catalogs to build different catalogs for different users, giving you greater flexibility with your product data and making it easier for your shoppers to interact with your products. + + For example, a product has two variations size and color. The size variation has three options, such as small, medium, and large and the color variation has three options, such as green, red, and blue. This creates a variation matrix with nine possible unique combinations or child products as shown in the following example: + + ![The sizes are across the top row and the colors are in the first column.](/assets/product-variations-1.png) + + You can create additional variations or options and attach them to a product to increase the number of combinations. Using the previous example, if you add a third variation with three options, you can build child products with 27 unique combinations of variations and options. + + ### Reusability + + Variations are reusable, and you can attach the same variation to any number of products. You can also create a link between the existing variation and a new product. The following scenario provides an example: + + 1. Create a variation `shoe size` and add five options in the variation. + 1. Create a product `shoe 1` and link the variation `shoe size` to the product. + 1. Create second product, `shoe 2` and link the variation `shoe size` to this product as well. + 1. Create a third product `shoe 3` and do not link any variation to this product. + + `shoe 1` and `shoe 2` inherit the properties of `shoe size` variation, and you can build the child products with the options. However, you cannot build child products for `shoe 3` unless you assign a variation with at-least one option to the product. + + ### Child Products + + Child products inherit attributes from their parent products. When you make changes to the attributes of the parent products, you can rebuild your child products, ensuring that changes to the parent products are propagated to the child products. + + Alternatively, you can modify a child product independently, without impacting its parent product. For example, you may prefer the status of your child product to be `live`, while keeping the parent product's status as `draft`. When you directly update a child product, it becomes independent of its parent product. In other words, any subsequent changes made to the parent product are not automatically reflected in the child product when you rebuild the parent product and its child products. Once a child product is independent of its parent, you cannot recreate the association between the child product and its parent. You must delete the child product and rebuild the parent to recreate the child product. + + Following on from that, if you add the same flow to both a parent and child product, the child flow values are not affected by changes to the parent flow values in a rebuild. + + In addition, when building your child products, you can choose to exclude or include certain combinations of variation options. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. See [**Build child products**](/docs/api/pxm/products/build-child-products). + + Re-building child products after adding or removing a new variation changes the total number of child products that you can generate from a base product. When you rebuild the child products after updating variations associated with the base product, all existing child products that belong to a base product are deleted. New child products are created with new product IDs. + + If you have any bundles that reference child products directly, then you must update the bundles with the new child product IDs. + + However, re-building child products after adding or removing an option does not change the existing product IDs. + + ### Sorting the Order of Variations and Options + + The `variation_matrix` object lists the variation IDs and variation option IDs and their corresponding product IDs that are generated when the variation and variation options are built with a product. The `variation_matrix` can then be added to your catalogs. + + The order of the variations in the `variation_matrix` is the order of the variations in the array when the variations were linked to the product. For example, the first variation in the `variation_matrix` corresponds to the first variation in the array, and so on. You can use the `sort_order`attribute to sort the order of your variation and variation options in the `variation_matrix` object. The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variations and variation options in the order that you want. + + Add the `sort_order` attribute to the body of your request and specify a `sort_order` value. A `sort_order` value must be a number. You can specify any numbers that you want. + + - 1, 2, 3, or 100, 90, 80, and so on. + - Zero or negative numbers. + + You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + + :::caution + + - Commerce does not sort variations and variation options. You must program your storefront to sort the variations and variation options in the order that you want. + - You must rebuild your products for the sort order changes to take effect. See [**Build Child Products**](#build-child-products). + + ::: + + ### Product Modifiers + + Use modifiers to change the properties of child products that are inherited from a base product. With modifiers, you only need to have one base product with a variation attached to the product. + + Modifiers attached to a variation option are applied to a base product to create child products. For example, instead of creating three base products for three different shirt colors, you can do the following: + + 1. [**Create a parent product**](/docs/api/pxm/products/create-product), *shirt*, with the variation, *color*, attached to it. + 1. Create three options for the *color* variation. See [**Create a variation option**](/docs/api/pxm/products/create-variation-option). + 1. [**Create a modifier**](/docs/api/pxm/products/create-modifier) for each option to change the properties of each child product. For example, attach a *description append* modifier to each option so that each child product has different description based on the color of the child product. + 1. [**Build the child products**](/docs/api/pxm/products/build-child-products). + + This screenshot provides an example of a child product of *shirt* which has a specific description associated with it because of the *description append* modifier setting for the option *yellow*: + + ![Child products with different descriptions](/assets/modifier-description-append.png) + + ### Price Modifiers + + You can use price modifiers to change the price property of child products. By default, child products inherit the same price as their base products. Using price modifiers, you can enable child products to inherit a different price. This enables you to configure the price of child products, for example, to be lower than its base product, without having to individually update the price of your child products. There are three types of price modifier. + + Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `price_increment` | `string` | Increases the price of a product. | + | `price_decrement` | `string` | Decreases the price of a product. | + | `price_equals` | `string` | Sets the price of a product to the amount you specify. | + + The following is an overview of the steps you need to follow to use price modifiers. + + 1. Create a price modifier. You must give the price modifier a unique name, for example, tax_modifier. + 1. Create a product modifier that uses the same name as the price modifier. + 1. [**Build your child products**](/docs/api/pxm/products/build-child-products) with the new product modifier. + - name: Product File Relationships + description: | + Products are the items or services that you might want to sell in your store. In Product Experience Manager, products can also have associated rich media assets, such as product images or a file containing additional product details. + + You can do this using [Files API](/docs/api/pxm/files). + + Once you have created your files, you associate files with your products using the [Create Product-File Relationships API](/docs/api/pxm/products/create-product-file-relationships). + - name: Product Image Relationships + description: | + Products are the items or services that you might want to sell in your store. In Product Experience Manager, products can also have associated rich media assets, such as product images or a file containing additional product details. + + You can do this using [Files API](/docs/api/pxm/files). + + Once you have created your files, you associate files with your products using the [Create Product Main Image Relationships API](/docs/api/pxm/products/create-product-main-image-relationships). + - name: Product Import/Bulk Update + description: | + You can use the Product Import API to: + + - Add new products. + - Add new: + + - main image files. See [**Importing Main Image Files**](#using-imported-main-image-files). + - custom data. See [**Importing custom data**](#importing-custom-data-flows). + - Make bulk updates to existing products, main image files, and custom data. + + You cannot use product import to: + + - Delete existing products. + - Import product bundles. + + The Product Import API uses a [**Comma Separated Values (CSV)**](#characteristics-of-csv-import-files) file to import/update products, main image files, and custom extension data. + + When you send a product import request, a job is created. Jobs are processed one at a time. You can continue to send product import requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. See [**Jobs**](/docs/api/pxm/products/jobs). + + We recommend that you include the maximum allowed number of products in each `csv`file (for example, up to 50,000 rows or a file size of 50 megabytes, see [**Characteristics of CSV Import File**](#characteristics-of-csv-import-files)) to minimize the number of files you submit. This helps prevent extended waiting times for processing jobs. + + #### Using Imported Main Image Files + + You can use the main images that you have previously uploaded to Commerce and assign them to your products when importing products to Commerce. You can do this by adding a `main_image_id` header to your `.csv` file. The ID you provide in `main_image_id` is the ID of a file that has already been uploaded to Commerce using create a file. + + #### Importing Custom Data (Flows) + + You can also create/update custom extension data in a `.csv` file by creating a header that includes the flow `ID` and the field `slug` in the following format: + + template:*flowID*:*fieldSlug*. + + where: + + - `template` must be `template`. + - `flowID` is the ID of the flow that contains the field whose data you want to create/update. + - `fieldSlug` is the slug of the field whose data you want to create/update. + + In the following example, for a flow with ID `82c10a02-1851-4992-8ecb-d44f2782d09b` and a field with the slug `condition`: + + - the header is `template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition`. + - the updated custom data is `as-new`. + + | name | slug | sku | status | template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition | + | :--- | :--- | :--- | :--- | :--- | + | BestEver Range | bestever-range-1a1a-30 | BE-Range-1a1a-30 | draft | as-new | + + #### Characteristics of CSV Import Files + + Product Import uses a [**Comma Separated Values (CSV)**](#characteristics-of-csv-import-files) file to import/update products, main image files, and custom extension data. + + - Each row in a `.csv` file represents a product you want to create/update. + - Each file: + - must not be larger than 50 megabytes. If a `.csv` file is larger than 50 megabytes, a `503 client read error` is displayed. + - must not have more than 50,000 rows, including the header. If a CSV file exceeds 50,000 rows, an error is displayed, and the products are not imported. + In other words, if you have a file with 50,000 rows that is larger than 50 megabytes, an error is displayed, and the products are not imported. + - If you want to create/update more than 50,000 products or your `.csv` file is larger than 50 megabytes, you must have a separate `.csv` file and import each `.csv` file one at a time. + - You can update existing products, including images, templates/flow fields, and entries. The entry in the `.csv` file must have a unique `id` and/or `external_ref` that matches the `id` and `external_ref` of the existing product you want to update. You may have both a unique `id` and `external_ref`, but you must have at least one. + - You can add new products. For new products that you want to add, the entry in the `.csv` file must have an `external_ref` that does not match any existing products. + + The following table describes the headers that are supported. + + | Header | Required | Description | + |:---- |:---------|:--| + | id | Optional | A unique product ID that is generated when you create the product. The `id` is used to look up products in the `.csv` file and matches them to the products in your storefront that you want to update. | + | external_ref | Optional | A unique attribute associated with a product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. | + | name | Required | The name of a product. | + | description | Required | A description for a product. You can include quotes in your product description, if you want to emphasize a word, for example. To do this, put quotes around the product description. For example, "This product description describes my "product" and the product "version"." | + | slug | Required | A label for the product that is used in the URL paths. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed. By default, the product name is used as the slug. | + | status | Required | The status of a product, either `Draft` or `Live`. | + | commodity_type | Required | The commodity type, either `physical` or `digital`. | + | upc_ean | Optional | The universal product code or european article number of the product. | + | mpn | Optional | The manufacturer part number of a product. | + | sku | Optional | The unique stock keeping unit of the product. | + | tags | Optional | The product tags used to store or assign a key word against a product. A product can have up to 20 product tags. A product tag can be up to 255 characters. See [**Product Tags**](/docs/api/pxm/products/product-tags). + | main_image_id | Optional | Specifies a unique ID of a main image file for a product. You can include a `main_image_id` for your products for images that are already uploaded to Commerce. See [**Using Main Image Files**](#importing-custom-data-flows). | + | `template::` | Optional | You can also specify custom extension data in the CSV by specifying the flow `ID` or `slug` and the field `name`. For example, `template::` format. See [**Importing Custom Data (Flows)**](#importing-custom-data-flows). | + - name: Product Export + description: | + The Export API allows you to import/update products, main image files, and custom extension data. + + Using the Export API builds a `.csv` file containing the product entries. A `.csv` file can contain up to 10,000 product entries. If you have more than 10,000 product entries, then another `.csv` file is created and so on, until all your products are exported. + + You might have specified custom extension data in a `.csv` file when you imported the products. These modifications are all exported. So, when you send a request to the Export API, the `.csv` file, included in the Job endpoint response, reflects any changes that you have made. For more information, see [Importing Custom Data (Flows)](/docs/pxm/products/importing-products/product-importer-csv#importing-custom-data-flows). + + After the files are exported, you get a link to the location where the `.csv` files are stored. You can then make any changes to the product fields (modify product information, add main image files, and custom extension data) in your exported `.csv` files. See [**Product Export CSV File**](/docs/api/pxm/products/product-export#product-export-csv-file). + + Once you are happy with your changes, you can import the updated `.csv` files using product import. See [**Product Import/Bulk Update**](/docs/api/pxm/products/product-import-bulk-update). + + ### Characteristics of Exporting Products + + - Product exports are an asynchronous operation. When you send a request to the Export API, it triggers an asynchronous job to build the `.csv` file containing the product entries. + - Jobs are processed one at a time. You can continue to send product export requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. See [**Jobs**](/docs/api/pxm/products/jobs). + - The Export API response includes a job resource. In the response, you can verify the job status; if the status is successful, the response includes a link to the location where the `.csv` file is stored. See [**Product Export CSV File**](#product-export-csv-file). A single CSV file contains 10,000 rows, excluding the header. If you are exporting 50,000 products, the job endpoint response contains links to five `.csv` files; each `.csv` file including 10,000 products. + - You might have specified custom extension data in a `.csv` file when you imported the products. These modifications are all exported. So, when you send a request to the Export API, the `.csv` file, included in the Job endpoint response, reflects any changes that you have made. + - You cannot export product bundles. + + ### Product Export CSV File + + The Product Export API generates a Comma Separated Values (CSV) file that you can use to import/update products, main image files, and custom extension data. + + The `.csv` file is: + + - Comma-separated. + - Header-based. + - Header attributes must be the same as the product attributes. + - Header names can be in any order. + - Each row after the first line represents a single product. + + The following table describes the headers that are supported. + + | Header | Required | Description | + |:---------------------------------|:---------|:-----------------------------------------------------| + | id | Optional | A unique product ID that is generated when you create the product. The `id` is used to look up products in the `.csv` file and matches them to the products in your storefront that you want to update. | + | external_ref | Optional | A unique attribute associated with a product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. | + | name | Required | The name of a product. | + | description | Required | A description for a product. You can include quotes in your product description, if you want to emphasize a word, for example. To do this, put quotes around the product description. For example, "This product description describes my "product" and the product "version"." | + | slug | Required | A label for the product that is used in the URL paths. A slug can contain any combination of letters, numbers, periods, hyphens, and underscores. NO spaces or other characters are allowed. By default, the product name is used as the slug. | + | status | Required | The status of a product, either `Draft` or `Live`. | + | commodity_type | Required | The commodity type, either `physical` or `digital`. | + | upc_ean | Optional | The universal product code or european article number of the product. | + | mpn | Optional | The manufacturer part number of a product. | + | sku | Optional | The unique stock keeping unit of the product. | + | tags | Optional | The product tags used to store or assign a key word against a product. A product can have up to 20 product tags. A product tag can be up to 255 characters. See [**Product Tags**](/docs/api/pxm/products/product-tags + ). | + | main_image_id | Optional | Specifies a unique ID of a main image file for a product. See [Exporting Main Image Files](#exporting-main-image-files). | + | `_created_at` | Optional| The date and time a product was created. **Note**: This field does not populate any data; it is provided solely for informational purposes. | + | `_updated_at` | Optional | The date and time a product was updated. **Note**: This field does not populate any data; it is provided solely for informational purposes. | + | `template::created_at` | Optional | The date and time a template was created. **Note**: This field does not populate any data; it is provided solely for informational purposes. | + | `template::updated_at` | Optional | The date and time a template was updated. **Note**: This field does not populate any data; it is provided solely for informational purposes. | + | `template::` | Optional | Custom extension data includes the flow `ID` or `slug` and the field `name`. See [Exporting Custom Data (Flows)](#exporting-custom-data-flows). | + + ### Exporting Main Image Files + + The main images that you have previously uploaded Commerce are exported. A `main_image_id` header is added to your `.csv` file. The ID in `main_image_id` is the ID of a file that has already been uploaded to Commerce using [create a file](/docs/pxm/products/product-assets/create-a-file). + + ### Exporting Custom Data (Flows) + + Custom extension data is exported in a `.csv` file by creating a header that includes the flow `ID` or `slug` and the field `name` as shown below: + + - `template::` + - `template::` + + where: + + - `template` must be `template`. + - one of the following for the template that contains the field whose data you want to export: + - `flowID` is the ID of the flow. + - `flowSlug` is the flow slug. + - `fieldName` is the name of the field whose data you want to export. + + In the following example, for a flow with ID `82c10a02-1851-4992-8ecb-d44f2782d09b` and a field with the name `condition`: + + - the header is `template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition`. + - the updated custom data is `as-new`. + + | name | slug | sku | status | template:82c10a02-1851-4992-8ecb-d44f2782d09b:condition | + | :--- | :--- | :--- | :--- | :--- | + | BestEver Range | bestever-range-1a1a-30 | BE-Range-1a1a-30 | draft | as-new | + - name: Hierarchies + description: | + Use hierarchies to organize your products into categories and sub-categories. Define hierarchies that work for the products in your store. + + A hierarchy is a tree structure that consists of a root node with 1 or more parent nodes. Each parent node can also have one or more children nodes, and so on, creating a parent-child relationship between nodes. + + A product can belong to multiple nodes in multiple hierarchies. + + ![Hierarchy Nodes](/assets/heirarchynodes.png) + + - Sibling nodes are nodes with the same parent. Sibling nodes must have unique names and unique slugs. + - Nodes that are in different locations in a hierarchy, or across multiple hierarchies, do not need unique names and slugs. + + ![Hierarchy Example](/assets/hierarchexample.png) + + - If you move the **Electric Ranges** node to the **Built-in** node, all the children of the **Electric Ranges** node also move to the **Built-in** node. + - The nodes **Electric Ranges** and **Gas Ranges** are siblings. They must have unique names and slugs. + - The **Double Oven** nodes can have the same name because they have different parents. + + You can create the **Major Appliances** hierarchy by performing the following steps. + + 1. Using [**Create a Hierarchy**](/docs/api/pxm/products/create-hierarchy), create a hierarchy whose name is **Major Appliances**. Each hierarchy has a hierarchy ID. In other words, the hierarchy ID is the ID of the root node. + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the following child nodes. When you create a node in a hierarchy, by default, the node is a child of the root node. Specify `sort_order` to configure the order of the nodes. + - **Ranges** + - **Refrigerators** + - **Dishwashers** + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the **Electric Ranges** node, specifying **Ranges** as the parent node. + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the following nodes, specifying **Electric Ranges** as the parent node. + - **Electric Ranges 24ˮ** + - **Electric Ranges 30ˮ** + - **Double Oven** + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the **Gas Ranges** node, specifying **Ranges** as the parent node. + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the following nodes, specifying **Gas Ranges** as the parent node. + - **Gas Ranges 24ˮ** + - **Gas Ranges 30ˮ** + - **Gas Ranges 32"** + - **Double Oven** + 1. Using [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node), create the following nodes, specifying **Dishwashers** as the parent node. + - **Built-in** + - **Standalone** + + Once you have created your products, (for more information, see [**Products API**](/docs/api/pxm/products/create-product)), you can use the Hierarchies API to organize your products. + + - You can associate products with nodes. You cannot associate a product with the root node. For more information, see [**Create Node Product Relationships**](/docs/api/pxm/products/create-node-product-relationship). + - You can duplicate an existing hierarchy. This is useful because it enables you to quickly and easily create multiple hierarchies with the same node structure. Any nodes in the existing hierarchy are also created in the duplicated hierarchy. In addition, you can optionally specify whether you want products associated with the nodes in an existing hierarchy to be associated with the nodes in the duplicated hierarchy. See [**Duplicate a Hierarchy**](/docs/api/pxm/products/duplicate-hierarchy). + - You can move an existing node to a different location within the same hierarchy by changing its parent node. If the node has child nodes, they retain their relationship with the moved node. In other words, the node and all its children move to the new location in the hierarchy. For more information, see [**Create a Node in a hierarchy**](/docs/api/pxm/products/create-node). + - If your store supports multiple languages, you can localize new and existing hierarchies and nodes. + + #### Hierarchies and Catalogs + + The hierarchies determine which products appear in the catalog. When you create a catalog, you specify one or more hierarchies. Only the products that are associated with the selected hierarchies are included in the catalog. Your Front-end developers use the hierarchies to create and populate navigation menus in your storefront. You can improve how your customers search your store using the Catalog View API. + + You can also specify the order you want your hierarchies to display in a published catalog. You can order your hierarchies on a catalog-by-catalog basis. + + ![Hierarchy_sorting](/assets/hierarchy_sorting.png) + + For more information, see Update a Catalog. + - name: Jobs + description: | + Several Product Experience Manager endpoints function as jobs. When any of these endpoints are run, a job is automatically created. + + - product [**import**](/docs/api/pxm/products/import-products). + - product [**export**](/docs/api/pxm/products/export-products). + - price book import + - [**duplicating hierarchies**](/docs/api/pxm/products/duplicate-hierarchy). + - [**building child products**](/docs/api/pxm/products/build-child-products). + + #### Characteristics of Jobs + + Jobs have the following characteristics. + + - Jobs are asynchronous. + - Jobs have a different status, depending on where a job is in its lifecycle. See [**Job Lifecycle**](#job-lifecycle). + - Jobs include the data used when an endpoint is run. + - Jobs are processed one at a time. You can continue to send requests using endpoints that function as jobs, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. + - Jobs report messages and/or errors to help you understand: + + - what changes a job implemented in Commerce. + - the reasons for any failed jobs. + + #### Job Lifecycle + + A job has the following lifecycle. + + ![job lifecycle](/assets/job-lifecycle.png) + + - **PENDING** - Commerce has received the request but is currently busy processing other requests. + - **STARTED** - Commerce has started processing the job. + - **SUCCESS** - The job has successfully completed. + - **FAILED** - The job has failed. See [**Get job errors**](/docs/api/pxm/products/get-all-jobs). +paths: + /pcm/jobs: + get: + summary: Get All Jobs + description: The jobs endpoints displays the status of a number of endpoints that function as jobs, for example, product import and export, price book import, building child products, and duplicating hierarchies. + operationId: getAllJobs + tags: + - Jobs + responses: + '200': + description: Returns all the jobs. + content: + application/json: + schema: + $ref: '#/components/schemas/multi' + examples: + completed: + summary: Get all jobs + $ref: '#/components/examples/multi' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/jobs/{jobID}: + get: + summary: Get a Job + operationId: getJob + tags: + - Jobs + parameters: + - $ref: '#/components/parameters/job_id' + responses: + '200': + description: Returns a job with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single' + examples: + started: + summary: Started Job + $ref: '#/components/examples/started' + successful: + summary: Product Import Job + $ref: '#/components/examples/successful' + product-export: + summary: Product Export Job + $ref: '#/components/examples/product-export' + hierarchy-duplicate: + summary: Hierarchy Duplicate Job + $ref: '#/components/examples/hierarchy-duplicate' + build-child-products: + summary: Build Child Products Job + $ref: '#/components/examples/build-child-products' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/jobs/{jobID}/cancel: + post: + summary: Cancel a Job + description: | + The jobs endpoints display the status of a number of endpoints that function as jobs, for example, product import and export, and duplicating hierarchies. + + Jobs are processed one at a time. You can continue to send job requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. If you decide that a specific job needs to be prioritized over another, you can cancel the less critical job using the `Cancel a job` endpoint. You can only cancel jobs whose status is PENDING. + operationId: cancelJob + tags: + - Jobs + requestBody: + content: + application/json: + schema: + type: object + parameters: + - $ref: '#/components/parameters/job_id' + responses: + '200': + description: Successfully cancelled job + content: + application/json: + schema: + $ref: '#/components/schemas/single' + examples: + cancelled: + summary: Cancelled Job + $ref: '#/components/examples/cancelled' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/jobs/{jobID}/errors: + get: + summary: Get Job Errors + operationId: getJobErrors + tags: + - Jobs + parameters: + - $ref: '#/components/parameters/job_id' + responses: + '200': + description: Successful + content: + application/json: + schema: + $ref: '#/components/schemas/errors' + examples: + errors: + summary: Errors Returned + $ref: '#/components/examples/errors' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products: + post: + summary: Create a product or bundle + description: | + Creates a product or bundle with the attributes that are defined in the body. + + #### Product Types + + Commerce automatically assigns types to the products you create. In Commerce Manager, you can see at a glance the product types in a list of a products. In addition, you can filter on product types in both the API and Commerce Manager. + + Product types can also be used in catalogs. For example, in your catalog, you can filter on `parent` so that only your parent products are displayed in your storefront. + + See [**Product Types**](/docs/api/pxm/products/products#product-types). + + #### Product Tags + + You can use product tags to store or assign a key word against a product or service that you sell in your store. The product tag can then be used to describe or label that product. Product tags represent similarities between products who do not share the same attributes. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. + + See [**Product Tags**](/docs/api/pxm/products/product-tags). + + #### Personalizing products + + You can allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. You can do this by configuring the the `custom_inputs` attribute. + + When configuring the `custom_inputs` attribute: + + - You can rename `input` to something more representative of the input that shoppers are adding, for example, `message` or `front`. + - `name` is the name that is displayed in your storefront. + - You can add validation rules. For example, the input field must be a `string` and/or up to 255 characters in length. The limit is 255 characters. + - You can specify if the input field is required. + + #### Curating Products + + You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. See [**Update a node**](/docs/api/pxm/products/update-node). + + #### Bundles + + With Product Experience Manager, you can use the products API to create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. + + See [**Bundles**](/docs/api/pxm/products/products#bundles). + operationId: createProduct + tags: + - Products + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/create_product_request' + examples: + create-product: + summary: Create a base product + $ref: '#/components/examples/product_request' + build-rules: + summary: Create a base product, associate variations, configure build rules + $ref: '#/components/examples/build_rules_request' + sku-bundles: + summary: SKU-based bundles + $ref: '#/components/examples/bundle_sku_based_request' + sku-less-bundles: + summary: SKU-less bundles + $ref: '#/components/examples/bundle_sku_less_request' + responses: + '201': + description: Creates a product with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_product_response' + examples: + created-product: + summary: Create a base product + $ref: '#/components/examples/create_single_product_response' + build-rules: + summary: Create a base product, associate variations, configure build rules + $ref: '#/components/examples/create_build_rules_response' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all products + description: | + Retrieves a list of all your products in the Product Experience Manager system. + + You can also use `include` to retrieve top-level resources, such as files or images, and key attribute data, such as SKU or slug for component products in a product bundle. With this option, you can get more information about the products in a product bundle in your store front, improving the buying experience for your shoppers. + + #### Filtering + + Many Commerce API endpoints support filtering. The general syntax is described in [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + + The following attributes and operators are supported. + + | Operator | Attribute | Description | Example | + | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types`, `tags` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `tags` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types`, `tags` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + operationId: getAllProducts + tags: + - Products + parameters: + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + - $ref: '#/components/parameters/filterproduct' + - $ref: '#/components/parameters/include' + responses: + '200': + description: Returns a list of all products. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_product_response' + examples: + list-products: + $ref: '#/components/examples/multi_product_response' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + /pcm/products/import: + post: + summary: Import Products + description: | + + You can use the Product Import API to: + + - Add new products, including: + + - main image files. See [Importing Main Image Files](/docs/api/pxm/products/product-import-bulk-update#using-imported-main-image-files). + - custom data. See [Importing custom data](/docs/api/pxm/products/product-import-bulk-update#importing-custom-data-flows). + - Make bulk updates to existing products. + + You cannot use product import to: + + - Delete existing products. + - Import product bundles. + + The Product Import API uses a Comma Separated Values (CSV) file to import products, main image files and custom extension data. Each row in a .csv file represents a product you want to create/update. + + Each file can have 50,000 rows, including the header. If a CSV file exceeds 50,000 rows, an error is displayed, and the products are not imported. A CSV file must not be larger than 50 megabytes. If a CSV file is larger than 50 megabytes, a `503 client read` error is displayed. + + If you want to create/update more than 50,000 products or your CSV file is larger than 50 megabytes, you must have a separate CSV file and import each CSV file one at a time. + + See [**Characteristics of CSV Files**](/docs/api/pxm/products/product-import-bulk-update#characteristics-of-csv-import-files). + operationId: importProducts + tags: + - Product Import/Bulk Update + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + description: The file you want to upload. Ensure that the file format is Comma Separated Values (CSV). + type: string + format: binary + example: UploadFile + examples: + upload_image: + summary: Upload Image + value: + file: '@path/to/file' + responses: + '201': + description: Import started + content: + application/json: + schema: + $ref: '#/components/schemas/single' + examples: + pending: + summary: Successful Job + $ref: '#/components/examples/import' + '400': + $ref: '#/components/responses/bad_request' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/export: + post: + summary: Export Products + description: | + + The Export API is available to make bulk updates to products in Product Experience Manager. You might also export products for your personal requirements. + + The Export API builds a CSV file containing the product entries. A CSV file can contain up to 50,000 product entries. If you have more than 50,000 product entries, then another CSV file is created and so on, until all your products are exported. + + The Job endpoint response specifies the location where the CSV file is stored. See [Characteristics of CSV Files](/docs/api/pxm/products/product-export#characteristics-of-exporting-products). + + ### Filtering + + The following attributes and operators are supported. + + | Operator | Attribute | Description | Example | + | :--- |:-------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------| :--- | + | `eq` | `sku`, `slug`, `upc_ean`, `mpn`, `name`, `description`, `tags` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. When filtering on tags, you can only specify one product tag. | `filter=eq(name,some-name)` | + | `In` | `sku`, `tags` | Checks if the values are included in the specified string. If they are, the condition is true. When filtering on tags, you can specify a list of product tags. | `filter=in(id,some-id)` | + | `like` | `sku`, `slug`, `upc_ean`, `mpn`, `name`, `description` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,some-name)` | + operationId: exportProducts + tags: + - Product Export + requestBody: + content: + application/json: + schema: + type: object + responses: + '201': + description: Export started + content: + application/json: + schema: + $ref: '#/components/schemas/single' + examples: + pending: + summary: Successful Job + $ref: '#/components/examples/export' + '400': + $ref: '#/components/responses/bad_request' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + parameters: + - $ref: '#/components/parameters/useTemplateSlugs' + - $ref: '#/components/parameters/filterexport' + /pcm/products/{productID}: + get: + summary: Get a product + description: | + Returns a product by its identifier. + + You can also use `include=component_products` to retrieve top-level resources, such as files or images, and key attribute data, such as SKU or slug for component products in a product bundle. With this option, you can get more information about the products in a product bundle in your store front, improving the buying experience for your shoppers. + operationId: getProduct + parameters: + - $ref: '#/components/parameters/product_id' + - $ref: '#/components/parameters/include' + tags: + - Products + responses: + '200': + description: Returns a product by its identifier. + content: + application/json: + schema: + $ref: '#/components/schemas/single_product_response' + examples: + get-product: + summary: Product + $ref: '#/components/examples/get_single_product_response' + get-product-bundle: + summary: Bundle + $ref: '#/components/examples/get_bundle_response' + get-product-component-parent: + summary: Parent Product + $ref: '#/components/examples/get_parent_product_response' + get-product-component-child: + summary: Child Product + $ref: '#/components/examples/get_child_product_response' + get-product-component-products: + summary: Component Product + $ref: '#/components/examples/get_component_product_response' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + summary: Update a product or bundle + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the product or bundle is not updated. + operationId: updateProduct + parameters: + - $ref: '#/components/parameters/product_id' + tags: + - Products + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_product_request' + examples: + update-product: + summary: Update a base product + $ref: '#/components/examples/update_product_request' + update-product-build-rules: + summary: Update a base product and build rules + $ref: '#/components/examples/update_build_rules_request' + update-product-custom-inputs: + summary: Update using custom_inputs + description: You can allow your shoppers to add custom text to a product when checking out their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized. You can do this using the custom_inputs attribute when creating your products. + $ref: '#/components/examples/update_custom_inputs_request' + update-product-bundle: + summary: Update a bundle + $ref: '#/components/examples/update_bundle_request' + responses: + '200': + description: Updates a product with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_product_response' + examples: + updated-product: + summary: Update a base product + $ref: '#/components/examples/update_single_product_response' + build-rules: + summary: Update a base product, configure build rules + $ref: '#/components/examples/update_build_rules_response' + update-product-custom-inputs: + summary: Update using custom_inputs + $ref: '#/components/examples/update_custom_inputs_response' + update-product-bundle: + summary: Update a bundle + $ref: '#/components/examples/update_bundle_response' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a product + description: | + Deletes the specified product. + + You cannot delete a product if it is part of a bundle. You must first delete the bundle before you delete the product. + operationId: deleteProduct + parameters: + - $ref: '#/components/parameters/product_id' + tags: + - Products + responses: + '204': + description: Deletes the specified product. + '403': + $ref: '#/components/responses/forbidden' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/attach_nodes: + post: + summary: Attach multiple nodes + description: | + Assigns products to multiple hierarchies and their children nodes. You can apply a filter to search for the appropriate products to attach to a node. For general filtering syntax, see [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + + The following attributes and operators are supported. + + | Operator | Attribute | Description | Example | + | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + + operationId: attachNodes + tags: + - Products + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + required: + - filter + - node_ids + properties: + filter: + type: string + description: | + Filters applied to search for appropriate products to attach to a node. See [Attach multiple nodes](/docs/api/pxm/products/attach-nodes). + example: eq(sku,book) + node_ids: + type: array + description: A list of node unique identifiers that you want to assign to the products. + example: + - '123' + items: + type: string + examples: + product-attach-nodes: + summary: Attach multiple nodes + value: + data: + filter: eq(sku,book) + node_ids: + - '123' + responses: + '200': + description: This request assigns the products that you have selected to multiple hierarchies and their children nodes and returns the following. + content: + application/json: + schema: + type: object + properties: + meta: + type: object + properties: + nodes_attached: + description: Number of nodes assigned to the products. + type: integer + nodes_not_found: + type: array + description: A list of node unique identifiers that could not be identified. + example: + - '123' + items: + type: string + examples: + created-product: + summary: Attach multiple nodes + value: + meta: + nodes_attached: 3 + nodes_not_found: [] + '400': + $ref: '#/components/responses/bad_request' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/detach_nodes: + post: + summary: Detach multiple nodes + description: | + Dissociates products from multiple hierarchies and their children nodes. You can apply filters to search for the appropriate products to detach. For general filtering syntax, see [**Filtering**](/docs/commerce-cloud/api-overview/filtering). + + The following attributes and operators are supported. + + | Operator | Attribute | Description | Example | + | :--- |:------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------| + | `eq` | `sku`, `slug`,`upc_ean`, `mpn`, `name`, `templates`, `commodity_type`, `owner`, `product_types` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For `product_types`, you can only specify one product type. For example, `filter=eq(product_types,child)` | `filter=eq(name,some-name)` | + | `like` | `sku`, `slug`,`upc_ean`, `mpn`, `name` | Like. Checks if the operand contains the specified string. Wildcards are supported. | `filter=like(name,*some-name*)` | + | `In` | `id`, `name`, `SKU`, `slug`, `upc_ean`, `mpn`, `product_types` | Checks if the values are included in the specified string. If they are, the condition is true. For `product_types`, you can specify more than one product type. For example, `filter=in(product_types,child,bundle)`. | `filter=in(id,some-id)` | + operationId: detachNodes + tags: + - Products + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + required: + - filter + - node_ids + properties: + filter: + type: string + description: | + You can apply filters to search for the appropriate products to detach. See [Detach multiple nodes](/docs/api/pxm/products/detach-nodes). + example: eq(sku,book) + node_ids: + type: array + description: A list of node unique identifiers that you want to assign to the products. + example: + - '123' + items: + type: string + examples: + product-attach-nodes: + summary: Attach multiple nodes + value: + data: + filter: eq(sku,book) + node_ids: + - '123' + responses: + '200': + description: The request dissociates the products that you have selected from multiple hierarchies and their children and returns the following. + content: + application/json: + schema: + type: object + properties: + meta: + type: object + properties: + nodes_detached: + description: Number of nodes dissociated from the products. + type: integer + nodes_not_found: + type: array + description: A list of node unique identifiers that could not be identified. + example: + - '123' + items: + type: string + examples: + created-product: + summary: Detach multiple nodes + value: + meta: + nodes_detached: 1 + nodes_not_found: [] + '400': + $ref: '#/components/responses/bad_request' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/{productID}/nodes: + get: + summary: Get a product's nodes + description: Returns the nodes associated with the product. Products must be in a `live` status. + operationId: getProductsNodes + tags: + - Products + responses: + '200': + description: Successfully returns the product's nodes. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_nodes' + examples: + get-product-nodes: + $ref: '#/components/examples/resp_multi_nodes' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + parameters: + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + - $ref: '#/components/parameters/product_id' + /pcm/products/{productID}/build: + post: + summary: Build child products + description: | + With product variations in Product Experience Manager, you can create product variations and different options for each variation and use both to create child products for a product. Each child product is a unique combination of options associated with the product. + + Child products inherit attributes from their parent products. When you make changes to the attributes of the parent products, you can rebuild your child products, ensuring that changes to the parent products are propagated to the child products. + + Alternatively, you can modify a child product independently, without impacting its parent product. For example, you may prefer the status of your child product to be `live`, while keeping the parent product's status as `draft`. When you directly update a child product, it becomes independent of its parent product. In other words, any subsequent changes made to the parent product are not automatically reflected in the child product when you rebuild the parent product and its child products. Once a child product is independent of its parent, you cannot recreate the association between the child product and its parent. You must delete the child product and rebuild the parent to recreate the child product. + + Following on from that, if you add the same flow to both a parent and child product, the child flow values are not affected by changes to the parent flow values in a rebuild. + + ### Using Build Rules + + When building your child products, you can build all products related to a product. + + Alternatively, you can build a combination of child products associated with a product, based on build rules that you specify. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. You can do this using `build_rules`. `build_rules` are combinations of variation option IDs that you wish to include or exclude when building your child products. + + :::note + + You do not need to configure any `build_rules` in the following scenarios: + + - Child products must be built with all variation options. Simply, use the `Create a product` or `Update a product` endpoints with no `build_rules` specified. + - Child products must be built apart from all options for a specific variation. In this case, you must remove the variation and use the `Create a product` or `Update a product` endpoints with no `build_rules` specified. In other words, using our example, if none of the `size` options should be included, then remove the `size` variation. + + ::: + + The `build_rules` contain: + + - (Required) `default`: specifies the default behavior. + - (Optional) `include`: specifies the option IDs to include when the child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. See [**Invalid Build Rules**](#invalid-build-rules). + - (Optional) `exclude`: specifies the option IDs to exclude when the child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. See [**Invalid build rules**](#invalid-build-rules). + + When building child products, Commerce compares each combination of option IDs to these rules to determine how your child products should be built, depending on how you have configured the `build_rules`. It depends on your requirements how you configure your `build_rules`. + + #### Invalid Build Rules + + The `build_rules` are invalid if both the option IDs come from the same variation. Combinations of option IDs in the nested arrays must come from different variations. + + If Commerce cannot resolve the `build_rules` a `could not determine whether to include or exclude a child product due to ambiguous rules` error is returned. This error can occur, for example, if you have the same number of variation option IDs in both the `include` and `exclude` arrays and the variation option IDs match. + + ### Building Child Products + + Building child products is an asynchronous operation. When you build child products, a job is created. The jobId of the job is displayed in the response. When the job is complete, the build child products operation is also complete. You can use the jobId to see the status of your job using the `Get a Job` endpoint. + + Jobs are processed one at a time. You can continue to send build child product requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. See Jobs. + + Re-building child products after adding or removing a new variation changes the total number of child products that you can generate from a parent product. When you rebuild the child products after updating variations associated with the parent product, all existing child products that belong to a parent product are deleted. New child products are created with new product IDs. + + If you have any bundles that reference child products directly, then you must update the bundles with the new child product IDs. + + However, re-building child products after adding or removing an option does not change the existing product IDs. + operationId: buildChildProducts + tags: + - Variations + requestBody: + content: + application/json: + schema: + type: object + responses: + '201': + description: Successfully started building child products + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + parameters: + - $ref: '#/components/parameters/product_id' + /pcm/products/{productID}/children: + get: + summary: Get child products + operationId: getChildProducts + tags: + - Variations + responses: + '200': + description: Returns a list of child products for the specified parent product ID. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_product_response' + examples: + list-products: + $ref: '#/components/examples/multi_get_child_response' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + parameters: + - $ref: '#/components/parameters/product_id' + /pcm/products/{productID}/relationships/templates: + post: + summary: Create a product template relationship + description: Retrieves all the templates that are associated with the specified product. + operationId: createProductTemplateRelationship + parameters: + - $ref: '#/components/parameters/product_id' + tags: + - Extending Products with Templates + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_templates_request' + examples: + create-product-template-relationship: + $ref: '#/components/examples/templates_relationship_request' + responses: + '201': + description: Returns a created product template relationship. + content: + application/json: + schema: + $ref: '#/components/schemas/template_response' + examples: + product-templates: + $ref: '#/components/examples/template_response' + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all product template relationships + operationId: getProductTemplateRelationships + parameters: + - $ref: '#/components/parameters/product_id' + tags: + - Extending Products with Templates + responses: + '200': + description: Returns all product template relationships + content: + application/json: + schema: + $ref: '#/components/schemas/template_response' + examples: + product-template-relationships: + $ref: '#/components/examples/template_response' + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a product template relationship + operationId: deleteProductTemplateRelationship + parameters: + - $ref: '#/components/parameters/product_id' + tags: + - Extending Products with Templates + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_templates_request' + examples: + delete-product-template-relationship: + $ref: '#/components/examples/templates_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/{productID}/relationships/component_products: + get: + summary: Get Bundle Component Product Relationships + description: Retrieves all the products included in the specified bundle product. + operationId: getProductComponentProductsRelationships + tags: + - Bundle Component Products Relationships + responses: + '200': + description: Returns all Component Products relationships + content: + application/json: + schema: + $ref: '#/components/schemas/component_products_response' + examples: + product-template-relationships: + $ref: '#/components/examples/component_products_relationship_response' + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + parameters: + - $ref: '#/components/parameters/product_id' + /pcm/products/{productID}/relationships/files: + get: + summary: Get all product file relationships + description: Retrieves all files that are associated with the specified product. + operationId: getProductFileRelationships + tags: + - Product File Relationships + parameters: + - $ref: '#/components/parameters/product_id' + responses: + '200': + description: Returns all product file relationships. + content: + application/json: + schema: + $ref: '#/components/schemas/file_response' + examples: + product-file-relationships: + $ref: '#/components/examples/file_relationship_response' + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + post: + summary: Create a product file relationship + operationId: createProductFileRelationships + tags: + - Product File Relationships + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_files_request' + examples: + create-product-file-relationship: + $ref: '#/components/examples/file_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + put: + summary: Replace a product file relationship + operationId: updateProductFileRelationships + tags: + - Product File Relationships + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_files_request' + examples: + replace-product-file-relationship: + $ref: '#/components/examples/file_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a product file relationships + operationId: deleteProductFileRelationships + tags: + - Product File Relationships + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_files_request' + examples: + delete-product-file-relationships: + $ref: '#/components/examples/file_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/{productID}/relationships/variations: + post: + summary: Create a product variation relationship + operationId: createProductVariationRelationships + tags: + - Variations + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_variations_request' + examples: + create-product-variation-relationship: + $ref: '#/components/examples/product_variations_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all product variation relationships + operationId: getProductVariationRelationships + tags: + - Variations + parameters: + - $ref: '#/components/parameters/product_id' + responses: + '200': + description: Returns all product variation relationships + content: + application/json: + schema: + $ref: '#/components/schemas/variations_response' + examples: + product-variation-relationships: + $ref: '#/components/examples/variations_response' + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + put: + summary: Replace a product variation relationship + operationId: updateProductVariationRelationships + tags: + - Variations + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_variations_request' + examples: + replace-product-variation-relationship: + $ref: '#/components/examples/product_variations_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a product variation relationships + operationId: deleteProductVariationRelationships + tags: + - Variations + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/product_variations_request' + examples: + delete-product-variation-relationships: + $ref: '#/components/examples/product_variations_relationship_request' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/products/{productID}/relationships/main_image: + post: + summary: Create main image relationships + description: Associates a main image with the specified product. + operationId: createProductMainImageRelationships + tags: + - Product Image Relationships + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/main_image_request' + examples: + create-product-main-image-relationship: + value: + data: + type: file + id: 3ab3deca-1f11-47b7-a409-24ea3234d72c + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get Main Image Relationships + operationId: getProductMainImageRelationships + tags: + - Product Image Relationships + parameters: + - $ref: '#/components/parameters/product_id' + responses: + '200': + description: Returns all product variation relationships + content: + application/json: + schema: + $ref: '#/components/schemas/main_image_response' + examples: + product-main-image-relationships: + value: + data: + - type: file + id: file-1 + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + put: + summary: Replace Main Image Relationships + operationId: updateProductMainImageRelationships + tags: + - Product Image Relationships + parameters: + - $ref: '#/components/parameters/product_id' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/replace_main_image_request' + examples: + replace-main-image-relationship: + value: + data: + - type: file + id: 3ab3deca-1f11-47b7-a409-24ea3234d72c + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete Main Image Relationships + operationId: deleteProductMainImageRelationships + tags: + - Product Image Relationships + parameters: + - $ref: '#/components/parameters/product_id' + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/bad_request' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/variations: + post: + summary: Create a variation + operationId: createVariation + tags: + - Variations + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/create_variation' + examples: + create-variation: + summary: Create a variation + $ref: '#/components/examples/create_variation' + responses: + '201': + description: Returns a created variation with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/created_variation' + examples: + created-variation: + $ref: '#/components/examples/created_variation' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all variations + operationId: getAllVariations + parameters: + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + tags: + - Variations + responses: + '200': + description: Returns all variations. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_variations' + examples: + list-variations: + $ref: '#/components/examples/multi_variations' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + /pcm/variations/{variationID}: + get: + summary: Get a variation + operationId: getVariation + parameters: + - $ref: '#/components/parameters/variation_id' + tags: + - Variations + responses: + '200': + description: Returns the specified variation. + content: + application/json: + schema: + $ref: '#/components/schemas/single_variation' + examples: + get-variation: + $ref: '#/components/examples/single_variation' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + summary: Update a variation + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the variation is not updated. + operationId: updateVariation + parameters: + - $ref: '#/components/parameters/variation_id' + tags: + - Variations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_variation' + examples: + update-variation: + $ref: '#/components/examples/update_variation' + responses: + '200': + description: Returns an updated variation with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_variation' + examples: + update-variation: + $ref: '#/components/examples/single_variation' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a variation and all it's associated options + operationId: deleteVariation + parameters: + - $ref: '#/components/parameters/variation_id' + tags: + - Variations + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/variations/{variationID}/options: + post: + summary: Create a variation option + operationId: createVariationOption + parameters: + - $ref: '#/components/parameters/variation_id' + tags: + - Variations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/create_option' + examples: + create-variation-option: + $ref: '#/components/examples/create_option' + responses: + '201': + description: Successfully returns the created variation option + content: + application/json: + schema: + $ref: '#/components/schemas/created_option' + examples: + created-variation-option: + $ref: '#/components/examples/created_option' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all variation options + operationId: getAllVariationOptions + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + tags: + - Variations + responses: + '200': + description: Successfully returns all variation options + content: + application/json: + schema: + $ref: '#/components/schemas/multi_options' + examples: + list-variations: + $ref: '#/components/examples/multi_options' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + /pcm/variations/{variationID}/options/{optionID}: + get: + summary: Get a variation option + operationId: getVariationOption + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + tags: + - Variations + responses: + '200': + description: Successfully returns the variation option + content: + application/json: + schema: + $ref: '#/components/schemas/single_option' + examples: + get-variation-option: + $ref: '#/components/examples/single_option' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + summary: Update a variation option + operationId: updateVariationOption + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + tags: + - Variations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_option' + examples: + update-variation-option: + $ref: '#/components/examples/update_option' + responses: + '200': + description: Successfully returns the updated variation option + content: + application/json: + schema: + $ref: '#/components/schemas/single_option' + examples: + updated-variation-option: + $ref: '#/components/examples/single_option' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a variation option + operationId: deleteVariationOption + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + tags: + - Variations + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/variations/{variationID}/options/{optionID}/modifiers: + post: + summary: Create a modifier + operationId: createModifier + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + tags: + - Variations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/create_modifier' + examples: + create-variation-modifier: + $ref: '#/components/examples/create_modifier' + responses: + '201': + description: Successfully returns the created modifier + content: + application/json: + schema: + $ref: '#/components/schemas/created_modifier' + examples: + created-variation-modifier: + $ref: '#/components/examples/created_modifier' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + summary: Get all modifiers + operationId: getAllModifiers + tags: + - Variations + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + responses: + '200': + description: Successfully returns all variation modifiers + content: + application/json: + schema: + $ref: '#/components/schemas/multi_modifiers' + examples: + list-variations: + $ref: '#/components/examples/multi_modifiers' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + /pcm/variations/{variationID}/options/{optionID}/modifiers/{modifierID}: + get: + summary: Get a modifier + operationId: getModifier + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + - $ref: '#/components/parameters/modifier_id' + tags: + - Variations + responses: + '200': + description: Returns the specified modifier. + content: + application/json: + schema: + $ref: '#/components/schemas/single_modifier' + examples: + get-variation-modifier: + $ref: '#/components/examples/single_modifier' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + summary: Update a modifier + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the modifier is not updated. + operationId: updateModifier + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + - $ref: '#/components/parameters/modifier_id' + tags: + - Variations + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_modifier' + examples: + update-variation-modifier: + $ref: '#/components/examples/update_modifier' + responses: + '200': + description: Successfully returns the updated modifier + content: + application/json: + schema: + $ref: '#/components/schemas/single_modifier' + examples: + updated-variation-modifier: + $ref: '#/components/examples/single_modifier' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '409': + $ref: '#/components/responses/write_conflict' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + summary: Delete a modifier + description: You cannot delete a modifier if it is in use. Deleting a modifier in us returns a `422 Failed Validation` error. + operationId: deleteModifier + parameters: + - $ref: '#/components/parameters/variation_id' + - $ref: '#/components/parameters/option_id' + - $ref: '#/components/parameters/modifier_id' + tags: + - Variations + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies: + post: + summary: Create a hierarchy + description: Create a hierarchy + operationId: createHierarchy + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/create_hierarchy' + examples: + create-hierarchy: + $ref: '#/components/examples/create_hierarchy' + required: true + responses: + '201': + description: Returns a created hierarchy with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_hierarchy' + examples: + created-hierarchy: + $ref: '#/components/examples/hierarchy_created' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + operationId: getHierarchy + parameters: + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + summary: Get all hierarchies + description: Get all hierarchies + tags: + - Hierarchies + responses: + '200': + description: Returns a list of all hierarchies. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_hierarchy' + examples: + list-hierarchies: + $ref: '#/components/examples/resp_multi_hierarchy' + '400': + $ref: '#/components/responses/bad_request' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}: + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + summary: Get a hierarchy + description: Retrieves the specified hierarchy. + operationId: getHierarchyChild + tags: + - Hierarchies + responses: + '200': + description: Returns a hierarchy with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_hierarchy' + examples: + get-hierarchy: + $ref: '#/components/examples/hierarchy_created' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + operationId: updateHierarchy + parameters: + - $ref: '#/components/parameters/hierarchy_id' + summary: Update a hierarchy + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the hierarchy is not updated. + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_hierarchy' + examples: + update-hierarchy: + $ref: '#/components/examples/update_hierarchy' + required: true + responses: + '200': + description: Successfully returns the updated hierarchy + content: + application/json: + schema: + $ref: '#/components/schemas/single_hierarchy' + examples: + updated-hierarchy: + $ref: '#/components/examples/hierarchy_updated' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + operationId: deleteHierarchy + parameters: + - $ref: '#/components/parameters/hierarchy_id' + summary: Delete a hierarchy + description: Deletes the specified hierarchy and all its children. + tags: + - Hierarchies + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes: + post: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + summary: Create a node + description: | + Creates a node in the specified hierarchy. + + ### Sorting Nodes in a Hierarchy + + You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. + + You can do this by adding a `meta` object to the body of your request and specifying a `sort_order` value. + + The node with the highest value of `sort_order` is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + + - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + - If you set `sort_order` for only a few child nodes, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + + You can also specify a `sort_order` when creating a node relationship. + + - If you create a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when creating **Node A** is overwritten. + - If you create **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you created **Node A** is not overwritten. + + ### Curating Products in a node + + You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. + + You can do this by adding a `curated_products` attribute to the body of your request and adding an array of product IDs to the attribute. You should add the products IDs in the order you want them to be displayed in your node. The first product ID is displayed first in the product list. + + You can only curate 20 products or less. You cannot have more than 20 curated products. + + - The product IDs you provide must exist in the specified node. + - If a curated product is removed from a node, the product is also removed from the curated_products list. + - Once you have curated the products in a node, you can use the get node products endpoint to retrieve a list of curated products. + + You can then display your curated products in your catalogs using the following catalog endpoints. + + - Get a node in your latest catalog release. + - Get a node in a catalog. + - Get all nodes in your latest catalog release. + - Get all nodes in a catalog. + - Get node children in your latest catalog release. + - Get node children in a catalog. + operationId: createNode + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/create_node' + examples: + create-node: + $ref: '#/components/examples/create_node' + responses: + '201': + description: Successfully returns the created node + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + created-node: + $ref: '#/components/examples/node_created' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + summary: Get all nodes in a hierarchy + description: A fully paginated view of all nodes in a hierarchy regardless of depth. + operationId: getAllNodesInHierarchy + tags: + - Hierarchies + responses: + '200': + description: Successfully returns the node's children + content: + application/json: + schema: + $ref: '#/components/schemas/multi_nodes' + examples: + get-all-nodes: + $ref: '#/components/examples/resp_multi_nodes' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}: + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Get a node + description: Retrieves a node from a hierarchy. + operationId: getHierarchyNode + tags: + - Hierarchies + responses: + '200': + description: Returns a node with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + get-node: + $ref: '#/components/examples/node_created' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + put: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Update a node + description: | + Updates the specified node in a hierarchy. You can do a partial update, where you specify only the field value to change. + + ### Sorting Nodes in a hierarchy + + You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. + + The node with the highest value of sort_order is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + + - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + + You can also specify a sort_order when creating a node relationship. + + - If you update a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when updating **Node A** is overwritten. + - If you have updated **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you updated **Node A** is not overwritten. + + ### Curating Products in a node + + You can curate the products in a node. Product curation allows you to promote specific products within each node of your hierarchies, enabling you to create unique product collections in your storefront. For example, you may find you have an abundance of cotton T-Shirts and you want to promote these products to the top of the product list. When a shopper navigates to T-shirts, the cotton T-Shirts are displayed first. + + You can do this by adding a `curated_products` attribute to the body of your request and adding an array of product IDs to the attribute. You should add the products IDs in the order you want them to be displayed in your node. The first product ID is displayed first in the product list. + + You can only curate 20 products or less. You cannot have more than 20 curated products. + + - The product IDs you provide must exist in the specified node. + - If a curated product is removed from a node, the product is also removed from the curated_products list. + - Once you have curated the products in a node, you can use the get node products endpoint to retrieve a list of curated products. + + You can then display your curated products in your catalogs using the following catalog endpoints. + + - Get a node in your latest catalog release. + - Get a node in a catalog. + - Get all nodes in your latest catalog release. + - Get all nodes in a catalog. + - Get node children in your latest catalog release. + - Get node children in a catalog. + operationId: updateNode + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_node' + examples: + update-node: + $ref: '#/components/examples/update_node' + responses: + '200': + description: Successfully returns the updated node + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + updated-node: + $ref: '#/components/examples/node_updated' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Deletes a node + description: Deletes a node by the node ID + operationId: deleteNode + tags: + - Hierarchies + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/children: + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + summary: Get a hierarchy's children + description: Get a hierarchy's children + operationId: getAllChildren + tags: + - Hierarchies + responses: + '200': + description: Returns the hierarchy's children. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_nodes' + examples: + get-hierarchy-children: + $ref: '#/components/examples/resp_multi_nodes' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/children: + post: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Create relationships between a node and child nodes + description: | + Use this endpoint to create relationships between a single parent node and one or more child nodes. You can create a relationship only if: + + - The parent node already exists. + - All child nodes already exist. + - Every child node in the body of the request exists in the same hierarchy as the parent node. + - A node is not a parent of itself. An array of child nodes request body must not contain the ID of the parent node in the path. + - All siblings in a hierarchy must have a unique `slug`. Siblings are the child nodes that are related to the same parent. + + ### Sort Order + + You can also provide `sort_order` information when you create a relationship by adding a `meta` object to the array of node reference objects for each child node that requires sorting. + + The node with the highest value of `sort_order` appears at the top of the response. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. + + - If you don’t provide `sort_order` when creating relationships, all child nodes in the response for Get a Node’s Children request are ordered by the `updated_at` time in descending order. The most recently updated child node appears at the top of the response. + - If you set `sort_order` for only a few child nodes or not all, the child nodes with `sort_order` value appear first in the response and then other child nodes appear in the order of `updated_at` time. + + You can also specify a `sort_order` when creating and updating a node. + + - If you create or update a node (**Node A**) with a `sort_order` and then you create a relationship for **Node A** with another node (**Node B**), the `sort_order` you specified when creating\updating **Node A** is overwritten. + - If you create\update **Node A** and then you create a relationship with **Node B** but do not configure a `sort_order`, the `sort_order` you specified when you created\updated **Node A** is not overwritten. + operationId: createNodeChildRelationships + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/node_children' + examples: + set-node-children: + $ref: '#/components/examples/node_children' + responses: + '200': + description: Successfully returns the node's children + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + set-node-children: + $ref: '#/components/examples/node_updated' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/children: + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + summary: Get a node's children + description: Retrieves the child nodes for a specified node. + operationId: getAllNodeChildren + tags: + - Hierarchies + responses: + '200': + description: Successfully returns the node's children + content: + application/json: + schema: + $ref: '#/components/schemas/multi_nodes' + examples: + get-node-children: + $ref: '#/components/examples/resp_multi_nodes' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/parent: + put: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Update a node's parent + description: | + Changes the parent of the specified node. The new parent node must be located within the same hierarchy as the specified node. + + You cannot move a node to another hierarchy. If you want to put the specified node into another hierarchy, create the node in the target hierarchy and delete it from the current hierarchy. + operationId: updateNodeParent + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/node_parent' + examples: + update-node-parent: + $ref: '#/components/examples/node_parent' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Delete a node's parent + operationId: deleteNodeParent + tags: + - Hierarchies + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/relationships/products: + post: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Create a node's product relationships + description: Creates relationships between the specified node and one or more products in a specified hierarchy. + operationId: createNodeProductRelationship + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/node_products' + examples: + create-node-product-relationships: + $ref: '#/components/examples/node_products' + responses: + '201': + description: Successfully returns the updated node + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + created-node-product-relationships: + $ref: '#/components/examples/node_updated' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + delete: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + summary: Deletes a node's product relationships + operationId: deleteNodeProductRelationships + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/node_products' + examples: + delete-node-product-relationships: + $ref: '#/components/examples/node_products' + responses: + '200': + description: Successfully returns the updated node + content: + application/json: + schema: + $ref: '#/components/schemas/single_node' + examples: + created-node-product-relationships: + $ref: '#/components/examples/node_updated' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/nodes/{nodeID}/products: + get: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + - $ref: '#/components/parameters/node_id' + - $ref: '#/components/parameters/page_offset' + - $ref: '#/components/parameters/page_limit' + summary: Get a node's products + description: | + Returns the products associated with the specified hierarchy node from a published catalog. Products must be in a live status. If the products have been curated using the update a hierarchy node endpoint, then the products are returned in the order specified in the `curated_products` attribute in the body of the update a hierarchy node request. A product that is curated has the "curated_product": true attribute displayed. + operationId: getNodeProducts + tags: + - Hierarchies + responses: + '200': + description: Successfully returns the node's products + content: + application/json: + schema: + $ref: '#/components/schemas/multi_product_response' + examples: + get-node-products: + $ref: '#/components/examples/multi_product_response' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '500': + $ref: '#/components/responses/internal' + /pcm/hierarchies/{hierarchyID}/duplicate_job: + post: + parameters: + - $ref: '#/components/parameters/hierarchy_id' + summary: Duplicate a hierarchy + description: | + Using this option, you can duplicate an existing hierarchy. This is useful because it enables you to quickly and easily create multiple hierarchies with the same node structure. + + When you duplicate a hierarchy, you can specify a new name and/or a new description for the duplicated hierarchy. All other attributes, such as slug and locales, stay the same. + + Any nodes in the existing hierarchy are also replicated in the duplicated hierarchy. In addition, you can optionally use the `include_products` attribute to specify whether you want products associated with the nodes in an existing hierarchy to be associated with the nodes in the duplicated hierarchy. By default, product associations in an existing hierarchy are not duplicated in a duplicate hierarchy. + + Duplicating a hierarchy is an asynchronous operation. When you duplicate a hierarchy, a job is created. The jobId of the job is displayed in the response. When the job is complete, the duplicate hierarchy operation is also complete. You can use the jobId to see the status of your job using Get a Job. + + Jobs are processed one at a time. You can continue to send duplicate hierarchy requests, but those jobs are queued. In other words, Commerce looks for any jobs that have a status of PENDING and starts the job with the earliest created date. This process is repeated until all jobs are processed. + + Once the job is complete, run: + + - Get all hierarchies to retrieve the HierarchyId of your duplicated hierarchy. + - Get a hierarchy to retrieve the nodes and (if applicable) products associated with the duplicated hierarchy. + operationId: duplicateHierarchy + tags: + - Hierarchies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/duplicate_job' + examples: + duplicate-hierarchy: + $ref: '#/components/examples/duplicate_job' + required: true + responses: + '201': + description: Successfully returns the duplicate hierarchy job ID + content: + application/json: + schema: + $ref: '#/components/schemas/single' + examples: + duplicated-hierarchy: + $ref: '#/components/examples/duplicate_hierarchy_job_created' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/tags: + get: + summary: Get All Product Tags + description: | + Retrieves all product tags for a store. A store can view the tags associated with the organization to which the store belongs. However, an organization can only view the tags associated with the organization. + + operationId: getAllProductTags + tags: + - Product Tags + responses: + '200': + description: Returns all the product tags. + content: + application/json: + schema: + $ref: '#/components/schemas/multi_tag' + examples: + list-tags: + summary: Get all tags + $ref: '#/components/examples/resp_multi_tags' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/tags/{tagID}: + get: + summary: Get a Product Tag + description: Retrieves a product tag for a store. A store can view the tags associated with the organization to which the store belongs. However, an organization can only view the tags associated with the organization. + operationId: getProductTag + tags: + - Product Tags + parameters: + - $ref: '#/components/parameters/tag_id' + responses: + '200': + description: Returns a product tag with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_tag' + examples: + get-tag: + summary: Get a tag + $ref: '#/components/examples/resp_single_tag' + '400': + $ref: '#/components/responses/bad_request' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/custom_relationships: + post: + summary: Create a custom relationship + description: Create a custom relationship + operationId: createCustomRelationship + tags: + - Custom Relationships + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/create_custom_relationship' + examples: + create-custom-relationship: + $ref: '#/components/examples/create_custom_relationship' + required: true + responses: + '201': + description: Returns a created custom relationship with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/single_custom_relationship' + examples: + created-custom-relationship: + $ref: '#/components/examples/custom_relationship_created' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' + /pcm/custom_relationships/{customRelationshipSlug}: + put: + operationId: updateCustomRelationship + parameters: + - $ref: '#/components/parameters/custom_relationship_slug' + summary: Update a custom relationship + description: Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the custom relationship is not updated. + tags: + - Custom Relationships + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_custom_relationship' + examples: + update-custom-relationship: + $ref: '#/components/examples/update_custom_relationship' + required: true + responses: + '200': + description: Successfully returns the updated custom relationship + content: + application/json: + schema: + $ref: '#/components/schemas/single_custom_relationship' + examples: + updated-custom-relationship: + $ref: '#/components/examples/custom_relationship_updated' + '403': + $ref: '#/components/responses/forbidden' + '404': + $ref: '#/components/responses/not_found' + '422': + $ref: '#/components/responses/unprocessable_entity' + '500': + $ref: '#/components/responses/internal' +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + schemas: + job: + type: object + properties: + id: + description: A unique identifier generated when a job is created. + type: string + type: + description: This represents the type of resource object being returned. Always `pim-job`. + type: string + enum: + - pim-job + attributes: + type: object + properties: + started_at: + description: The date and time a job is started. + type: string + example: '2020-09-22T09:00:00' + format: date-time + nullable: true + completed_at: + type: string + example: '2020-09-22T09:00:00' + format: date-time + nullable: true + description: The date and time a job is completed. + created_at: + type: string + description: The date and time a job is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time a job is updated. + example: '2020-09-22T09:00:00' + format: date-time + type: + type: string + description: | + The status of a job. + + * `pending` - Commerce has received the request but is currently busy processing other requests. + * `started` - Commerce has started processing the job. + * `success` - The job has successfully completed. + * `failed` - The job has failed. + enum: + - child-products + - product-import + - product-export + - hierarchy-duplicate + - price-import + status: + type: string + enum: + - pending + - cancelled + - started + - success + - failed + meta: + type: object + properties: + x_request_id: + type: string + description: Applies to all job types. A unique request ID is generated when a job is created. + copied_from: + type: string + description: Applies to `hierarchy-duplicate` job types. The ID of the original hierarchy that you duplicated. + hierarchy_id: + type: string + description: Applies to `hierarchy-duplicate` job types. The duplicated hierarchy ID. + file_locations: + type: array + nullable: true + description: If the job type is `product_export`, a link to the file is created when running a job. + items: + type: string + filter: + type: string + description: The entities included in the job. For example, if the job type is `product-export`, the PXM products included in the export. + multi: + type: object + properties: + data: + description: An array of jobs. + type: array + items: + $ref: '#/components/schemas/job' + meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 2 + error: + required: + - errors + properties: + errors: + type: array + items: + required: + - status + - title + properties: + status: + type: string + description: The HTTP response code of the error. + example: '500' + title: + type: string + description: A brief summary of the error. + example: Internal server error + detail: + type: string + description: Optional additional detail about the error. + example: An internal error has occurred. + request_id: + type: string + description: Internal request ID. + example: 00000000-0000-0000-0000-000000000000 + meta: + type: object + description: Additional supporting meta data for the error. + example: + missing_ids: + - e7d50bd5-1833-43c0-9848-f9d325b08be8 + single: + type: object + properties: + data: + $ref: '#/components/schemas/job' + errors: + type: object + properties: + data: + type: array + description: An array of job errors. + items: + type: object + properties: + type: + description: This represents the type of resource object being returned. Always `pim-job-error`. + type: string + example: pim-job-error + enum: + - pim-job-error + id: + description: A unique identifier for a job error generated when a job error is created. + type: string + attributes: + type: object + properties: + message: + description: A description of an error message. + type: string + example: 'data.attributes.sku: Must be unique amongst products.' + product_custom_inputs: + type: object + description: You use the `custom_inputs` attribute to allow your shoppers to add custom text to a product when adding product items to their carts. This is useful, for example, if you have a product like a T-shirt that can be personalized or you sell greetings cards that can be printed with your shoppers personalized messages. See [Personalizing Products](/docs/api/pxm/products/create-product#personalizing-products). + additionalProperties: + description: A name for the custom text field. You can rename this to something more representative of the input that shoppers are adding, for example, `message` or `front`. + type: object + properties: + name: + type: string + description: A name for the custom text field. + validation_rules: + type: array + description: The validation rules for the custom text. + type: + description: This represents the type of the resource being returned. + type: string + options: + type: object + description: The length of the custom input text field. + max_length: + type: integer + description: The number of characters the custom text field can be. You can specify a maximum length up to 255 characters, as the limit is 255 characters. + required: + type: boolean + description: '`true` or `false` depending on whether the custom text is required.' + product_build_rules: + type: object + description: You can build a combination of child products associated with a product, based on build rules that you specify. This is useful, for example, if you have a variation option that you do not sell. This makes managing and building your child products quick and easy. See [Using Build Rules](/docs/api/pxm/products/build-child-products#using-build-rules). + properties: + default: + description: Specifies the default behaviour, either `include` or `exclude`. + type: string + enum: + - include + - exclude + include: + description: An array of option IDs to include when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. + type: array + items: + type: array + items: + type: string + exclude: + description: An array of option IDs to exclude when child products are built. Each combination consists of a nested array of option IDs from one or more variations. Combinations of option IDs in the nested arrays must come from different variations. + type: array + items: + type: array + items: + type: string + product_bundle_components: + type: object + description: With Product Experience Manager, you can create and manage bundles. A bundle is a purchasable product, comprising of one or more products that you want to sell together. You can create multiple components within a bundle. Each component must have at least one or more options. Each option is a product and a quantity. See [Bundles](/docs/api/pxm/products/products#bundles). + additionalProperties: + description: The name of the component, such as `games`. The `bundle_configuration` uses the component name to reference a component. A component name should be relatively short and must not contain any special characters. + type: object + properties: + name: + type: string + description: The component name. The component name is the name that is displayed in your storefront. + options: + type: array + description: The product options included in a component. This can be the ID of another bundle. + items: + type: object + properties: + id: + type: string + description: The unique ID of the product you want to add to a component. + type: + type: string + description: This represents the type of object being returned. Always `product`. + quantity: + type: integer + description: The number of this product option that a shopper must purchase. + sort_order: + type: integer + description: The sort order of the options. The `create a bundle` and `update a bundle` endpoints do not sort the options. You can use the `sort_order` attribute when programming your storefront to display the options in the order that you want. + default: + description: Whether the product option is a default option in a bundle. Shoppers can select a bundle that specifies a default list of product options. See [Dynamic Bundles](/docs/api/pxm/products/products#dynamic-bundles). + type: boolean + min: + type: integer + description: The minimum number of product options a shopper can select from this component. + max: + type: integer + description: The maximum number of product options a shopper can select from this component. + sort_order: + type: integer + description: The sort order of the components. The `create a bundle` and `update a bundle` endpoints do not sort the components. You can use the `sort_order` attribute when programming your storefront to display the components in the order that you want. + product_response: + type: object + properties: + id: + description: A unique product ID that is generated when you create the product. + type: string + type: + description: This represents the type of resource object being returned. Always `product`. + type: string + enum: + - product + attributes: + type: object + additionalProperties: false + properties: + name: + description: A name for the product. + type: string + description: + description: A description for the product. + type: string + slug: + description: A label for the product that is used in the URL paths. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. By default, the product name is used as the slug. + type: string + sku: + description: The unique stock keeping unit of the product. + type: string + status: + description: The status for the product, either `draft` or `live`. + type: string + enum: + - live + - draft + commodity_type: + description: The commodity type, either `physical` or `digital`. + type: string + enum: + - physical + - digital + upc_ean: + description: The universal product code or european article number of the product. + type: string + mpn: + description: The manufacturer part number of the product. + type: string + external_ref: + description: The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. + type: string + locales: + description: Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + type: object + tags: + description: You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas. + type: array + items: + type: string + extensions: + type: object + additionalProperties: + type: object + additionalProperties: + oneOf: + - type: string + nullable: true + - type: integer + - type: boolean + custom_inputs: + $ref: '#/components/schemas/product_custom_inputs' + build_rules: + $ref: '#/components/schemas/product_build_rules' + components: + $ref: '#/components/schemas/product_bundle_components' + meta: + type: object + properties: + created_at: + description: The date and time a product is created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + description: The date and time a product is updated. + type: string + example: '2020-09-22T09:00:00' + format: date-time + owner: + description: The resource owner, either `organization` or `store`. + type: string + enum: + - organization + - store + variations: + description: A product's variations and the options defined for each variation. If you have specified `build_rules`, only the child products included in the `build_rules` are specified. + type: array + items: + type: object + properties: + id: + type: string + description: A unique ID generated when a variation is created. + name: + type: string + description: The name of a variation. + options: + type: array + items: + type: object + description: The options available for this variation. + properties: + id: + type: string + description: A unique ID that is generated an option is created. + name: + type: string + description: The name of an option. + description: + type: string + description: A description of an option. + product_types: + description: | + One of the following product types: + + - `standard` - A `standard` product is a standalone product. + - `parent` - A `parent` product is a product that has child products that have been built using the `Build Child Products` endpoint. + - `child` - When you configure product variations and variation options for `parent` products, the `child` products derived from the `parent` products are automatically created in Commerce. + - `bundle` - A `bundle` is a purchasable product, comprising one or more standalone products (in other words, components) to be sold together. + type: array + items: + type: string + enum: + - parent + - child + - bundle + - standard + variation_matrix: + description: The child products defined for a product. The order of the variations in the `variation_matrix` is the order of the variations in the array when the variations were linked to the product. For example, the first variation in the `variation_matrix` corresponds to the first variation in the array, and so on. You can use the `sort_order`attribute to sort the order of your variation and variation options in the `variation_matrix` object. See [Sorting the Order of Variations and Options](/docs/api/pxm/products/variations#sorting-the-order-of-variations-and-options) If no variations are defined for a product, the `variation_matrix` is empty. + type: object + relationships: + description: Relationships are established between different product entities. For example, a `bundle` product and a `child` product are related to a `parent` product, as both are associated with it. + type: object + additionalProperties: + type: object + properties: + data: + oneOf: + - type: array + items: + type: object + properties: + id: + description: A unique identifier for a resource. + type: string + type: + description: This represents the type of resource object being returned. + type: string + - type: object + nullable: true + properties: + id: + description: A unique identifier for a resource. + type: string + type: + description: This represents the type of resource object being returned. + type: string + links: + description: | + Links are used to allow you to move between requests. Single entities use a `self` parameter with a link to that specific resource. Sometimes, there are not enough entities for a project to fill multiple pages. In this situation, we return some defaults. + + | Property | Description | + | :--- | :--- | + | `current` | Always the current page. | + | `first` | Always the first page. | + | `last` | `null` if there is only one page. | + | `prev` | `null` if the user is on the first page. | + | `next` | `null` if there is only one page. | + type: object + additionalProperties: + type: string + multi_product_response: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/product_response' + included: + type: object + description: Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + properties: + component_products: + description: Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + type: array + items: + $ref: '#/components/schemas/product_response' + meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 2 + product_locales: + type: object + description: Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + required: + - name + properties: + name: + type: string + description: A localized name for the product. + description: + type: string + description: A localized description for the product. + product_attributes: + type: object + additionalProperties: false + properties: + external_ref: + type: string + description: The unique attribute associated with the product. This could be an external reference from a separate company system, for example. The maximum length is 2048 characters. + name: + type: string + description: The product name to display to customers. + description: + description: A description for the product. + type: string + slug: + type: string + description: The unique slug of the product. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + sku: + type: string + description: The unique stock keeping unit of the product. + status: + type: string + enum: + - live + - draft + description: The status for the product, either `draft` or `live`. Default is `draft`. + commodity_type: + description: The commodity type, either `physical` or `digital`. + type: string + enum: + - physical + - digital + upc_ean: + type: string + description: The universal product code or european article number of the product. + mpn: + type: string + description: The manufacturer part number of the product. + tags: + type: array + description: You can use product tags to store or assign a key word against a product. The product tag can then be used to describe or label that product. Using product tags means that you can group your products together, for example, by brand, category, subcategory, colors, types, industries, and so on. A product can have up to 20 tags. A product tag can be up to 255 characters. Product tags must not contain any spaces or commas. See [Product Tags](/docs/api/pxm/products/product-tags). + items: + type: string + build_rules: + $ref: '#/components/schemas/product_build_rules' + locales: + $ref: '#/components/schemas/product_locales' + custom_inputs: + $ref: '#/components/schemas/product_custom_inputs' + components: + $ref: '#/components/schemas/product_bundle_components' + create_product_request: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource being returned. Always `product`. + type: string + enum: + - product + example: product + attributes: + $ref: '#/components/schemas/product_attributes' + relationships: + description: Relationships are established between different product entities. + type: object + properties: + variations: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for a resource. + type: string + type: + description: This represents the type of resource object being returned. + type: string + single_product_response: + type: object + properties: + data: + $ref: '#/components/schemas/product_response' + included: + type: object + description: Returns a list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + properties: + component_products: + description: A list of component products in a product bundle. If a bundle has no component products (in other words, is not a product bundle), an empty array is returned. + type: array + items: + $ref: '#/components/schemas/product_response' + update_product_request: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + - id + properties: + type: + description: This represents the type of resource object being returned. Always `product`. + type: string + enum: + - product + example: product + id: + type: string + description: The unique identifier of the product. Must match the product ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + attributes: + $ref: '#/components/schemas/product_attributes' + attributes: + type: object + properties: + name: + description: The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + type: string + description: + description: A description for a node. + type: string + slug: + description: A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + type: string + curated_products: + description: You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. + type: array + items: + description: A list of product IDs whose products you want to curate. + type: string + locales: + description: Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: false + properties: + name: + description: A localized hierarchy or node name. + type: string + description: + description: A localized hierarchy or node description. + type: string + relationships: + type: object + description: Relationships allow you to move between requests. Includes links to the child nodes and products associated with a hierarchy or node. + properties: + children: + description: The child nodes related to the resource. + type: object + properties: + data: + description: An array of child nodes. + type: array + required: [] + links: + description: Links allow you to move between requests. + type: object + properties: + related: + description: A link to a related resource. + type: string + parent: + description: The parent node related to the resource + type: object + properties: + data: + description: The parent node + type: object + required: + - id + - type + properties: + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + id: + description: The unique identifier of a node. + type: string + products: + type: object + description: The products related to the resource. + properties: + data: + description: An array of products. + type: array + required: [] + links: + type: object + description: Links allow you to move between requests. + properties: + related: + description: A link to a related resource. + type: string + node: + type: object + properties: + id: + description: The unique identifier of a node. + type: string + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + attributes: + $ref: '#/components/schemas/attributes' + relationships: + $ref: '#/components/schemas/relationships' + meta: + type: object + properties: + sort_order: + description: The sort order value. The node with the highest value of `sort_order` is displayed first. For example, a node with a `sort_order` value of `3` appears before a node with a `sort_order` value of `2`. See [Sorting Nodes in a hierarchy](/docs/api/pxm/products/create-node#sorting-nodes-in-a-hierarchy). + type: integer + created_at: + description: The date and time a node is created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + description: The date and time a node was updated. + type: string + example: '2020-09-22T09:00:00' + format: date-time + parent_name: + description: The name of the parent of the node if one exists. + type: string + owner: + description: The node owner, either `organization` or `store`. + type: string + enum: + - store + - organization + multi_meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 30 + minimum: 0 + multi_links: + type: object + description: Links are used to allow you to move between requests. + properties: + first: + description: Always the first page. + type: string + example: /pcm/hierarchies?page[offset]=0&page[limit]=10 + last: + description: This is `null` if there is only one page. + type: string + example: /pcm/hierarchies?page[offset]=20&page[limit]=10 + next: + description: This is `null` if there is only one page. + type: string + example: /pcm/hierarchies?page[offset]=10&page[limit]=10 + prev: + description: This is `null` if you on the first page. + type: string + example: /pcm/hierarchies?page[offset]=8&page[limit]=10 + multi_nodes: + type: object + properties: + data: + description: An array of nodes. + type: array + items: + $ref: '#/components/schemas/node' + meta: + $ref: '#/components/schemas/multi_meta' + links: + $ref: '#/components/schemas/multi_links' + template_response: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for a template generated when a template is created. + type: string + type: + description: This represents the type of resource object being returned. Always `template`. + type: string + enum: + - template + product_templates_request: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + description: The unique identifier of a template. + type: + type: string + enum: + - template + description: This represents the type of resource object being returned. Always `template'. + component_products_response: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + description: The unique identifier of a product component generated when a product is created. + type: + type: string + enum: + - product + description: This represents the type of resource object being returned. Always `product`. + file_response: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + description: The unique identifier of the new file. + type: + type: string + description: This represents the type of resource object being returned. Always `file`. + enum: + - file + product_files_request: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for a file generated when a file is created. + type: string + type: + description: This represents the type of resource being returned. Always `file`. + type: string + enum: + - file + meta: + type: object + properties: + tags: + description: The files associated with a product. + type: array + items: + type: string + additionalProperties: false + variations_response: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier generated when a variation is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + meta: + type: object + properties: + created_at: + description: The date and time a resource is created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + product_variations_request: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + description: The ID of the product variation. + type: + type: string + enum: + - product-variation + description: This represents the type of resource being returned. Always `product-variation`. + main_image_response: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for the image file generated automatically when a file is created. + type: string + type: + description: This represents the type of resource object being returned. Always `file`. + type: string + replace_main_image_request: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: string + description: The ID of the new image file. + example: 00000000-0000-0000-0000-000000000000 + type: + type: string + enum: + - file + main_image_request: + type: object + properties: + data: + type: object + properties: + id: + type: string + description: The ID of the image file. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource being returned. Always `file`. + type: string + enum: + - file + multi_variations: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for a variation. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + attributes: + type: object + additionalProperties: false + properties: + name: + description: The name of a variation. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + options: + type: array + items: + type: object + description: The options available for this variation. + properties: + id: + type: string + description: A unique ID that is generated when an option is created. + name: + type: string + description: A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + description: + type: string + description: A human recognizable description of the option. + created_at: + type: string + description: The date and time an option is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time an option is updated. + example: '2020-09-22T09:00:00' + format: date-time + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + owner: + type: string + description: The owner of the resource, either `organization` or `store`. + enum: + - organization + - store + created_at: + type: string + description: The date and time a variation is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time a variation is updated. + example: '2020-09-22T09:00:00' + format: date-time + meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 3 + create_variation: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + attributes: + type: object + additionalProperties: false + properties: + name: + description: The variation name. + type: string + sort_order: + description: | + The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + + The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. + + You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + + You must rebuild your products for the sort order changes to take effect. + type: integer + created_variation: + type: object + required: + - data + properties: + data: + type: object + required: + - id + - type + - attributes + - meta + properties: + id: + description: A unique identifier generated when a variation is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + attributes: + type: object + additionalProperties: false + properties: + name: + description: A human-recognizable identifier for a variation. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + owner: + description: The owner of the resource, either `organization` or `store`. + type: string + enum: + - organization + - store + created_at: + type: string + description: The date and time a variation is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time a variation is updated. + example: '2020-09-22T09:00:00' + format: date-time + single_variation: + type: object + required: + - data + properties: + data: + type: object + required: + - id + - type + - attributes + - meta + properties: + id: + description: A unique identifier for a variation. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + attributes: + type: object + additionalProperties: false + properties: + name: + description: The name for a variation. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + options: + description: A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue. + type: array + items: + type: object + description: The options available for this variation + properties: + id: + type: string + description: A unique ID that is generated an option is created. + name: + type: string + description: A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + description: + type: string + description: A description for an option. + created_at: + type: string + description: The date and time an option is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time an option is updated. + example: '2020-09-22T09:00:00' + format: date-time + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + owner: + description: The owner of the resource, either `organization` or `store`. + type: string + enum: + - organization + - store + created_at: + type: string + description: The date and time a variation is created. + updated_at: + type: string + description: The date and time a variation is updated. + update_variation: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + - id + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation`. + type: string + enum: + - product-variation + attributes: + type: object + additionalProperties: false + properties: + name: + description: The variation name. + type: string + sort_order: + description: | + The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + + The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. + + You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + + You must rebuild your products for the sort order changes to take effect. + type: integer + id: + type: string + description: The unique identifier of the variation. Must match the variation ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + multi_options: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier generated when an option is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-option`. + type: string + enum: + - product-variation-option + attributes: + type: object + additionalProperties: false + properties: + name: + description: A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + type: string + description: + description: A human-recognizable description for the option. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - organization + - store + created_at: + type: string + description: The date and time an option is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time an option is updated. + example: '2020-09-22T09:00:00' + format: date-time + meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 3 + create_option: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation-option`. + type: string + enum: + - product-variation-option + attributes: + type: object + additionalProperties: false + properties: + name: + description: A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + type: string + sort_order: + description: | + By default, variations and variation options are sorted alphabetically. You can use the `sort_order` attribute to sort the order of your variation and variation options in the `variation_matrix`. + + The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + + The variation option with the highest value of `sort_order` is displayed first. For example, a variation option with a `sort_order` value of `3` appears before a variation option with a `sort_order` value of `2`. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + + You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + + You must rebuild your products for the sort order changes to take effect. + type: integer + description: + description: A description of a product variation option. + type: string + created_option: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + properties: + id: + description: A unique identifier that is generated when an option is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-option`. + type: string + enum: + - product-variation-option + attributes: + type: object + additionalProperties: false + properties: + name: + description: A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + type: string + description: + description: A human-recognizable description for the option. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - organization + - store + created_at: + type: string + description: The date and time an option is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time an option is updated. + example: '2020-09-22T09:00:00' + format: date-time + single_option: + type: object + required: + - data + properties: + data: + type: object + required: + - id + - type + - attributes + - meta + properties: + id: + description: The unique identifier generated when an option is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-option`. + type: string + enum: + - product-variation-option + attributes: + type: object + description: A variation option represents an option for selection for a single product-variation. For example, if your variation is `color`, you might have three possible options; red, green, and blue. + additionalProperties: false + properties: + name: + description: A human-recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + type: string + description: + description: A human-recognizable description for the option. + type: string + sort_order: + description: The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. The variation with the highest value of `sort_order` is displayed first. For example, a variation with a `sort_order` value of 3 appears before a variation with a `sort_order` value of 2. You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, including, zero or negative numbers. You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + type: integer + meta: + type: object + properties: + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - organization + - store + created_at: + type: string + description: The date and time an option is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time an option is updated. + example: '2020-09-22T09:00:00' + format: date-time + update_option: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + - id + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation-option`. + type: string + enum: + - product-variation-option + attributes: + type: object + additionalProperties: false + properties: + name: + description: A human recognizable identifier for the option, also used in the SLUG for child products. Option names can only contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. + type: string + description: + description: The description of the option. + type: string + sort_order: + description: | + By default, variations and variation options are sorted alphabetically. You can use the `sort_order` attribute to sort the order of your variation and variation options in the `variation_matrix`. The sort order value is visible when you add the variations and variation options to your catalogs. You can then use the `sort_order` value to program your storefront to display the variation options in the order that you want. + + The variation option with the highest value of `sort_order` is displayed first. For example, a variation option with a `sort_order` value of `3` appears before a variation option with a `sort_order` value of `2`. + + You can specify any numbers that you want. You can use 1, 2, 3, or 100, 90, 80, and so on, zero or negative numbers. + + You can set `sort_order` to either `null` or omit it entirely from the request if you wish to remove an existing `sort_order` attribute. + + You must rebuild your products for the sort order changes to take effect. + type: integer + id: + type: string + description: The unique identifier of the option. Must match the option ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + multi_modifiers: + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + description: A unique identifier for a modifier that is generated automatically when a modifier is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-modifier'. + type: string + enum: + - product-variation-modifier + attributes: + type: object + additionalProperties: false + properties: + type: + description: | + You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + + | Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + | `description_equals` | `string` | Overrides the description of the child product. | + | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + | `price_increment` | `string` | Increases the price of the child product. | + | `price_decrement` | `string` | Decreases the price of the child product. | + | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `sku_equals` | `string` | Sets the SKU of the child product. | + | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + type: string + enum: + - commodity_type + - status + - price + - name_append + - name_prepend + - name_equals + - sku_append + - sku_prepend + - sku_equals + - sku_builder + - slug_append + - slug_prepend + - slug_equals + - slug_builder + - description_append + - description_prepend + - description_equals + - custom_inputs_equals + - build_rules_equals + - locales_equals + - upc_ean_equals + - mpn_equals + - external_ref_equals + value: + description: Required for non-builder modifiers. The value of the modifier type. + type: string + seek: + description: Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + type: string + set: + description: Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + type: string + reference_name: + description: The name of the modifier. + type: string + meta: + type: object + properties: + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - store + - organization + meta: + type: object + properties: + results: + type: object + description: Contains the results for the entire collection. + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 3 + create_modifier: + type: object + description: Use modifiers to change the properties of child products that are inherited from a parent product. With modifiers, you only need to have one parent product with a variation attached to the product. + required: + - data + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation-modifier`. + type: string + enum: + - product-variation-modifier + attributes: + type: object + required: + - type + additionalProperties: false + properties: + type: + type: string + description: | + You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + + | Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + | `description_equals` | `string` | Overrides the description of the child product. | + | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + | `price_increment` | `string` | Increases the price of the child product. | + | `price_decrement` | `string` | Decreases the price of the child product. | + | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `sku_equals` | `string` | Sets the SKU of the child product. | + | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + enum: + - commodity_type + - status + - price + - name_append + - name_prepend + - name_equals + - sku_append + - sku_prepend + - sku_equals + - sku_builder + - slug_append + - slug_prepend + - slug_equals + - slug_builder + - description_append + - description_prepend + - description_equals + - custom_inputs_equals + - build_rules_equals + - locales_equals + - upc_ean_equals + - mpn_equals + - external_ref_equals + value: + description: Required for non-builder modifiers. The value of the modifier type. + type: string + seek: + description: Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + type: string + set: + description: Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + type: string + reference_name: + description: A name for the modifier. + type: string + created_modifier: + type: object + properties: + data: + type: object + properties: + id: + description: A unique identifier for a modifier that is generated automatically when a modifier is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-modifier'. + type: string + enum: + - product-variation-modifier + attributes: + type: object + additionalProperties: false + properties: + type: + description: | + You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + + | Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + | `description_equals` | `string` | Overrides the description of the child product. | + | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + | `price_increment` | `string` | Increases the price of the child product. | + | `price_decrement` | `string` | Decreases the price of the child product. | + | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `sku_equals` | `string` | Sets the SKU of the child product. | + | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + type: string + enum: + - commodity_type + - status + - price + - name_append + - name_prepend + - name_equals + - sku_append + - sku_prepend + - sku_equals + - sku_builder + - slug_append + - slug_prepend + - slug_equals + - slug_builder + - description_append + - description_prepend + - description_equals + - custom_inputs_equals + - build_rules_equals + - locales_equals + - upc_ean_equals + - mpn_equals + - external_ref_equals + value: + description: Required for non-builder modifiers. The value of the modifier type. + type: string + seek: + description: Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + type: string + set: + description: Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + type: string + reference_name: + description: The name of the modifier. + type: string + meta: + type: object + properties: + owner: + description: The owner of the resource, either `organization` or `store`. + type: string + enum: + - organization + - store + single_modifier: + type: object + properties: + data: + type: object + properties: + id: + description: A unique identifier for a modifier that is generated automatically when a modifier is created. + type: string + type: + description: This represents the type of resource object being returned. Always `product-variation-modifier'. + type: string + enum: + - product-variation-modifier + attributes: + type: object + additionalProperties: false + properties: + type: + description: | + You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + + | Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + | `description_equals` | `string` | Overrides the description of the child product. | + | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + | `price_increment` | `string` | Increases the price of the child product. | + | `price_decrement` | `string` | Decreases the price of the child product. | + | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `sku_equals` | `string` | Sets the SKU of the child product. | + | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + type: string + enum: + - commodity_type + - status + - price + - name_append + - name_prepend + - name_equals + - sku_append + - sku_prepend + - sku_equals + - sku_builder + - slug_append + - slug_prepend + - slug_equals + - slug_builder + - description_append + - description_prepend + - description_equals + - custom_inputs_equals + - build_rules_equals + - locales_equals + - upc_ean_equals + - mpn_equals + - external_ref_equals + value: + description: Required for non-builder modifiers. The value of the modifier type. + type: string + seek: + description: Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + type: string + set: + description: Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + type: string + reference_name: + description: The name of the modifier. + type: string + meta: + type: object + description: The owner of the resource, either `organization` or `store`. + properties: + owner: + type: string + enum: + - organization + - store + update_modifier: + type: object + required: + - data + properties: + data: + type: object + required: + - type + - attributes + - id + properties: + type: + description: This represents the type of resource object being returned. Always `product-variation-modifier`. + type: string + enum: + - product-variation-modifier + attributes: + type: object + required: + - type + additionalProperties: false + properties: + type: + description: | + You can specify different modifiers for different options in a variation. When you build child products using options in variations, the properties of a child products depends on the modifier set for the options that are applied to the child product. The table below describes the different types of modifiers. + + | Modifier | Data Type | Effect | + | :--- | :--- | :--- | + | `name_equals` | `string` | Overrides the name of the child product with the name specified by the modifier. | + | `name_append` | `string` | Appends the string specified in the modifier to the name of the child product. | + | `name_prepend` | `string` | Prepends the string specified in the modifier to the name of the child product. | + | `description_equals` | `string` | Overrides the description of the child product. | + | `description_append` | `string` | Appends the string specified in the modifier to the description of the child product. | + | `description_prepend` | `string` | Prepends the string specified in the modifier to the product description of the child product. | + | `commodity_type` | `string` | Sets the commodity type of the child product, such as `physical` or `digital`. | + | `price` | `string` | Allows application of price modifiers (`price_increment`, `price_decrement`, and `price_equals`) to the child products. | + | `price_increment` | `string` | Increases the price of the child product. | + | `price_decrement` | `string` | Decreases the price of the child product. | + | `price_equals` | `string` | Sets the price of a child product to the amount you specify. | + | `slug_append` | `string` | Appends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_prepend` | `string` | Prepends the string specified in the modifier to the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `slug_builder` | `string`| Sets a part of the slug of the child product. Can only contain A-Z, a-z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed. However, for the `slug-builder` modifier, you can use `{}` in the `seek` field, for example, `"seek": :{COLOR}"`. | + | `sku_equals` | `string` | Sets the SKU of the child product. | + | `sku_append` | `string` | Appends the string specified in the modifier to the SKU of the child product. | + | `sku_prepend` | `string` | Prepends the string specified in the modifier to the SKU of the child product. | + | `sku_builder` | `string` | Sets a part of the SKU of the child product. | + | `status` | `string` | Sets the status of the child product, such as `draft` or `live`. | + type: string + enum: + - commodity_type + - status + - price + - name_append + - name_prepend + - name_equals + - sku_append + - sku_prepend + - sku_equals + - sku_builder + - slug_append + - slug_prepend + - slug_equals + - slug_builder + - description_append + - description_prepend + - description_equals + - custom_inputs_equals + - build_rules_equals + - locales_equals + - upc_ean_equals + - mpn_equals + - external_ref_equals + value: + description: Required for non-builder modifiers. The value of the modifier type. + type: string + seek: + description: Required for builder modifiers. The sub-string to find and replace enclosed in curly brackets for `slug_builder` and `sku_builder`. + type: string + set: + description: Required for builder modifiers. The value to replace matches the `seek` string for `slug_builder` and `sku_builder`. + type: string + reference_name: + description: The name of the modifier. + type: string + id: + type: string + description: The unique identifier of the modifier. Must match the modifier ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + attributes_hierarchy: + type: object + properties: + name: + description: The name of a hierarchy, such as `Major Appliances`. + type: string + description: + description: A description for a hierarchy. + type: string + slug: + description: A unique slug for a hierarchy. + type: string + locales: + description: Product Experience Manager supports localization of hierarchies and nodes. If you store supports multiple languages, you can localize hierarchy and node names and descriptions. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: false + properties: + name: + description: A localized hierarchy or node name. + type: string + description: + description: A localized hierarchy or node description. + type: string + relationships_hierarchy: + type: object + properties: + children: + description: The child nodes related to the hierarchy. + type: object + properties: + data: + description: An array of child nodes. + type: array + required: [] + links: + description: Links allow you to move between requests. + type: object + properties: + related: + description: A link to a related resource. + type: string + hierarchy: + type: object + properties: + id: + description: A unique identifier generated when a hierarchy is created. + type: string + type: + description: This represents the type of resource object being returned. Always `hierarchy`. + type: string + enum: + - hierarchy + attributes: + $ref: '#/components/schemas/attributes_hierarchy' + relationships: + $ref: '#/components/schemas/relationships_hierarchy' + meta: + type: object + properties: + created_at: + description: The date and time a hierarchy is created. + type: string + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + description: The date and time a hierarchy is updated. + type: string + example: '2020-09-22T09:00:00' + format: date-time + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - store + - organization + multi_hierarchy: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/hierarchy' + links: + $ref: '#/components/schemas/multi_links' + meta: + $ref: '#/components/schemas/multi_meta' + req_attributes_hierarchy: + type: object + additionalProperties: false + properties: + name: + description: The name of the hierarchy, such as `Major Appliances`. + type: string + description: + description: A description of the hierarchy. + type: string + slug: + description: A unique slug for the hierarchy. + type: string + locales: + description: Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: false + properties: + name: + description: A localized name for the hierarchy. + type: string + description: + description: A localized description for the hierarchy. + type: string + create_hierarchy: + type: object + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `hierarchy`. + type: string + enum: + - hierarchy + attributes: + $ref: '#/components/schemas/req_attributes_hierarchy' + single_hierarchy: + type: object + properties: + data: + $ref: '#/components/schemas/hierarchy' + update_hierarchy: + type: object + required: + - data + properties: + data: + type: object + required: + - id + - type + - attributes + properties: + id: + type: string + description: The unique identifier of the hierarchy. Must match the hierarchy ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `hierarchy`. + type: string + enum: + - hierarchy + example: hierarchy + attributes: + $ref: '#/components/schemas/req_attributes_hierarchy' + attributes_nodes: + type: object + additionalProperties: false + properties: + name: + description: The name of the node, such as `Ranges` or `Refrigerators`. Names must be unique among sibling nodes in the hierarchy. Otherwise, a name can be non-unique within the hierarchy and across multiple hierarchies. + type: string + description: + description: A description of the node. + type: string + slug: + description: A slug for the node. Slugs must be unique among sibling nodes in the hierarchy. Otherwise, a slug can be non-unique within the hierarchy and across multiple hierarchies. + type: string + curated_products: + description: You can curate your products in your nodes product lists. Product curation allows you to promote specific products within each node in a hierarchy, enabling you to create unique product collections in your storefront. See [Curating Products in a node](/docs/api/pxm/products/create-node#curating-products-in-a-node). + type: array + items: + description: A list of product IDs for the products that you want to curate in a node. + type: string + locales: + description: Product Experience Manager supports localization of products and hierarchies. If your store supports multiple languages, you can localize product names and descriptions. You can have as many locales as you want. + type: object + additionalProperties: + description: A [three-letter language code](https://www.iso.org/iso-639-language-code) that represents the name of language you have used. + type: object + additionalProperties: false + properties: + name: + description: A localized name for the node. + type: string + description: + description: A localized description for the node. + type: string + create_node: + type: object + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + attributes: + $ref: '#/components/schemas/attributes_nodes' + meta: + type: object + additionalProperties: false + properties: + sort_order: + description: | + You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The `sort_order` for each node. This value determines the order of nodes in the response for the `Get a Node’s Children` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + + - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for `Get a Node’s Children` request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. See [Sorting Nodes in a hierarchy](). + type: integer + single_node: + type: object + properties: + data: + $ref: '#/components/schemas/node' + update_node: + type: object + properties: + data: + type: object + required: + - id + - type + - attributes + properties: + id: + type: string + description: The unique identifier of the node. Must match the node ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + attributes: + $ref: '#/components/schemas/attributes_nodes' + meta: + type: object + additionalProperties: false + properties: + sort_order: + description: | + You can sort the order of your nodes, regardless of where the nodes are in the hierarchy. The `sort_order` for each node. This value determines the order of nodes in the response for the `Get a Node’s Children` request. The node with the highest value of sort_order is displayed first. For example, a node with a sort_order value of 3 appears before a node with a sort_order value of 2. + + - If you don’t provide `sort_order` when creating nodes, all child nodes in the response for `Get a Node’s Children` request are ordered by the `updated_at` time in descending order, with the most recently updated child node first. + - If you set `sort_order` for only a few child nodes or not all, the child nodes with a `sort_order` value appear first and then other child nodes appear in the order of `updated_at` time. + type: integer + node_children: + type: object + properties: + data: + type: array + items: + type: object + required: + - id + - type + properties: + id: + type: string + description: The unique identifier of the child node. Must not match the node ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + node_parent: + type: object + properties: + data: + type: object + required: + - id + - type + properties: + id: + type: string + description: The unique identifier of the new parent node. Must not match the node ID specified in the request path. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `node`. + type: string + enum: + - node + node_products: + type: object + properties: + data: + type: array + items: + type: object + required: + - id + - type + properties: + id: + type: string + description: The unique identifier of the product to be attached to the node. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `product`. + type: string + enum: + - product + duplicate_job: + type: object + properties: + data: + type: object + properties: + type: + description: This represents the type of resource object being returned. Always `hierarchy`. + type: string + enum: + - hierarchy + attributes: + type: object + additionalProperties: false + properties: + name: + description: The name of the duplicate hierarchy. The maximum length is 1000 characters. + type: string + description: + description: A description of the duplicate hierarchy. + type: string + include_products: + description: Specify `true` if you want the product associations in the existing nodes associated in your duplicated hierarchy. If not, specify `false`. + type: boolean + tag: + type: object + properties: + id: + description: A unique identifier generated when a tag is created. + type: string + type: + description: This represents the type of resource object being returned. Always `tag`. + type: string + enum: + - tag + attributes: + type: object + properties: + value: + type: string + description: The text value of the tag. + meta: + type: object + properties: + x_request_id: + type: string + description: A unique request ID is generated when a tag is created. + created_at: + type: string + description: The date and time a tag is created. + example: '2020-09-22T09:00:00' + format: date-time + updated_at: + type: string + description: The date and time a tag is updated. + example: '2020-09-22T09:00:00' + format: date-time + owner: + description: The owner of a resource, either `organization` or `store`. + type: string + enum: + - store + - organization + multi_tag: + type: object + properties: + data: + description: An array of tags. + type: array + items: + $ref: '#/components/schemas/tag' + meta: + type: object + properties: + results: + description: Contains the results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + example: 2 + single_tag: + type: object + properties: + data: + $ref: '#/components/schemas/tag' + req_attributes_custom_relationship: + type: object + additionalProperties: false + properties: + name: + description: The name of the custom relationship, such as `Kitchen electrics`. + type: string + description: + description: A description of the custom relationship. + type: string + slug: + description: A unique slug for the custom relationship. Must match the slug specified in the request path. + type: string + create_custom_relationship: + type: object + properties: + data: + type: object + required: + - type + - attributes + properties: + type: + description: This represents the type of resource object being returned. Always `custom-relationship`. + type: string + enum: + - custom-relationship + attributes: + $ref: '#/components/schemas/req_attributes_custom_relationship' + attributes_custom_relationship: + type: object + additionalProperties: false + properties: + name: + description: The name of the custom relationship, such as `Kitchen electrics`. + type: string + description: + description: A description of the custom relationship. + type: string + slug: + description: A unique slug for the custom relationship. + type: string + custom_relationship: + type: object + properties: + id: + description: A unique identifier generated when a custom relationship is created. + type: string + type: + description: This represents the type of resource object being returned. Always `hierarchy`. + type: string + enum: + - custom-relationship + attributes: + $ref: '#/components/schemas/attributes_custom_relationship' + meta: + type: object + properties: + owner: + description: The owner of the resource. + type: string + example: store + timestamps: + type: object + properties: + created_at: + description: The date and time the resource is created. + type: string + example: '2024-01-10T20:16:35.343Z' + format: date-time + updated_at: + description: The date and time the resource is updated. + type: string + example: '2024-01-10T20:16:35.343Z' + format: date-time + single_custom_relationship: + type: object + properties: + data: + $ref: '#/components/schemas/custom_relationship' + update_custom_relationship: + type: object + required: + - data + properties: + data: + type: object + required: + - id + - type + - attributes + properties: + id: + type: string + description: The unique identifier of the custom relationship. + example: 00000000-0000-0000-0000-000000000000 + type: + description: This represents the type of resource object being returned. Always `custom-relationship`. + type: string + enum: + - custom-relationship + example: custom-relationship + attributes: + $ref: '#/components/schemas/req_attributes_custom_relationship' + examples: + multi: + value: + data: + - type: pim-job + id: 1ea62172-57f6-45e5-a708-ab5bd634e3f9 + attributes: + completed_at: '2024-01-05T13:46:42.142Z' + created_at: '2024-01-05T13:46:41.695Z' + started_at: '2024-01-05T13:46:42.07Z' + status: success + type: product-import + updated_at: '2024-01-05T13:46:42.07Z' + meta: + x_request_id: 7e832a26-d615-4305-b26a-e33c9c2fc06a + - type: pim-job + id: 3ab3deca-1f11-47b7-a409-24ea3234d72c + attributes: + created_at: '2024-01-05T13:42:41.695Z' + status: started + type: product-import + updated_at: '2024-01-05T13:42:42.07Z' + meta: + x_request_id: 9ac00140-0037-4c6a-913c-b812196a2de6 + - type: pim-job + id: 7e1b9ba1-c844-4556-9b16-4ae3f0988b0f + attributes: + completed_at: '2024-01-05T15:27:23.663Z' + created_at: '2024-01-05T15:27:23.161Z' + started_at: '2024-01-05T15:27:23.65Z' + status: success + type: product-export + updated_at: '2024-01-05T15:27:23.65Z' + meta: + file_locations: [] + filter: eq(sku,product-1) + x_request_id: fad8c5c0-9546-4e0c-b68e-8a2d809891e5 + meta: + results: + total: 1 + started: + value: + data: + type: pim-job + id: 1ea62172-57f6-45e5-a708-ab5bd634e3f9 + attributes: + started_at: null + completed_at: null + created_at: '2024-01-05T13:46:41.695Z' + status: started + type: product-import + updated_at: '2024-01-05T13:46:42.07Z' + meta: + x_request_id: 7e832a26-d615-4305-b26a-e33c9c2fc06a + successful: + value: + data: + type: pim-job + id: 1ea62172-57f6-45e5-a708-ab5bd634e3f9 + attributes: + completed_at: '2024-01-05T13:46:42.142Z' + created_at: '2024-01-05T13:46:41.695Z' + started_at: '2024-01-05T13:46:42.07Z' + status: success + type: product-import + updated_at: '2024-01-05T13:46:42.07Z' + meta: + x_request_id: 7e832a26-d615-4305-b26a-e33c9c2fc06a + product-export: + value: + data: + type: pim-job + id: 7e1b9ba1-c844-4556-9b16-4ae3f0988b0f + attributes: + completed_at: '2024-01-05T15:27:23.663Z' + created_at: '2024-01-05T15:27:23.161Z' + started_at: '2024-01-05T15:27:23.65Z' + status: success + type: product-export + updated_at: '2024-01-05T15:27:23.65Z' + meta: + file_locations: [] + filter: eq(sku,product-1) + x_request_id: fad8c5c0-9546-4e0c-b68e-8a2d809891e5 + hierarchy-duplicate: + value: + data: + type: pim-job + id: 5ba1c98d-87b8-4d63-b2ed-3d3c6c876523 + attributes: + completed_at: '2024-01-08T11:56:29.257Z' + created_at: '2024-01-08T11:56:27.553Z' + started_at: '2024-01-08T11:56:29.222Z' + status: success + type: hierarchy-duplicate + updated_at: '2024-01-08T11:56:29.237Z' + meta: + copied_from: 5b912d00-db5a-4e18-86f2-3a652967ee48 + hierarchy_id: c05bfefc-8de4-43ea-858b-eb8984ad9f8f + x_request_id: an-x-request-id + build-child-products: + value: + data: + type: pim-job + id: 14a0a190-cd03-4d7f-a449-e2051ac539ea + attributes: + completed_at: '2024-01-08T11:58:19.113Z' + created_at: '2024-01-08T11:58:04.416Z' + started_at: '2024-01-08T11:58:19.067Z' + status: success + type: child-products + updated_at: '2024-01-08T11:58:19.067Z' + meta: + x_request_id: an-x-request-id + cancelled: + value: + data: + type: pim-job + id: 1e5da4bf-b2c0-4619-bb3d-f749875b15bb + attributes: + started_at: null + completed_at: null + created_at: '2023-11-14T15:37:13.589Z' + status: cancelled + type: product-import + updated_at: '2023-11-14T15:37:13.589Z' + meta: + x_request_id: 4fde01c1-95ba-4dd6-948e-b9d5763ff9c2 + errors: + value: + data: + - type: pim-job-error + id: 2950cae3-1050-4c43-9fbd-2aa60dc5c249 + attributes: + message: 'data.attributes.sku: Must be unique amongst products.' + multi_product_response: + value: + data: + - type: product + id: 9c85b276-09b4-488e-a59c-c561bae14c9e + attributes: + commodity_type: physical + custom_inputs: + back: + name: T-Shirt Back + validation_rules: + - type: string + options: + max_length: 50 + required: false + front: + name: T-Shirt Front + validation_rules: + - type: string + options: + max_length: 50 + required: false + description: T-shirt. + mpn: 1234-5678-TTTT + name: T-Shirt + sku: '97805' + slug: '97805' + status: live + upc_ean: '12345656' + tags: + - tag1 + - tag2 + extensions: + products(size): + widthMM: 600 + fuelType: electric + hasUKPlug: true + online: null + relationships: + children: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/children + component_products: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/component_products + files: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/templates + variations: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/variations + meta: + created_at: '2022-08-18T14:25:57.391Z' + owner: store + product_types: + - standard + updated_at: '2022-08-18T14:25:57.391Z' + meta: + results: + total: 1 + product_request: + value: + data: + type: product + attributes: + external_ref: d0ddf10c-402c-4e0f-b421-94e7f682c603 + name: T-Shirt + sku: '97805' + slug: '97805' + description: T-shirt. + status: live + commodity_type: physical + mpn: 1234-5678-TTTT + upc_ean: '12345656' + tags: + - tag1 + - tag2 + custom_inputs: + front: + name: T-Shirt Front + validation_rules: + - type: string + options: + max_length: 50 + required: false + back: + name: T-Shirt Back + validation_rules: + - type: string + options: + max_length: 50 + required: false + locales: + fr-FR: + name: T_Shirt + description: T-Shirt. + build_rules_request: + value: + data: + type: product + attributes: + name: Shirt + sku: '978055216732567' + slug: '978055216732567' + description: T-shirt. + status: live + commodity_type: physical + mpn: 1234-5678-SSSS + upc_ean: '135623456' + build_rules: + default: include + exclude: + - - cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + - 0b261f7d-753d-4af6-b9f4-62b436cca37d + include: + - - cf9e99f1-33dc-4991-88a1-3718678e9453 + - 1592377e-ced8-452e-a025-e50272488b11 + relationships: + variations: + data: + - type: product-variation + id: 6c4b5caa-3819-4366-a14e-c5b85009544b + - type: product-variation + id: f192e114-9f8a-4284-99d0-4d9ccd8a0275 + - type: product-variation + id: b1ae545e-3375-455f-b5ea-09669b60996f + bundle_sku_based_request: + value: + data: + type: product + attributes: + name: Favourite games bundle + description: All of your favourite DOOM games in one bundle + sku: doom-franchise + mpn: 1234-5678-ABCD + upc_ean: '123456' + commodity_type: digital + components: + games: + name: Game 1 + max: 1 + min: 1 + sort_order: 5 + options: + - id: 7c0aa6df-0bd3-4d1f-b6f9-fd9358868869 + type: product + quantity: 1 + default: true + posters: + name: Game 2 + max: 1 + min: 1 + sort_order: 4 + options: + - id: f0ec8088-13e1-4a53-8b5d-3f4d973e05c9 + type: product + quantity: 1 + default: false + bundle_sku_less_request: + value: + data: + type: product + attributes: + name: Shower bundle + description: A bundle of shower products + commodity_type: physical + components: + shampoo: + name: Shampoo + max: 1 + min: 1 + sort_order: 1 + options: + - id: shampooProductID + type: product + quantity: 1 + default: true + conditioner: + name: Conditioner + max: 1 + min: 1 + sort_order: 2 + options: + - id: conditionerProductID + type: product + quantity: 1 + default: false + create_single_product_response: + value: + data: + type: product + id: 9c85b276-09b4-488e-a59c-c561bae14c9e + attributes: + commodity_type: physical + custom_inputs: + back: + name: T-Shirt Back + validation_rules: + - type: string + options: + max_length: 50 + required: false + front: + name: T-Shirt Front + validation_rules: + - type: string + options: + max_length: 50 + required: false + description: T-shirt. + external_ref: d0ddf10c-402c-4e0f-b421-94e7f682c603 + locales: + fr-FR: + name: T-Shirt + description: T-Shirt. + mpn: 1234-5678-TTTT + name: T-Shirt + sku: '97805' + slug: '97805' + status: live + upc_ean: '12345656' + tags: + - tag1 + - tag2 + relationships: + children: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/children + component_products: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/component_products + files: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/templates + variations: + data: [] + links: + self: /products/9c85b276-09b4-488e-a59c-c561bae14c9e/relationships/variations + meta: + created_at: '2022-08-18T14:25:57.391Z' + owner: store + product_types: + - standard + updated_at: '2022-08-18T14:25:57.391Z' + create_build_rules_response: + value: + data: + type: product + id: 9214719b-17fe-4ea7-896c-d61e60fc0d05 + attributes: + build_rules: + default: include + exclude: + - - cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + - 0b261f7d-753d-4af6-b9f4-62b436cca37d + commodity_type: physical + description: T-shirt. + locales: + fr-FR: + name: shirt + description: T-shirt. + mpn: 1234-5678-SSSS + name: Shirt + sku: '978055216732567' + slug: '978055216732567' + status: live + upc_ean: '135623456' + relationships: + children: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/children + component_products: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/component_products + files: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/templates + variations: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/variations + meta: + created_at: '2022-08-18T12:14:52.782Z' + owner: store + product_types: + - standard + updated_at: '2022-08-18T12:14:52.782Z' + variations: + - id: 6c4b5caa-3819-4366-a14e-c5b85009544b + name: Shirt Size + options: + - id: cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + name: Small + description: Size Small + - id: da9d88d0-8ea6-434c-a0dd-059caf595687 + name: Medium + description: Size Medium + - id: 07493fea-74b0-40a2-972a-cd7e1d6561bd + name: Large + description: Size Large + - id: b1ae545e-3375-455f-b5ea-09669b60996f + name: Shirt Material + options: + - id: 994c2029-519c-43d9-9c54-14f3af4e3efd + name: Cotton + description: Material Cotton + - id: 7951f3d9-f628-49f8-8a43-7749d28153d6 + name: Denim + description: Material Denim + - id: 58115bff-589a-4287-98d8-373112102617 + name: Wool + description: Material Wool + - id: f192e114-9f8a-4284-99d0-4d9ccd8a0275 + name: Shirt Color + options: + - id: 0b261f7d-753d-4af6-b9f4-62b436cca37d + name: Red + description: Color Red + - id: 55d6d785-cc52-453a-bff6-2cf9add8a580 + name: Green + description: Color Green + - id: a43d8b6f-b411-49aa-adaa-36a1a025051e + name: Blue + description: Color Blue + import: + value: + data: + type: pim-job + id: 7e1b9ba1-c844-4556-9b16-4ae3f0988b0f + attributes: + completed_at: null + created_at: '2024-01-05T15:27:23.161Z' + started_at: null + status: pending + type: product-import + updated_at: '2024-01-05T15:27:23.161Z' + meta: + x_request_id: fad8c5c0-9546-4e0c-b68e-8a2d809891e5 + export: + value: + data: + type: pim-job + id: 7e1b9ba1-c844-4556-9b16-4ae3f0988b0f + attributes: + completed_at: null + created_at: '2024-01-05T15:27:23.161Z' + started_at: null + status: pending + type: product-export + updated_at: '2024-01-05T15:27:23.161Z' + meta: + file_locations: null + filter: eq(sku,product-1) + x_request_id: fad8c5c0-9546-4e0c-b68e-8a2d809891e5 + get_single_product_response: + value: + data: + type: product + id: f5bd4e59-a95f-4bda-bfe6-0f34f47ac94b + attributes: + commodity_type: physical + description: This electric model offers an induction heating element and convection oven. + mpn: BE-R-1111-aaaa-1a1a + name: BestEver Range, Model 1a1a + sku: BE-Range-1a1a + slug: bestever-range-1a1a + status: draft + upc_ean: '111122223333' + tags: + - tag1 + - tag2 + extensions: + products(size): + widthMM: 600 + fuelType: electric + hasUKPlug: true + online: null + relationships: + files: + data: [] + links: + self: /products/f5bd4e59-a95f-4bda-bfe6-0f34f47ac94b/relationships/files + templates: + data: [] + links: + self: /products/f5bd4e59-a95f-4bda-bfe6-0f34f47ac94b/relationships/templates + meta: + created_at: '2023-09-28T10:43:41.72Z' + owner: organization + product_types: + - standard + updated_at: '2023-09-28T10:43:41.72Z' + variation_matrix: {} + get_bundle_response: + value: + data: + type: product + id: 495f5c48-c747-4540-86fd-40380bf2df91 + attributes: + commodity_type: physical + components: + games: + name: Games + options: + - id: 1a499918-2ec0-468d-b7b9-f09eab2f6ad8 + type: product + quantity: 2 + sort_order: 15 + default: true + sort_order: 10 + name: DOOM Bundle + status: draft + relationships: + children: + data: [] + links: + self: /products/495f5c48-c747-4540-86fd-40380bf2df91/children + component_products: + data: [] + links: + self: /products/495f5c48-c747-4540-86fd-40380bf2df91/relationships/component_products + files: + data: [] + links: + self: /products/495f5c48-c747-4540-86fd-40380bf2df91/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/495f5c48-c747-4540-86fd-40380bf2df91/relationships/templates + variations: + data: [] + links: + self: /products/495f5c48-c747-4540-86fd-40380bf2df91/relationships/variations + meta: + created_at: '2024-01-08T13:36:53.658Z' + owner: organization + product_types: + - bundle + updated_at: '2024-01-08T13:36:53.658Z' + variation_matrix: {} + get_parent_product_response: + value: + data: + type: product + id: 571e366f-17e6-4e51-8239-b3cc8ee1144d + attributes: + commodity_type: physical + name: Jeans + sku: jeans + slug: jeans + status: live + relationships: + children: + data: [] + links: + self: /products/571e366f-17e6-4e51-8239-b3cc8ee1144d/children + component_products: + data: [] + links: + self: /products/571e366f-17e6-4e51-8239-b3cc8ee1144d/relationships/component_products + files: + data: [] + links: + self: /products/571e366f-17e6-4e51-8239-b3cc8ee1144d/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/571e366f-17e6-4e51-8239-b3cc8ee1144d/relationships/templates + variations: + data: [] + links: + self: /products/571e366f-17e6-4e51-8239-b3cc8ee1144d/relationships/variations + meta: + created_at: '2024-01-05T10:29:44.214Z' + owner: store + product_types: + - parent + updated_at: '2024-01-05T10:29:45.212Z' + variation_matrix: + 46fff1c9-668b-461a-9344-e7a8cbbbf931: 4d32b816-4397-4a71-b875-4e4ea3ce6745 + 843868fc-2440-44d1-8ce7-dc474f79ad1c: cf501150-f02d-49ad-b7d7-33ed15417b76 + variations: + - id: ec2bcebd-f42e-4725-8715-c338589e33ea + name: Paint colour + options: + - id: 843868fc-2440-44d1-8ce7-dc474f79ad1c + name: Blue + description: This is a colour. + - id: 46fff1c9-668b-461a-9344-e7a8cbbbf931 + name: Red + description: This is a colour. + get_child_product_response: + value: + data: + type: product + id: 4d32b816-4397-4a71-b875-4e4ea3ce6745 + attributes: + commodity_type: physical + name: Jeans + sku: jeansRed + slug: jeansRed + status: live + relationships: + base_product: + data: + type: product + id: 571e366f-17e6-4e51-8239-b3cc8ee1144d + children: + data: [] + component_products: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/component_products + files: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/templates + variations: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/variations + meta: + created_at: '2024-01-05T10:29:44.603Z' + owner: store + product_types: + - child + updated_at: '2024-01-05T10:29:45.155Z' + variation_matrix: {} + get_component_product_response: + value: + data: + type: product + id: 4ca7de77-994d-4e7c-b834-4cb2ae156f57 + attributes: + commodity_type: physical + components: + Apples: + name: Apples + options: + - id: f809fe4f-83f7-4db4-8175-e467a0d1974a + type: product + quantity: 12 + Oranges: + name: Oranges + options: + - id: 7f8f596a-2dc0-4e78-ba0d-3810eac6f86a + type: product + quantity: 12 + description: fruit + name: fruit Bundle + slug: 45-b + status: live + relationships: + children: + data: [] + links: + self: /products/4ca7de77-994d-4e7c-b834-4cb2ae156f57/children + component_products: + data: [] + links: + self: /products/4ca7de77-994d-4e7c-b834-4cb2ae156f57/relationships/component_products + files: + data: [] + links: + self: /products/4ca7de77-994d-4e7c-b834-4cb2ae156f57/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/4ca7de77-994d-4e7c-b834-4cb2ae156f57/relationships/templates + variations: + data: [] + links: + self: /products/4ca7de77-994d-4e7c-b834-4cb2ae156f57/relationships/variations + meta: + created_at: '2022-02-01T12:51:51.132Z' + owner: store + product_types: + - bundle + updated_at: '2022-02-01T12:51:51.132Z' + variation_matrix: {} + included: + component_products: + - type: product + id: f809fe4f-83f7-4db4-8175-e467a0d1974a + attributes: + commodity_type: physical + description: fruit + name: Apples + sku: '45' + status: live + relationships: + children: + data: [] + links: + self: /products/f809fe4f-83f7-4db4-8175-e467a0d1974a/children + component_products: + data: [] + links: + self: /products/f809fe4f-83f7-4db4-8175-e467a0d1974a/relationships/component_products + files: + data: [] + links: + self: /products/f809fe4f-83f7-4db4-8175-e467a0d1974a/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/f809fe4f-83f7-4db4-8175-e467a0d1974a/relationships/templates + variations: + data: [] + links: + self: /products/f809fe4f-83f7-4db4-8175-e467a0d1974a/relationships/variations + meta: + created_at: '2022-02-01T12:50:33.347Z' + owner: store + product_types: + - standard + updated_at: '2022-02-01T12:50:33.347Z' + variation_matrix: {} + - type: product + id: 7f8f596a-2dc0-4e78-ba0d-3810eac6f86a + attributes: + commodity_type: physical + description: fruit + name: Oranges + sku: '46' + status: live + relationships: + children: + data: [] + links: + self: /products/7f8f596a-2dc0-4e78-ba0d-3810eac6f86a/children + component_products: + data: [] + links: + self: /products/7f8f596a-2dc0-4e78-ba0d-3810eac6f86a/relationships/component_products + files: + data: [] + links: + self: /products/7f8f596a-2dc0-4e78-ba0d-3810eac6f86a/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/7f8f596a-2dc0-4e78-ba0d-3810eac6f86a/relationships/templates + variations: + data: [] + links: + self: /products/7f8f596a-2dc0-4e78-ba0d-3810eac6f86a/relationships/variations + meta: + created_at: '2022-02-01T12:49:19.298Z' + owner: store + product_types: + - standard + updated_at: '2022-02-01T12:49:19.298Z' + variation_matrix: {} + update_product_request: + value: + data: + type: product + id: 60afe403-a191-455e-b771-c510c928a308 + attributes: + name: UPDATED BestEver Range, Model 1a1a + update_build_rules_request: + value: + data: + type: product + id: 9214719b-17fe-4ea7-896c-d61e60fc0d05 + attributes: + build_rules: + default: include + exclude: + - - cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + - 0b261f7d-753d-4af6-b9f4-62b436cca37d + - 994c2029-519c-43d9-9c54-14f3af4e3efd + update_custom_inputs_request: + value: + data: + type: product + id: 9214719b-17fe-4ea7-896c-d61e60fc0d05 + attributes: + custom_inputs: + front: + name: T-Shirt Front + validation_rules: + - type: string + options: + max_length: 50 + required: false + back: + name: T-Shirt Back + validation_rules: + - type: string + options: + max_length: 50 + required: false + update_bundle_request: + value: + data: + id: 8a0072c0-cedf-4e53-bdc4-a14a5d6389d5 + type: product + attributes: + name: Favourite games bundle + description: Favourite DOOM games in one bundle - Select one from four choices + sku: fav23455 + mpn: 1234-5678-ABCD00 + upc_ean: '123456' + commodity_type: digital + status: live + components: + List 1: + name: PS5 + sort_order: 1 + options: + - id: c7cf43f3-24c6-4523-8a24-3663b49b81aa + type: product + quantity: 1 + default: true + List 2: + name: Controller + sort_order: 2 + options: + - id: e59ca559-37c7-4dc9-8a91-df94cd5700d3 + type: product + quantity: 1 + default: true + List 3: + name: PS+ + sort_order: 3 + options: + - id: 8ae2a7ea-f767-4af0-8486-ae203947ecc4 + type: product + quantity: 1 + default: true + List 4: + min: 1 + max: 1 + sort_order: 4 + options: + - id: 549a291f-669c-47d0-bc04-60a3f18fc55c + type: product + quantity: 1 + default: true + sort_order: 2 + - id: 071e461c-22a2-42e0-9604-c345bbc9b85c + type: product + quantity: 1 + default: false + sort_order: 1 + - id: 633b8172-8aa9-4dbd-aa07-0dcefca3de74 + type: product + quantity: 1 + default: false + - id: 549a291f-669c-47d0-bc04-60a3f18fc55c + type: product + quantity: 1 + default: false + sort_order: 3 + update_single_product_response: + value: + data: + type: product + id: 60afe403-a191-455e-b771-c510c928a308 + attributes: + commodity_type: physical + description: The 30 inch version of this popular electric range. + mpn: BE-R-1111-aaaa-1a1a-30 + name: UPDATED BestEver Range 30 inch, Model 1a1a-30 + sku: BE-Range-1a1a-30 + slug: bestever-range-1a1a-30 + status: draft + upc_ean: '111130303030' + locales: + fr-FR: + name: MISE À JOUR de la gamme BestEver 30 pouces, modèle 1a1a-30 + description: La version 30 pouces de cette cuisinière électrique populaire + tags: + - tag1 + - tag2 + relationships: + files: + data: [] + links: + self: /products/60afe403-a191-455e-b771-c510c928a308/relationships/files + templates: + data: [] + links: + self: /products/60afe403-a191-455e-b771-c510c928a308/relationships/templates + meta: + created_at: '2023-09-28T10:43:41.72Z' + owner: organization + product_types: + - standard + updated_at: '2023-09-28T10:43:41.72Z' + update_build_rules_response: + value: + data: + type: product + id: 9214719b-17fe-4ea7-896c-d61e60fc0d05 + attributes: + build_rules: + default: include + exclude: + - - cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + - 0b261f7d-753d-4af6-b9f4-62b436cca37d + - 994c2029-519c-43d9-9c54-14f3af4e3efd + commodity_type: physical + description: T-shirt. + locales: + fr-FR: + name: Shirt + description: T-Shirt. + mpn: 1234-5678-SSSS + name: Shirt + sku: '978055216732567' + slug: '978055216732567' + status: live + upc_ean: '135623456' + relationships: + children: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/children + component_products: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/component_products + files: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/templates + variations: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/variations + meta: + created_at: '2022-08-18T12:14:52.782Z' + owner: store + product_types: + - standard + updated_at: '2022-08-18T12:40:13.484Z' + variation_matrix: {} + variations: + - id: 6c4b5caa-3819-4366-a14e-c5b85009544b + name: Shirt Size + options: + - id: cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + name: Small + description: Size Small + - id: da9d88d0-8ea6-434c-a0dd-059caf595687 + name: Medium + description: Size Medium + - id: 07493fea-74b0-40a2-972a-cd7e1d6561bd + name: Large + description: Size Large + - id: b1ae545e-3375-455f-b5ea-09669b60996f + name: Shirt Material + options: + - id: 994c2029-519c-43d9-9c54-14f3af4e3efd + name: Cotton + description: Material Cotton + - id: 7951f3d9-f628-49f8-8a43-7749d28153d6 + name: Denim + description: Material Denim + - id: 58115bff-589a-4287-98d8-373112102617 + name: Wool + description: Material Wool + - id: f192e114-9f8a-4284-99d0-4d9ccd8a0275 + name: Shirt Color + options: + - id: 0b261f7d-753d-4af6-b9f4-62b436cca37d + name: Red + description: Color Red + - id: 55d6d785-cc52-453a-bff6-2cf9add8a580 + name: Green + description: Color Green + - id: a43d8b6f-b411-49aa-adaa-36a1a025051e + name: Blue + description: Color Blue + update_custom_inputs_response: + value: + data: + type: product + id: 9214719b-17fe-4ea7-896c-d61e60fc0d05 + attributes: + commodity_type: physical + custom_inputs: + back: + name: T-Shirt Back + validation_rules: + - type: string + options: + max_length: 50 + required: false + front: + name: T-Shirt Front + validation_rules: + - type: string + options: + max_length: 50 + required: false + description: T-shirt. + locales: + fr-FR: + name: T-Shirt + description: T-Shirt. + mpn: 1234-5678-SSSS + name: Shirt + sku: '978055216732567' + slug: '978055216732567' + status: live + relationships: + children: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/children + component_products: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/component_products + files: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/templates + variations: + data: [] + links: + self: /products/9214719b-17fe-4ea7-896c-d61e60fc0d05/relationships/variations + meta: + created_at: '2022-08-18T12:14:52.782Z' + updated_at: '2022-08-19T12:28:26.343Z' + variation_matrix: {} + variations: + - id: 6c4b5caa-3819-4366-a14e-c5b85009544b + name: Shirt Size + options: + - id: cbde9096-e0e1-43d8-a1aa-cb66cf1d299f + name: Small + description: Size Small + - id: da9d88d0-8ea6-434c-a0dd-059caf595687 + name: Medium + description: Size Meduim + - id: 07493fea-74b0-40a2-972a-cd7e1d6561bd + name: Large + description: Size Large + - id: b1ae545e-3375-455f-b5ea-09669b60996f + name: Shirt Material + options: + - id: 994c2029-519c-43d9-9c54-14f3af4e3efd + name: Cotton + description: Material Cotton + - id: 7951f3d9-f628-49f8-8a43-7749d28153d6 + name: Denim + description: Material Denim + - id: 58115bff-589a-4287-98d8-373112102617 + name: Wool + description: Material Wool + - id: f192e114-9f8a-4284-99d0-4d9ccd8a0275 + name: Shirt Color + options: + - id: 0b261f7d-753d-4af6-b9f4-62b436cca37d + name: Red + description: Color Red + - id: 55d6d785-cc52-453a-bff6-2cf9add8a580 + name: Green + description: Color Green + - id: a43d8b6f-b411-49aa-adaa-36a1a025051e + name: Blue + description: Color Blue + update_bundle_response: + value: + data: + type: product + id: 8a0072c0-cedf-4e53-bdc4-a14a5d6389d5 + attributes: + commodity_type: digital + components: + List 1: + name: PS5 + options: + - id: c7cf43f3-24c6-4523-8a24-3663b49b81aa + type: product + quantity: 1 + default: true + sort_order: 1 + List 2: + name: Controller + options: + - id: e59ca559-37c7-4dc9-8a91-df94cd5700d3 + type: product + quantity: 1 + default: true + sort_order: 2 + List 3: + name: PS+ + options: + - id: 8ae2a7ea-f767-4af0-8486-ae203947ecc4 + type: product + quantity: 1 + default: true + sort_order: 3 + List 4: + options: + - id: 549a291f-669c-47d0-bc04-60a3f18fc55c + type: product + quantity: 1 + default: true + - id: 071e461c-22a2-42e0-9604-c345bbc9b85c + type: product + quantity: 1 + default: false + - id: 633b8172-8aa9-4dbd-aa07-0dcefca3de74 + type: product + quantity: 1 + default: false + - id: 549a291f-669c-47d0-bc04-60a3f18fc55c + type: product + quantity: 1 + default: false + min: 1 + max: 1 + sort_order: 4 + headsets: + name: Headsets + options: + - id: 8ae2a7ea-f767-4af0-8486-ae203947ecc4 + type: product + quantity: 5 + default: true + description: Favourite DOOM games in one bundle - Select one from four choices + mpn: 1234-5678-ABCD00 + name: Favourite games bundle + sku: fav23455 + slug: PGH69345-B + status: live + upc_ean: '123456' + relationships: + children: + data: [] + links: + self: /products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/children + component_products: + data: [] + links: + self: /products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/component_products + files: + data: [] + links: + self: /products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/templates + variations: + data: [] + links: + self: /products/8a0072c0-cedf-4e53-bdc4-a14a5d6389d5/relationships/variations + meta: + created_at: '2022-02-03T19:38:00.602Z' + owner: store + updated_at: '2022-02-03T19:43:21.487Z' + variation_matrix: {} + resp_multi_nodes: + value: + data: + - id: 9ea0de15-3347-43dd-8faa-cd32f44a04c7 + type: node + attributes: + description: Latest Ballet Shoes + locales: + fr-FR: + name: Chaussons de ballet + description: Dernières chaussures de ballet + name: Ballet Shoes + slug: ballet-shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/children + products: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/products + meta: + created_at: '2024-01-11T19:19:50.087Z' + owner: store + sort_order: 5 + updated_at: '2024-01-11T19:56:53.695Z' + - type: node + id: b2f5e53e-de3c-4548-98da-120f8b185d34 + attributes: + description: All Dress Shoes + locales: + fr-FR: + name: Chaussures habillées + description: Toutes les chaussures habillées + name: Dress Shoes + slug: dress-shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/b2f5e53e-de3c-4548-98da-120f8b185d34/children + products: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/b2f5e53e-de3c-4548-98da-120f8b185d34/products + meta: + created_at: '2024-01-11T19:50:21.729Z' + owner: store + sort_order: 3 + updated_at: '2024-01-11T19:50:21.729Z' + meta: + results: + total: 2 + multi_get_child_response: + value: + data: + - type: product + id: 4d32b816-4397-4a71-b875-4e4ea3ce6745 + attributes: + commodity_type: physical + name: Jeans + sku: jeansRed + slug: jeansRed + status: live + relationships: + base_product: + data: + type: product + id: 571e366f-17e6-4e51-8239-b3cc8ee1144d + children: + data: [] + component_products: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/component_products + files: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/files + main_image: + data: null + templates: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/templates + variations: + data: [] + links: + self: /products/4d32b816-4397-4a71-b875-4e4ea3ce6745/relationships/variations + meta: + created_at: '2024-01-05T10:29:44.603Z' + owner: store + product_types: + - child + updated_at: '2024-01-05T10:29:45.155Z' + variation_matrix: {} + template_response: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: template + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: template + templates_relationship_request: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: template + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: template + component_products_relationship_response: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: product + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: product + file_relationship_response: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: file + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: file + file_relationship_request: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: file + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: file + variations_response: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: product-variation + - id: 50f56ce9-9381-43f6-8a52-5369a8b42e52 + type: product-variation + product_variations_relationship_request: + value: + data: + - id: 43903bfa-5352-4a3d-9496-c9ab1229a175 + type: product-variation + multi_variations: + value: + data: + - type: product-variation + id: c1ccccba-53e4-46b5-aed8-94f32823148a + attributes: + name: Size + sort_order: 1 + meta: + options: + - id: 057a50ba-1afb-4944-9637-bd9b568a9f39 + name: Large + description: Large size + sort_order: 3 + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + - id: fa191e68-9bba-49f9-8e12-056c4e8f50e2 + name: Medium + description: Medium size + sort_order: 2 + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + - id: 112d1c5c-d149-453e-b208-89470968bacf + name: Small + description: Small size + sort_order: 1 + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + - type: product-variation + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + attributes: + name: Paint Color + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + meta: + results: + total: 2 + create_variation: + value: + data: + type: product-variation + attributes: + name: Paint Color + sort_order: 10 + created_variation: + value: + data: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: product-variation + attributes: + name: Paint Color + sort_order: 10 + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + single_variation: + value: + data: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: product-variation + attributes: + name: Paint Color + sort_order: 1 + meta: + options: + - id: 3de2c96c-2a99-4ded-bcf8-eeba32c0c5be + name: Red + description: Red color + sort_order: 2 + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + - id: 31f2d09b-8a10-447a-b3ad-3358d07f818a + name: Blue + description: Blue color + sort_order: 1 + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + update_variation: + value: + data: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + type: product-variation + attributes: + name: Paint Color + sort_order: 0 + multi_options: + value: + data: + - type: product-variation-option + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + attributes: + description: Our most popular color + name: Blue + sort_order: 0 + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + - type: product-variation-option + id: fbe73839-58a2-41b4-aca6-cb0724668c97 + attributes: + description: Our second most popular color + name: Red + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + meta: + results: + total: 2 + create_option: + value: + data: + type: product-variation-option + attributes: + name: Blue + sort_order: 0 + description: Our most popular color + created_option: + value: + data: + type: product-variation-option + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + attributes: + description: Our most popular color + name: Blue + sort_order: 0 + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + single_option: + value: + data: + type: product-variation-option + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + attributes: + description: Our most popular color + name: Blue + sort_order: 0 + meta: + owner: store + created_at: '2024-01-25T11:25:38.001Z' + updated_at: '2024-01-25T11:25:38.001Z' + update_option: + value: + data: + type: product-variation-option + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + attributes: + description: Our most popular color + name: Blue + sort_order: 0 + multi_modifiers: + value: + data: + - type: product-variation-modifier + id: 68ec4892-9e4c-4154-a9fd-f5a9fb1f6878 + attributes: + type: sku_equals + value: newSku + meta: + owner: store + - type: product-variation-modifier + id: a510cddc-e946-4c22-9541-54626a7cf0ec + attributes: + seek: '{color}' + set: red + type: slug_builder + meta: + owner: store + - type: product-variation-modifier + id: 2f0cbb06-8880-4a75-bfc6-a20f0f73a997 + attributes: + reference_name: PriceEqual + type: price + meta: + owner: store + meta: + results: + total: 3 + create_modifier: + value: + data: + type: product-variation-modifier + attributes: + seek: '{color}' + set: red + type: slug_builder + created_modifier: + value: + data: + type: product-variation-modifier + id: a510cddc-e946-4c22-9541-54626a7cf0ec + attributes: + seek: '{color}' + set: red + type: slug_builder + meta: + owner: store + single_modifier: + value: + data: + type: product-variation-modifier + id: 68ec4892-9e4c-4154-a9fd-f5a9fb1f6878 + attributes: + type: sku_equals + value: newSku + meta: + owner: store + update_modifier: + value: + data: + type: product-variation-modifier + id: 68ec4892-9e4c-4154-a9fd-f5a9fb1f6878 + attributes: + type: sku_equals + value: anotherSku + resp_multi_hierarchy: + value: + data: + - type: hierarchy + id: 6183d10c-94b5-4caa-9f12-2f14cb738d41 + attributes: + description: Shoes Category + locales: + fr-FR: + name: Chaussures + description: Catégorie de chaussures + name: Shoes + slug: shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/children + meta: + created_at: '2024-01-10T20:16:35.343Z' + owner: store + updated_at: '2024-01-10T20:30:50.867Z' + links: + last: /pcm/hierarchies?page[offset]=29&page[limit]=1 + next: /pcm/hierarchies?page[offset]=1&page[limit]=1 + meta: + results: + total: 30 + create_hierarchy: + value: + data: + type: hierarchy + attributes: + name: Shoes + description: Shoes Category + slug: shoes + locales: + fr-FR: + name: Chaussures + description: Catégorie de chaussures + hierarchy_created: + value: + data: + type: hierarchy + id: 6183d10c-94b5-4caa-9f12-2f14cb738d41 + attributes: + description: Shoes Category + locales: + fr-FR: + name: Chaussures + description: Catégorie de chaussures + name: Shoes + slug: shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/children + meta: + created_at: '2024-01-10T20:16:35.343Z' + owner: store + updated_at: '2024-01-10T20:16:35.343Z' + update_hierarchy: + value: + data: + type: hierarchy + id: 6183d10c-94b5-4caa-9f12-2f14cb738d41 + attributes: + description: Shoes Category Updated + locales: + fr-FR: + name: Chaussures mises à jour + description: Catégorie de chaussures mise à jour + name: Shoes Updated + slug: shoes + hierarchy_updated: + value: + data: + type: hierarchy + id: 6183d10c-94b5-4caa-9f12-2f14cb738d41 + attributes: + description: Shoes Category Updated + locales: + fr-FR: + name: Chaussures mises à jour + description: Catégorie de chaussures mise à jour + name: Shoes Updated + slug: shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/children + meta: + created_at: '2024-01-10T20:16:35.343Z' + owner: store + updated_at: '2024-01-10T20:30:50.867Z' + create_node: + value: + data: + type: node + attributes: + name: Ballet Shoes + description: All Ballet Shoes + slug: ballet-shoes + locales: + fr-FR: + name: Chaussons de ballet + description: Toutes les ballerines + meta: + sort_order: 2 + node_created: + value: + data: + type: node + id: 9ea0de15-3347-43dd-8faa-cd32f44a04c7 + attributes: + description: All Ballet Shoes + locales: + fr-FR: + name: Chaussons de ballet + description: Toutes les chaussures de ballet + name: Ballet Shoes + slug: ballet-shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/children + parent: + data: + type: node + id: 14e8e15a-7214-435d-bccb-6ae9b570d683 + products: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/products + meta: + created_at: '2024-01-11T19:19:50.087Z' + owner: store + parent_name: Shoes + sort_order: 2 + updated_at: '2024-01-11T19:19:50.087Z' + update_node: + value: + data: + type: node + id: 9ea0de15-3347-43dd-8faa-cd32f44a04c7 + attributes: + name: Ballet Shoes + description: Latest Ballet Shoes + slug: ballet-shoes + locales: + fr-FR: + name: Chaussons de ballet + description: Dernières chaussures de ballet + meta: + sort_order: 5 + node_updated: + value: + data: + type: node + id: 9ea0de15-3347-43dd-8faa-cd32f44a04c7 + attributes: + description: Latest Ballet Shoes + locales: + fr-FR: + name: Chaussons de ballet + description: Dernières chaussures de ballet + name: Ballet Shoes + slug: ballet-shoes + relationships: + children: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/children + products: + data: [] + links: + related: /hierarchies/6183d10c-94b5-4caa-9f12-2f14cb738d41/nodes/9ea0de15-3347-43dd-8faa-cd32f44a04c7/products + meta: + created_at: '2024-01-11T19:19:50.087Z' + owner: store + sort_order: 5 + updated_at: '2024-01-11T19:56:53.695Z' + node_children: + value: + data: + - type: node + id: b2f5e53e-de3c-4548-98da-120f8b185d34 + node_parent: + value: + data: + type: node + id: 60dc3982-ab34-47e8-9173-c920c63dc382 + node_products: + value: + data: + - type: product + id: 9c85b276-09b4-488e-a59c-c561bae14c9e + duplicate_job: + value: + data: + type: hierarchy + attributes: + name: New Shoes + description: New Shoes Category + include_products: true + duplicate_hierarchy_job_created: + value: + data: + type: pim-job + id: 1d9b101e-a40a-4e53-9f54-08a9ede65019 + attributes: + completed_at: null + created_at: '2024-01-11T22:49:10.338Z' + started_at: null + status: pending + type: hierarchy-duplicate + updated_at: '2024-01-11T22:49:10.338Z' + meta: + x_request_id: 40995a1d-c0c1-4d52-a178-bfb5399ab0ec + resp_multi_tags: + value: + data: + - type: tag + id: a88aac35-54de-40c2-bb4b-f1c57624db27 + attributes: + value: shirts + meta: + created_at: '2024-03-20T15:56:40.014Z' + owner: store + updated_at: '2024-03-20T15:56:40.014Z' + - type: tag + id: 6782e020-fefd-431e-9dea-b59d249c2c5e + attributes: + value: shoes + meta: + created_at: '2024-03-20T15:56:40.014Z' + owner: store + updated_at: '2024-03-20T15:56:40.014Z' + meta: + results: + total: 2 + resp_single_tag: + value: + data: + type: tag + id: 9879a8f5-0da2-4be6-91f6-a0f09d1c77a9 + attributes: + value: tables + meta: + created_at: '2024-03-20T18:37:43.398Z' + owner: organization + updated_at: '2024-03-20T18:37:43.398Z' + create_custom_relationship: + value: + data: + type: custom-relationship + attributes: + name: Kitchen electrics + description: Kitchen electric devices + slug: CRP_kitchen_individual_devices + custom_relationship_created: + value: + data: + type: custom-relationship + id: f3297ee8-da90-45e9-ae56-a2654aebbdfe + attributes: + name: Kitchen electrics + description: Kitchen electric devices + slug: CRP_kitchen_individual_devices + meta: + owner: store + timestamps: + created_at: '2024-01-10T20:16:35.343Z' + updated_at: '2024-01-10T20:16:35.343Z' + update_custom_relationship: + value: + data: + type: custom-relationship + id: f3297ee8-da90-45e9-ae56-a2654aebbdfe + attributes: + name: Kitchen electrics + description: Kitchen electric devices 2024 + slug: CRP_kitchen_individual_devices + custom_relationship_updated: + value: + data: + type: custom-relationship + id: f3297ee8-da90-45e9-ae56-a2654aebbdfe + attributes: + name: Kitchen electrics + description: Kitchen electric devices 2024 + slug: CRP_kitchen_individual_devices + meta: + owner: store + timestamps: + created_at: '2024-01-10T20:16:35.343Z' + updated_at: '2024-01-10T20:16:35.343Z' + responses: + bad_request: + description: Bad request. The request failed validation. + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + bad-request: + value: + errors: + - title: Bad Request + detail: Could not parse the supplied filter + status: '400' + not_found: + description: Bad Request. Not Found. + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + internal-server-error: + value: + errors: + - title: Not Found + status: '404' + unprocessable_entity: + description: Bad request. The request failed validation. + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + failed-validation: + value: + errors: + - title: Failed Validation + status: '422' + detail: can not be empty + internal: + description: Internal server error. There was a system failure in the platform. + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + internal-server-error: + value: + errors: + - status: '500' + title: Internal Server Error + detail: There was an internal server error, you can report with your request id. + request_id: 635da56d-75a1-43cd-b696-7ab119756b3a + forbidden: + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + internal-server-error: + value: + errors: + - title: Forbidden + status: '403' + detail: entity owned by organization + write_conflict: + description: Write conflict detected + content: + application/json: + schema: + $ref: '#/components/schemas/error' + examples: + internal-server-error: + value: + errors: + - title: Conflict + status: '409' + detail: write conflict detected + parameters: + job_id: + name: jobID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the job. + page_offset: + name: page[offset] + in: query + description: The number of records to offset the results by. + schema: + type: integer + minimum: 0 + maximum: 10000 + format: int64 + example: + - '0' + page_limit: + name: page[limit] + in: query + description: The number of records per page. The maximum limit is 100. + schema: + type: integer + minimum: 0 + maximum: 10000 + format: int64 + example: + - '10' + filterproduct: + name: filter + in: query + description: | + Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering). + + For more information about the attributes and operators that are supported, see [Get all products](/docs/api/pxm/products/get-all-products). + style: form + explode: true + schema: + type: string + example: + - eq(name,some-name) + - like(name,*some-name*) + - filter=in(id,some-id) + include: + name: include + in: query + description: | + Using the include parameter, you can retrieve top-level resources. + + - Files or main image. For example, `include=files,main_image`. + - Component product data. For example, `include=component_products`. + - Key attribute data, such as SKU or slug. + style: form + explode: true + schema: + type: string + example: + - component_products + useTemplateSlugs: + name: useTemplateSlugs + description: Set to `true` if you want to use a template slug instead of a template ID when exporting products that have custom data. + in: query + style: form + explode: true + schema: + type: boolean + default: false + filterexport: + name: filter + in: query + description: | + + Many Commerce API endpoints support filtering. The general syntax is described [**here**](/docs/commerce-cloud/api-overview/filtering), but you must go to a specific endpoint to understand the attributes and operators an endpoint supports. + + For more information about the attributes and operators that this endpoint supports, see [Export Products](/docs/api/pxm/products/export-products). + style: form + explode: true + schema: + type: string + example: + - eq(name,some-name) + - like(name,*some-name*) + - filter=in(id,some-id) + product_id: + name: productID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + x-postman-example: '{{productID}}' + required: true + description: A unique identifier for the product. + variation_id: + name: variationID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + x-postman-example: '{{variationID}}' + required: true + description: A unique identifier for the variation. + option_id: + name: optionID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the option. + modifier_id: + name: modifierID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the modifier. + hierarchy_id: + name: hierarchyID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the hierarchy. + node_id: + name: nodeID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the node. + tag_id: + name: tagID + in: path + schema: + type: string + example: 00000000-0000-0000-0000-000000000000 + required: true + description: A unique identifier for the tag. + custom_relationship_slug: + name: customRelationshipSlug + in: path + schema: + type: string + example: CRP_electric_devices_2024 + required: true + description: A custom relationship slug. diff --git a/packages/sdks/specs/plugins/decorators/component-merge.js b/packages/sdks/specs/plugins/decorators/component-merge.js new file mode 100644 index 00000000..615301cf --- /dev/null +++ b/packages/sdks/specs/plugins/decorators/component-merge.js @@ -0,0 +1,51 @@ +// import { readFileAsStringSync } from "../../utils" +const resolve1 = require("@redocly/openapi-core/lib/resolve") +const fs = require("fs") +const _ = require("lodash") + +const ComponentMerge = (props) => { + const { mergeRef } = props + return { + Root: { + leave(root, { report, location }) { + try { + const externalResolver = new resolve1.BaseResolver() + + if (fs.lstatSync(mergeRef).isDirectory()) { + throw new Error( + `Expected a file but received a folder at ${mergeRef}`, + ) + } + + const content = fs.readFileSync(mergeRef, "utf-8") + // In some cases file have \r\n line delimeters like on windows, we should skip it. + const source = new resolve1.Source( + mergeRef, + content.replace(/\r\n/g, "\n"), + ) + + const document = externalResolver.parseDocument(source, false) + + const updated = _.merge(root, document.parsed) + + updateObjectProperties(root, updated) + } catch (e) { + report({ + message: `Failed to merge component.`, + location: location.key(), + }) + } + }, + }, + } +} + +function updateObjectProperties(obj, newValues) { + for (let key in obj) { + if (obj.hasOwnProperty(key) && newValues.hasOwnProperty(key)) { + obj[key] = newValues[key] + } + } +} + +module.exports = ComponentMerge diff --git a/packages/sdks/specs/plugins/decorators/operation-property-override.js b/packages/sdks/specs/plugins/decorators/operation-property-override.js new file mode 100644 index 00000000..7f3b7f81 --- /dev/null +++ b/packages/sdks/specs/plugins/decorators/operation-property-override.js @@ -0,0 +1,58 @@ +const resolve1 = require("@redocly/openapi-core/lib/resolve") +const fs = require("fs") +const _ = require("lodash") + +const OperationPropertyOverride = (props) => { + const { operationIds } = props + return { + Operation: { + leave(operation, { report, location }) { + if (!operation.operationId) return + if (!operationIds) + throw new Error( + `Parameter "operationIds" is not provided for "operation-property-override" rule`, + ) + const operationId = operation.operationId + const operationFileRef = operationIds[operationId] + if (operationFileRef) { + try { + const externalResolver = new resolve1.BaseResolver() + + if (fs.lstatSync(operationFileRef).isDirectory()) { + throw new Error( + `Expected a file but received a folder at ${operationFileRef}`, + ) + } + + const content = fs.readFileSync(operationFileRef, "utf-8") + // In some cases file have \r\n line delimeters like on windows, we should skip it. + const source = new resolve1.Source( + operationFileRef, + content.replace(/\r\n/g, "\n"), + ) + + const document = externalResolver.parseDocument(source, false) + + const mergedValues = _.merge(operation, document.parsed) + updateObjectProperties(operation, mergedValues) + } catch (e) { + report({ + message: `Failed to read markdown override file for operation "${operationId}".\n${e.message}`, + location: location.child("operationId").key(), + }) + } + } + }, + }, + } +} + +function updateObjectProperties(obj, newValues) { + for (let key in obj) { + if (obj.hasOwnProperty(key) && newValues.hasOwnProperty(key)) { + obj[key] = newValues[key] + } + } +} + +module.exports = OperationPropertyOverride diff --git a/packages/sdks/specs/plugins/override.js b/packages/sdks/specs/plugins/override.js new file mode 100644 index 00000000..70199727 --- /dev/null +++ b/packages/sdks/specs/plugins/override.js @@ -0,0 +1,16 @@ +const OperationPropertyOverride = require("./decorators/operation-property-override.js") +const ComponentMerge = require("./decorators/component-merge.js") + +function overridePlugin() { + return { + id: "override", + decorators: { + oas3: { + "operation-property-override": OperationPropertyOverride, + "component-merge": ComponentMerge, + }, + }, + } +} + +module.exports = overridePlugin diff --git a/packages/sdks/specs/shopper.yaml b/packages/sdks/specs/shopper.yaml new file mode 100644 index 00000000..43bb3ed9 --- /dev/null +++ b/packages/sdks/specs/shopper.yaml @@ -0,0 +1,12991 @@ +openapi: 3.1.0 +info: + title: Catalogs Introduction + description: > + Use the catalog-view Service API to create your catalogs. + + You also have the flexibility to create catalogs for different scenarios by + combining hierarchies of products with a price book. Scenarios might + include: + + + - Multiple geographical regions. Display different catalogs in different + regions with suitable pricing or combine product hierarchies from two + different regions to display in a third region. + + - Multiple channels. Display different catalogs based on how a shopper + accesses your store, such as through a mobile app or a web storefront. + + - Direct to business versus direct to customers. Offer different products + and prices for business customers versus retail customers. + + - Preferred customers. Offer special pricing to preferred customers while + displaying a standard price catalog to all other shoppers. + + - Reward programs. Enable reward programs where catalog prices drop after a + certain spending level is reached. + + - Product sales. Offer sale items for a limited time. + + Scenarios are created by defining the context within which a catalog is + displays. Contexts can be a customer ID, a channel, or any other + user-defined tag that can be passed to the APIs from the front-end shopper + experiences. + version: 1.0.0 +servers: + - url: https://euwest.api.elasticpath.com + description: EU West Production Server + - url: https://useast.api.elasticpath.com + description: US East Production Server +tags: + - name: Catalogs + description: > + A catalog contains the products available for sale either in your + organization or store. A catalog also contains information about how to + organize those products for navigation menus and search facets in a + shopper experience. + + + Before you create a catalog you must define the following resources: + + + - Hierarchies: hierarchies and nodes to categorize the products. See + [**Hierarchies**](/docs/api/pxm/products/hierarchies). + + - Products: product information, associated assets, and links to hierarchy + nodes. See [**Products**](/docs/api/pxm/products/products). + + - Price Books: prices for the products associated with the hierarchies. + See [**Price Books**](/docs/api/pxm/pricebooks). + + + A catalog is a combination of hierarchies and a price book. + + ### Products + + Commerce automatically assigns types to the products you create. Product + types can be used in catalogs. For example, in your catalog, you can + filter on `parent` so that only your parent products are displayed in your + storefront. + + You can use product tags to store or assign a key word against a product + or service that you sell in your store. The product tag can then be used + to describe or label that product. Product tags represent similarities + between products who do not share the same attributes. Using product tags + means that you can group your products together, for example, by brand, + category, subcategory, colors, types, industries, and so on. Product tags + can be used in catalogs. For example, you can categorize your products + based on color. Your shoppers can then search your products by color, + enabling shoppers to quickly find what they are looking for, increasing + the likelihood of a purchase, and boosting conversion rates. + + ### Hierarchies + + The hierarchies determine which products appear in the catalog, that is, + only the products that are associated with the selected hierarchies are + included in the catalog. You can also specify the order you want your + hierarchies to display in a published catalog. You can order your + hierarchies on a catalog-by-catalog basis. + + ![Hierarchy_sorting](/assets/hierarchy_sorting.png) + + For more information, see [**create a + Catalog**](/docs/api/pxm/catalog/create-catalog). + + #### Understanding How Products And Nodes Are Associated + + You can use `breadcrumb` metadata to understand how products and nodes are + associated. it explains how products are associated with parent nodes and + the relationship among the array of nodes. This is useful if you want to + improve how your shoppers search within your store. + + The `breadcrumb` information that you get in an endpoint response depends + on whether the endpoint is retrieving product or node details. + + | Object | Product/Node | Description | + + | --- | --- | --- | + + | `breadcrumb` | Node | A list of nodes that a product is associated with. + Up to 10 levels of nodes are displayed, depending on the number of levels + of nodes you have. | + + | `bread_crumbs` | Product | The relationship among the array of nodes a + product is associated with, demonstrating the linking of the children + nodes with the parent nodes. Up to 10 levels of nodes are displayed, + depending on the number of levels of nodes you have. | + + | `bread_crumb_nodes` | Product | An array of parent node IDs that a + product is associated with. The `bread_crumb_node` metadata lists up to 10 + levels of parent nodes, depending on the number of levels of parent nodes + you have. | + + #### Understanding `bread_crumbs` Metadata + + The following diagram illustrates a parent and child nodes. + + ![Breadcrumbs](/assets/breadcrumbs.PNG) + + 1. The product is in **Node 2**. The ID for **Node 2** is shown first in + the first set of breadcrumbs. + + 1. **Node 2** is part of **Hierarchy 1**. The ID for **Hierarchy 1** is + shown second. + + 1. **Node 1** is the parent node of **Node 2**. The ID for **Node 1** is + shown last. + + 1. The product is also in **Node 3**. The ID for **Node 3** is shown first + in the second set of breadcrumbs. + + 1. **Node 3** is in the root of **Hierarchy 1**. The ID for **Hierarchy + 1** is shown last. + + In the `bread_crumb_nodes` metadata, you can see a list of parent nodes a + product is associated with. + + If you subsequently add a product to a new node, then the + `bread_crumb_nodes` metadata appends the new node to the top of the list. + Using the example above, if we add the product to **Node 1**: + + 1. The `bread_crumb_nodes` metadata is generated to show the new node + appended to the top of the list. + + 1. The `bread_crumbs` metadata is updated with the new node. + + #### Understanding Breadcrumb Metadata for Child Products + + When a catalog is published, the breadcrumb information for a child + product includes the metadata mentioned for the parent product, in + addition to the information specific to the child product. For example, + **Product A** is the parent product, associated with **Node 1** and **Node + 2**. The metadata for child **Product B** includes **Node 1** and **Node + 2**, in addition to its own metadata information. + + ### Nodes + + The nodes determine which products appear under this in the catalog, that + is, only the products that are associated with the selected node are shown + under this node. + + ### Price books + + + A price book contains the prices for each of the products in the catalog. + You can create multiple price books for different scenarios, such as + seasonal sales, business versus retail customer pricing, and reward + programs. When creating a catalog, you can specify up to five price books. + You must set a priority for your price books. Product prices are displayed + in the catalog according to the priority of the price books. See [Create a + catalog](/docs/api/pxm/catalog/create-catalog). + x-displayName: Catalogs + - name: Releases + description: > + When a catalog is published, a catalog release is created. A catalog + release provides a snapshot of the product information taken at the time + of publication. You can have one or more catalog releases available in + your organization or in your store. If you publish a catalog for your + organization, the catalog is available when the store is launched. + + + If you have more than one catalog published for your store, use catalog + rules to specify when to display each catalog. For example, you can use + [**catalog rules**](/docs/api/pxm/catalog/rules) to schedule a catalog to + appear during a particular date and time, such as a seasonal catalog. The + catalog may have different pricing than the other catalogs. + + + When a catalog is ready to be used in a store, you publish it. You can + create and publish catalogs for different contexts and channels. + + + Here are some pointers to understand a catalogs' lifecycle. + + + - The default catalog is always the oldest published catalog and must have + have at least one release. + + - At any time, the most recent three catalog releases are maintained. + Hence, if there is a fourth catalog release, the first catalog release is + automatically removed. + + - Until the catalog is published again, the previously created three + catalog releases stay permanently. + + - If you want any other catalog to become the default catalog, you must + create a catalog rule. + + - If you want the oldest published catalog to become the default catalog, + you must remove the catalog rule. + + - Use the `sort_order` value in the `variations` to program your + storefront to display the variation options in the order that you want. + + + Here is a diagram that describes a catalogs' lifecycle: + + + ![Catalogs' Lifecycle](/assets/catalog-lifecycle.png) + + ### Publishing catalogs + + When you publish a catalog, the `live` products in the hierarchies appear + in a catalog release. A catalog release provides a snapshot of product + information taken at the time of publication. You can have one or more + catalog releases available in your organization or in your store. If you + publish a catalog for your organization, the catalog is available when the + store is launched. + + If you have more than one catalog published for your store, use catalog + rules to specify when to display each catalog. For example, you can use + [catalog rules](/docs/api/pxm/catalog/rules) to schedule a catalog to + appear during a particular date and time, such as a seasonal catalog. The + catalog may have different pricing than the other catalogs. You can have + multiple published catalogs. + + When a catalog is ready to be used in a store, you publish it. You can + create and publish catalogs for different contexts and channels. You can + see the differences between the last two consecutive catalog releases. See + [Publish a catalog](/docs/api/pxm/catalog/publish-release). + + You retrieve catalogs for your shopper experience by using the [Catalog + View API](/docs/api/pxm/catalog/releases). + x-displayName: Releases + - name: Rules + description: > + If your store requires multiple catalogs, add catalog rules to control + when a catalog is displayed. A catalog rule contains a catalog plus the + criteria under which to display the catalog. + + + :::caution + + + You cannot create catalog rules for organization catalogs. + + + ::: + + + You can use catalog rules to schedule a catalog to appear during a + particular period, such as on a specific date or during summer. The + catalog might offer different pricing during this period. The pricing + depends on the associated price book. + + + The following scenarios provides a few examples for using catalog rules. + + + - **Multiple geographical regions**. Display different catalogs in + different regions with suitable pricing or combine product hierarchies + from two different regions to display in a third region. + + - **Multiple channels**. Display different catalogs based on how a shopper + accesses your store, such as through a mobile app or a web storefront. + + - **Direct to business versus direct to customers**. Offer different + products and prices for business customers versus retail customers. + + - **Preferred accounts**. Offer special pricing to a group of users while + displaying a standard price catalog to other users. + + - **Preferred customers**. Offer special pricing to preferred customers + while displaying a standard price catalog to all other shoppers. + + - **Reward programs**. Enable reward programs where catalog prices drop + after a certain spending level is reached. + + - **Product sales**. Offer sale items for a limited time. + + - **Standard pricing**. Display a default catalog to the shoppers who do + not meet the criteria of the other catalog rules. + + + You can define a catalog rule with any of the following criteria. + + + - **Accounts**. List the accounts that should see a catalog. When a user + has logged in with the account, they see the configured catalog. + + - **Customers**. List the customers that should see a catalog. When the + customer is logged in, they see the configured catalog. + + - **Channel**. Specify a shopper experience, such as web storefront or + mobile app. Set up the channel to retrieve the catalog from the catalog + rule that matches that channel. + + - **Other tags**. Create your own user-defined tags. For example, you + might want to tag by regions or you might want to distinguish between + business and consumer customers. + + + If a catalog rule has no criteria defined, it is the default catalog rule. + + + ### Resolving catalog rules + + + When there is a request for a catalog, the store displays the catalog with + the rule that matches the most attributes of the shoppers context. + + + The request triggers the following steps: + + + 1. Compares the shoppers context against the defined catalog rules. + + 1. Determines the best match. + + 1. Retrieves the catalog associated with the matching catalog rule. + + + The follow examples show how the best match might be resolved: + + + - A shopper matches one of the `customer_ids` in one catalog rule only. + The catalog for that catalog rule is displayed. + + - A shopper matches one of the `customer_ids` in one catalog rule only, + but doesnʼt match any of the `tags` specified in that catalog rule. + Because there are no other catalog rules for this `customer_id`, the + catalog for the catalog rule is displayed because it is the best match. + + - A shopper is browsing a store using the stores mobile app, which matches + `channel=mobile` in two catalog rules. The catalog displayed depends on + matches with the `tags` or `customer_ids` attributes. If there is no other + matching attribute, the first catalog rule found by the store is used. The + best practice is to create catalog rules that cover all cases so that you + avoid this situation. + + - An unknown shopper is browsing the only channel offered by the seller. + The store displays the base catalog. + x-displayName: Rules + - name: Administrator Latest Releases Catalog API + description: > + Use the Administrator Latest Releases Catalog View API to retrieve + product, hierarchy and node information. + + + :::danger + + + The Administrator Latest Releases Catalog View API is for Administrator + use only. Do not use these endpoints on your customer-facing frontends. + + + ::: + + + Publishing a catalog creates a release of that catalog that you can use in + an organization or in a specific store or other shopper experience. You + can retrieve the hierarchies, nodes, and the `live` products associated + with a catalog release. You can see which parent nodes a product is + associated with. This is useful if want to improve how your shoppers + search your store, for example. + + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + x-displayName: Administrator Latest Releases Catalog API + - name: Shopper Catalog API + description: > + Use the Shopper Catalog View API to retrieve hierarchy, node and product + information for a catalog release. When you publish a catalog for a store, + you can define catalog rules so that you can show catalogs with different + pricing or different products to preferred customers or channels. These + endpoints can be used in your customer-facing frontends. + + + A catalog is a combination of one or more hierarchies, products, and a + price book. Use the Products API and Hierarchies API to create a hierarchy + of products that can be included in a catalog. Use the Price Book API to + associate prices with products. + + + ### Characteristics of Shopper Catalogs + + + Shopper catalogs can have the following characteristics. + + + - Use catalog rules to schedule a catalog to appear during a particular + date and time, such as a seasonal catalog. The catalog may have different + pricing than the other catalogs. You can have multiple published catalogs. + + - If you have defined catalog rules and you want to retrieve a published + catalog for a particular channel or a user-defined tag, you must set the + appropriate headers in the request: + - `EP-Channel` - The channel, such as website or mobile app. See [**Create a Catalog Rule**](/docs/api/pxm/catalog/create-rule). + - `EP-Context-Tag` - A tag defined in the store, such as `clearance`. See [**Create a Catalog Rule**](/docs/api/pxm/catalog/create-rule). + * When a catalog is ready to be used in a store, you publish it. See + [**Publish a Catalog**](/docs/api/pxm/catalog/publish-release). + + * You can create and publish catalogs for different contexts and channels. + You can see the differences between the last 2 consecutive catalog + releases. See [**Publish a + Catalog**](/docs/api/pxm/catalog/publish-release). + + * You retrieve catalogs for your shopper experience by using the Shopper + Catalog View API. For more information on how you can retrieve a catalog + as a shopper using the Catalog API. + + * When a catalog is published for a store, the corresponding events + contain `store_id` and `org_id`. + + * When a catalog is published for an organization, the corresponding + events contain `org_id`. + + * Use the `sort_order` value in `variations` to program your storefront to + display the variation options in the order that you want. + + + ### Shopper Catalog Caching + + + When conducting a `GET` on `catalog` endpoints, all data returned, + including catalog releases, products, nodes and hierarchies, are cached + for 5 minutes. This means, if you call the same endpoint again, the + catalog data is retrieved from the cached objects pool, optimizing the + performance and efficiency of your store front. + + + If you use any of the `catalog` endpoints with a `filter` or `include` + query parameter, these are cached separately. + + + The cached entries disappear from the cached objects pool after 5 minutes. + x-displayName: Shopper Catalog API + - name: Cart Management + description: > + A Cart contains the product and custom cart items that a user intends to + purchase. After a Cart is ready for Checkout, you can use the [Checkout + endpoint](/docs/api/carts/checkout) to convert the cart to an order. + + + :::note + + + - Adding, modifying, or removing any cart items, custom items, or + promotions always returns the cart meta, calculated using the calculation + method. This is useful to update the client with up-to-date totals. + + - We will automatically delete carts 7 days after they were last updated. + + - If you do not pass a `X-MOLTIN-CURRENCY` header specifying what currency + you would like the cart to use, the products in the cart are converted to + your default currency. + + + ::: + x-displayName: Cart Management + - name: Account Cart Associations + description: > + You can create associations between an account and one or more carts. + After cart associations exist for a account, those carts are accessible + across any device. You can delete associations as required. + + + There are two ways to access the cart: with an [Account Management + Authentication Tokens](/docs/api/accounts/post-v-2-account-members-tokens) + and without one. + + + ### With an `Account Management Authentication` token + + + These endpoints are for users who authenticated implicitly and require a + Account Management Authentication token in the header to access the + account cart associations APIs. For more information, see the [Account + Token](/docs/api/accounts/post-v-2-account-members-tokens) documentation. + + + #### Cart creation + + + Shoppers create carts and can use any of the carts that they created to + check out an order. + + + :::note + + + You can create a cart id, name, and description for the cart. The cart + requires a name. Ensure that the string length is greater than or equal to + one. Use any symbol in the name and description. For cart id, ensure that + you follow the guidelines for safe characters. For more information about + cart id naming requirements, see [Safe + Characters](/guides/Getting-Started/safe-characters). + + + ::: + + + ### Without an `Account Management Authentication` token + + + These endpoints are for users who use the Client Credentials Token and do + not require an account management authentication token in the header to + access the account cart associations APIs. For more information, see the + [Authentication](/docs/authentication/security) documentation. + + + This user acts as a system administrator and can call any account cart + association operations for any account and cart. + + + ### Error Codes + + + You might encounter the following response codes, depending on the + scenario: + + + * `400` - `The type does not exist or is not listed as account` - Ensure + that the type is `account` and is present. + + + * `403` - `Cannot associate more than one account`. + + + * `403` - `Account does not have the required permissions to fulfill this + request`. + + + * `403` - `Invalid json payload` - Check JSON input. The request body must + be an array `[]`. If the request body is an object, the error is + generated. + x-displayName: Account Cart Associations + - name: Customer Cart Associations + description: > + You can create associations between a customer and one or more carts. + After cart associations exist for a customer, those carts are accessible + across any device. You can delete associations as required. + + + There are two ways to access the cart: with a customer token and without + one. + + + ### With a `customer` token + + + These endpoints are for users who authenticated implicitly and require a + customer token in the header to access the customer cart associations + APIs. For more information, see the [Customer + Token](/docs/customer-management/customer-management-api/customer-tokens) + documentation. + + + #### Cart creation + + + Shoppers create carts and can use any of the carts that they created to + check out an order. + + + :::note + + + You can create a cart id, name, and description for the cart. The cart + requires a name. Ensure that the string length is greater than or equal to + one. Use any symbol in the name and description. For cart id, ensure that + you follow the guidelines for safe characters. For more information about + cart id naming requirements, see [Safe + Characters](/guides/Getting-Started/safe-characters). + + + ::: + + + ### Without a `customer` token + + + These endpoints are for users who use the Client Credentials Token and do + not require a Customer token in the header to access the customer cart + associations APIs. For more information, see the + [Authentication](/docs/authentication/security) documentation. + + + This user acts as a system administrator and can call any customer cart + association operations for any customer and cart. + + + ### Error Codes + + + You might encounter the following response codes, depending on the + scenario: + + + * `400` - `The type does not exist or is not listed as customer` - Ensure + that the type is `customer` and is present. + + + * `403` - `Cannot associate more than one customer`. + + + * `403` - `Customer does not have the required permissions to fulfill this + request`. + + + * `403` - `Invalid json payload` - Check JSON input. The request body must + be an array `[]`. If the request body is an object, the error is + generated. + x-displayName: Customer Cart Associations + - name: Cart Items + description: Products added to a cart are referred to as a `cart_item`. + x-displayName: Cart Items + - name: Checkout + description: > + + The checkout workflow ties together many of the key concepts covered in + this section. When a customer initiates the checkout process, an order is + created from the cart. The order is incomplete until after a successful + payment is made. A complete order can be shipped and the product deducted + from inventory counts. + + + ![Checkout workflow](/assets/checkout-flow.png) + + + ### Summary of the checkout workflow + + + 1. Add a product to a cart. A cart and its reference number is generated. + + 2. Manage the cart items. For example, you might add items, remove items, + and change quantities. + + 3. Check out the cart. An incomplete order is created. + + 4. Pay for an order: provide billing and shipping details, if you are a + new customer. The order is now in the processing status. + + 5. If using a manual gateway, after you authorize and capture it, + Composable Commerce considers the order complete. If you use a third-party + integration supported by Composable Commerce (such as Stripe), after the + third-party gateway authorizes and captures the payment, the order becomes + complete. Usually capture does not occur at the same time as + authorization. For more information, see the Capture section. + + 6. After the order is shipped, you can manually flag it as fulfilled. + + + ### Carts + + + When a product is added to a cart, a cart is generated together with its + unique reference ID that on checkout becomes a part of the order ID. If + you are using our JavaScript software development kit, generating a cart + reference ID is done for you; otherwise, add a cart reference generator to + your functionality. + + + ### Promotions and custom items + + + Optionally, apply a promotion code on a cart, or add custom_items to + modify the product price (typically to handle taxes, customs, or + shipping). + + + ### Checkout + + + You can checkout a cart with an associated customer name and email + (customer object). Typically, this would be used for new customers or ones + that prefer to shop as guests. Use the customer.id checkout option to + checkout for an existing customer. After a successful checkout is + completed, the response contains an order. + + + Email addresses that either begin or end with a period, or contain + consecutive periods, are considered invalid, resulting in the following + error: + + ```json + + "errors": [ + { + "status": 400, + "source": "data.customer.email", + "title": "format", + "detail": "Does not match format 'email" + } + ] + ``` + + ### Payments + + + On checkout, an incomplete order is created. You can then use a + third-party integration to handle your payment gateway. If the payment + gateway is supported by Composable Commerce, such as Stripe, the payment + is processed externally but handled internally. When a successful + validation is returned, Composable Commerce flags the order as complete. + + + If you are using a payment method not officially supported by Composable + Commerce, the gateway needs to be implemented and handled manually. After + the payment has been authorized and captured either through Commerce + Manager or API, the status of an order becomes complete. + + + ### Shipping + + + The status of an order and the status of shipping are handled separately, + and so an order can be complete but not shipped. Orders that have not been + shipped yet have a status of unfulfilled. This flag is generated + automatically by Composable Commerce when an order is created. Currently, + you can only update the shipping status manually, through the API. After + the order is shipped, flag its shipping status as fulfilled. + + + ### Inventory + + + If enabled, you can manage your stock. As such, your stock is + automatically updated as soon as a product is checked out. + x-displayName: Checkout + - name: Orders + description: > + An Order is created through the [checkout](/docs/api/carts/checkout) + endpoint within the Carts API. + + + An order is created after a customer checks out their cart. On creation, + the order is marked unpaid. The customer is prompted for a shipping + address, a billing address, and a payment method. After the order is + successfully paid, you can trigger an inventory process and a shipping + process. + + + You can keep a history of orders associated with the customer account. + + + ### Reorder + + + A re-order is when a shopper copies items from a previous order from their + order history into a cart of their choice. If a shopper re-orders to an + empty cart, the same quantities as the past order are applied. If the + shopper re-orders to an existing cart, and orders the same item, the + quantity increases. If an item is out of stock, the item is not added to + the cart, and the shopper sees an insufficient stock error. The tax for + the items in a re-order is not applied. For more information, see [Tax + Items](/docs/api/carts/tax-items). + x-displayName: Orders + - name: Payments + description: > + When you [checkout](/docs/api/carts/checkout) a + [cart](/docs/api/carts/cart-management), an unpaid + [order](/docs/api/carts/orders) is returned. You can process the payment + for the order though a payment gateway. + + + :::note + + + - You need to configure and enable a payment gateway before you can accept + payments for orders. + + - Configure your store to use [Manual + Gateway](/docs/api/payments/update-manual-gateway) to process payments if + the order total is zero or the payment is through non-supported payment + providers. + + - There are a number of actions that happen to your inventory when + checking out and paying for an order. For more information, see + [Inventory](/docs/api/pxm/inventory/inventories-introduction). + + - We recommend to wait until the payment confirmation process is fully + completed before proceeding with any additional updates to the order. + Making simultaneous updates to the same entity immediately after payment + confirmation can lead to a race condition. To learn more information on + handling parallel calls to API objects, see [Parallel Calls to API + Objects](https://beta.elasticpath.dev/guides/Getting-Started/api-contract#parallel-calls-to-api-objects). + + + ::: + + + ### Payment Methods + + + Depending on the chosen gateway, you may or may not have access to capture + funds immediately or authorize for later payment. For more information, + see [Transactions](/docs/api/carts/transactions). + + + To make a partial payment in Postman through any payment gateway, specify + the desired payment amount in the amount field within the request body. To + learn about Split Payments, see the [Split + Payments](/docs/api/payments/payment-gateways-introduction#split-payments) + section. + + + #### Purchase + + + The simplest method is purchase. The gateway attempts to charge the + customer immediately, and the result of the attempt is returned. + + + You can partially pay funds using purchase method. The gateway attempts to + charge the customer immediately, and the payment status for an order shows + `partially_paid`. + + + When you Get an order, you can see the following fields in the meta + object: + + + - `balance_owing`: Specifies the outstanding funds required to complete an + order. It considers all complete or pending transactions, including + authorized, paid, and captured transactions. (`balance_owing` = order + total - `authorized` amount - `paid` amount). + + - `paid`: Specifies the total amount of purchased or captured + transactions. + + - `authorized`: Specifies the total amount of completed or pending + authorized transactions for an order. + + + #### Authorize + + + You can `authorize` a payment so funds can later be captured when an item + is dispatched or restocked. + + + You can partially pay for an order using `authorize` payment method so + that the order is `partially_authorized`. The transaction must be complete + for the order status to be `partially_authorized`. + + + For more information about order and payment statuses for split payments, + see [Split + Payments](/docs/api/payments/payment-gateways-introduction#split-payments). + + + #### Capture + + + After authorizing a transaction, you have to capture the authorized funds. + + + :::note + + + We recommend capturing payments several hours to days after the + authorization to mitigate risks of fraud and chargebacks. When you sell + digital goods that are delivered immediately, we recommend using a single + purchase call instead of separate authorize and capture calls. + + + ::: + + + After the payment is `partially_authorized`, you must `capture` the + authorized transaction later. Once you capture the authorized + transactions, the order payment status will change to `partially_paid`. + + + #### Refunds + + + You can use either the Refund through Composable Commerce or use the Mark + as Refunded capability, or a combination of both capabilities. + + + For more information about refund for split payments, see [Refund a + Payment](/docs/api/carts/refund-a-transaction). + + + #### Refund through Composable Commerce + + + You can start a full or partial refund to a supported payment provider + directly from Commerce Manager or the API. When you start the refund + process, the refund request is sent to the payment gateway. You no longer + have to log on to your payment gateway’s console to process the refund. + + + When you process a refund, use the refund endpoint to pass the refund + amount. If you don’t pass an amount, the refund is processed as Mark as + refunded. For more information, see the Mark as Refunded section. + + + Each time a partial refund is triggered, the transaction.updated event is + generated and updated with refunded.amount. The `order.updated` event is + also triggered. The `order.refunded` event generates when the full amount + is refunded. + + + + #### Mark as Refunded + + + You can use your payment gateway’s console to process a refund. Process + the refund first in the payment gateway and then use the **Mark as + Refunded** capability in Composable Commerce to complete the process. + + + When an order is **Marked as refunded**, the payment status + `order.payment.status` is set to refunded. In this case, the + `order.updated`, `transaction.updated` and `order.refunded` events are + generated. + x-displayName: Payments + - name: Transactions + x-displayName: Transactions + - name: Custom Discounts + description: > + With custom discounts, you can allow your shoppers to apply discounts from + external services to their purchases. To apply custom discounts to carts + and cart items, you need to set `custom_discounts_enabled` field to `true` + in your [Cart Settings](/docs/api/settings/put-v-2-settings-cart). + + + You cannot add custom discounts to an empty cart. + + + :::caution + + + - You can apply up to five custom discounts to cart and cart item. + + - The stores that use [simple calculation + method](/guides/How-To/Carts/calculate-totals) do not support custom + discounts. + + + ::: + x-displayName: Custom Discounts + - name: Tax Items + description: > + Taxes differ by country and can differ within the country by region, + state, or province. Each jurisdiction has a unique tax code and rate. If + your store serves many jurisdictions, integrate a third-party tax + generator to manage taxes. If your store serves a few jurisdictions, you + can use the API to define the tax codes and rates in Composable Commerce. + + + Taxes are calculated after all promotional discounts have been applied. + When calculating taxes on a cart or order, you can choose from the + following methods for calculating taxes: + + - Simple calculation method: Taxes are calculated at the unit level and are rounded to the nearest penny for the unit. + - Line calculation method: Default. Taxes are calculated at the line level and are rounded to the nearest penny for the line. + For more information about calculation methods, see [Calculate cart and order totals](/guides/How-To/Carts/calculate-totals). + + :::note + + Tax items can be added and removed using [client credentials + tokens](/docs/authentication/Tokens/client-credential-token). Only + administrators with `client-credentials` are able to manage tax items. + + ::: + x-displayName: Tax Items +paths: + /catalog: + get: + operationId: getByContextRelease + summary: Get the catalog release as shoppers + description: Returns a list of all published releases of the specified catalog. + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + /catalog/hierarchies: + get: + operationId: getByContextAllHierarchies + summary: Get all Hierarchies + description: > + Returns all hierarchies from a catalog. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-hierarchy' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The hierarchies of the catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/hierarchies/{hierarchy_id}: + get: + operationId: getByContextHierarchy + summary: Get a Hierarchy + description: > + Returns a hierarchy from the catalog. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog to retrieve. For + information about how catalog rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules). + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/hierarchies/{hierarchy_id}/nodes: + get: + operationId: getByContextHierarchyNodes + summary: Get a Hierarchy's Nodes + description: > + Returns all the nodes for the specified hierarchy. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + In the `bread_crumb` metadata, you can identify the parent nodes that a + node is associated with. This is useful if you want to improve how your + shoppers search your store, for example. See [Product and Node + Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/hierarchies/{hierarchy_id}/children: + get: + operationId: getByContextHierarchyChildNodes + summary: Get a Hierarchy's Children + description: > + Returns the parent nodes for the specified hierarchy. + + ![Parent Nodes](/assets/rootnodes.PNG) + + If you have multiple catalog rules defined, the rule that best matches + the shopperʼs context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + In the `bread_crumb` metadata, you can identify the parent nodes that a + node is associated with. This is useful if you want to improve how your + shoppers search your store, for example. See [Product and Node + Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + + The following operators and attributes are available when filtering on + this endpoint. + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + + For more information, see + [Filtering](/guides/Getting-Started/filtering). + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/nodes: + get: + operationId: getByContextAllNodes + summary: Get all Nodes + description: > + Returns all nodes in the catalog. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. For more information, see [Building + breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + + + The response lists the products associated with the nodes. If products + are [curated](/guides/How-To/Products/curating-products), they are + displayed in `curated_products`. Product curation allows you to promote + specific products within each of your hierarchies, enabling you to + create unique product collections in your storefront. + + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - If a curated product is removed from a node, the product is also + removed from the `curated_products` list. + + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available. + + + | Operator | Description | Attributes | Example | + + | --- | --- | --- | --- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + + | `in` | Checks if the values are included in the specified string. + If they are, the condition is true. + + | `Id` | + `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` + | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The nodes of the catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/nodes/{node_id}: + get: + operationId: getByContextNode + summary: Get a Node + description: > + Returns a node from the catalog. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + The response lists the products associated with a node. If products are + [curated](/guides/How-To/Products/curating-products), they are displayed + in `curated_products`. Product curation allows you to promote specific + products within each of your nodes, enabling you to create unique + product collections in your storefront. + + + - If you don't provide any `curated_products`, products are listed by + their `updated_at` time in descending order, with the most recently + updated product first. + + - If you configure `curated_products` for only a few products, the + curated products are displayed first and the other products are + displayed in the order of `updated_at` time. + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - A product that is curated has the `"curated_product": true` attribute + displayed. + + - If a curated product is removed from a node, the product is also + removed from the `curated_products` list. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/nodes/{node_id}/relationships/children: + get: + operationId: getByContextChildNodes + summary: Get a Node's Children + description: > + Returns the child nodes for a node in the catalog. + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see which parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + The response lists the products associated with the nodes. If products + are [curated](/guides/How-To/Products/curating-products), they are + displayed in `curated_products`. Product curation allows you to promote + specific products within each of your hierarchies, enabling you to + create unique product collections in your storefront. + + - If you don't provide any curated_products, products are listed by + their updated_at time in descending order, with the most recently + updated product first. + + - If you configure curated_products for only a few products, the curated + products are displayed first and the other products are displayed in the + order of updated_at time. + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - A product that is curated has the "curated_product": true attribute + displayed. + + - If a curated product is removed from a node, the product is also + removed from the curated_products list. + + ### Filtering + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available. + + | Operator | Description | Attributes | Example | + + | --- | --- | --- | --- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + + | `in` | Checks if the values are included in the specified string. + If they are, the condition is true. + + | `Id` | + `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` + | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + responses: + '200': + description: The child nodes of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/products: + get: + operationId: getByContextAllProducts + summary: Get all Products + description: > + Retrieves the list of products from the catalog. Only the products in a + live status are retrieved. + + + ### Catalog Rules + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. If + no catalog rules are configured, the first catalog found is returned. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + ### Product and Node Associations + + You can see the parent nodes a product is associated within the `bread_crumbs` and `bread_crumb_nodes` metadata for each product. For example, this is useful if you want to improve how your shoppers search your store. See [Product and Node Associations in Breadcrumb Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types` and `tags`, you can only + specify one. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types` and `tags`, you can + specify more than one. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/products/{product_id}: + get: + operationId: getByContextProduct + summary: Get a Product + description: > + Returns the specified product from the catalog. The product must be in + the `live` status. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/include' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + responses: + '200': + description: The product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/products/{product_id}/relationships/component_products: + get: + operationId: getByContextComponentProductIDs + summary: Get a Bundle's Component Products + description: > + With Product Experience Manager, you can + [create](/docs/api/pxm/products/create-product) and manage bundles. A + bundle is a purchasable product, comprising of one or more products that + you want to sell together. + + + You can create multiple components within a bundle. Each component must + have at least one or more options. Each option is a product and a + quantity. + + + This endpoint returns a list of component product IDs for the specified + bundle. + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: >- + The list of component product IDs of a bundle product from a + catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-reference-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/products/{product_id}/relationships/children: + get: + operationId: getByContextChildProducts + summary: Get a Parent Product's Child Products + description: > + For a specified product and catalog release, retrieves a list of child + products from a parent product. Any product other than a base product + results in a `422 Unprocessable Entity` response. Only the products in a + `live` status are retrieved. + + If you have multiple catalog rules defined, the rule that best matches + the shopperʼs context is used to determine which catalog is retrieved. + If no catalog rules are configured, the first catalog found is returned. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated within the + `breadcrumbs` metadata for each product. For example, this is useful if + you want to improve how your shoppers search your store. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types` and `tags`, you can only + specify one. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types` and `tags`, you can + specify more than one. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of child products of a parent product from a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/hierarchies/{hierarchy_id}/products: + get: + operationId: getByContextProductsForHierarchy + summary: Get a Hierarchy's Products + description: > + Returns the products associated with the specified hierarchy in the + catalog. The products must be in the live status. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + See [Resolving catalog + rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types` and `tags`, you can only + specify one. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types` and `tags`, you can + specify more than one. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + `files` | Optional | Any files associated with a product. | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + responses: + '200': + description: The products of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/nodes/{node_id}/relationships/products: + get: + operationId: getByContextProductsForNode + summary: Get a Node's Products + description: > + Returns the products associated with the specified hierarchy node in the + catalog. The products must be in the `live` status. If the products have + been curated then the products are returned in the order specified in + the `curated_products` attribute. A product that is curated has the + `"curated_product": true` attribute displayed. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + See [Resolving catalog + rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types` and `tags`, you can only + specify one. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types` and `tags`, you can + specify more than one. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - $ref: '#/components/parameters/filter-product' + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalog/products/{product_id}/configure: + post: + operationId: configureByContextProduct + summary: Configure a Shopper Bundle + description: > + Once you have configured your product bundles, you can display them in + your storefront in your published catalog. Depending on how you have + configured the minimum and maximum values for the product options in + your components, you can allow your shoppers to choose which products + they want to select. For example, you can enable a shopper to select 1 + or more product options from a list of 10, giving your shoppers greater + flexibility when selecting products in your store front. + + + - Products must be in a `live` status. + + - If you have not specified any minimum or maximum values for the + product options in your components, your shoppers can select any + combination of product options. + + + If you have configured minimum and maximum values using [Create a + Bundle](/docs/api/pxm/products/create-product), this becomes part of the + `bundle_configuration`. You can check how your bundle is configured + using [Get a product in a catalog + release](/docs/api/pxm/catalog/get-product) in `bundle_configuration` + under `meta`. The `bundle_configuration` forms the body of the request. + + + The response updates the `bundle_configuration` with the product options + the shopper selects. The `meta` data is updated with the `meta` data of + the selected product options. In your storefront, you could display this + as a summary of the product options a shopper has selected. + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/channel' + - $ref: '#/components/parameters/tag' + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + requestBody: + $ref: '#/components/requestBodies/bundle-configuration-data' + responses: + '200': + description: The configured product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Shopper Catalog API + security: + - bearerAuth: [] + /catalogs: + post: + operationId: createCatalog + summary: Creates a new catalog + description: > + Before you create a catalog, you must define the following resources: + + + - Hierarchies - hierarchies and nodes to categorize the products. + + - Products - product information, associated assets, and links to + hierarchy nodes. + + - Price Books - prices for the products associated with the hierarchies. + You can create multiple price books for different scenarios, such as + seasonal sales, business versus retail customer pricing, and reward + programs. When creating a catalog, you can specify up to five price + books. You must configure a priority for your price books. Product + prices are displayed in the catalog according to the priority of the + price books. Priority is a number and the price book with the highest + number has the highest priority. + requestBody: + description: Creates a catalog with the following attributes. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-create-data' + responses: + '201': + description: The created catalog + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Catalogs + security: + - bearerAuth: [] + get: + operationId: getCatalogs + summary: Gets all authorized catalogs + description: > + Retrieves a list of all the catalogs that you are authorized to view. + Currently, published catalogs are limited to the current release and two + releases prior to the current release. You can see the differences + between the last 2 consecutive catalog releases using the delta link + returned in the response of a [publish a + catalog](/docs/api/pxm/catalog/publish-release) endpoint. + + You can use the `is_full_delta` attribute returned from the `get a + release of a catalog` endpoint to determine if you need to refresh the + data in your company system before publishing a catalog release and + injecting fresh data in a delta link. The `is_full_delta` attribute + tells you if this is a full publish of a catalog release. Using a search + service as an example, if the `is_full_delta` attribute is `true`, you + should remove all data about that catalog from the search service before + publishing a catalog release and injecting fresh data from the delta + file. See [Publish a catalog](/docs/api/pxm/catalog/publish-release). + + + If the `is_full_publish` attribute returned in the response is `false`, + data from the previous catalog release overlaid the existing data in the + delta file. The `is_full_publish` attribute is always `true` the first + time a catalog is published. + responses: + '200': + description: The list of catalogs. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Catalogs + security: + - bearerAuth: [] + /catalogs/{catalog_id}: + get: + operationId: getCatalogByID + summary: Get a catalog by ID + description: Retrieves the specified catalog. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Catalogs + security: + - bearerAuth: [] + put: + operationId: updateCatalog + summary: Updates a catalog + description: >- + Specify whichever attributes you want to change. The values of the other + attributes remain the same. If the attributes section is empty, the + catalog is not updated. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + requestBody: + description: Updated catalog. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-update-data' + responses: + '200': + description: An updated catalog with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Catalogs + security: + - bearerAuth: [] + delete: + operationId: deleteCatalogByID + summary: Deletes a catalog + description: >- + Deletes an unpublished catalog. Use [**Delete a + Release**](/docs/api/pxm/catalog/delete-release-by-id) and [**Delete All + Releases**](/docs/api/pxm/catalog/delete-releases) to delete releases of + a catalog. If the catalog is associated with any catalog rules, you must + first update the catalog rules to remove the catalog. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the catalog has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Catalogs + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases: + post: + operationId: publishRelease + summary: Publishes a catalog + description: > + Publishes a catalog. You must publish a catalog before you can retrieve + that catalog in an organization or store. The hierarchies, live + products, and prices associated with a published catalog are in + read-only mode. If you make a change to these resources, for example, a + change to your price book or hierarchies, you need to republish the + catalog. + + You can get [a catalog release](/docs/api/pxm/catalog/get-release-by-id) + to retrieve a published catalog. Currently, published catalogs are + limited to the current release and two releases prior to the current + release. + + You can see the differences between the last 2 consecutive catalog + releases. This is useful if want to understand how your products have + changed in your catalog, ensuring your site search integration is kept + up-to-date. + + Once a catalog release has completed publishing, the delta relationship + links to the delta document. + + + The `delta` links are signed and only valid for 1 hour. Re-reading a + catalog release, for example, using [Getting a release of a + catalog](/docs/pxm/catalogs/catalog-latest-release/get-a-release-of-a-catalog) + returns a fresh a link. + + You can use the `is_full_delta` attribute returned from the `get a + release of a catalog` endpoint to determine if you need to refresh the + data in your company system before injecting fresh data in a `delta` + link. The `is_full_delta` attribute tells you if this is a full publish + of the catalog. Using a search service as an example, if the + `is_full_delta` attribute is `true`, you should remove all data about + that catalog from the search service before injecting fresh data from + the `delta` file. If the `is_full_delta` attribute is `false`, then data + from the previous catalog overlays the existing data in the `delta` + file. To publish a catalog and inject fresh data in a `delta` link, set + `export_full_delta` to `true`. + + If a previous catalog publish date is greater than 90 days, then a full + catalog publish is automatically performed. If you publish your catalogs + infrequently, Commerce may perform a full publish when you are expecting + a delta publish. + + :::caution + + + Generating a full delta is resource intensive and slows down the + publishing process and so should only be performed in certain + circumstances, for example, when initializing an integration with a + service like Algolia. + + ::: + + The `is_full_delta` attribute is always `true` the first time a catalog + is published. The information is stored in a collection of `json` + documents in a compressed file. You can either manually check the file + or, for example, use them to automatically update another company system + you may have. + + - Delta files are only available for 30 days. + + - Delta files are removed when a catalog release is deleted. + + Each document has a `delta_type` with one of the following values, + depending on whether a product has been deleted, updated or created in a + catalog release. + + - `delete` describes products deleted from this release of a catalog. + + - `createupdate` describes products updated in this release of a + catalog. + + ### Multi-Store Management Solutions + + In a multi-store management solution. + + - You can create organization catalogs. Your organization catalogs are + available for your stores to use. + + - Your stores can create their own catalogs. + + - Your stores can create catalogs that have a combination of + organization products and store products. + + If you are publishing a catalog in a store that contains resources from + an organization, in Commerce Manager, you must enable the **Include + Organization Resources in Catalog Publishes** checkbox. + + 1. Go to **SYSTEM** > **Store Settings**. + + 2. Click **General Settings**. + + 3. Select **PXM** from the list. + + 4. Select the **Include Organization Resources in Catalog Publishes** + checkbox. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + requestBody: + description: Options for catalog release publishing + content: + application/json: + schema: + $ref: '#/components/schemas/catalog-release-create-data' + responses: + '201': + description: Publishes a catalog release with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + get: + operationId: getReleases + summary: Gets all authorized catalog releases + description: > + Returns a list of all published releases of the specified catalog. + Currently, published catalogs are limited to the current release and two + releases prior to the current release. You can see the differences + between the last 2 consecutive catalog releases using the `delta` link + returned in the response of a `publish a catalog` endpoint. + + + You can use the `is_full_delta` attribute returned from the `get a + release of a catalog` endpoint to determine if you need to refresh the + data in your company system before publishing a catalog release and + injecting fresh data in a delta link. The `is_full_delta` attribute + tells you if this is a full publish of a catalog release. Using a search + service as an example, if the `is_full_delta` attribute is `true`, you + should remove all data about that catalog from the search service before + publishing a catalog release and injecting fresh data from the delta + file. + + + If the `is_full_publish` attribute returned in the response is `false`, + data from the previous catalog release overlaid the existing data in the + delta file. The `is_full_publish` attribute is always `true` the first + time a catalog is published. + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + responses: + '200': + description: The list of catalogs. + content: + application/json: + schema: + $ref: '#/components/schemas/release-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + delete: + operationId: deleteReleases + summary: Deletes all releases + description: Deletes all releases of the specified published catalog. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the releases have been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}: + get: + operationId: getReleaseByID + summary: Get a catalog release by ID + description: Retrieves the specified catalog release. + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: The catalog release ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/release-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + delete: + operationId: deleteReleaseByID + summary: Deletes a release + description: Deletes the specified published catalog release. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: The catalog release ID. + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the release has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Releases + security: + - bearerAuth: [] + /catalogs/rules: + post: + operationId: createRule + summary: Creates a new catalog rule + description: > + If you have multiple catalogs, create catalog rule resources. With + catalog rules, you can display different catalogs to different shoppers. + For example, you can display a preferred pricing catalog to a few + special customers. Or you can display one catalog to shoppers using your + website and a different catalog to shoppers using your mobile app. + Finally, you can define custom criteria by creating tags. + + + :::note + + + - If you have one catalog for all customers and channels, you can omit + creating this resource. + + - Due to the way catalogs are cached in Commerce, using catalog rules to + display catalogs sometimes causes a 5-minute time delay before the + catalogs are displayed. + + - You cannot create catalog rules for organization catalogs. + + + ::: + + + For ideas about the kinds of business scenarios you can achieve with + catalog rules, see [Catalog Rules](/docs/api/pxm/catalog/rules). To + understand how catalogs are matched to shoppers by using rules, see + [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + requestBody: + description: Creates a catalog rule with the following attributes. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/rule-create-data' + responses: + '201': + description: The created catalog rule + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Rules + security: + - bearerAuth: [] + get: + operationId: getRules + summary: Gets all authorized catalog rules + description: > + Retrieves all authorized catalog rules. + + + ### Filtering + + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are supported. + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + parameters: + - $ref: '#/components/parameters/filter-rule' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The list of catalog rules. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Rules + security: + - bearerAuth: [] + /catalogs/rules/{catalog_rule_id}: + get: + operationId: getRuleByID + summary: Get a catalog rule by ID + parameters: + - name: catalog_rule_id + in: path + description: The catalog rule ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog rile. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Rules + security: + - bearerAuth: [] + put: + operationId: updateRule + summary: Updates a catalog rule + description: >- + Specify whichever attributes you want to change. The values of the other + attributes remain the same. If the attributes section is empty, the + catalog rule is not updated. + parameters: + - name: catalog_rule_id + in: path + description: The catalog rule ID. + required: true + schema: + type: string + requestBody: + description: An updated catalog rule with the following attributes. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/rule-update-data' + responses: + '200': + description: An Updated catalog rule with the following attributes. + content: + application/json: + schema: + $ref: '#/components/schemas/rule-data' + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Rules + security: + - bearerAuth: [] + delete: + operationId: deleteRuleByID + summary: Deletes a catalog rule + parameters: + - name: catalog_rule_id + in: path + description: The catalog rule ID. + required: true + schema: + type: string + responses: + '204': + description: A 204 response indicates that the catalog rule has been deleted. + default: + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Rules + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/hierarchies: + get: + operationId: getAllHierarchies + summary: Get all Hierarchies + description: > + Returns the hierarchies from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + ::: + + ### Filtering + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - $ref: '#/components/parameters/filter-hierarchy' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The hierarchies of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}: + get: + operationId: getHierarchy + summary: Get a Hierarchy + description: > + Returns the specified hierarchy from a published catalog. + + + :::note + + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + + ::: + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/hierarchy-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/nodes: + get: + operationId: getHierarchyNodes + summary: Get a Hierarchy's Nodes + description: > + Returns all nodes for the specified hierarchy from a published catalog. + + + :::note + + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + + ::: + + + In the `bread_crumb` metadata, you can identify the parent nodes that a + node is associated with. This is useful if you want to improve how your + shoppers search your store, for example. See [Product and Node + Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: The catalog release ID. + required: true + schema: + type: string + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/children: + get: + operationId: getHierarchyChildNodes + summary: Get a Hierarchy's Children + description: > + Returns the parent nodes for the specified hierarchy from a published + catalog. + + + ![Parent Nodes](/assets/rootnodes.PNG) + + + :::note + + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + + ::: + + + In the `bread_crumb` metadata, you can identify the parent nodes that a + node is associated with. This is useful if you want to improve how your + shoppers search your store, for example. See [Product and Node + Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). + + + | Operator | Description | Supported Attributes | Example | + + |:--- |:--- |:--- |:--- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug`| `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. | `id` | `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/nodes: + get: + operationId: getAllNodes + summary: Get all Nodes + description: > + Returns the child nodes from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + ::: + + You can see the parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. See [Building breadcrumbs in a + storefront](#building-breadcrumbs-in-a-storefront). + + + The response lists the products associated with the nodes. If products + are [curated](/guides/How-To/Products/curating-products), they are + displayed in `curated_products`. Product curation allows you to promote + specific products within each of your hierarchies, enabling you to + create unique product collections in your storefront. + + + - If you don't provide any `curated_products`, products are listed by + their `updated_at` time in descending order, with the most recently + updated product first. + + - If you configure `curated_products` for only a few products, the + curated products are displayed first and the other products are + displayed in the order of `updated_at` time. + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - If a curated product is removed from a node, the product is also + removed from the `curated_products` list. + + - A product that is curated has the `"curated_product": true` attribute + displayed. + + ### Filtering + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available. + + + | Operator | Description | Attributes | Example | + + | --- | --- | --- | --- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + + | `in` | Checks if the values are included in the specified string. + If they are, the condition is true. + + | `Id` | + `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` + | + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The nodes of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: An unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}: + get: + operationId: getNode + summary: Get a Node + description: > + Returns a node from a published catalog. + + :::note + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + ::: + + You can see the parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The response lists the products associated with the nodes. If products + are [curated](/guides/How-To/Products/curating-products), they are + displayed in `curated_products`. Product curation allows you to promote + specific products within each of your hierarchies, enabling you to + create unique product collections in your storefront. + + - If you don't provide any `curated_products`, products are listed by + their `updated_at` time in descending order, with the most recently + updated product first. + + - If you configure `curated_products` for only a few products, the + curated products are displayed first and the other products are + displayed in the order of `updated_at` time. + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - If a curated product is removed from a node, the product is also + removed from the `curated_products` list. + + - A product that is curated has the `"curated_product": true` attribute + displayed. + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + responses: + '200': + description: The catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/children: + get: + operationId: getChildNodes + summary: Get a Node's Children + description: > + Returns the child nodes for a node from a published catalog. + + + :::note + + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + + ::: + + + You can see the parent nodes a node is associated with in the + `bread_crumb` metadata for each node. This is useful if you want to + improve how your shoppers search your store, for example. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. For more information, see [Building + breadcrumbs in a storefront](#building-breadcrumbs-in-a-storefront). + + + The response lists the products associated with the nodes. If products + are [curated](/guides/How-To/Products/curating-products), they are + displayed in `curated_products`. Product curation allows you to promote + specific products within each of your hierarchies, enabling you to + create unique product collections in your storefront. + + + - If you don't provide any `curated_products`, products are listed by + their `updated_at` time in descending order, with the most recently + updated product first. + + - If you configure `curated_products` for only a few products, the + curated products are displayed first and the other products are + displayed in the order of `updated_at` time. + + - You can only curate 20 products or less. You cannot have more than 20 + curated products. + + - If a curated product is removed from a node, the product is also + removed from the `curated_products` list. + + - A product that is curated has the `"curated_product": true` attribute + displayed. + + + ### Filtering + + + This endpoint supports filtering. For general syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available. + + + | Operator | Description | Attributes | Example | + + | --- | --- | --- | --- | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. | `name`, `slug` | `filter=eq(name,some-name)` | + + | `in` | Checks if the values are included in the specified string. + If they are, the condition is true. + + | `Id` | + `filter=in(id,9214719b-17fe-4ea7-896c-d61e60fc0d05,e104d541-2c52-47fa-8a9a-c4382480d97c,65daaf68-ff2e-4632-8944-370de835967d)` + | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-node' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The child nodes of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/node-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/products: + get: + operationId: getAllProducts + summary: Get all Products + description: > + Returns the products from a published catalog. Only the products in a + `live` status are retrieved. Currently, published catalogs are limited + to the current release and two releases prior to the current release. + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + The `variations` object lists the variation IDs and variation option IDs + and their corresponding product IDs that are generated when the + variation and variation options are built with a product. The + `variations` object can then be added to your catalogs. By default, + variations and variation options are sorted randomly. You can use the + `sort_order` attribute to sort the order of your variation and variation + options in `variations`. Once a parent product is published in a + catalog, the [Get a List of products in a catalog + release](/docs/api/pxm/catalog/get-all-products) response displays the + sorted variations and variation options. Variations and variation + options are displayed in descending order according to their + `sort_order` values. + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. + | + + | `files` | Optional | Any files associated with a + product. + + + See [**Including Resources**](/guides/Getting-Started/includes). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types`, you can only specify one + product type. For example, `filter=eq(product_types,child)`. + | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types`, you can specify + more than one product type. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}: + get: + operationId: getProduct + summary: Get a Product + description: > + Returns a product from a published catalog. The product must be in + `live` status. Currently, published catalogs are limited to the current + release and two releases prior to the current release. + + + ### Product and Node Associations in Breadcrumb Metadata + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + ### Product Variations + + + The `variations` object lists the variation IDs and variation option IDs + and their corresponding product IDs that are generated when the + variation and variation options are built with a product. The + `variations` object can then be added to your catalogs. By default, + variations and variation options are sorted randomly. You can use the + `sort_order`attribute to sort the order of your variation and variation + options in `variations`. Once a parent product is published in a + catalog, the get a product in a catalog release response displays the + sorted variations and variation options. Variations and variation + options are displayed in descending order according to their + `sort_order` values. + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. + | + + | `files` | Optional | Any files associated with a + product. + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + responses: + '200': + description: The product of a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/component_products: + get: + operationId: getComponentProductIDs + summary: Get a Bundle's Component Products + description: > + With Product Experience Manager, you can + [create](/docs/api/pxm/products/create-product) and manage bundles. A + bundle is a purchasable product, comprising of one or more products that + you want to sell together. + + + You can create multiple components within a bundle. Each component must + have at least one or more options. Each option is a product and a + quantity. + + + This endpoint returns a list of component product IDs for the specified + bundle. + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: >- + The list of component product IDs of a specific bundle product from + a catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-reference-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/products/{product_id}/relationships/children: + get: + operationId: getChildProducts + summary: Get a Parent Product's Child Products + description: > + For a specified product and catalog release, retrieves a list of child + products from a parent product. Any product other than a base product + results in a `422 Unprocessable Entity` response. Only the products in a + `live` status are retrieved. + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. If + no catalog rules are configured, the first catalog found is returned. + For information about how rules are matched, see [Resolving Catalog + Rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + You can see the parent nodes a product is associated within the + breadcrumbs metadata for each product. For example, this is useful if + you want to improve how your shoppers search your store. See [Product + and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types`, you can only specify one + product type. For example, `filter=eq(product_types,child)`. + | `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types`, you can specify + more than one product type. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: product_id + in: path + description: The product ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: >- + The list of child products of a specific base product from a + catalog. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/hierarchies/{hierarchy_id}/products: + get: + operationId: getProductsForHierarchy + summary: Get a Hierarchy's Products + description: > + Returns the products associated with the specified hierarchy in the + catalog. The products must be in the `live` status. + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + See [Resolving catalog + rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + + The `variations` object lists the variation IDs and variation option IDs + and their corresponding product IDs that are generated when the + variation and variation options are built with a product. The variations + object can then be added to your catalogs. By default, variations and + variation options are sorted randomly. You can use the `sort_order` + attribute to sort the order of your variation and variation options in + variations. Once a parent product is published in a catalog, the [Get a + List of products in a catalog](/docs/api/pxm/catalog/get-all-products) + release response displays the sorted variations and variation options. + Variations and variation options are displayed in descending order + according to their `sort_order` values. + + + ### Filtering + + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types`, you can only specify one + product type. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types`, you can specify + more than one product type. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + + ### Building breadcrumbs in a storefront + + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + + ### Including Resources + + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: hierarchy_id + in: path + description: The catalog hierarchy ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/filter-product' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog hierarchy. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /catalogs/{catalog_id}/releases/{release_id}/nodes/{node_id}/relationships/products: + get: + operationId: getProductsForNode + summary: Get a Node's Products + description: > + Returns the products associated with the specified hierarchy node in the + catalog. The products must be in the `live` status. If the products have + been curated, then the products are returned in the order specified in + the `curated_products` attribute. A product that is curated has the + `"curated_product": true` attribute displayed. + + :::note + + Currently, published catalogs are limited to the current release and two + releases prior to the current release. + + ::: + + + If you have multiple catalog rules defined, the rule that best matches + the shoppers context is used to determine which catalog is retrieved. + See [Resolving catalog + rules](/docs/api/pxm/catalog/rules#resolving-catalog-rules). + + + You can see the parent nodes a product is associated with in the + `bread_crumbs` and `bread_crumb_nodes` metadata for each product. This + is useful if you want to improve how your shoppers search your store, + for example. See [Product and Node Associations in Breadcrumb + Metadata](/guides/How-To/Catalogs/breadcrumbs). + + The `variations` object lists the variation IDs and variation option IDs + and their corresponding product IDs that are generated when the + variation and variation options are built with a product. The + `variations` object can then be added to your catalogs. By default, + variations and variation options are sorted randomly. You can use the + `sort_order` attribute to sort the order of your variation and variation + options in `variations`. Once a parent product is published in a + catalog, the [Get a List of products in a catalog + release](/docs/api/pxm/catalog/get-all-products) response displays the + sorted variations and variation options. Variations and variation + options are displayed in descending order according to their + `sort_order` values. + + + ### Filtering + + This endpoint supports filtering. For general filtering syntax, see + [Filtering](/guides/Getting-Started/filtering). The following operators + and attributes are available when filtering on this endpoint. + + | Operator | + Description + | Supported Attributes | Example | + + |:---|:------------------------------------------------------------------------------------------------|:---------------------------------------------------------|:--- + | + + | `Eq` | Checks if the values of two operands are equal. If they are, + the condition is true. For `product_types` and `tags`, you can only + specify one. For example, `filter=eq(product_types,child)`. | + `name`, `sku`, `slug`, `manufacturer_part_num`, `upc_ean`, + `product_types`, `tags` | `filter=eq(name,some-name)` | + + | `In` | Checks if the values are included in the specified string. If + they are, the condition is true. For `product_types` and `tags`, you can + specify more than one. For example, + `filter=in(product_types,child,bundle)`. | `id`, `name`, `sku`, `slug`, + `manufacturer_part_num`, `upc_ean`, `product_types`, `tags` | + `filter=in(id,some-id)` | + + ### Building breadcrumbs in a storefront + + In a catalog, you can use a filter to return a list of nodes in a + hierarchy structure that a product belongs to. You can use this to build + breadcrumbs in your storefront. An example is shown below. + + `filter=in(id,c83bfe55-0d87-4302-a86d-ab19e7e323f1,6003d7ef-84f3-49bb-a8bd-4cbfa203dcbb)` + + - Specify the node Ids in the filter expression. + + - You can have as many node Ids as you want. + + - It does not matter what order you specify the node Ids. The nodes are + returned in the order they were last updated. + + ### Including Resources + + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products and product + attributes, such as SKU or slug. + + | Parameter | Required | + Description + | + + | + :---------------------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + | `component_products` | Optional | The component product data and key + attribute data, such as SKU or slug, to return for component products in + a product bundle. | + + | `main_image` | Optional | The main images associated with a + product. | + + | `files` | Optional | Any files associated with a product. + | + + See [**Including Resources**](/guides/Getting-Started/includes). + parameters: + - $ref: '#/components/parameters/accept-language' + - $ref: '#/components/parameters/filter-product' + - name: catalog_id + in: path + description: The catalog ID. + required: true + schema: + type: string + - name: release_id + in: path + description: >- + The unique identifier of a published release of the catalog or + `latest` for the most recently published version. + required: true + schema: + type: string + - name: node_id + in: path + description: The catalog node ID. + required: true + schema: + type: string + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + '200': + description: The products of a catalog node. + content: + application/json: + schema: + $ref: '#/components/schemas/product-list-data' + default: + description: The unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/error-response' + tags: + - Administrator Latest Releases Catalog API + security: + - bearerAuth: [] + /v2/carts: + get: + tags: + - Cart Management + summary: Get Shopper Carts + description: > + You can retrieve the carts that are associated with an + [account](/docs/api/carts/account-cart-associations) or a + [customer](/docs/api/carts/customer-cart-associations). + + + When a shopper retrieves their latest carts, the carts are sorted in + descending order by the updated_date. For more information, see + [Pagination](/guides/Getting-Started/pagination). + + + :::note + + + Requires an `implicit` token with only one of [Account Management + Authentication + Token](/docs/api/accounts/post-v-2-account-members-tokens) or [customer + token](/docs/customer-management/customer-management-api/customer-tokens). + + + ::: + operationId: getCarts + parameters: + - name: EP-Account-Management-Authentication-Token + in: header + description: >- + An Account Management Authentication token to access a specific + account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/CartResponse' + links: + $ref: '#/components/schemas/Response.PageLinks' + meta: + $ref: '#/components/schemas/Response.Meta.Carts' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + post: + tags: + - Cart Management + summary: Create a Cart + description: > + + Creates a cart. Call this endpoint each time a customer creates a cart. + + + Each shopper can have multiple carts. Use the carts API to create a + cart. The carts are distinct from one another. Shoppers can add + different items to their carts. They can check out one of the carts + without affecting the content or status of their other carts. + + + After the shopper checks out the cart, the cart remains available to the + shopper. The cart is persistent and stays with the shopper after it is + used. + + + You can also create a cart to specify custom discounts. You can enable + custom discounts when the `discount_settings.custom_discounts_enabled` + field is set to `true`. Default is set from cart discount settings for + the store. See [Update Cart + Settings](/docs/api/settings/put-v-2-settings-cart). + + + ### Preview Cart + + + You can set a future date for your shopping cart and view the promotions + that will be available during that time period. This feature enables you + to validate your promotion settings and observe how they will be applied + in the cart. + + + :::caution + + - Once the cart is in preview mode, you cannot revert it to a regular + cart. + + - Carts with `snapshot_date` are same as preview carts. + + - You cannot checkout a cart that includes a `snapshot_date`. + + - To delete a promotion preview cart, use [Delete a + cart](/docs/api/carts/delete-a-cart) endpoint. + + - The promotion preview cart has the same expiration time as a regular + cart based on the store's [cart + settings](/docs/api/settings/put-v-2-settings-cart). + + - Preview cart interactions skip inventory checks and events, allowing + users to preview future carts without impacting related external + systems. + + ::: + + + ### Errors + + + - `400 Bad Request` : This is returned when the submitted request does + not adhere to the expected API contract for the endpoint. + + - For example, in the case of string fields, this error might indicate issues in the length or format of submitted strings. For more information about valid string fields, refer to Safe Characters section. + - In the case of preview carts (those with `snapshot_date`), an error is returned for invalid actions, such as removing the preview date, setting a preview date in the past, or attempting to checkout a cart with a `snapshot_date`. + operationId: createACart + parameters: + - name: x-moltin-customer-token + in: header + description: A customer token to be associated with the cart. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRequest' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}: + get: + tags: + - Cart Management + summary: Get a Cart + description: > + Use this endpoint to retrieve a specific cart. If a cart ID does not + exist, a new cart will be automatically created. If the cart is + associated with shipping groups, calling this endpoint displays the + associated shipping group IDs in the `relationships` section. + + + You can easily get a new or existing cart by providing the unique cart + reference in the request. If the cart is associated with shipping + groups, calling this endpoint displays the associated shipping group IDs + in the relationships section. + + + :::note + + + - The default cart name is Cart. However, you can update the cart name + as required. Ensure that the string length of the name is greater than + or equal to one. Follow the safe character guidelines for name and + description naming. For more information about cart ID naming + requirements, see the [Safe + Characters](/guides/Getting-Started/safe-characters) section. + + - Outside of the JS-SDK, we don’t handle creating cart references. You + need to create your own. + + + ::: + + + :::caution + + + An empty cart is returned for any carts that don’t currently exist. For + more information about the cart items object, see [Get Cart + Items](/docs/api/carts/get-cart-items). + + + ::: + + + ### Query parameters + + + + | Name | Required | Type | + Description | + + |:----------|:---------|:---------|:-------------------------------------------| + + | `include` | Optional | `string` | Comma-delimited string of entities + that can be included. The information included are `items`,`tax_items`, + `custom_discounts`, or `promotions`. | + operationId: getCart + parameters: + - name: cartID + in: path + description: The unique identifier for this cart that you created. + required: true + style: simple + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + put: + tags: + - Cart Management + summary: Update a Cart + description: > + Updates cart properties for the specified cartID. + + + You can also update a cart to specify custom discounts. You can enable + custom discounts when the `discount_settings.custom_discounts_enabled` + field is set to `true`. Default is set from cart discount settings for + the store. See [Cart + Settings](/docs/api/settings/put-v-2-settings-cart). + operationId: updateACart + parameters: + - name: cartID + in: path + description: The unique identifier of a cart created by you. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRequest' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Cart Management + summary: Delete a Cart + description: > + You can delete a cart, including the items, name, description, and + remove all associations. + + + ### Errors + + + The following error message is received when you attempt to delete a + cart that is associated with a customer. Before deletion, ensure that + the cart is disassociated. + + + ```json + + message: { + errors: [ + { + status: 400, + title: 'Last cart', + detail: 'This is the last cart associated with a customer and it cannot be deleted, try disassociating instead' + } + ] + } + ```` + operationId: deleteACart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you want to delete. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items: + get: + tags: + - Cart Items + summary: Get Cart Items + description: > + + Use this endpoint to retrieve cart items. If the cart is associated with + shipping groups, calling this endpoint displays the associated shipping + group IDs. + + + You can use this endpoint to retrieve the breakdown of cart items by + promotion ID. For example, if you have Promotions Standard item discount + with code *sale2024*, Rule Promotions item discount with code + *sale2024*, and Rule Promotions cart discount with code *sale2024*, the + `discounts.constituents` field in the response example will show the + breakdown of the same promotion code used in both Promotions Standard + and Rule Promotions. + + + ```json + + "data": [ + + { + "id": "98de010d-dd10-4fa5-a070-0b9bcdc72974", + "type": "cart_item", + "product_id": "5a4662d2-9a2b-4f6e-a215-2970db914b0c", + "name": "sku1", + "description": "sku1", + "sku": "sku1", + "slug": "sku1", + "image": { + "mime_type": "", + "file_name": "", + "href": "" + }, + "quantity": 1, + "manage_stock": false, + "unit_price": { + "amount": 10000, + "currency": "USD", + "includes_tax": false + }, + "value": { + "amount": 10000, + "currency": "USD", + "includes_tax": false + }, + "discounts": [ + { + "amount": { + "amount": -2000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "e4d929d5-f471-4317-9a86-a84a6c572b44", + "promotion_source": "rule-promotion", + "is_cart_discount": true + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "de19a043-a6da-4bde-b896-d17e16b77e25", + "promotion_source": "rule-promotion" + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "509295ee-2971-45b6-801e-95df09756989" + }, + { + "amount": { + "amount": -1000, + "currency": "USD", + "includes_tax": false + }, + "code": "sale2024", + "id": "ca79e606-7ecd-41ac-9478-af4c8c28c546", + "promotion_source": "rule-promotion", + "is_cart_discount": true + } + ], + "links": { + "product": "https://useast.api.elasticpath.com/v2/products/5a4662d2-9a2b-4f6e-a215-2970db914b0c" + }, + "meta": { + "display_price": { + "with_tax": { + "unit": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + }, + "value": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + } + }, + "without_tax": { + "unit": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + }, + "value": { + "amount": 5000, + "currency": "USD", + "formatted": "$50.00" + } + }, + "tax": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "discount": { + "unit": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00" + }, + "value": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00" + } + }, + "without_discount": { + "unit": { + "amount": 10000, + "currency": "USD", + "formatted": "$100.00" + }, + "value": { + "amount": 10000, + "currency": "USD", + "formatted": "$100.00" + } + }, + "discounts": { + "sale2024": { + "amount": -5000, + "currency": "USD", + "formatted": "-$50.00", + "constituents": { + "509295ee-2971-45b6-801e-95df09756989": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "ca79e606-7ecd-41ac-9478-af4c8c28c546": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "de19a043-a6da-4bde-b896-d17e16b77e25": { + "amount": -1000, + "currency": "USD", + "formatted": "-$10.00" + }, + "e4d929d5-f471-4317-9a86-a84a6c572b44": { + "amount": -2000, + "currency": "USD", + "formatted": "-$20.00" + } + } + } + } + }, + "timestamps": { + "created_at": "2024-05-24T18:00:58Z", + "updated_at": "2024-05-24T18:00:58Z" + } + }, + "catalog_id": "09b9359f-897f-407f-89a2-702e167fe781", + "catalog_source": "pim" + } + + ``` + operationId: getCartItems + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + put: + tags: + - Cart Items + summary: Bulk Update Items in Cart + description: > + The bulk update feature allows shoppers to update an array of items to + their cart in one action, rather than updating each item one at a time. + Shoppers can update quantity and shipping group details in bulk + requests. This minimizes the time for shoppers while updating items to + their cart. Shoppers can even update multiple items with the same or + different shipping groups to their cart. + + + When you update multiple items that qualify for free gifts in the cart, + the corresponding free gifts for all eligible products are also + automatically updated in the cart. + operationId: bulkUpdateItemsInCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/BulkUpdateCartsItems' + required: false + responses: + '200': + description: '' + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + post: + tags: + - Cart Items + summary: Manage Carts + description: > + + ### Add Product to Cart + + + Adding a Product to Cart is the most common Cart action. If you want to + add any custom products or promotions, you need to do that as a separate + action. + + + #### Dynamic Bundles + + + A bundle is a purchasable product that is composed of a combination of + two or more products that you want to sell together. You can create + multiple components within a bundle. Each component can have one or more + options. Each option is a product and a quantity. You can configure + minimum and/or maximum values for the number of product options in a + component that your shoppers can select. For example, you can enable a + shopper to select 1 or more product options from a list of 10. These are + called [dynamic + bundles](/docs/api/pxm/products/products#dynamic-bundles). + + + Your dynamic bundles are displayed in your published catalogs. + + + 1. Use the configure a shopper endpoint to allow shoppers to make their + selections from a bundle. + + 2. In the response of the configure a shopper, the + `bundle_configuration` object contains the bundle selections a shopper + has made. + + 3. In the add a product to cart request, use the `bundle_configuration` + object to add the customers selections to a cart. + + + ```json + "bundle_configuration": { + "selected_options": { + "games": { + "d7b79eb8-19d8-45ea-86ed-2324a604dd9c": 1 + }, + "toys": { + "0192ccdd-6d33-4898-87d7-c4d87f2bf8ea": 1, + "1aea6f97-f0d9-452c-b3c1-7fb5629ead82": 1 + } + } + } + + ``` + + + When a cart is checked out, the options a shopper selected are added to + the order. See [order items](/docs/api/carts/get-order-items). + + + #### Personalized Products + + + You can allow shoppers to personalize their goods by adding custom text + inputs to products directly. This feature is particularly useful for + customizable items, such as personalized T-shirts or greeting cards. You + can use this functionality by leveraging the `custom_inputs` attribute, + and defining the details and validation rules for the custom text. + + + First, you must configure a `custom_inputs` attribute when creating a + new product or updating an existing product. Once you have defined your + custom inputs on a product, you must configure the custom inputs in your + orders. + + + For example, you may sell T-shirts that can have personalized text on + the front and back of the shirt. + + + ```json + { + "data": { + "type": "product", + "attributes": { + "custom_inputs": { + "front": { + "name": "T-Shirt Front", + "validation_rules": [ + { + "type": "string", + "options": { + "max_length": 50 + } + } + ], + "required": false + }, + "back": { + "name": "T-Shirt Back", + "validation_rules": [ + { + "type": "string", + "options": { + "max_length": 50 + } + } + ], + "required": false + } + } + } + } + } + + ``` + + + If the same product has different `custom_inputs` attributes, then these + are added as separate items in a cart. + + + The `custom_inputs` attribute is stored in the cart item and the text + for `custom_input` must not exceed 255 characters in length. When a cart + is checked out, the `custom_inputs` attribute becomes part of the order. + + + #### Limitations on Usage of `custom_inputs` with Specific Promotion + Types + + + When you add products to a cart with `custom_inputs`, there are certain + limitations on usage of the `custom_inputs` with the following promotion + types: + + - For [Free Gift Promotions](/docs/api/promotions/create-a-promotion), you can add `custom_inputs` to gift items. + - For [Fixed Bundle Discount Promotions](/docs/api/promotions/create-a-promotion), the promotion applies as long as the cart contains the bundle SKUs even when there are different `custom_inputs`. + - For [X for Y Discount Promotion and X for amount discount promotion](/docs/api/promotions/create-a-promotion), the promotion applies when there are two SKUs with the same `custom_inputs`. The promotion does not apply when there are different `custom_inputs` and the SKUs are in different line items. + + :::note + + + - Any requests to add a product to cart returns the collection of cart + items. + + - [Tax items](/docs/api/carts/tax-items) may optionally be added with + the product. Only administrators with [client + credentials](/docs/authentication/Tokens/client-credential-token) are + able to do this. If included, they replace any existing taxes on the + product. + + - The cart currency is set when the first item is added to the cart. + + - The product being added to the cart requires a price in the same + currency as the other items in the cart. The API returns a 400 error if + a price is not defined in the correct currency. + + - A cart can contain a maximum of 100 unique items. Items include + products, custom items, tax items, and promotions. + + - There are a number of actions that happen to your inventory when + checking out and paying for an order. For more information, see the + [Inventory](/docs/api/pxm/inventory/inventories-introduction) + documentation. + + + ::: + + + ### Add Custom Item to Cart + + + You can add a custom item to the cart when you don't manage things like + shipping, taxes and inventory in Commerce. + + + For [Shipping Groups](/docs/ship-groups/shipping-groups), once you have + created a [cart shipping + group](/docs/ship-groups/shipping-groups/shipping-groups-api/create-cart-shipping-group), + you need to link it to the cart items. This is important, because it is + necessary to associate items with shipping groups in order to include + shipping groups in the corresponding cart, order, and totals. + + + :::note + + + - Custom Cart Items are available through [implicit + authentication](/docs/authentication/Tokens/implicit-token). Ensure that + you always check each order has the correct details for each item, most + importantly, price. + + + ::: + + + ### Add Promotion to Cart + + + You can use the Promotions API to apply discounts to your cart as a + special cart item type. Any requests to add a product to cart will + return a collection of cart items. + + There are certain limitations on usage of the `custom_inputs` attribute with some promotion types. See [Limitations on Usage of `custom_inputs` with Specific Promotion Types](/docs/api/carts/manage-carts#limitations-on-usage-of-custom_inputs-with-specific-promotion-types). + + To remove promotion from the cart via the promotion code, see [Delete + Promotion Code from + Cart](/docs/api/carts/delete-a-promotion-via-promotion-code). + + + ### Re-order + + + From a shopper’s order history, they can add the items from a previous + order into their carts. Shoppers can add items regardless of past order + status, such as incomplete or not paid. For more information, see + [Orders](/docs/api/carts/orders). + + + :::note + - Any requests to add an item to cart return a collection of [cart items](/docs/api/carts/cart-items). + - A cart can contain a maximum of 100 unique items. Items include products, custom items, and promotions. + - When a shopper creates a cart and re-orders items from an order with properties such as custom attributes, custom discounts, and payment intent ID, these properties will remain unchanged in the original cart. + - Custom items do not exist in catalogs, and therefore cannot be reordered. + ::: + + + ### Merging Carts + + + A shopper can have multiple carts, and the system may automatically + merge items from an anonymous cart into the shopper's registered cart + when they sign in. For example, if a shopper has an existing cart with + items `A`, `B` and `C`, and later adds items `D` and `E` while not + signed in, the system can merge these carts when the shopper signs in. + After the carts merge, the cart contains items `A`, `B`, `C`, `D` and + `E`. + + + If any items are duplicated from the anonymous cart to the registered + cart, their quantities are incremented accordingly. For example, if a + shopper's existing cart with items `A`, `B` and `C`, and they later add + two more `A` items and one `B` item while not signed in, the system will + merge the carts when the shopper signs in. The existing cart will now + contain three `A` items, two `B` items, and one `C` item. + + + :::note + + + When the system merges items from one cart into another cart, properties + such as custom attributes, custom discounts, and payment intent ID will + remain unchanged in the original cart. + + + ::: + + + ### Best Practices + + + We recommend to include a unique `sku` code within the request body + while adding custom items to carts. If the same `sku` is used for + multiple products, they are merged into a single line item. + + + For example, if a cart consists of the following items: + + + - `product-1` with quantity 1 and sku code as `sku-1` + + - `product-2` with quantity 1 and sku code as `sku-1` + + - `product-3` with quantity 1 and sku code as `sku-2`. + + + The following response is returned where it combines all products with + the same sku codes into a single line item, while products with a unique + sku codes are represented as separate items: + + + ```json + + { + "data": [ + { + "id": "c58760f4-8889-4719-b34d-be1f1d11ae59", + "type": "custom_item", + "name": "product-1", + "description": "My first custom item!", + "sku": "sku-1", + "slug": "", + "image": { + "mime_type": "", + "file_name": "", + "href": "" + }, + "quantity": 2, + "manage_stock": false, + "unit_price": { + "amount": 20000, + "currency": "USD", + "includes_tax": true + }, + "value": { + "amount": 40000, + "currency": "USD", + "includes_tax": true + }, + "links": {}, + "meta": { + "display_price": { + "with_tax": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + }, + "without_tax": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + }, + "tax": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "discount": { + "unit": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + }, + "value": { + "amount": 0, + "currency": "USD", + "formatted": "$0.00" + } + }, + "without_discount": { + "unit": { + "amount": 20000, + "currency": "USD", + "formatted": "$200.00" + }, + "value": { + "amount": 40000, + "currency": "USD", + "formatted": "$400.00" + } + } + }, + "timestamps": { + "created_at": "2023-05-02T16:28:11Z", + "updated_at": "2023-05-02T16:28:18Z" + } + } + } + ``` + operationId: manageCarts + parameters: + - name: cartID + in: path + description: The unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CartItemsObjectRequest' + - $ref: '#/components/schemas/CartMergeObjectRequest' + - $ref: '#/components/schemas/CustomItemObject' + - $ref: '#/components/schemas/ReOrderObjectRequest' + - $ref: '#/components/schemas/PromotionItemObject' + - $ref: '#/components/schemas/BulkAddItemsRequest' + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Cart Items + summary: Delete all Cart Items + description: > + A shopper can clean up their cart, deleting custom items, promotions, + and so on, while the empty cart remains available. The cart id, name, + description, and any account or customer associations persist. The + shopper can continue to add items to the cart. + operationId: deleteAllCartItems + parameters: + - name: cartID + in: path + description: The unique identifier of the cart created by you. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items/{cartitemID}: + put: + tags: + - Cart Items + summary: Update a Cart Item + description: >- + You can easily update a cart item. A successful update returns the cart + items. + operationId: updateACartItem + parameters: + - name: cartID + in: path + description: A unique identifier of the cart that you created. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: A unique identifier of the cart item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UpdateCartsItems' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + $ref: '#/components/schemas/CartsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Cart Items + summary: Delete a Cart Item + description: Use this endpoint to delete a cart item. + operationId: deleteACartItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart created by you. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart that you want to delete. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/relationships/accounts: + post: + tags: + - Account Cart Associations + summary: Create an Account Cart Association + description: >- + You can create associations between an account and one or more carts. + After cart associations exist for an account, the account can access + those carts across any device. + operationId: createAccountCartAssociation + parameters: + - name: cartID + in: path + description: >- + The ID for the cart created by the account. Ensure that you follow + the guidelines for [Safe + Characters](/guides/Getting-Started/safe-characters). + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: >- + An Account Management Authentication token to access a specific + account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + required: false + responses: + '200': + description: OK + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + '204': + description: >- + No Content is sent back in case the account has already been + associated to the cart. + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Account Cart Associations + summary: Delete Account Cart Association + description: You can delete an association between an account and a cart. + operationId: deleteAccountCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the account. + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: >- + An Account Management Authentication token to access a specific + account's carts. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsAccountsData' + required: false + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/relationships/customers: + post: + tags: + - Customer Cart Associations + summary: Create a Customer Cart Association + description: >- + You can create associations between a customer and one or more carts. + After cart associations exist for a customer, the customer can access + those carts across any device. + operationId: createCustomerCartAssociation + parameters: + - name: cartID + in: path + description: >- + The ID for the cart created by the customer. Ensure that you follow + the guidelines for [Safe + Characters](/guides/Getting-Started/safe-characters). + required: true + style: simple + schema: + type: string + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + required: false + responses: + '200': + description: OK + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Customer Cart Associations + summary: Delete Customer Cart Association + description: You can delete an association between a customer and a cart. + operationId: deleteCustomerCartAssociation + parameters: + - name: cartID + in: path + description: The ID for the cart created by the customer. + required: true + style: simple + schema: + type: string + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's carts. + style: simple + schema: + type: string + example: '{{customerToken}}' + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsRelationshipsCustomersData' + required: false + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/discounts/{promoCode}: + delete: + tags: + - Cart Items + summary: Delete a Promotion via Promotion Code + description: >- + You can remove promotion code from a cart if it was applied manually. + This endpoint does not work if the promotion is applied automatically. + operationId: deleteAPromotionViaPromotionCode + parameters: + - name: cartID + in: path + description: Specifies the unique identifier of a cart created by you. + required: true + style: simple + schema: + type: string + - name: promoCode + in: path + description: Specifies the promotion code to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items/{cartitemID}/taxes: + post: + tags: + - Tax Items + summary: Add Tax Item to Cart + description: > + + Use this endpoint to add a tax item to a cart. + + + :::note + + + There is a soft limit of 5 unique tax items per cart item at any one + time. + + + ::: + operationId: addTaxItemToCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + '422': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 422 + title: Unprocessable Entity + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/taxes: + post: + tags: + - Tax Items + summary: Bulk Add Tax Items to Cart + description: > + :::note + + + A cart item can only have a maximum of five tax items. + + + ::: + + + ### Errors + + + `422 Unprocessable Entity` + + + In this example, when `options.add_all_or_nothing` is set to `true` and + if one of cart items is not found or or has reached its maximum tax item + limit, the following error response is returned: + + + ```json + + { + "status": 422, + "title": "Add all or nothing.", + "detail": "Add all or nothing set to (true). Could not bulk add tax items to cart." + } + + ``` + + + In this example, if you add more than five tax items to the same cart + item, the following error response is returned: + + + ```json + + { + "status": 422, + "title": "Tax item not added to cart item.", + "detail": "Cannot exceed tax item limit of (5) on cart item.", + "meta": { + "id": "f88e6370-cb35-40b2-a998-c759f31dec0a" + } + } + ``` + + + `404` + + + In this example, if there is a mismatch between + `cart_item`/`custom_item` and the `relationships.item.data.type` + specified in the bulk add tax item, the following error response is + returned: + + + ```json + + { + "data": [], + "errors": [ + { + "status": 404, + "title": "Tax item not added to cart item.", + "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + "meta": { + "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + } + }, + { + "status": 404, + "title": "Tax item not added to cart item.", + "detail": "Mismatch between bulk tax item type(cart_item) and cart item type(custom_item).", + "meta": { + "id": "56aab5d1-1dd4-45ed-88ed-4d0cc396b62d" + } + } + ] + } + + ``` + operationId: bulkAddTaxItemsToCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkTaxes' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkTaxes' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Tax Items + summary: Bulk Delete Tax Items from Cart + description: Use this endpoint to bulk delete tax items from cart. + operationId: bulkDeleteTaxItemsFromCart + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items/{cartitemID}/taxes/{taxitemID}: + put: + tags: + - Tax Items + summary: Update a TaxItem + description: Use this endpoint to update a tax item. + operationId: updateATaxItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + - name: taxitemID + in: path + description: The unique identifier of the tax item. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsItemsTaxesObject' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Tax Items + summary: Delete a Tax Item + description: Use this endpoint to delete a tax item. + operationId: deleteATaxItem + parameters: + - name: cartID + in: path + description: The unique identifier of the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: The unique identifier of the cart item. + required: true + style: simple + schema: + type: string + - name: taxitemID + in: path + description: The unique identifier of the tax item. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/custom-discounts: + post: + tags: + - Custom Discounts + summary: Bulk Add Custom Discounts to Cart + description: > + The default value for custom discounts on both the cart and cart items + is set to 5 if this parameter is not configured in the store. To verify + the custom discount limit value, call [Get all + settings](/docs/api/settings/get-v-2-settings) endpoint. + + + To increase the custom discount value, contact [Elastic Path Support + team](https://support.elasticpath.com/hc/en-us). + operationId: bulkAddCustomDiscountsToCart + parameters: + - name: cartID + in: path + description: >- + Specifies the system generated ID for the cart that the shopper + created. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkCustomDiscounts' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsBulkCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Custom Discounts + summary: Bulk Delete Custom Discounts From Cart + description: Use this endpoint to bulk delete custom discounts from cart. + operationId: bulkDeleteCustomDiscountsFromCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/custom-discounts/{customdiscountID}: + put: + tags: + - Custom Discounts + summary: Update Custom Discount For Cart + description: Use this endpoint to update a custom discount in your cart. + operationId: updateCustomDiscountForCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be updated. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Custom Discounts + summary: Delete Custom Discount From Cart + description: Use this endpoint to delete custom discount from cart. + operationId: deleteCustomDiscountFromCart + parameters: + - name: cartID + in: path + description: Specifies the unique ID for the cart. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items/{cartitemID}/custom-discounts: + post: + tags: + - Custom Discounts + summary: Add Custom Discount To Cart Item + description: Use this endpoint to add a custom discount to cart item. + operationId: addCustomDiscountToCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the unique identifier for the cart item. + required: true + style: simple + schema: + type: string + requestBody: + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/items/{cartitemID}/custom-discounts/{customdiscountID}: + put: + tags: + - Custom Discounts + summary: Update Custom Discount For Cart Item + description: Use this endpoint to update a custom discount in your cart item. + operationId: updateCustomDiscountForCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the ID for the cart item. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be updated. + required: true + style: simple + schema: + type: string + requestBody: + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsObject' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/CartsCustomDiscountsResponse' + deprecated: false + security: + - bearerAuth: [] + delete: + tags: + - Custom Discounts + summary: Delete Custom Discount From Cart Item + description: Use this endpoint to delete custom discount from cart item. + operationId: deleteCustomDiscountFromCartItem + parameters: + - name: cartID + in: path + description: Specifies the ID for the cart. + required: true + style: simple + schema: + type: string + - name: cartitemID + in: path + description: Specifies the ID for the cart item. + required: true + style: simple + schema: + type: string + - name: customdiscountID + in: path + description: Specifies the ID for the custom discount to be deleted. + required: true + style: simple + schema: + type: string + responses: + '204': + description: No Content + headers: {} + content: {} + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/payments: + post: + tags: + - Payments + summary: Create Stripe Payment Intent for a Cart + description: > + The Cart Payment Intent feature enables the creation of a Stripe Payment + Intent specifically tied to a shopping cart and its subsequent order. + This allows Payment Intent users to track payment details from the cart + stage and seamlessly maintain consistency in payment information + throughout the order stage. Using these features, you can create Payment + Intents for their carts, update Payment Intents with final cart details, + and synchronize Payment Intents from Stripe to Commerce. + + + :::note + + + - Typically, in Commerce, inventory is allocated at the time of payment + initiation after an order is created. However, in the case of Cart + Payment Intent, information about the payment is received only upon + synchronizing the order from Stripe to Commerce. This may happen after + the payment is completed. Therefore, there might be a delay between the + payment made and allocation, increasing the chance of paying for items + that are not in stock. + + - There are certain fields you can choose to set up when [creating a + payment intent](https://stripe.com/docs/api/payment_intents/create). + However, if you decide to update a payment intent, the available options + may not be the same as those allowed while creating a payment intent. + See [updating a payment + intent](https://stripe.com/docs/api/payment_intents/update). + + + ::: + + + The following steps outline the workflow associated with the Payment + Intent: + + + 1. [Add items to + cart](/docs/api/carts/manage-carts#add-custom-item-to-cart). + + 1. [Create a Payment Intent for the + cart](/docs/api/carts/create-cart-payment-intent). The Payment Intent is + created in Stripe, reflecting the cart and transaction details, + including currency, amounts, payment type, and any optional Stripe + details. The Payment Intent ID is generated and linked to the cart. + + 1. [Update a Payment + Intent](/docs/carts-orders/update-cart-payment-intent). This step is + optional but becomes necessary when there are changes in the cart + details at the time of payment. It ensures the Payment Intent accurately + reflects the current cart details when processing the payments on the + front end. + + 1. [Checkout the cart](/docs/api/carts/checkout). An unpaid order is + created, and the Payment Intent ID is linked to the order. + + 1. [Confirm the order](/docs/carts-orders/confirm-an-order). This is + important because after checkout, it is essential to confirm the Payment + Intent and synchronize it with Commerce. This results in a corresponding + transaction and change in order statuses in Commerce. Additionally, the + Payment Intent ID is removed from the order once it is linked via the + transaction. + + + ### Best Practices + + + We recommend you follow these practices to maintain consistency and + accuracy when using Cart Payment Intent. + + + - After checkout, we recommend clearing the shopping cart. You can + achieve this using a [Delete a cart](/docs/api/carts/delete-a-cart) + endpoint or [Update a cart](/docs/api/carts/update-a-cart) to remove the + Payment Intent ID. This helps to avoid potential issues where subsequent + checkouts for the same cart might unintentionally use the previous + Stripe Payment Intent ID. + + - If it is not reasonable to clear the cart immediately after checkout + due to several subsequent, duplicate checkouts to the same cart, ensure + that you only synchronize the Payment Intent when finalizing the order. + Each order confirmation is unaware of the others, and syncing Payment + Intent IDs for each confirmation can lead to duplicate transactions in + Commerce. In other words, if you synchronize Payment Intents for earlier + versions of a repeated checkout, you'll end up with multiple orders from + the same cart, each having transactions linked to the same Payment + Intent. + + - To pay the entire amount at once, use the [Update Cart Payment + Intent](/docs/carts-orders/update-cart-payment-intent) endpoint to + update the Stripe Payment Intent with the final cart details when + preparing to take the payment. Doing so, ensures that the Payment Intent + accurately reflects the current cart details when processing payments on + the front end. We do not recommend calling the [Update Cart Payment + Intent](/docs/carts-orders/update-cart-payment-intent) for each + individual change in the cart, as this can lead to more requests and may + slow down the front-end performance. + operationId: createCartPaymentIntent + parameters: + - name: cartID + in: path + required: true + style: simple + schema: + type: string + description: >- + The universally unique identifier of the cart for which you want to + create a payment intent. + requestBody: + required: false + content: + application/json: + schema: + $ref: '#/components/schemas/ElasticPathPaymentsPoweredByStripePayment' + responses: + '201': + description: Payment Intent created successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/CartResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/carts/{cartID}/checkout: + post: + tags: + - Checkout + summary: Checkout API + description: > + When a Cart is ready for checkout, you can convert the cart to an order. + The cart remains and can be modified and checked out again if required. + + + A cart can be checked out with a customer ID, customer object, or with + an account by authenticating with the `Client Credentials Token`. + + + After a successful checkout, a response that contains the order is + returned. If the cart is linked to a shipping group, the shipping group + is also associated with the order after checkout. + + + You can checkout using one of the following methods: + + - Customer ID. You can checkout a cart with an existing customer ID. + + - Guest Checkout (Checkout with Customer Object). You can checkout a + cart with an associated customer name and email. + + - Checkout with Account. The shopper authenticates with the `Client + Credentials` Token. + + - Checkout with Account Management Authentication Token. The shopper + authenticates with the `Implicit Token` and the + `EP-Account-Management-Authentication-Token`. + + + :::note + + + - The cart currency is set when the first item is added to the cart. + + - The product being added to the cart requires a price in the same + currency as the other items in the cart. The API returns a 400 error if + a price is not defined in the correct currency. + + - To ensure that a free gift is automatically applied to an order, set + the promotion to automatic. The checkout process will not be successful + if free gift items are out of stock. See [Errors](#errors) section. + + + ::: + + + :::caution + + + - By default, carts are automatically deleted 7 days after the last + update. You can change this setting by [updating cart + settings](/docs/api/settings/put-v-2-settings-cart). + + - Your inventory is modified during checkout and payment of an order. + For more information about the changes in the inventory, see the + [Inventory](/docs/api/pxm/inventory/inventories-introduction) section. + + + ::: + + + ### Next Steps + + + After a cart has been converted to an Order using either of the previous + methods, you most likely want to capture payment for order. See [Paying + for an Order](/docs/api/carts/payments). + + + ### Errors + + + The following error response is returned during checkout when an + eligible item is added to the cart, and the free gift is out of stock. + + + ```json + + { + "errors": [ + { + "status": 400, + "title": "Insufficient stock", + "detail": "There is not enough stock to add gift2 to your cart", + "meta": { + "id": "f2b68648-9621-45a3-aed6-1b526b0f5beb", + "sku": "gift2" + } + } + ] + } + + ``` + operationId: checkoutAPI + parameters: + - name: cartID + in: path + description: The ID of the cart that you want to checkout. + required: true + style: simple + schema: + type: string + - name: EP-Account-Management-Authentication-Token + in: header + description: >- + An account management authentication token that identifies the + authenticated account member. + style: simple + schema: + type: string + example: '{{accountToken}}' + requestBody: + description: '' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CustomerCheckout' + - $ref: '#/components/schemas/AccountCheckout' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders: + get: + tags: + - Orders + summary: Get All Orders + description: > + This endpoint returns all orders with custom flow fields. The pagination + offset is set to fetch a maximum of 10,000 orders. If the store has + 10,000 orders and you fetch the orders without using filters, an error + is returned. Use a filter to view orders when the order is beyond the + 10,000 mark. + + + :::note + + + - Pass the `X-Moltin-Customer-Token` header to limit orders to a + specific customer. See [Customer + Tokens](/docs/customer-management/customer-management-api/customer-tokens). + + - Pass the `EP-Account-Management-Authentication-Token` header to limit + orders to a specific account. See [Account Management + Token](/docs/api/accounts/post-v-2-account-members-tokens). + + - You can use pagination with this resource. For more information, see + [pagination](/guides/Getting-Started/pagination). + + + ::: + + + ### Filtering + + + The following operators and attributes are available for filtering + orders. + + + | Attribute | Type | Operator | Example | + + | :--- | :--- | :--- | :--- | + + | `status` | `string` | `eq` | `eq(status,complete)` | + + | `payment` | `string` | `eq` | `eq(payment,paid)` | + + | `shipping` | `string` | `eq` | `eq(shipping,unfulfilled)` | + + | `name` (`customer.name`) | `string` | `eq` / `like` | + `like(name,Brad*)` | + + | `email` (`customer.email`) | `string` | `eq` / `like` | + `like(email,*@elasticpath.com)` | + + | `customer_id` | `string` | `eq` / `like` | `eq(customer_id, + e5a0d684-a4af-4919-a348-f66b0b4955e0)` | + + | `account_id` | `string` | `eq` / `like` | + `eq(account_id,3d7200c9-a9bc-4085-9822-63e80fd94a09)` | + + | `account_member_id` | `string` | `eq` / `like` | + `eq(account_member_id,2a8a3a92-2ccd-4b2b-a7af-52d3896eaecb)` | + + | `contact.name` | `string` | `eq` / `like` | `eq(name,John Doe)` | + + | `contact.email` | `string` | `eq` / `like` | `eq(email,John Doe)` | + + | `shipping_postcode` | `string` | `eq` / `like` | + `like(shipping_postcode,117*)` | + + | `billing_postcode` | `string` | `eq` / `like` | + `like(billing_postcode,117*)` | + + | `with_tax` | `integer` | `gt`/`ge`/`lt`/`le` | `ge(with_tax,10000)` | + + | `without_tax` | `integer` | `gt`/`ge`/`lt`/`le` | + `ge(without_tax,10000)` | + + | `currency` | `string` | `eq` | `eq(currency,USD)` | + + | `product_id` | `string` | `eq` | + `eq(product_id,6837058c-ae42-46db-b3c6-7f01e0c34b40)` | + + | `product_sku` | `string` | `eq` | `eq(product_sku,deck-shoe-001)` | + + | `created_at` | `date` | `eq` / `gt` / `ge`/ `le` / `lt` | + `gt(created_at,YYYY-MM-DD)` | + + | `updated_at` | `date` | `eq` / `gt` / `ge`/ `le`/ `lt` | + `lt(updated_at,YYYY-MM-DD)` | + + | `external_ref` | `string` | `eq` / `like` | `like(external_ref, + 16be*)` | + operationId: getCustomerOrders + parameters: + - name: x-moltin-customer-token + in: header + description: A customer token to access a specific customer's orders. + style: simple + schema: + type: string + example: '{{customerToken}}' + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/OrderResponse' + links: + $ref: '#/components/schemas/Response.PageLinks' + meta: + $ref: '#/components/schemas/Response.Meta.Orders' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}: + get: + tags: + - Orders + summary: Get an Order + description: Use this endpoint to retrieve a specific order. + operationId: getAnOrder + parameters: + - name: orderID + in: path + description: The ID of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + put: + tags: + - Orders + summary: Update an Order + description: > + You can only update custom data, `shipping`, `shipping_address`, and + status on orders. All other settings in the order object are immutable. + + + :::caution + + + You can update `shipping`, `shipping_address`, and status of an order + only if the order is not fulfilled. You can use the refund API to refund + an order only if the payment status is `paid`. Canceling an order does + not automatically refund a payment. You must refund the orders manually. + + + ::: + + + :::note + + + - This request is only accessible to client credentials token users with + Seller Admin role. + + - Non client credentials token users cannot access this endpoint. See + [Permissions](/docs/authentication/Tokens/permissions). + + + ::: + operationId: updateAnOrder + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersUpdateRequest' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/items: + get: + tags: + - Orders + summary: Get Order Items + description: Use this endpoint to retrieve order items. + operationId: getOrderItems + parameters: + - name: orderID + in: path + description: The ID of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/OrderItemResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/anonymize: + post: + tags: + - Orders + summary: Anonymize Orders + description: > + You can anonymize an order when it is fulfilled, canceled, or fully + refunded. + + + When anonymization is successful, Personal Identifiable Information such + as customer details, `shipping_address`, and `billing_address` are + replaced with *. + operationId: anonymizeOrders + parameters: [] + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersAnonymizeRequest' + contentMediaType: application/json + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/OrderResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + '422': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + detail: >- + Order has status: order:incomplete, payment:unpaid, + shipping:unfulfilled; only fulfilled or refunded or + cancelled orders may be anonymized + status: 422 + title: Could not anonymize orders + meta: + order_id: 496c29a1-6e7a-4ab6-a4e7-d1ec9a08b85e + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/payments: + post: + tags: + - Payments + summary: Authorize Setup + description: Authorize setup + operationId: authorizeSetup + parameters: + - name: orderID + in: path + description: >- + The Universally Unique Identifier (UUID) of the order you want to + pay for. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/PaymentsRequest' + required: false + responses: + '200': + description: OK + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions/{transactionID}/confirm: + post: + tags: + - Payments + summary: Confirm Setup + description: Confirm setup + operationId: confirmSetup + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsConfirmRequest' + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions/{transactionID}/capture: + post: + tags: + - Transactions + summary: Capture a Transaction + description: >- + Use this endpoint to capture a previously authorized payment. In this + step, you can also pass in a custom reference, such as the payment + reference from your chosen gateway. + operationId: captureATransaction + parameters: + - name: orderID + in: path + description: The UUID of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The UUID of the transaction to capture. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsCaptureRequest' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions/{transactionID}/refund: + post: + tags: + - Transactions + summary: Refund a Transaction + description: > + There are two ways to refund; through your payment gateway and mark it + refunded in Commerce Manager, or directly through Commerce Manager or + API. + + + * Mark as Refunded: You can manually mark a transaction as refunded. + Before you can mark the order as refunded, you need to handle the actual + refund on your side with your payment provider. Mark as Refunded is a + full refund made to the transaction. + + * Refund through Composable Commerce: You can process a full or partial + refund to a supported payment provider directly from Commerce Manager or + API by providing the refund amount. When you start the refund process, + the request is directly sent to the payment gateway. + + + :::caution + + + If you use manual gateway for partial or full refund, you need to handle + the actual refund on your side with your payment provider. + + + ::: + operationId: refundATransaction + parameters: + - name: orderID + in: path + description: The UUID of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The UUID of the transaction you want to refund. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsRefundRequest' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions: + get: + tags: + - Transactions + summary: Get Order Transactions + description: Get order transactions + operationId: getOrderTransactions + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + type: array + items: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions/{transactionID}: + get: + tags: + - Transactions + summary: Get a Transaction + description: Retrieves a transaction + operationId: getATransaction + parameters: + - name: orderID + in: path + description: >- + The unique identifier of the order that you require transactions + for. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction. + required: true + style: simple + schema: + type: string + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] + /v2/orders/{orderID}/transactions/{transactionID}/cancel: + post: + tags: + - Transactions + summary: Cancel a Transaction + description: > + Use this endpoint to cancel or void a pending or authorized transaction. + The transaction can be canceled or voided when it is in `pending` and + `completed` statuses. + + + :::caution + + + This endpoint works only for Stripe and PayPal and does not work for + manual gateway. + + + ::: + operationId: cancelATransaction + parameters: + - name: orderID + in: path + description: The unique identifier of the order. + required: true + style: simple + schema: + type: string + - name: transactionID + in: path + description: The unique identifier of the transaction to be canceled or voided. + required: true + style: simple + schema: + type: string + requestBody: + description: '' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrdersTransactionsCancelRequest' + required: false + responses: + '200': + description: '' + headers: {} + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Response.Data' + - properties: + data: + $ref: '#/components/schemas/TransactionResponse' + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/Response.Error' + example: + errors: + status: 401 + title: Unauthorized + deprecated: false + security: + - bearerAuth: [] + parameters: [] +components: + parameters: + accept-language: + description: >- + The language and locale your storefront prefers. See + [Accept-Language](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language). + in: header + name: accept-language + required: false + schema: + type: string + channel: + description: >- + The list of channels in which this catalog can be displayed. A channel + is the shopping experience, such as a mobile app or web storefront. If + empty, the catalog rule matches all channels. The channel will + eventually be included in the bearer token that is used for + authorization, but currently, you must set the `EP-Channel` header in + your requests. + in: header + name: EP-Channel + required: false + schema: + type: string + filter-hierarchy: + name: filter + in: query + description: | + This endpoints supports filtering. See [Filtering](#filtering). + required: false + schema: + type: string + filter-node: + name: filter + in: query + description: | + This endpoint supports filtering, see [Filtering](#filtering). + required: false + schema: + type: string + filter-product: + name: filter + in: query + description: | + This endpoints support filtering. See [Filtering](#filtering). + required: false + schema: + type: string + filter-rule: + name: filter + in: query + description: | + This endpoint supports filtering. See [Filtering](#filtering). + required: false + schema: + type: string + include: + name: include + in: query + description: > + Using the `include` parameter, you can retrieve top-level resources, + such as, files or main image, bundle component products. + required: false + schema: + type: array + items: + type: string + enum: + - main_images + - files + - component_products + include-component-products: + name: include + in: query + description: > + Using the `include=component_products` parameter, you can retrieve key + attribute data for the bundle component products in the product bundle, + such as SKU or slug . + required: false + schema: + type: string + limit: + description: >- + The maximum number of records per page for this response. You can set + this value up to 100. If no page size is set, the [page + length](/docs/api/settings/settings-introduction#page-length) store + setting is used. + name: page[limit] + in: query + required: false + schema: + type: integer + format: int64 + minimum: 1 + offset: + description: >- + The current offset by number of records, not pages. Offset is + zero-based. The maximum records you can offset is 10,000. If no page + size is set, the [page + length](/docs/api/settings/settings-introduction#page-length) store + setting is used. + name: page[offset] + in: query + required: false + schema: + type: integer + format: int64 + maximum: 10000 + minimum: 0 + tag: + description: >- + Product tags are used to store or assign a key word against a product. + The product tag can then be used to describe or label that product. + Using product tags means that you can group your products together, for + example, by brand, category, subcategory, colors, types, industries, and + so on. You can enhance your product list using tags, enabling you to + refine your product list and run targeted promotions. Tags are used to + refine the eligibility criteria for a rule. Requests populate the + catalog rule tag using the `EP-Context-Tag` header. + in: header + name: EP-Context-Tag + required: false + schema: + type: string + schemas: + amount: + description: The three-letter ISO code for the currency associated with this price. + type: object + properties: + amount: + description: >- + The price in the lowest denomination for the specified currency. + This is a product's list price. + type: integer + format: int64 + examples: + - 100 + x-go-name: Amount + x-omitempty: false + includes_tax: + description: Whether this price includes tax. + type: boolean + examples: + - false + default: false + x-go-name: IncludesTax + title: Amount + x-go-name: PriceAmount + prioritized-pricebooks: + description: >- + If you want multiple price books for different scenarios, such as + seasonal sales, business versus retail pricing, and reward programs, + when creating a catalog, you can specify up to five price books. You + must configure a priority for your price books. Product prices are + displayed in the catalog according to the priority of the price books. + type: array + items: + type: object + properties: + id: + description: A unique identifier of a price book. + type: string + format: uuid + priority: + description: >- + Priority is a number and the price book with the highest number + has the highest priority. + type: integer + required: + - priority + - id + x-go-name: PrioritizedPricebook + maxItems: 5 + catalog: + description: Creates a catalog with the following attributes. + type: object + properties: + id: + description: A unique identifier of a catalog. + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: The name of a catalog. + type: string + examples: + - catalog-123 + description: + description: >- + A brief description of the catalog, such as the purpose of the + catalog. + type: string + examples: + - Catalog for Store 123 + default: '' + hierarchy_ids: + description: >- + The unique identifiers of the hierarchies associated with a + catalog. + type: array + items: + type: string + pricebook_id: + description: >- + The unique identifier of a price book associated with a catalog. + If no price book is selected, the catalog is displayed without + prices. + type: string + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: >- + Product Experience Manager supports localization of products and + hierarchies. If you store supports multiple languages, you can + localize product names and descriptions. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.iso.org/iso-639-language-code) that + represents the name of language you have used. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.iso.org/iso-639-language-code) that + represents the name of language you have used. + type: string + created_at: + description: The date and time a catalog is created. + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + updated_at: + description: The date and time a catalog was updated. + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + owner: + description: >- + The owner of this resource, can be either `organization` or + `store`. + type: + - string + - 'null' + default: store + enum: + - store + - organization + x-go-name: Owner + required: + - name + - hierarchy_ids + - created_at + - updated_at + relationships: + description: >- + Relationships are established between different catalog entities. + For example, a catalog rule and a price book are related to a + catalog, as both are associated with it. + type: object + properties: + rules: + description: The catalog rules related to a catalog. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + releases: + description: >- + When a catalog is published, a catalog release is created. This + is a URL to all catalog published releases available for this + catalog. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + meta: + type: object + properties: + count: + description: The number releases available for a catalog. + type: integer + title: CatalogRelationships + type: + type: string + examples: + - catalog + const: catalog + required: + - id + - type + - attributes + title: Catalog + catalog-create-data: + description: Creates a catalog with the following attributes. + type: object + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: The name of the catalog. + type: string + examples: + - catalog-123 + minLength: 1 + description: + description: A brief description of the catalog. + type: + - string + - 'null' + examples: + - Catalog for Store 123 + hierarchy_ids: + description: >- + The unique identifiers of the hierarchies to associate with + a catalog. + type: array + items: + type: string + pricebook_id: + description: > + The unique identifier of the price book to associate with + this catalog. You can specify either a `pricebook_id` or + `pricebook_ids` but not both. If you specify both a + `pricebook_id` and `pricebook_ids`, a `422 Unprocessable + Entity` error is displayed. + type: string + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: >- + Product Experience Manager supports localization of products + and hierarchies. If you store supports multiple languages, + you can localize product names and descriptions. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.iso.org/iso-639-language-code) that + represents the name of language you have used. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.iso.org/iso-639-language-code) that + represents the name of language you have used. + type: string + required: + - name + - hierarchy_ids + type: + description: Represents the type of object being returned. Always `Catalog`. + type: string + examples: + - catalog + const: catalog + required: + - type + - attributes + required: + - data + title: CatalogCreateData + catalog-data: + description: Container for a single catalog. + type: object + properties: + data: + $ref: '#/components/schemas/catalog' + links: + $ref: '#/components/schemas/links' + required: + - data + title: CatalogData + catalog-list-data: + description: Container for a list of catalogs. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/catalog' + links: + $ref: '#/components/schemas/links' + required: + - data + title: CatalogListData + catalog-update-data: + description: A catalog combines price books, product lists, and hierarchies. + type: object + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: The name of the catalog. + type: + - string + - 'null' + examples: + - catalog-123 + minLength: 1 + description: + description: A brief description of the catalog. + type: + - string + - 'null' + examples: + - Catalog for Store 123 + hierarchy_ids: + description: >- + The unique identifiers of the hierarchies to associate with + a catalog. + type: + - array + - 'null' + items: + type: string + pricebook_id: + description: >- + The unique identifier of a price book to associate with a + catalog. You can specify a `pricebook_id` or a + `pricebook_ids` but not both. If you specify both, a `422 + unprocessable entity` error is displayed. + type: + - string + - 'null' + pricebook_ids: + $ref: '#/components/schemas/prioritized-pricebooks' + locales: + description: >- + Product Experience Manager supports localization of products + and hierarchies. If you store supports multiple languages, + you can localize product names and descriptions. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.loc.gov/standards/iso639-2/) that + represents the name of language you have used. + type: object + additionalProperties: + description: >- + A [three-letter language + code](https://www.loc.gov/standards/iso639-2/) that + represents the name of language you have used. + type: string + id: + description: The unique identifier of the catalog to be updated. + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-go-name: ID + type: + description: >- + This represents the type of object being returned. Always + `catalog`. + type: string + examples: + - catalog + const: catalog + required: + - type + - id + - attributes + required: + - data + title: CatalogUpdateData + component-product: + description: The unique identifier of the component, for example, `games`. + type: object + properties: + name: + description: The component name is the name that is displayed in your storefront. + type: string + x-go-name: Name + min: + description: >- + The minimum number of product options a shopper can select from this + component. + type: + - integer + - 'null' + x-go-name: Min + max: + description: >- + The maximum number of product options a shopper can select from this + component. + type: + - integer + - 'null' + x-go-name: Max + sort_order: + description: >- + The sort order of the components. The `create a bundle` and `update + a bundle` endpoints do not sort the components. You can use the + `sort_order` attribute when programming your storefront to display + the components in the order that you want. + type: + - integer + - 'null' + x-go-name: Sort Order + options: + description: >- + The product options included in a component. This can be the ID of + another bundle. + type: array + items: + $ref: '#/components/schemas/component-product-option' + x-go-name: Options + title: Component Product + component-product-option: + description: >- + The product options included in a component. This can be the ID of + another bundle. + type: object + properties: + id: + description: A unique identifier of the product you want to add to a component. + type: string + format: uuid + x-go-name: ID + type: + description: This represents the type of object being returned. Always `product`. + type: string + examples: + - product + default: product + const: product + x-go-name: Type + quantity: + description: The number of this product option that a shopper must purchase. + type: integer + examples: + - 2 + x-go-name: Quantity + sort_order: + description: >- + The sort order of the options. The `create a bundle` and `update a + bundle` endpoints do not sort the options. You can use the + `sort_order` attribute when programming your storefront to display + the options in the order that you want. + type: + - integer + - 'null' + examples: + - 15 + x-go-name: Sort Order + default: + description: >- + The boolean indicates whether the current option is a default option + for the component. + type: + - boolean + - 'null' + examples: + - true + default: false + x-go-name: Default + title: Component Product Option + components: + additionalProperties: + $ref: '#/components/schemas/component-product' + description: >- + A bundle is a purchasable product, comprising of one or more products + that you want to sell together. You can create multiple components + within a bundle. Each component must have at least one or more options. + Each option is a product and a quantity. + title: Components + type: object + custom-input-validation-rule-options: + description: The length of the custom input text field. + type: object + properties: + max_length: + description: >- + The number of characters the custom text field can be. You can + specify a maximum length up to 255 characters, as the limit is 255 + characters. + type: integer + examples: + - 255 + x-go-name: MaxLength + x-go-name: CustomInputValidationRuleOptions + custom-input-validation-rule: + description: The validation rules for the custom text. + type: object + properties: + type: + description: This represents the type of object being returned. Must be `string`. + type: string + examples: + - string + default: string + const: string + x-go-name: Type + options: + $ref: '#/components/schemas/custom-input-validation-rule-options' + title: Custom Input Validation Rule + x-go-name: CustomInputValidationRule + custom-input: + description: >- + The name of the custom input. You can rename the input to something more + representative of the input that shoppers are adding, for example, + `message` or `front`. + type: object + properties: + name: + description: >- + The name for the custom text field that is displayed in your + storefront. + type: string + examples: + - Message + x-go-name: Name + validation_rules: + description: The validation rules for the custom text. + type: array + items: + $ref: '#/components/schemas/custom-input-validation-rule' + x-go-name: ValidationRules + required: + description: >- + This is `true` or `false` depending on whether the custom text is + required. + type: + - boolean + - 'null' + examples: + - false + default: false + x-go-name: Required + title: Custom Input + custom_inputs: + description: > + You can allow your shoppers to add custom text to a product when adding + product items to their carts. This is useful, for example, if you have a + product like a T-shirt that can be personalized or you sell greetings + cards that can be printed with your shoppers personalized messages. You + can do this using the `custom_inputs` attribute. + + - You can rename input to something more representative of the input that shoppers are adding, for example, `message` or `front`. + - `name` is the name that is displayed in your storefront. + - You can add validation rules. For example, the input field must be a string and/or up to 255 characters in length. The limit is 255 characters. + type: object + additionalProperties: + $ref: '#/components/schemas/custom-input' + title: Custom Inputs + currencies: + description: >- + A collection of one or more currencies objects that consists of the + [**three-letter ISO + code**](https://www.iso.org/iso-3166-country-codes.html) of the + currencies associated with this price and the amount. This is the + product's price. + type: object + additionalProperties: + $ref: '#/components/schemas/amount' + title: Currencies + shopper_attributes: + description: >- + The optional price extension with values in string format, viewable by + shoppers. + type: object + additionalProperties: + type: string + title: ShopperAttributes + diff-list-data: + description: A list of differences between two releases. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/product-diff' + links: + $ref: '#/components/schemas/links' + title: DiffListData + display-price: + description: A price formatted for display. + type: object + properties: + with_tax: + $ref: '#/components/schemas/formatted-price' + without_tax: + $ref: '#/components/schemas/formatted-price' + x-omitempty: true + error: + description: APIError is a json-api style part of an error response. + type: object + properties: + detail: + type: string + examples: + - not processable + x-go-name: Detail + status: + type: string + examples: + - '422' + x-go-name: Status + title: + type: string + examples: + - There was a problem processing your request. + x-go-name: Title + title: APIError + x-go-name: APIError + error-response: + description: ErrorResponse is a json-api style Error response. + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/error' + x-go-name: Errors + title: ErrorResponse + x-go-name: ErrorResponse + extension: + description: The name of the product template. + type: object + additionalProperties: + description: The product attributes available for this template. + type: object + title: Extension + extensions: + description: >- + With extension templates, you can attach a specific set of custom fields + to your products in Product Experience Manager. For example, a **Book** + template might contain the attributes, such as **ISBN**, **Author**, + **Number of pages**, **Year Published**, or **Condition (New/Used)**. + type: object + additionalProperties: + $ref: '#/components/schemas/extension' + title: Extensions + file-reference: + description: >- + In Product Experience Manager, products can have associated rich media + assets, such as product images or a file containing additional product + details. + type: object + properties: + type: + description: This represents the type of object being returned. Always `file`. + type: string + examples: + - file + const: file + id: + description: A unique identifier for a file. + type: string + format: uuid + created_at: + description: The date and time a file is created. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + x-go-name: FileRelationship + files-relationship: + description: >- + In Product Experience Manager, products can have associated rich media + assets, such as product images or a file containing additional product + details. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/file-reference' + x-omitempty: true + component-products-relationship: + description: >- + A bundle is a purchasable product, comprising of one or more products + that you want to sell together. You can create multiple components + within a bundle. Each component must have at least one or more options. + Each option is a product and a quantity. You can link to the products + that make up your bundle components. + type: object + properties: + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/self-link' + x-omitempty: true + formatted-price: + description: A price formatted for display. + type: object + properties: + amount: + description: >- + The price in the lowest denomination for the specified currency. + This is a product's list price. + type: integer + examples: + - '47500' + x-omitempty: false + currency: + description: >- + The three-letter ISO code of the currencies associated with this + price and the amount. + type: string + examples: + - USD + formatted: + description: The format of the price for display. + type: string + examples: + - $475.00 + title: FormattedPrice + x-omitempty: true + hierarchy: + description: >- + A category hierarchy in a catalog. Hierarchies can have parent nodes and + child nodes, as well as a list of attached products. + type: object + properties: + attributes: + $ref: '#/components/schemas/hierarchy-attributes' + id: + description: A unique identifier of a hierarchy. + type: string + examples: + - e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + relationships: + $ref: '#/components/schemas/hierarchy-relationships' + type: + description: >- + This represents the type of object being returned. Always + `hierarchy`. + type: string + examples: + - hierarchy + x-go-name: Type + meta: + $ref: '#/components/schemas/hierarchy-meta' + title: Hierarchy + x-go-name: Hierarchy + hierarchy-meta: + description: A hierarchy's metadata. + type: object + properties: + language: + description: >- + Product Experience Manager supports localization of hierarchies. If + your store supports multiple languages, you can localize hierarchy + names and descriptions. This is [**three-letter language + code**](https://www.iso.org/iso-639-language-code) that represents + the name of the language you have used. + type: string + examples: + - en-GB + title: HierarchyMeta + x-go-name: HierarchyMeta + x-omitempty: true + hierarchy-attributes: + description: Resource attributes of a catalog hierarchy. + type: object + properties: + created_at: + description: The date and time a hierarchy is created. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + published_at: + description: The date and time a hierarchy is published in a catalog. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + description: + description: A description of a hierarchy. + type: string + examples: + - Formal dresswear + x-go-name: Description + name: + description: The name of a hierarchy. + type: string + examples: + - Formal dresswear + x-go-name: Name + slug: + description: A unique slug for a hierarchy. + type: string + examples: + - formal + x-go-name: Slug + updated_at: + description: The date and time a hierarchy was updated. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: UpdatedAt + title: HierarchyAttributes + x-go-name: HierarchyAttributes + hierarchy-data: + description: Container for hierarchies. + type: object + properties: + data: + $ref: '#/components/schemas/hierarchy' + links: + $ref: '#/components/schemas/links' + title: HierarchyData + hierarchy-list-data: + description: Container for a list of hierarchies. + type: object + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/hierarchy' + links: + $ref: '#/components/schemas/links' + title: HierarchyListData + hierarchy-relationships: + description: Relationships to child nodes, and products. + type: object + properties: + products: + description: A URL to all the products associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + children: + description: A URL to all the child products associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + nodes: + description: A URL to all the nodes associated with a hierarchy. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + title: HierarchyRelationships + x-go-name: HierarchyRelationships + links: + description: Links allow you to move between requests. + type: object + properties: + self: + description: >- + Single entities use a `self` parameter with a link the specific + resource. + type: + - string + - 'null' + format: uri + first: + description: Always the first page. + type: + - string + - 'null' + format: uri + last: + description: This is `null` if there is only one page. + type: + - string + - 'null' + format: uri + prev: + description: This is `null` if there is only one page. + type: + - string + - 'null' + format: uri + next: + description: This is `null` if there is only one page. + type: + - string + - 'null' + format: uri + main-image-relationship: + description: >- + In Product Experience Manager, products can also have associated product + images. + type: object + properties: + data: + description: The images associated with a product. + type: object + properties: + type: + description: >- + This represents the type of object being returned. Always + `main_image`. + type: string + examples: + - main_image + const: main_image + id: + description: A unique identifier for an image. + type: string + format: uuid + x-nullable: 'true' + x-omitempty: true + node: + description: >- + A category node in a catalog. Nodes can have child nodes, as well as a + list of attached products. + type: object + properties: + attributes: + $ref: '#/components/schemas/node-attributes' + id: + description: The unique identifier of a node. + type: string + examples: + - e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + relationships: + $ref: '#/components/schemas/node-relationships' + type: + description: This represents the type of object being returned. Always `node`. + type: string + examples: + - node + x-go-name: Type + meta: + $ref: '#/components/schemas/node-meta' + title: Node + x-go-name: Node + node-attributes: + description: Resource attributes of a catalog node. + type: object + properties: + created_at: + description: The date and time a node was created. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + published_at: + description: The date and time a node was published in a catalog. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + description: + description: A description of a node. + type: string + examples: + - Formal dresswear + x-go-name: Description + label: + type: string + examples: + - category + x-go-name: Label + name: + description: >- + The name of a node. Names must be unique among sibling nodes in a + hierarchy. Otherwise, a name can be non-unique within the hierarchy + and across multiple hierarchies. + type: string + examples: + - Formal dresswear + x-go-name: Name + slug: + description: >- + A slug for the node. Slugs must be unique among sibling nodes in the + hierarchy. Otherwise, a slug can be non-unique within the hierarchy + and across multiple hierarchies. + type: string + examples: + - formal + x-go-name: Slug + curated_products: + description: >- + A list of curated products for a node. You can curate your products + in your nodes product lists. Product curation allows you to promote + specific products within each node in a hierarchy, enabling you to + create unique product collections in your storefront. + type: array + items: + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + status: + type: string + examples: + - live + x-go-name: Status + updated_at: + description: The date and time a node was updated. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: UpdatedAt + title: NodeAttributes + x-go-name: NodeAttributes + node-create-data: + description: Container for nodes. + type: object + properties: + data: + description: >- + A node in a catalog (e.g. a category node). Nodes can have child + nodes, as well as a list of attached products + type: object + properties: + attributes: + description: Resource attributes of a catalog node. + type: object + properties: + description: + type: string + examples: + - Formal dresswear + x-go-name: Description + hierarchy_id: + description: hierarchy id of the node + type: string + examples: + - ddd401ac-db06-4d9e-af60-cf5206abb9bc + label: + type: string + examples: + - category + x-go-name: Label + name: + type: string + examples: + - Formal dresswear + x-go-name: Name + slug: + type: string + examples: + - formal + x-go-name: Slug + status: + type: string + examples: + - Live + x-go-name: Status + locales: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + required: + - name + title: NodeCreateAttributes + relationships: + $ref: '#/components/schemas/node-relationships' + id: + type: string + examples: + - 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + type: + type: string + examples: + - node + x-go-name: Type + required: + - type + - attributes + title: NodeCreateArgs + links: + $ref: '#/components/schemas/links' + required: + - data + title: NodeCreateData + node-data: + description: Container for nodes. + type: object + properties: + data: + $ref: '#/components/schemas/node' + links: + $ref: '#/components/schemas/links' + title: NodeData + node-list-data: + description: Container for a list of nodes. + type: object + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/node' + links: + $ref: '#/components/schemas/links' + title: NodeListData + node-meta: + description: A node's metadata. + type: object + properties: + language: + description: The node details localized in the supported languages. + type: string + examples: + - en-GB + bread_crumb: + description: >- + Helps you understand the association of products with nodes. It + explains how products are associated with parent nodes and the + relationship among the array of nodes. This is useful if you want to + improve how your shoppers search within you store. + type: array + items: + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + title: NodeMeta + x-go-name: NodeMeta + x-omitempty: true + node-reference: + description: Minimum set of information to identify a catalog node. + type: object + properties: + id: + description: The unique identifier of a hierarchy. + type: string + examples: + - 65477ce0-fcb8-436b-a120-3d57979421dd + x-go-name: ID + label: + description: A label for a hierarchy. + type: string + examples: + - category + x-go-name: Label + name: + description: The name of a hierarchy. + type: string + examples: + - Formal dresswear + x-go-name: Name + title: NodeReference + x-go-name: NodeReference + node-relationships: + description: Relationships to parent and child nodes, and products. + type: object + properties: + products: + description: A URL to all products associated with a node. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/product-reference' + x-omitempty: true + links: + $ref: '#/components/schemas/related-link' + children: + description: A URL to all child nodes associated with a node. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + parent: + description: A URL to all parent nodes associated with a node. + type: object + properties: + data: + type: object + properties: + type: + type: string + examples: + - node + const: node + id: + type: string + examples: + - 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + required: + - id + - type + links: + $ref: '#/components/schemas/related-link' + required: + - data + hierarchy: + description: A URL to the hierarchies associated with a node. + type: object + properties: + data: + type: object + properties: + type: + type: string + examples: + - hierarchy + const: hierarchy + id: + type: string + examples: + - 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + required: + - id + - type + links: + $ref: '#/components/schemas/related-link' + required: + - data + title: NodeRelationships + x-go-name: NodeRelationships + node-relationships-data: + description: Container for node relationships. + type: object + properties: + data: + $ref: '#/components/schemas/node-relationships' + links: + $ref: '#/components/schemas/links' + title: NodeRelationshipsData + page-meta: + description: Contains the results for the entire collection. + type: object + properties: + results: + description: Total number of results for the entire collection. + type: object + properties: + total: + description: Total number of results for the entire collection. + type: integer + format: int64 + page: + type: object + properties: + limit: + description: The maximum number of records for all pages. + type: integer + format: int64 + offset: + description: The current offset by number of pages. + type: integer + format: int64 + current: + description: The current number of pages. + type: integer + format: int64 + total: + description: The total number of records for the entire collection. + type: integer + format: int64 + title: PageMeta + pricebook: + description: >- + Top level entity in the pricebooks domain model. It contains a list of + product prices. + type: object + properties: + id: + description: The unique identifier of a price book. + type: string + examples: + - 4c45e4ec-26e0-4043-86e4-c15b9cf985a7 + x-go-name: ID + type: + description: >- + This represents the type of object being returned. Always + `pricebook`. + type: string + examples: + - pricebook + default: pricebook + const: pricebook + x-go-name: Type + attributes: + type: object + properties: + created_at: + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: CreatedAt + description: + type: + - string + - 'null' + examples: + - This is a pricebook + x-go-name: Description + name: + type: + - string + - 'null' + examples: + - pricebook-store-abc + x-go-name: Name + updated_at: + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: UpdatedAt + required: + - name + additionalProperties: false + required: + - type + - attributes + title: Pricebook + x-go-name: Pricebook + pricebook-create-data: + description: Container for pricebooks. + type: object + properties: + data: + description: New top level pricebook. + type: object + additionalProperties: false + properties: + type: + type: string + examples: + - pricebook + default: pricebook + const: pricebook + x-go-name: Type + attributes: + type: object + properties: + description: + type: + - string + - 'null' + examples: + - This is a pricebook + x-go-name: Description + name: + type: + - string + - 'null' + examples: + - pricebook-store-abc + x-go-name: Name + required: + - name + required: + - type + - attributes + title: PricebookCreateArgs + links: + $ref: '#/components/schemas/links' + required: + - data + title: PricebookData + pricebook-data: + description: Container for pricebooks. + type: object + properties: + data: + $ref: '#/components/schemas/pricebook' + links: + $ref: '#/components/schemas/links' + required: + - data + title: PricebookData + pricebook-price: + description: >- + ProductPrice associates a collection of locale specific prices with a + product ID. + type: object + properties: + type: + type: string + examples: + - product-price + default: product-price + const: product-price + attributes: + type: object + properties: + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + $ref: '#/components/schemas/sales' + sku: + type: string + examples: + - 4c45e4ec-sku + required: + - currencies + - sku + id: + type: string + examples: + - 4c45e4ec-26e0-4043-86e4-c15b9cf985a7 + x-go-name: ID + additionalProperties: false + required: + - type + - id + - attributes + title: PricebookPrice + pricebook-price-create-data: + description: Container for pricebook prices. + type: object + properties: + data: + description: >- + ProductPrice associates a collection of locale specific prices with + a product ID. + type: object + properties: + type: + type: string + examples: + - product-price + default: product-price + const: product-price + attributes: + type: object + properties: + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + $ref: '#/components/schemas/sales' + sku: + type: string + examples: + - 4c45e4ec-sku + required: + - currencies + - sku + required: + - type + - attributes + title: PricebookPriceCreateArgs + links: + $ref: '#/components/schemas/links' + required: + - data + title: PricebookPriceCreateData + pricebook-price-data: + description: Container for pricebook prices. + type: object + properties: + data: + $ref: '#/components/schemas/pricebook-price' + links: + $ref: '#/components/schemas/links' + required: + - data + title: PricebookPriceData + product: + description: A product in a catalog with the following attributes. + type: object + properties: + attributes: + $ref: '#/components/schemas/product-attributes' + id: + description: A unique identifier for a product. + type: string + examples: + - 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + relationships: + $ref: '#/components/schemas/product-relationships' + type: + description: This represents the type of object being returned. Always `product`. + type: string + examples: + - product + x-go-name: Type + meta: + $ref: '#/components/schemas/product-meta' + title: Product + x-go-name: Product + product-attributes: + description: A product's attributes. + type: object + properties: + published_at: + description: The date and time a product was published in a catalog. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + base_product: + description: >- + If this product is a `parent` product. A `parent` product is a + product that has child products that have been built using the + `build child products` endpoint. + type: boolean + examples: + - false + default: false + x-go-name: BaseProduct + base_product_id: + description: The unique identifier of a `parent` product. + type: string + examples: + - cdf574bc-e36e-48fc-9eac-01c87839b285 + x-go-name: BaseProductID + commodity_type: + description: The commodity type, either `physical` or `digital`. + type: string + examples: + - physical + x-go-name: CommodityType + curated_product: + description: >- + If a product is curated, then the `curated_product` attribute with a + value of `true` is displayed. If a product is not curated, the + `curated_product` attribute is not displayed. + type: boolean + examples: + - true + x-go-name: CuratedProduct + x-omitempty: true + upc_ean: + description: >- + The universal product code or european article number of the + product. + type: string + examples: + - '0123456' + x-go-name: UpcEan + manufacturer_part_num: + description: The manufacturer part number of the product. + type: string + examples: + - mfn1 + x-go-name: ManufacturerPartNum + tags: + description: >- + A list of tags associated with the product. A tag must be HTML + compatible characters excluding commas and will be stored in + lowercase letters. + type: array + items: + description: A tag associated with the product. + type: string + examples: + - tag-a + x-go-name: Tags + x-omitempty: true + price_modifiers: + description: A list of price modifier names. + type: array + items: + description: A list of price modifier names. + type: string + examples: + - modifier-1 + x-go-name: PriceModifiers + x-omitempty: true + created_at: + description: The date and time a product was created. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: CreatedAt + description: + description: A description of the product. + type: string + examples: + - This is a product + x-go-name: Description + name: + description: A name of a product. + type: string + examples: + - Blue shirt + x-go-name: Name + price: + $ref: '#/components/schemas/currencies' + shopper_attributes: + $ref: '#/components/schemas/shopper_attributes' + tiers: + $ref: '#/components/schemas/tiers' + components: + $ref: '#/components/schemas/components' + custom_inputs: + $ref: '#/components/schemas/custom_inputs' + sku: + description: The unique stock keeping unit of the product. + type: string + examples: + - blue-shirt + x-go-name: Sku + slug: + description: >- + A label for the product that is used in the URL paths. A slug can + contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. + Spaces or other special characters like ^, [], *, and $ are not + allowed. By default, the product name is used as the slug. + type: string + examples: + - blue-shirt + x-go-name: Slug + status: + description: The status of the product, either `live` or `draft`. + type: string + examples: + - live + x-go-name: Status + external_ref: + description: >- + The unique attribute associated with the product. This could be an + external reference from a separate company system, for example. + type: + - string + - 'null' + x-go-name: ExternalRef + updated_at: + description: The date and time a product was updated. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: UpdatedAt + extensions: + $ref: '#/components/schemas/extensions' + title: ProductAttributes + x-go-name: ProductAttributes + product-create-data: + description: Container for products. + type: object + properties: + data: + description: A new product in a catalog. + type: object + properties: + attributes: + description: A product's attributes. + type: object + properties: + description: + type: string + examples: + - This is a product + name: + type: string + examples: + - Blue shirt + sku: + type: string + examples: + - blue-shirt + slug: + type: string + examples: + - blue-shirt + status: + type: string + examples: + - live + locales: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + required: + - name + - status + title: ProductCreateAttributes + id: + type: string + examples: + - 8fccaa19-dba9-4621-8d11-31a222a68c7c + x-go-name: ID + type: + type: string + examples: + - product + x-go-name: Type + required: + - attributes + - type + title: ProductCreateArgs + links: + $ref: '#/components/schemas/links' + title: ProductData + product-data: + description: Container for products. + type: object + properties: + data: + $ref: '#/components/schemas/product' + links: + $ref: '#/components/schemas/links' + included: + $ref: '#/components/schemas/included' + title: ProductData + product-diff: + type: object + properties: + id: + type: string + examples: + - e871df93-c769-49a9-9394-a6fd555b8e8a + x-go-name: ID + type: + type: string + examples: + - product_diff + x-go-name: Type + attributes: + type: object + properties: + sku: + type: string + this_release_id: + type: string + other_release_id: + type: string + diff_created_at: + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + exists: + type: object + properties: + this: + type: boolean + other: + type: boolean + required: + - this + - other + x-go-name: ProductDiffExists + updated_at: + type: object + properties: + this: + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-omitempty: true + other: + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-omitempty: true + x-go-name: ProductDiffUpdatedAt + x-go-name: ProductDiff + product-list-data: + description: Container for a list of products. + type: object + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/product' + x-go-name: Data + links: + $ref: '#/components/schemas/links' + included: + $ref: '#/components/schemas/included' + title: ProductListData + product-meta: + description: >- + A product's metadata contains information about products, for example, + the nodes a product is associated with, any child products, bundle + configurations, and so on. + type: object + properties: + bread_crumbs: + description: >- + The relationship among the array of nodes a product is associated + with, demonstrating the linking of the children nodes with the + parent nodes. Up to 10 levels of parent nodes are displayed, + depending on the number of levels of parent nodes you have. + type: object + additionalProperties: + type: array + items: + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + bread_crumb_nodes: + description: >- + An array of parent node IDs that a product is associated with. Up to + 10 levels of parent nodes are displayed, depending on the number of + levels of parent nodes you have. + type: array + items: + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-omitempty: true + catalog_id: + description: A unique identifier of the catalog a product is associated with. + type: string + examples: + - 362a16dc-f7c6-4280-83d6-4fcc152af091 + x-go-name: CatalogID + pricebook_id: + description: >- + The unique identifier of the price book a product is associated + with. + type: + - string + - 'null' + examples: + - f5466169-0037-460c-b181-b02682b6f4de + x-go-name: PricebookID + display_price: + $ref: '#/components/schemas/display-price' + catalog_source: + description: The source of a catalog. Always `pim`. + type: string + examples: + - pim + const: pim + x-go-name: CatalogSource + sale_id: + description: >- + With sales pricing, a store can optionally add a sale price to a + product price. For example, a store can schedule seasonal pricing on + products without creating a new price book and catalog ruleset. + Optionally, a store can schedule the date ranges for the sale + products. This is the unique identifier of a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + bundle_configuration: + $ref: '#/components/schemas/bundle-configuration' + component_products: + description: >- + A bundle is a purchasable product, comprising of one or more + products that you want to sell together. You can create multiple + components within a bundle. Each component must have at least one or + more options. Each option is a product and a quantity. + type: object + additionalProperties: + type: object + properties: + sale_id: + description: >- + With sales pricing, a store can optionally add a sale price to + a product price. For example, a store can schedule seasonal + pricing on products without creating a new price book and + catalog ruleset. Optionally, a store can schedule the date + ranges for the sale products. This is the unique identifier of + a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + price: + $ref: '#/components/schemas/currencies' + display_price: + $ref: '#/components/schemas/display-price' + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + pricebook_id: + type: + - string + - 'null' + examples: + - f5466169-0037-460c-b181-b02682b6f4de + x-go-name: PricebookID + x-go-name: ComponentProductMeta + price_modifiers: + description: >- + You can use price modifiers to change the price property of child + products. By default, child products inherit the same price as their + base products. Using price modifiers, you can enable child products + to inherit a different price. + type: object + additionalProperties: + description: >- + A name for the modifier. The name must be unique and is + case-sensitive. + type: object + properties: + modifier_type: + description: | + There are three modifier types. + + - The `price_increment` type increases the prices of a product. + - The `price_decrement` type decreases the price of a product. + - The `price_equals` type sets the price of a product to an amount you specify. + type: string + examples: + - price_equals + currencies: + $ref: '#/components/schemas/currencies' + x-go-name: PriceModifierMeta + tiers: + description: >- + You can use tiers to allow your store to offer different pricing for + minimum quantities of items that your shoppers purchase. + type: object + additionalProperties: + description: The name of the tier, such as `Pencils`. + type: object + properties: + sale_id: + description: The unique identifier of a sale. + type: string + x-go-name: SaleID + sale_expires: + description: The date and time a sale expires. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + x-go-name: SaleExpires + display_price: + $ref: '#/components/schemas/display-price' + original_price: + $ref: '#/components/schemas/currencies' + original_display_price: + $ref: '#/components/schemas/display-price' + x-go-name: ProductMetaTier + x-go-name: ProductMetaTiers + variation_matrix: + description: >- + The `variation_matrix` object lists the variation IDs and variation + option IDs and their corresponding product IDs that are generated + when the variation and variation options are built with a product. + If no variations are available, the `variation_matrix` is empty. + type: object + variations: + description: >- + If you specified `build_rules` for a product, the `variations` + object lists the variation option IDs that you specified to include + when building your child products. If no `build_rules` are + specified, all the variation and variation options available for a + product are displayed. If a product does not have any variations, + then the `variations` object is not displayed. + type: array + items: + $ref: '#/components/schemas/variation' + x-omitempty: true + child_option_ids: + description: An array of variation options IDs that a child product has. + type: + - array + - 'null' + items: + type: string + examples: + - - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + - 6ddf2a66-d805-449c-a0e1-8e81335e31a6 + x-omitempty: true + child_variations: + description: >- + If this is a child product, the `child_variations` object lists the + variation option IDs that define this child product. + type: + - array + - 'null' + items: + $ref: '#/components/schemas/variation' + x-omitempty: true + product_types: + description: > + Commerce automatically assigns types to the products you create. In + Commerce Manager, you can see at a glance the product types in a + list of a products. In addition, you can filter on product types in + both the API and Commerce Manager. + + Product types can also be used in catalogs. For example, in your catalog, you can filter on parent so that only your parent products are displayed in your storefront. + + Products have one of the following types: + + - **standard** - Standard products are a standalone products. + - **parent** - A parent product is a product that has child products that have been built using the `Build Child Products` endpoint. + - **child** - When you configure product variations and variation options for parent products, the child products derived from the parent products are automatically created in Commerce. + - **bundle** - A bundle is a purchasable product, comprising two or more standalone products (in other words, components) to be sold together. + type: array + items: + type: string + x-go-name: ProductTypes + x-omitempty: true + language: + description: >- + If you storefront supports multiple languages, your storefront's + preferred language and locale. + type: string + examples: + - en-GB + title: ProductMeta + x-go-name: ProductMeta + x-omitempty: true + variation_option: + description: The options available for a variation. + type: object + properties: + id: + description: A unique identifier for an option. + type: string + format: uuid + x-go-name: ID + name: + description: The name of the option. + type: string + sort_order: + description: >- + If you specified a `sort_order` when creating your variations and + variation options, then use the `sort_order` value to program your + storefront to display the variations and variation options in the + order that you want. + type: + - integer + - 'null' + x-go-name: Sort Order + description: + description: The option description to display to customers. + type: string + x-go-name: ProductVariationOption + variation: + type: object + properties: + id: + description: A unique identifier of a variation. + type: string + format: uuid + x-go-name: ID + name: + description: The name of a variation. + type: string + sort_order: + description: >- + If you specified a `sort_order` when creating your variations and + variation options, then use the `sort_order` value to program your + storefront to display the variations and variation options in the + order that you want. + type: + - integer + - 'null' + x-go-name: Sort Order + option: + $ref: '#/components/schemas/variation_option' + options: + description: The options available for this variation. + type: array + items: + $ref: '#/components/schemas/variation_option' + x-omitempty: true + x-go-name: ProductVariation + bundle-configuration-data: + description: Container for a bundle configuration. + type: object + properties: + data: + $ref: '#/components/schemas/bundle-configuration' + required: + - data + title: BundleConfigurationData + bundle-configuration: + description: >- + A bundle is a purchasable product, comprising of one or more products + that you want to sell together. You can create multiple components + within a bundle. Each component must have at least one or more options. + Each option is a product and a quantity. + type: object + properties: + selected_options: + description: >- + The product options included in a component. This can be the ID of + another bundle. + type: object + additionalProperties: + description: The unique identifier of the component, for example, `games`. + type: object + additionalProperties: + description: The number of this product option that a shopper must purchase. + type: integer + format: int64 + required: + - selected_options + title: BundleConfiguration + x-go-name: ProductBundleConfiguration + product-reference: + description: A product identifier. + type: object + properties: + id: + description: A unique identifier for a product. + type: string + format: uuid + x-go-name: ID + type: + description: This represents the type of object being returned. Always `product`. + type: string + examples: + - product + const: product + x-go-name: Type + title: ProductReference + x-go-name: ProductReference + x-nullable: 'true' + product-reference-list-data: + description: Container for a list of product references. + type: object + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/links' + title: ProductReferenceListData + product-references: + description: A list of product identifiers. + type: array + items: + $ref: '#/components/schemas/product-reference' + title: ProductReferences + x-go-name: ProductReferences + product-relationships: + description: >- + Relationships allow you to move between requests. Includes links to the + parent and child products, bundle component products, files, and main + images associated with a product. + type: object + properties: + parent: + description: >- + The details of a `parent` product. A `parent` product is a product + that has child products that have been built using the `Build Child + Products` endpoint. + type: object + properties: + data: + $ref: '#/components/schemas/product-reference' + x-go-name: Parent + x-omitempty: true + children: + description: >- + The details of a `child` product. When you configure product + variations and variation options for parent products, the child + products derived from the parent products are automatically created + in Commerce. + type: object + properties: + data: + $ref: '#/components/schemas/product-references' + links: + $ref: '#/components/schemas/self-link' + x-go-name: Children + x-omitempty: true + files: + $ref: '#/components/schemas/files-relationship' + main_image: + $ref: '#/components/schemas/main-image-relationship' + component_products: + $ref: '#/components/schemas/component-products-relationship' + title: ProductRelationships + x-go-name: ProductRelationships + x-omitempty: true + product-relationships-data: + description: Container for product relationships. + type: object + properties: + data: + $ref: '#/components/schemas/product-relationships' + links: + $ref: '#/components/schemas/links' + title: ProductRelationshipsData + products-for-cart: + description: >- + A list of products to be added to cart. Can be type product-data or + error-response. + type: object + properties: + data: + type: array + items: {} + x-go-name: Data + included: + type: + - object + - 'null' + properties: + component_products: + type: array + items: + $ref: '#/components/schemas/product' + x-go-name: ComponentProducts + x-go-name: Included + required: + - data + title: ProductsForCart + x-go-name: ProductsForCart + products-for-cart-configuration: + description: A list of product id or sku and bundle configuration for cart. + type: object + properties: + data: + type: array + items: + type: object + properties: + id: + type: + - string + - 'null' + format: uuid + x-go-name: ID + sku: + type: + - string + - 'null' + x-go-name: SKU + bundle_configuration: + $ref: '#/components/schemas/bundle-configuration' + minItems: 1 + x-go-name: Data + required: + - data + title: ProductsForCartConfiguration + x-go-name: ProductsForCartConfiguration + related-link: + description: >- + A URL to a related object, for example, catalog rules, hierarchies, + price books, products and deltas. + type: object + properties: + related: + description: >- + A URL to a related object, for example, catalog rules, hierarchies, + price books, products and deltas. + type: string + required: + - related + self-link: + description: Links are used to allow you to move between requests. + type: object + properties: + self: + description: >- + Single entities use a self parameter with a link to that specific + resource. + type: string + required: + - self + release: + description: >- + A catalog release represents a collection of hierarchical product data, + price books and catalogs rules. + type: object + properties: + id: + description: A unique identifier for the catalog release. + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + x-go-name: ID + attributes: + type: object + properties: + name: + description: The name of a release. + type: string + examples: + - Clothing + published_at: + description: The date and time a release was published. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + catalog_id: + description: A unique identifier for the catalog. + type: string + examples: + - 0194f54d-f2a1-4e33-9a6e-9ec366152490 + description: + description: A description of the catalog release. + type: string + examples: + - Catalog for Store 123 + default: '' + hierarchies: + description: An array of hierarchy IDs associated with the release. + type: array + items: + $ref: '#/components/schemas/node-reference' + x-go-name: RootNodes + relationships: + $ref: '#/components/schemas/release-relationships' + type: + description: >- + This represents the type of object being returned. Always + `catalog-release`. + type: string + x-go-name: Type + meta: + $ref: '#/components/schemas/release-meta' + title: Release + x-go-name: Release + release-data: + description: Container for a catalog release. + type: object + properties: + data: + $ref: '#/components/schemas/release' + links: + $ref: '#/components/schemas/links' + title: Release Data + release-list-data: + description: Container for a list of catalog releases. + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/release' + links: + $ref: '#/components/schemas/links' + title: ReleaseListData + release-meta: + description: A release's metadata. + type: object + properties: + created_at: + description: The date and time a release is created. + type: string + format: date-time + examples: + - '1970-01-01T00:00:00.000' + started_at: + description: >- + The date and time a release is available for use. In other words, + the date and time the status of a catalog release changes to + PUBLISHED, rather than IN PROGRESS. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + updated_at: + description: The date and time a release is updated. + type: + - string + - 'null' + format: date-time + examples: + - '1970-01-01T00:00:00.000' + release_status: + description: The status of the current release. + type: string + enum: + - PENDING + - IN_PROGRESS + - FAILED + - PUBLISHED + language: + description: Your storefront's preferred language code and locale. + type: string + examples: + - en-GB + is_full_publish: + description: > + Indicates that a full publish was performed (either because this is + the first time a catalog has been published or because of a change + that occurred, for example, adding/removing a price book or + hierarchy). When determining whether delta data needs to be + refreshed, ignore this attribute and always use the `is_full_delta` + attribute. + type: boolean + examples: + - false + default: false + x-go-name: IsFullPublish + is_full_delta: + description: > + Indicates whether the release delta file contains the full content + of a catalog release. Using a search service as an example, if the + `is_full_delta` attribute is `true`, you should remove all data + about that catalog release from the search service before injecting + fresh data from the delta file. If the `is_full_delta` attribute is + `false`, then data from the previous catalog release overlays the + existing data in the delta file. The `is_full_delta` attribute is + always `true` the first time a catalog is published. + type: boolean + examples: + - false + default: false + x-go-name: IsFullDelta + total_products: + description: The total number of products displayed in a catalog release. + type: + - integer + - 'null' + format: int64 + x-go-name: TotalProducts + total_nodes: + description: The total number of hierarchy nodes displayed in a catalog release. + type: + - integer + - 'null' + format: int64 + x-go-name: TotalNodes + percent_completed: + description: >- + An integer that represents the progress of a catalog publish. The + attribute starts at `0` and reaches `100` when publishing is + complete. + type: + - integer + - 'null' + format: int32 + x-go-name: PercentCompleted + owner: + description: The owner of the resource, can be either `organization` or `store`. + type: + - string + - 'null' + enum: + - store + - organization + x-go-name: Owner + title: ReleaseMeta + x-go-name: ReleaseMeta + x-omitempty: true + release-relationships: + description: >- + Relationships are established between different catalog entities. For + example, products, hierarchies, price books, and catalog rules are + related to a catalog, as they are associated with it. + type: object + properties: + delta: + description: >- + A URL to a delta document that describes the changes between catalog + releases. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + products: + description: A URL to all products included in a catalog release. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + hierarchies: + description: A URL to all hierarchies included in a catalog release. + type: object + properties: + links: + $ref: '#/components/schemas/related-link' + required: + - links + title: ReleaseRelationships + x-go-name: ReleaseRelationships + rule: + description: >- + A catalog rule specifies which catalog to use for a given shopper + context. + type: object + properties: + id: + description: >- + The catalog rule ID. Use this to get, modify, or delete the catalog + rule. + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: >- + The name of a catalog rule. The name must not contain any + spaces. + type: string + examples: + - rule-123 + description: + description: A brief description of the purpose of a catalog rule. + type: string + examples: + - Catalog Rule for most favored customers + default: '' + x-omitempty: true + account_ids: + description: >- + The list of accounts who are eligible to see this catalog. If + this field is empty, the rule matches all accounts. + type: array + items: + type: string + x-omitempty: true + customer_ids: + description: >- + The list of customers who are eligible to see this catalog. If + empty, the rule matches all customers. + type: array + items: + type: string + x-omitempty: true + channels: + description: >- + The list of channels in which this catalog can be displayed. A + channel is the shopping experience, such as a mobile app or web + storefront. If empty, the catalog rule matches all channels. The + channel will eventually be included in the bearer token that is + used for authorization, but currently, you must set the + `EP-Channel` header in your requests. + type: array + items: + type: string + x-omitempty: true + tags: + description: >- + A list of user-defined tags that can be used to further restrict + the eligibility criteria for this rule. Requests populate the + catalog rule tag using the `EP-Context-Tag` header. + type: array + items: + type: string + x-omitempty: true + schedules: + description: > + Specifies a time period when a catalog is displayed, such as on + a specific date or during summer. Requests populate the rule tag + using the `EP-Context-Tag` header. + + + The schedules attribute must include the following. + + + - `valid_from` matches the date and time that the catalog is + displayed from. + + - `valid_to` matches the date and time the catalog is displayed + to. + + + Commerce runs on UTC time. + + + You can offset the timezone by adding the offset to the end of + the date and time. For example, a catalog which contains a sale + hierarchy that should appear for a set timeframe may be + scheduled to publish on a given date and time within a given + timezone. For instance, a sale that should begin on 1st of June + 2022 05:00 ET and end on the 15th of June 2022 at 23:50 PT would + have a valid schedule of `"valid_from": + "2022-06-01T05:00:00.000-05:00"`, `"valid_to": + "2022-06-15T11:59:99.000-08:00"`. + type: array + items: + $ref: '#/components/schemas/rule-schedule' + x-omitempty: true + catalog_id: + description: The unique identifier of a catalog. + type: string + examples: + - d09b4e16-08a5-4f42-817c-6e0d98acbb63 + created_at: + description: The date and time a catalog rule was created. + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + updated_at: + description: The date and time a catalog release is updated. + type: string + format: date-time + examples: + - '2020-09-22T09:00:00' + required: + - name + - catalog_id + - created_at + - updated_at + type: + description: >- + This represents the type of object being returned. Always + `catalog_rule`. + type: string + examples: + - catalog_rule + const: catalog_rule + required: + - id + - type + - attributes + title: Catalog Rule + rule-create-data: + description: >- + A catalog rule specifies which catalog to use for a given shopper + context. + type: object + properties: + data: + type: object + properties: + attributes: + type: object + properties: + name: + description: >- + The name of a catalog rule. The name must not contain + spaces. + type: string + examples: + - rule-123 + minLength: 1 + description: + description: A brief description of the purpose of a catalog rule. + type: + - string + - 'null' + examples: + - Catalog Rule for most favored customers + default: '' + account_ids: + description: >- + The list of accounts who are eligible to see this catalog. + If this field is empty, the rule matches all accounts. + type: + - array + - 'null' + items: + type: string + customer_ids: + description: >- + The list of customers who are eligible to see this catalog. + If empty, the rule matches all customers. + type: + - array + - 'null' + items: + type: string + channels: + description: >- + The list of channels in which this catalog can be displayed. + A channel is the shopping experience, such as a mobile app + or web storefront. If empty, the catalog rule matches all + channels. The channel will eventually be included in the + bearer token that is used for authorization, but currently, + you must set the `EP-Channel` header in your requests. + type: + - array + - 'null' + items: + type: string + tags: + description: >- + A list of user-defined tags that can be used to further + restrict the eligibility criteria for this rule. Requests + populate the catalog rule tag using the `EP-Context-Tag` + header. + type: + - array + - 'null' + items: + type: string + schedules: + description: > + Specifies a time period when a catalog is displayed, such as + on a specific date or during summer. Requests populate the + rule tag using the `EP-Context-Tag` header. + + + The schedules attribute must include the following. + + + - `valid_from` matches the date and time that the catalog is + displayed from. + + - `valid_to` matches the date and time the catalog is + displayed to. + + + Commerce runs on UTC time. + + + You can offset the timezone by adding the offset to the end + of the date and time. For example, a catalog which contains + a sale hierarchy that should appear for a set timeframe may + be scheduled to publish on a given date and time within a + given timezone. For instance, a sale that should begin on + 1st of June 2022 05:00 ET and end on the 15th of June 2022 + at 23:50 PT would have a valid schedule of `"valid_from": + "2022-06-01T05:00:00.000-05:00"`, `"valid_to": + "2022-06-15T11:59:99.000-08:00"`. + type: + - array + - 'null' + items: + $ref: '#/components/schemas/rule-schedule' + catalog_id: + description: The unique identifier of a catalog. + type: string + examples: + - d09b4e16-08a5-4f42-817c-6e0d98acbb63 + required: + - name + - catalog_id + type: + description: >- + This represents the type of object being returned. Always + `catalog_rule`. + type: string + examples: + - catalog_rule + const: catalog_rule + required: + - type + - attributes + required: + - data + title: CatalogRuleCreateData + rule-data: + description: Container for a single catalog rule. + type: object + properties: + data: + $ref: '#/components/schemas/rule' + links: + $ref: '#/components/schemas/links' + required: + - data + title: CatalogRuleData + rule-list-data: + description: Container for a list of catalog rules. + type: object + properties: + meta: + $ref: '#/components/schemas/page-meta' + data: + type: array + items: + $ref: '#/components/schemas/rule' + links: + $ref: '#/components/schemas/links' + required: + - data + title: CatalogRuleListData + rule-schedule: + description: A period of time during which a catalog is valid + type: object + properties: + valid_from: + description: Matches the date and time that the catalog is displayed from. + type: + - string + - 'null' + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: ValidFrom + valid_to: + description: Matches the date and time the catalog is displayed to. + type: + - string + - 'null' + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: ValidTo + title: Catalog Schedule + x-go-name: RuleSchedule + rule-update-data: + description: >- + A catalog rule specifies which catalog to use for a given shopper + context. + type: object + properties: + data: + type: object + properties: + id: + description: >- + The catalog rule ID. Use this to get, modify, or delete the + catalog rule. + type: string + examples: + - 8dbb35b2-ef04-477e-974d-e5f3abe6faae + attributes: + type: object + properties: + name: + description: >- + The name of a catalog rule. The name must not contain + spaces. + type: + - string + - 'null' + examples: + - rule-123 + minLength: 1 + description: + description: A description of the purpose of a catalog rule. + type: + - string + - 'null' + examples: + - Catalog Rule for most favored customers + default: '' + account_ids: + description: >- + Specifies the list of accounts who are eligible to see this + catalog. If this field is empty, the rule matches all + accounts. + type: + - array + - 'null' + items: + type: string + customer_ids: + description: >- + The list of customers who are eligible to see this catalog. + If empty, the rule matches all customers. + type: + - array + - 'null' + items: + type: string + channels: + description: >- + The list of channels in which this catalog can be displayed. + A channel is the shopping experience, such as a mobile app + or web storefront. If empty, the catalog rule matches all + channels. The channel will eventually be included in the + bearer token that is used for authorization, but currently, + you must set the `EP-Channel` header in your requests. + type: + - array + - 'null' + items: + type: string + schedules: + description: > + Specifies a time period when a catalog is displayed, such as + on a specific date or during summer. Requests populate the + rule tag using the `EP-Context-Tag` header. + + + The schedules attribute must include the following. + + + - `valid_from` matches the date and time that the catalog is + displayed from. + + - `valid_to` matches the date and time the catalog is + displayed to. + + + Commerce runs on UTC time. + + + You can offset the timezone by adding the offset to the end + of the date and time. For example, a catalog which contains + a sale hierarchy that should appear for a set timeframe may + be scheduled to publish on a given date and time within a + given timezone. For instance, a sale that should begin on + 1st of June 2022 05:00 ET and end on the 15th of June 2022 + at 23:50 PT would have a valid schedule of `"valid_from": + "2022-06-01T05:00:00.000-05:00"`, `"valid_to": + "2022-06-15T11:59:99.000-08:00"`. + type: + - array + - 'null' + items: + $ref: '#/components/schemas/rule-schedule' + tags: + description: >- + A list of user-defined tags that can be used to further + restrict the eligibility criteria for this rule. Requests + populate the catalog rule tag using the `EP-Context-Tag` + header. + type: + - array + - 'null' + items: + type: string + catalog_id: + description: The unique identifier of a catalog rule. + type: + - string + - 'null' + examples: + - d09b4e16-08a5-4f42-817c-6e0d98acbb63 + type: + description: >- + This represents the type of object being returned. Always + `catalog_rule`. + type: string + examples: + - catalog_rule + const: catalog_rule + required: + - id + - type + required: + - data + title: CatalogRuleUpdateData + sale: + description: A set of sale prices and a validity period. + type: object + properties: + schedule: + $ref: '#/components/schemas/schedule' + currencies: + $ref: '#/components/schemas/tiered-currencies' + sales: + description: A set of sale specifications + type: object + additionalProperties: + $ref: '#/components/schemas/sale' + title: Sales + schedule: + description: A definition of the times at which a sale is valid + type: object + properties: + valid_from: + type: + - string + - 'null' + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: ValidFrom + valid_to: + type: + - string + - 'null' + format: date-time + examples: + - '2020-09-22T09:00:00' + x-go-name: ValidTo + x-go-name: Schedule + tier: + description: The name of the tier, for example, `Pencils`. + type: object + properties: + minimum_quantity: + description: >- + The minimum quantity of 1 or more defined for the specified price. + If a minimum quantity is not specified, an error is returned. + type: integer + examples: + - '5' + price: + $ref: '#/components/schemas/currencies' + title: Tier + tiered-amount: + description: The three-letter ISO code for the currency associated with this price. + type: object + properties: + amount: + description: >- + The price in the lowest denomination for the specified currency. + This is a product's list price. + type: integer + format: int64 + examples: + - 100 + x-go-name: Amount + x-omitempty: false + includes_tax: + description: Whether this price includes tax. + type: boolean + examples: + - false + default: false + x-go-name: IncludesTax + tiers: + description: >- + The price tier that an item is eligible for based on the quantity + purchased. You cannot have conflicting tiers within the same + currencies block. + type: object + additionalProperties: + description: The name of the tier, for example, `Pencils`. + type: object + properties: + minimum_quantity: + description: >- + The minimum quantity of 1 or more defined for the specified + price. If a minimum quantity is not specified, an error is + returned. + type: integer + examples: + - 5 + x-go-name: MinimumQuantity + amount: + description: The price for each quantity. + type: integer + format: int64 + examples: + - 100 + x-go-name: Amount + x-omitempty: false + x-go-name: TierAmount + x-go-name: Tiers + title: TieredAmount + x-go-name: TieredAmount + tiered-currencies: + description: Collection of currency specific prices for a product. + type: object + additionalProperties: + $ref: '#/components/schemas/tiered-amount' + title: TieredCurrencies + tiers: + description: >- + The price tier that an item is eligible for based on the quantity + purchased. You cannot have conflicting tiers within the same currencies + block. + type: object + additionalProperties: + $ref: '#/components/schemas/tier' + title: Tiers + catalog-release-create-data: + description: Creates a catalog release with the following attributes. + type: object + properties: + data: + type: object + properties: + export_full_delta: + description: > + Set to `true` if you want to export all the data from a catalog + release in a delta link. The `is_full_delta` attribute is + returned from the `get a release of a catalog` endpoint. The + `is_full_delta` attribute tells you if the delta file contains + the full content of a catalog release. You can use the + `is_full_delta` to determine if you need to refresh the data in + your company system before publishing a catalog release with + fresh data in a delta link. Using a search service as an + example, if the `is_full_delta` attribute is true, you should + remove all data about that catalog from the search service + before publishing a catalog release and injecting fresh data + from the delta file. If the `is_full_delta` attribute is false, + then data from the previous catalog overlays the existing data + in the delta file. The `is_full_delta` attribute is always + `true` the first time a catalog is published. + type: boolean + x-go-name: ExportFullDelta + include_organization_resources: + description: >- + If you are publishing a catalog in a store that contains + resources from an organization, you must set this to true and + you must enable the **Include Organization Resources in Catalog + Publishes** checkbox in Commerce Manager. See [**Multi-Store + Management Solutions**](/docs/api/pxm/catalog/publish-release). + type: + - boolean + - 'null' + x-go-name: IncludeOrganizationResources + title: CatalogReleaseCreateData + included: + description: Included is an array of resources that are included in the response. + type: object + properties: + main_images: + description: The main images associated with a product. + type: array + items: + $ref: '#/components/schemas/elastic-path-file' + component_products: + description: The component products associated with a product. + type: array + items: + $ref: '#/components/schemas/product' + files: + description: The files associated with a product. + type: array + items: + $ref: '#/components/schemas/elastic-path-file' + elastic-path-file: + type: object + properties: + id: + description: The unique identifier for this file. + type: string + format: uuid + type: + description: The type represents the object being returned. + type: string + examples: + - file + file_name: + description: The name of the file. + type: string + examples: + - file_name.jpg + mime_type: + description: The mime type of the file. + type: string + examples: + - image/jpeg + file_size: + description: The size of the file. Required when uploading files. + type: integer + examples: + - 36000 + public: + description: >- + DEPRECATED Whether the file public or not. Required when uploading + files. + type: boolean + examples: + - true + meta: + $ref: '#/components/schemas/file-meta' + links: + $ref: '#/components/schemas/links' + link: + $ref: '#/components/schemas/file-link' + title: ElasticPathFile + file-meta: + properties: + timestamps: + description: The date and time the file was created. + type: object + properties: + created_at: + description: The date and time the file was created. + type: string + examples: + - '2023-10-11T13:02:25.293Z' + dimensions: + description: The file dimensions. + type: object + properties: + width: + description: The width of the file. + type: integer + examples: + - 1800 + height: + description: The height of the file. + type: integer + examples: + - 1000 + file-link: + description: The publicly available URL for this file. + type: object + properties: + href: + description: The publicly available URL for this file. + type: string + examples: + - >- + https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png + CartsRequest: + title: CartsRequest + type: object + properties: + description: + type: string + description: The cart description. + example: cart description + discount_settings: + $ref: '#/components/schemas/DiscountSettings' + name: + description: >- + The cart name provided by the shopper. A cart name must contain 1 to + 255 characters. You cannot use whitespace characters, but special + characters are permitted. For more information, see the [Safe + Characters](/guides/Getting-Started/safe-characters) section. + type: string + example: my cart name + snapshot_date: + description: >- + This optional parameter sets a reference date for the cart. If this + parameter is set, it allows the cart to act as one that might occur + on that specified date. For example, such future carts might acquire + future-enabled discounts, allowing users to test and validate future + interactions with carts. The snapshot_date must be in the format + 2026-02-21T15:07:25Z. By default, this parameter is left empty. + type: string + example: '2026-09-10T00:12:00Z' + custom_attributes: + $ref: '#/components/schemas/CustomAttributes' + payment_intent_id: + description: >- + To remove the Stripe payment intent from a cart, pass the empty + value in the `payment_intent_id` field. You must use an empty value + for this field. You cannot use this endpoint to directly update the + cart to use an existing Payment Intent. + type: string + example: '' + DiscountSettings: + title: DiscountSettings + type: object + properties: + custom_discounts_enabled: + description: >- + This parameter enables custom discounts for a cart. When set to + true, Elastic Path promotions will not be applied to the new carts. + Default is set from cart discount settings for the store. See [Cart + Settings](/docs/api/settings/put-v-2-settings-cart). + type: boolean + example: false + use_rule_promotions: + description: >- + When set to true, this parameter allows the cart to use rule + promotions. + type: boolean + example: false + CustomAttributes: + title: CustomAttributes + type: object + properties: + custom_attributes: + description: >- + Specifies the custom attributes for the cart object. The attribute + can be any string, numerical, and underscore. A cart can have + maximum of 20 custom attributes. + type: object + properties: + attribute: + description: Specifies the attribute `type` and `value`. + type: object + properties: + type: + description: >- + Specifies the type of the attribute such as string, integer, + boolean, and float. + type: string + value: + description: Specifies the value of the attribute. + oneOf: + - type: string + - type: number + - type: boolean + CartResponse: + title: CartResponse + type: object + properties: + id: + description: The unique identifier for the cart. Use SDK or create it yourself. + type: string + type: + description: The type of object being returned. + type: string + example: cart + name: + description: The name of this cart. + type: string + example: cart name + description: + description: A description of the cart. + type: string + example: cart description + discount_settings: + $ref: '#/components/schemas/DiscountSettings' + payment_intent_id: + description: Stripe-assigned unique identifier for the linked Payment Intent + type: string + links: + type: object + properties: + self: + description: A link to that specific resource. + type: string + example: https://useast.api.elasticpath.com/v2/carts/1 + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + shipping: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + relationships: + type: object + properties: + customers: + type: object + properties: + data: + type: object + properties: + type: + description: The type of related object. + type: string + example: customers + id: + description: The ID of the customer. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + items: + type: object + properties: + data: + type: object + properties: + type: + description: The type of related object. + type: string + example: cart_item + id: + description: The unique identifier for the cart item + type: string + format: uuid + readOnly: true + example: 1cf8b15b-4f12-43c5-837c-dbbc09aefa55 + CartItemsObjectRequest: + title: Cart Items Object Request + oneOf: + - $ref: '#/components/schemas/CartItemObject' + - $ref: '#/components/schemas/CartMergeObjectRequest' + - $ref: '#/components/schemas/CustomItemObject' + - $ref: '#/components/schemas/ReOrderObjectRequest' + - $ref: '#/components/schemas/PromotionItemObject' + CartItemObject: + title: Cart Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/CartItemObjectData' + - $ref: '#/components/schemas/CartItemResponse' + CartItemObjectData: + title: Cart Item Object Data + type: object + required: + - type + - quantity + properties: + type: + description: The type of object being returned. + type: string + enum: + - cart_item + quantity: + description: The number of items added to the cart. + type: number + example: 2 + id: + type: string + format: uuid + description: >- + Specifies the ID of the product you want to add to cart. (use this + OR sku) + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + sku: + type: string + description: >- + Specifies the item SKU that you want to add to cart. (use this OR + id) + example: my-item + custom_inputs: + description: The custom text to be added to a product. + type: object + bundle_configuration: + description: Object used to describe the bundle options selected. + type: object + properties: + selected_options: + description: Specifies selected options. + type: object + shipping_group_id: + description: Identifier for a created Cart Shipping Group + type: string + CartMergeObjectRequest: + title: Cart Merge Object Request + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartMergeObject' + description: '' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartMergeObject: + title: Cart Merge Object + type: object + required: + - type + - cart_id + properties: + type: + description: The type of object being returned. Must be `cart_items`. + type: string + enum: + - cart_items + cart_id: + description: The original cart to be merged from. + type: string + format: uuid + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + CustomItemObject: + title: Custom Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/CustomItemObjectData' + description: '' + CustomItemObjectData: + title: Custom Item Object Data + type: object + required: + - type + - name + - quantity + - price + properties: + type: + description: The type of object being returned. Must be `custom_item`. + type: string + enum: + - custom_item + quantity: + description: The number of custom items to add to cart. + type: number + example: 2 + price: + type: object + required: + - amount + properties: + amount: + description: The unit price of the custom item. + type: number + example: 10000 + includes_tax: + description: >- + Set to`true` if relevant taxes have been included in the price, + `false` if not. Defaults to `true`. + type: boolean + description: + description: A description of the custom item. + type: string + example: My first custom item! + sku: + type: string + description: >- + The `SKU` code to use for the custom item. See [best + practices](https://elasticpath.dev/docs/commerce-cloud/carts/cart-items/add-custom-item-to-cart#best-practices) + to use the `SKU` code. + example: my-custom-item + name: + type: string + description: The name of the custom item. + example: My Custom Item + custom_inputs: + description: The custom text to be added to a product. + type: object + shipping_group_id: + description: Identifier for a created Cart Shipping Group + type: string + ReOrderObjectRequest: + title: Re-Order Object Request + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/ReOrderObject' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + ReOrderObject: + title: Re Order Object + type: object + required: + - type + - order_id + properties: + type: + description: The type of resource being returned. Use `order_items`. + type: string + enum: + - order_items + order_id: + description: The unique identifier of the order. + type: string + format: uuid + example: 78d7b5c2-c852-40ad-87bb-beb161f61f37 + BulkAddItemsRequest: + title: Bulk Add Items Request + type: object + properties: + data: + anyOf: + - $ref: '#/components/schemas/CartItemsObjectRequest' + - $ref: '#/components/schemas/CartMergeObjectRequest' + - $ref: '#/components/schemas/CustomItemObject' + - $ref: '#/components/schemas/ReOrderObjectRequest' + - $ref: '#/components/schemas/PromotionItemObject' + PromotionItemObject: + title: Promotion Item Object + type: object + properties: + data: + allOf: + - $ref: '#/components/schemas/PromotionItemObjectData' + PromotionItemObjectData: + title: Promotion Item Object Data + type: object + required: + - type + - code + properties: + type: + description: Specifies the type of resource, which is `promotion_item`. + type: string + enum: + - promotion_item + code: + description: >- + Specifies the promotion code. For more information about + codes[].user[], see the [Create Promotion + codes](/docs/api/promotions/create-promotion-codes) section. + type: string + example: PROMO_CODE + BulkUpdateCartsItems: + title: Bulk Update Carts Items + type: object + required: + - id + - quantity + properties: + data: + type: array + items: + type: object + properties: + id: + description: >- + Specifies the ID of the cart item that you want to update in + cart. + type: string + example: '{{cartitemID}}' + quantity: + description: Specifies the amount of items to update in the cart. + type: number + example: 2 + custom_inputs: + description: >- + Specifies the custom text to be added to a product. See + [custom + inputs](https://elasticpath.dev/docs/pxm/products/ep-pxm-products-api/update-a-product#using-custom-inputs-attribute). + type: object + options: + $ref: '#/components/schemas/UpdateAllOrNothingOptionsObject' + UpdateCartsItems: + title: Update Carts Items + type: object + required: + - quantity + properties: + data: + type: object + properties: + id: + description: The unique identifier of the cart item. + type: string + format: uuid + example: '{{cartitemID}}' + quantity: + description: The amount of products to add to cart. + type: number + example: 2 + custom_inputs: + description: The custom text to be added to a product. + type: object + shipping_group_id: + description: >- + The unique identifier of the shipping group to be added to the + cart. + type: string + format: uuid + example: 900ab9c1-4b39-43fe-b080-0dc2806065d9 + AddAllOrNothingOptionsObject: + title: Add All Or Nothing Options Object + type: object + properties: + add_all_or_nothing: + description: >- + When `true`, if an error occurs for any item, no items are added to + the cart. When `false`, valid items are added to the cart and the + items with errors are reported in the response. Default is `false`. + type: boolean + example: false + UpdateAllOrNothingOptionsObject: + title: Update All Or Nothing Options Object + type: object + properties: + update_all_or_nothing: + description: >- + When set to`true`, if an error occurs for any item, no items are + updated in the cart. When set to `false`, valid items are updated in + the cart and the items with errors are reported in the response. + Default is `true`. + type: boolean + example: false + CartItemResponse: + title: Cart Item Relationship + type: object + properties: + product_id: + description: The unique ID of the product. + type: string + format: uuid + readOnly: true + example: 55cda543-f9d7-42a4-b40a-665f2e4ff7c5 + name: + description: The name of this item + type: string + readOnly: true + example: shirt + description: + description: A description of the cart item. + type: string + readOnly: true + example: T-shirt. + catalog_id: + description: >- + The unique identifier of the catalog associated with the product is + shown if catalog_source=pim is set. + type: string + readOnly: true + format: uuid + example: 11d3f9d2-c99b-472c-96c3-51842333daea + catalog_source: + description: The catalog source. Always `pim` or `legacy`. + type: string + readOnly: true + example: pim + image: + type: object + readOnly: true + properties: + mime_type: + description: The MIME type for the uploaded file. + type: string + readOnly: true + example: image/png + file_name: + description: The name of the image file that was uploaded. + type: string + readOnly: true + example: shirt-trans.png + href: + description: The link to the image. + type: string + readOnly: true + example: >- + https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/7cc08cbb-256e-4271-9b01-d03a9fac9f0a.png + manage_stock: + description: null + type: boolean + readOnly: true + example: true + unit_price: + readOnly: true + $ref: '#/components/schemas/ItemPriceData' + value: + readOnly: true + $ref: '#/components/schemas/ItemPriceData' + links: + type: object + readOnly: true + properties: + product: + description: A URL related to the resource. + type: string + example: >- + https://useast.api.elasticpath.com/products/9eda5ba0-4f4a-4074-8547-ccb05d1b5981 + meta: + type: object + readOnly: true + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + CartsResponse: + title: Carts Response + type: object + properties: + data: + type: array + items: + type: object + anyOf: + - $ref: '#/components/schemas/CartItemObject' + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + discounts: + type: object + additionalProperties: + type: object + properties: + amount: + type: number + example: -1000 + currency: + type: string + example: USD + formatted: + type: string + example: '-$1.00' + timestamps: + $ref: '#/components/schemas/CartTimestamps' + ItemPriceData: + title: Order Price Data + type: object + properties: + amount: + description: The amount for this item as an integer. + type: number + readOnly: true + example: 10000 + currency: + description: The currency this item was added to the cart as. + type: string + readOnly: true + example: USD + includes_tax: + description: Whether or not this price is tax inclusive. + type: boolean + readOnly: true + example: false + CartsRelationshipsAccountsData: + title: Carts Relationships Accounts Data + type: object + properties: + data: + type: array + items: + properties: + id: + description: The ID of the account. + type: string + example: '{{accountID}}' + type: + description: The type of related object. Ensure that it is account. + type: string + example: account + CartsRelationshipsCustomersData: + title: Carts Relationships Customers Data + type: object + properties: + data: + type: array + items: + properties: + id: + description: The ID of the customer. + type: string + example: '{{customerID}}' + type: + description: The type of related object. Ensure that it is customer. + type: string + example: customer + CartsItemsTaxesObject: + title: Carts Items Taxes Object + type: object + required: + - type + - rate + properties: + code: + description: A unique tax code in this jurisdiction. + type: string + example: TAX01 + jurisdiction: + description: The relevant tax jurisdiction. + type: string + example: UK + name: + description: The name of the tax item. + type: string + example: Tax name + rate: + description: The tax rate represented as a decimal (12.5% -> 0.125). + type: number + example: 0.2 + type: + description: The type of object being returned. Use `tax_item`. + type: string + example: tax_item + id: + description: The unique identifier for this tax item. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + CartsBulkCustomDiscounts: + title: CartsBulkCustomDiscounts + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + - $ref: '#/components/schemas/CartItemBulkCustomDiscountObject' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartsBulkCustomDiscountsResponse: + title: CartsBulkCustomDiscountsResponse + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + - $ref: '#/components/schemas/artItemBulkCustomDiscountResponse' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + CartItemBulkCustomDiscountObject: + title: CartItemBulkCustomDiscountObject + type: object + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsObject' + - $ref: '#/components/schemas/CustomDiscountRelationshipsCartItemRequest' + artItemBulkCustomDiscountResponse: + title: artItemBulkCustomDiscountResponse + type: object + allOf: + - $ref: '#/components/schemas/CartsCustomDiscountsResponse' + - $ref: '#/components/schemas/CustomDiscountRelationshipsCartItemRequest' + CartsCustomDiscountsObject: + title: CartsCustomDiscountsObject + type: object + required: + - amount + - description + - discount_code + - discount_engine + - external_id + - type + properties: + amount: + description: >- + Specifies an amount to be applied for the custom discount. It must + be less than zero. + type: number + example: -1000 + description: + description: Specifies a description for the custom discount. + type: string + example: Custom discount description + discount_code: + description: Specifies the discount code used for the custom discount. + type: string + example: cart-custom-promo-code + discount_engine: + description: >- + Specifies from where the custom discount is applied. For example, + Talon.one. + type: string + example: Custom Discount Engine + external_id: + description: Specifies an external id for the custom discount. + type: string + example: custom-discount-external-id + type: + description: Specifies the type of the resource. Always `custom_discount`. + type: string + example: custom_discount + CartsCustomDiscountsResponse: + title: CartsCustomDiscountsResponse + type: object + properties: + amount: + type: object + properties: + amount: + description: >- + Specifies an amount to be applied for the custom discount. It + must be less than zero. + type: number + example: -1000 + currency: + description: The currency set for the custom discount. + type: string + example: USD + formatted: + description: The formatted value for the custom discount. + type: string + example: '-$10.00' + description: + description: Specifies a description for the custom discount. + type: string + example: Custom discount description + discount_code: + description: Specifies the discount code used for the custom discount. + type: string + example: cart-custom-promo-code + discount_engine: + description: >- + Specifies from where the custom discount is applied. For example, + Talon.one. + type: string + example: Custom Discount Engine + external_id: + description: Specifies an external id for the custom discount. + type: string + example: custom-discount-external-id + type: + description: Specifies the type of the resource. Always `custom_discount`. + type: string + example: custom_discount + id: + description: Specifies the UUID of the custom discount. + type: string + format: uuid + readOnly: true + example: 662461ad-ddcb-4dbd-8ed7-ade9aa63b5f9 + CustomDiscountRelationshipsCartItemRequest: + title: CustomDiscountRelationshipsCartItemRequest + type: object + required: + - type + - id + properties: + relationships: + type: object + properties: + item: + type: object + properties: + data: + type: object + properties: + type: + description: >- + Specifies the type of item. For example, `custom_item` + or `cart_item`. + type: string + example: cart_item + id: + description: >- + Specifies the unique identifier of the `cart_item` or + `custom_item` in the cart. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + CartItemRelationship: + title: CartItemRelationship + type: object + required: + - type + - id + properties: + relationships: + type: object + properties: + order: + type: object + properties: + data: + type: object + properties: + type: + description: This specifies the type of item. + type: string + example: order + id: + description: >- + This specifies the ID of the cart_item or custom_item in + the cart. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + CartsBulkTaxes: + title: CartsBulkTaxes + type: object + properties: + data: + type: array + items: + allOf: + - $ref: '#/components/schemas/CartsItemsTaxesObject' + - $ref: '#/components/schemas/CartItemRelationship' + options: + $ref: '#/components/schemas/AddAllOrNothingOptionsObject' + OrdersAnonymizeRequest: + title: OrdersAnonymizeRequest + type: object + properties: + data: + $ref: '#/components/schemas/OrdersAnonymizeData' + OrdersAnonymizeData: + title: OrdersAnonymizeData + type: object + properties: + order_ids: + description: >- + The unique identifiers of the orders to be anonymized. You can + anonymize multiple orders at the same time. + type: array + items: + type: string + example: '{{orderID}}' + OrdersUpdateRequest: + title: OrdersUpdateRequest + type: object + properties: + data: + oneOf: + - $ref: '#/components/schemas/OrdersAddressData' + - $ref: '#/components/schemas/OrdersCancelData' + - $ref: '#/components/schemas/OrdersFulfulledData' + OrdersAddressData: + title: OrdersAddressData + type: object + required: + - type + - shipping_address + properties: + external_ref: + description: >- + Represents an optional external ID reference for an order. It can + contain alphanumeric characters, special characters, and spaces, and + does not required to be unique. The maximum allowed length is 64 + characters. It can be used to include an external reference from a + separate company system. + type: string + example: external_order_123 + shipping_address: + type: object + properties: + first_name: + description: Specifies the first name of the address holder. + type: string + example: James + last_name: + description: Specifies the last name of the address holder. + type: string + example: Doe + phone_number: + description: Specifies the phone number of the address holder. + type: string + example: 5558679305 + company_name: + description: Specifies the company name. + type: string + example: company name + line_1: + description: Specifies the first line of the address. + type: string + example: 1234 Disney Drive + line_2: + description: Specifies the second line of the address. + type: string + example: Disney Resort + city: + description: Specifies the name of the city in the shipping address. + type: string + example: Anaheim + county: + description: Specifies the county of the shipping address. + type: string + example: Orange + region: + description: >- + Specifies the state, province, or region of the shipping + address. + type: string + example: CA + postcode: + description: Specifies the postcode or ZIP code of the address. + type: string + example: 92802 + country: + description: Specifies the country in the shipping address. + type: string + example: US + instructions: + description: Specifies any instructions provided with the shipping address. + type: string + example: Buzzer 10233 + OrdersCancelData: + title: OrdersCancelData + type: object + required: + - type + - status + properties: + status: + description: >- + The status of the order. You can only update the status to + `cancelled`. + type: string + example: cancelled + type: + description: The type of the resource. You must use order. + type: string + example: order + external_ref: + description: >- + Represents an optional external ID reference for an order. It can + contain alphanumeric characters, special characters, and spaces, and + does not required to be unique. The maximum allowed length is 64 + characters. It can be used to include an external reference from a + separate company system. + type: string + example: external_order_123 + OrdersFulfulledData: + title: OrdersFulfulledData + type: object + required: + - type + - shipping + properties: + shipping: + description: >- + The shipping status of the order. You can only update the shipping + status to `fulfilled`. + type: string + example: fulfilled + type: + description: The type of the resource. You must use order. + type: string + example: order + external_ref: + description: >- + Represents an optional external ID reference for an order. It can + contain alphanumeric characters, special characters, and spaces, and + does not required to be unique. The maximum allowed length is 64 + characters. It can be used to include an external reference from a + separate company system. + type: string + example: external_order_123 + PaymentsRequest: + title: PaymentsRequest + type: object + properties: + data: + $ref: '#/components/schemas/Data.PaymentObject' + Data.BasePayments: + title: Data.BasePayments + type: object + required: + - gateway + - method + properties: + gateway: + type: string + enum: + - adyen + - authorize_net + - braintree + - card_connect + - cyber_source + - elastic_path_payments_stripe + - manual + - paypal_express_checkout + - stripe + - stripe_connect + - stripe_payment_intents + method: + description: Specifies the transaction method, such as `purchase` or `authorize`. + type: string + enum: + - authorize + - purchase + - purchase_setup + - authorize_setup + amount: + description: The amount to be paid for the transaction. + type: number + example: 10000 + Data.AdyenPayment: + title: Data.AdyenPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `adyen`. + type: string + enum: + - adyen + options: + type: object + properties: + shopper_reference: + description: >- + The shopper reference token associated with the saved + payment method. + type: string + recurring_processing_model: + description: Enter CardOnFile for a one-time purchase. + type: string + payment: + description: The Adyen recurringDetailReference payment method identifier. + type: string + Data.AuthorizeNetPayment: + title: Data.AuthorizeNetPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `authorize_net`. + type: string + enum: + - authorize_net + options: + type: object + properties: + customer_payment_profile_id: + description: The Authorize.net customer payment profile ID. + type: string + payment: + description: The Authorize.net customer profile ID. + type: string + Data.BraintreePayment: + title: Data.BraintreePayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `braintree`. + type: string + enum: + - braintree + payment: + description: The Braintree Customer ID that you want to bill. + type: string + Data.CardConnectPayment: + title: Data.CardConnectPayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `card_connect`. + type: string + enum: + - card_connect + payment: + description: >- + Enter account_id, profile_id from CardPointe API. For example, + 1|16178397535388255208. + type: string + Data.CyberSourcePayment: + title: Data.CyberSourcePayment + required: + - payment + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the gateway. You must use `cyber_source`. + type: string + enum: + - cyber_source + payment: + description: The CyberSource token. + type: string + ElasticPathPaymentsPoweredByStripePayment: + title: Elastic Path Payments Powered By Stripe + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: >- + Specifies the gateway. You must use + `elastic_path_payments_stripe`. + type: string + enum: + - elastic_path_payments_stripe + options: + type: object + properties: + receipt_email: + description: >- + Provides the email address to which you want to send the + Stripe receipts for the transactions within the store. This + feature is available only in the live mode. + type: string + automatic_payment_methods: + type: object + description: >- + Parent object determining whether to use Stripe's + `automatic_payment_methods` setting. + properties: + enabled: + type: boolean + description: >- + When set to true, it displays all enabled payment + methods from the Stripe dashboard. When set to false, + the Stripe default, which is card, is used. + payment_method_types: + type: array + items: + type: string + description: >- + Specifies the Stripe payment method types configured for the + store. See [Stripe + Documentation](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-payment_method_types). + example: card + payment: + description: Specifies the Stripe token or source. + type: string + Data.ManualPayment: + title: Data.ManualPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `manual`. + type: string + enum: + - manual + paymentmethod_meta: + type: object + properties: + custom_reference: + description: >- + A reference associated with the payment method. This might + include loyalty points or gift card identifiers. We + recommend not to include personal information in this field. + type: string + name: + description: A custom name associated with the payment method. + type: string + Data.PayPalExpressCheckoutPayment: + title: Data.PayPalExpressCheckoutPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: >- + Specifies the type of payment gateway. You must use + `paypal_express_checkout`. + type: string + enum: + - paypal_express_checkout + options: + type: object + properties: + description: + description: The description for the payment. + type: string + soft_descriptor: + description: >- + The descriptor appended to PayPal generated descriptor that + is visible on the card statement of the payer. + type: string + application_context: + type: object + properties: + brand_name: + description: >- + The label that overrides the business name in the PayPal + account on the payPal site. + type: string + locale: + description: >- + The locale pages that appear based on language and + country code. PayPal supports a five-character code. For + example, ja-JP. + type: string + landing_page: + description: >- + The type of landing page to show on the PayPal site for + customer checkout. Use values LOGIN, BILLING, or + NO_PREFERENCE. + type: string + shipping_preference: + description: >- + The shipping preference. Use SET_PROVIDED_ADDRESS value. + This parameter does allow the user to change their + address on PayPal site. + type: string + user_action: + description: >- + If you set `useraction=commit` in the query string, the + flow redirects the buyer to the PayPal payment page and + displays a Pay Now button. When the shopper clicks **Pay + Now**, call `DoExpressCheckoutPayment` to complete the + payment without additional interaction from the shopper. + Choose this flow when you know the final payment amount + when you initiate the checkout flow. + type: string + return_url: + description: >- + The callback URL for PayPal to redirect the user in the + case of approved payment. + type: string + cancel_url: + description: >- + The callback URL for PayPal to redirect user in the case + a cancelled payment. + type: string + Data.StripePayment: + title: Data.StripePayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: Specifies the type of payment gateway. You must use `stripe`. + type: string + enum: + - stripe + options: + type: object + properties: + receipt_email: + description: >- + The option to provide an email for Stripe receipts. Specify + live mode to access this feature. + type: string + payment: + description: The Stripe token or source. + type: string + Data.StripeConnectPayment: + title: Data.StripeConnectPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: >- + Specifies the type of payment gateway. You must use + `stripe_connect`. + type: string + enum: + - stripe_connect + options: + type: object + properties: + receipt_email: + description: >- + Provides the email address to which you want to send the + Stripe receipts for the transactions within the store. This + feature is available only in the live mode. + type: string + payment: + description: Specifies the Stripe token or source. + type: string + Data.StripePaymentIntentsPayment: + title: Data.StripePaymentIntentsPayment + required: + - gateway + allOf: + - $ref: '#/components/schemas/Data.BasePayments' + - type: object + properties: + gateway: + description: >- + Specifies the type of payment gateway. You must use + `stripe_payment_intents`. + type: string + enum: + - stripe_payment_intents + options: + type: object + properties: + receipt_email: + description: >- + Provides the email address to which you want to send the + Stripe receipts for the transactions within the store. This + feature is available only in the live mode. + type: string + payment: + description: Specifies the Stripe token or source. + type: string + Data.PaymentObject: + oneOf: + - $ref: '#/components/schemas/Data.AdyenPayment' + - $ref: '#/components/schemas/Data.AuthorizeNetPayment' + - $ref: '#/components/schemas/Data.BraintreePayment' + - $ref: '#/components/schemas/Data.CardConnectPayment' + - $ref: '#/components/schemas/Data.CyberSourcePayment' + - $ref: '#/components/schemas/ElasticPathPaymentsPoweredByStripePayment' + - $ref: '#/components/schemas/Data.ManualPayment' + - $ref: '#/components/schemas/Data.PayPalExpressCheckoutPayment' + - $ref: '#/components/schemas/Data.StripePayment' + - $ref: '#/components/schemas/Data.StripeConnectPayment' + - $ref: '#/components/schemas/Data.StripePaymentIntentsPayment' + TransactionResponse: + title: TransactionResponse + type: object + properties: + id: + description: The ID of the transaction. + type: string + format: uuid + readOnly: true + reference: + description: The payment gateway reference. + type: string + example: manual + name: + description: A custom name associated with the payment method. + type: string + example: payment method name + custom_reference: + description: >- + A reference associated with the payment method. This might include + loyalty points or gift card identifiers. We recommend you not to + include personal information in this field. + type: string + example: custom reference + gateway: + description: The name of the payment gateway used. + type: string + enum: + - adyen + - authorize_net + - braintree + - card_connect + - cyber_source + - elastic_path_payments_stripe + - manual + - paypal_express_checkout + - stripe + - stripe_connect + - stripe_payment_intents + amount: + description: The amount for this transaction. + type: number + example: 10000 + refunded_amount: + description: The refunded amount. + type: number + example: 0 + currency: + description: The transaction currency. + type: string + example: USD + transaction-type: + description: >- + The type of transaction, such as `purchase`, `capture`, `authorize` + or `refund`. + type: string + example: capture + status: + description: >- + The status provided by the gateway for this transaction, such as + `complete` or `failed`. + type: string + example: complete + relationships: + type: object + properties: + order: + type: object + properties: + data: + type: object + properties: + type: + description: >- + Represents the type of the object being returned. It is + always `order`. + type: string + example: order + id: + description: The ID of the order. + type: string + format: uuid + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + meta: + type: object + properties: + display_price: + $ref: '#/components/schemas/FormattedPriceData' + display_refunded_amount: + $ref: '#/components/schemas/FormattedPriceData' + timestamps: + $ref: '#/components/schemas/Timestamps' + OrdersTransactionsConfirmRequest: + title: OrdersTransactionsConfirmRequest + type: object + properties: + data: + type: object + OrdersTransactionsCaptureRequest: + title: OrdersTransactionsCaptureRequest + type: object + properties: + data: + type: object + properties: + options: + type: object + properties: + soft_descriptor: + type: string + note_to_payer: + type: string + OrdersTransactionsRefundRequest: + title: OrdersTransactionsRefundRequest + type: object + properties: + data: + type: object + properties: + amount: + description: >- + The amount value to be refunded. If this field is not provided, + it will be considered as manual refund (Mark as Refunded) and + the refund process must be manually handled via payment + provider. If the amount value is same as payment value, then it + will be treated as a full refund and sent to the payment + provider to process refund automatically. + type: number + example: 1000 + options: + type: object + properties: + note: + description: >- + Provides comments about the refund. It is used by PayPal + Express. + type: string + OrdersTransactionsCancelRequest: + title: OrdersTransactionsCancelRequest + type: object + properties: + data: + type: object + properties: + options: + type: object + reason: + description: >- + Specifies the reason for canceling the transaction. The reason + may include `duplicate`, `fraudulent`, `requested_by_customer`, + or `abandoned`. + type: string + example: requested_by_customer + OrderPriceData: + title: OrderPriceData + type: object + properties: + amount: + description: The amount for this item. + type: number + example: 10000 + currency: + description: The currency this item. + type: string + example: USD + includes_tax: + description: Whether or not this price is tax inclusive. + type: boolean + example: false + FormattedPriceData: + title: FormattedPriceData + type: object + properties: + amount: + description: The raw total of this cart. + type: number + example: 10000 + currency: + description: The currency set for this cart. + type: string + example: USD + formatted: + description: The tax inclusive formatted total based on the currency. + type: string + example: $10.00 + OrderItemFormattedUnitPriceData: + title: OrderItemFormattedUnitPriceData + type: object + properties: + unit: + $ref: '#/components/schemas/FormattedPriceData' + value: + $ref: '#/components/schemas/FormattedPriceData' + DiscountData: + title: DiscountData + type: object + properties: + amount: + $ref: '#/components/schemas/OrderPriceData' + code: + type: string + example: 10_off + id: + type: string + format: uuid + readOnly: true + example: a01cf221-751b-46e4-b612-57ad3c645ee6 + OrderItemResponse: + title: OrderItemResponse + type: object + properties: + type: + description: The type represents the object being returned. + type: string + example: order_item + id: + description: The unique identifier for this order item. + type: string + format: uuid + readOnly: true + example: 68bf8510-bebf-47b1-96ba-8a9930c7d928 + quantity: + description: The quantity of this item were ordered. + type: number + example: 1 + product_id: + description: The unique identifier for this order item. + type: string + format: uuid + readOnly: true + example: 4e9c6098-9701-4839-a69c-54d8256d9012 + name: + description: The name of this order item. + type: string + example: Product 123 + sku: + description: The SKU code for the order item. + type: string + example: IFD-1 + unit_price: + $ref: '#/components/schemas/OrderPriceData' + value: + $ref: '#/components/schemas/OrderPriceData' + discounts: + type: array + items: + $ref: '#/components/schemas/DiscountData' + links: + type: object + meta: + type: object + properties: + display_price: + type: object + properties: + with_tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + without_tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + tax: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + discount: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + without_discount: + $ref: '#/components/schemas/OrderItemFormattedUnitPriceData' + discounts: + type: object + additionalProperties: + type: object + properties: + amount: + type: number + example: -1000 + currency: + type: string + example: USD + formatted: + type: string + example: '-$1.00' + timestamps: + $ref: '#/components/schemas/Timestamps' + relationships: + type: object + properties: + cart_item: + type: object + properties: + data: + type: object + properties: + type: + description: The type represents the object being returned. + type: string + example: order_item + id: + description: The unique identifier for this item. + type: string + format: uuid + readOnly: true + example: 5601a4b1-9d13-42d3-8fb7-03b35169d1b6 + catalog_id: + description: >- + The unique identifier of the catalog associated with the product is + shown if `catalog_source=pim` is set. + type: string + example: default + catalog_source: + description: The catalog source. Always `pim` or `legacy`. + type: string + example: pim - legacy + OrderResponse: + title: OrderResponse + type: object + properties: + type: + description: Specifies the type of object being returned. You must use `order`. + type: string + example: order + id: + description: Specifies the unique identifier of the order. + type: string + format: uuid + readOnly: true + example: aa854b8f-5930-476d-951a-e9b9cfbdefb1 + status: + description: >- + Specifies the status of the order, such as `incomplete`, `complete`, + `processing`, or `cancelled`. + type: string + example: complete - incomplete - cancelled + payment: + description: >- + Specifies the status of the payment, such as `unpaid`, `authorized`, + `paid`, or `refunded`. + type: string + example: authorized - paid - unpaid - refunded + shipping: + description: >- + Specifies the status of the shipment, such as `fulfilled` or + `unfulfilled`. + type: string + example: unfulfilled - fulfilled + anonymized: + description: Specifies if the order is anonymized. + type: boolean + example: false + meta: + $ref: '#/components/schemas/OrderMeta' + billing_address: + $ref: '#/components/schemas/BillingAddress' + contact: + $ref: '#/components/schemas/Contact' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + OrderMeta: + title: OrderMeta + type: object + properties: + timestamps: + $ref: '#/components/schemas/Timestamps' + with_tax: + $ref: '#/components/schemas/FormattedPriceData' + without_tax: + $ref: '#/components/schemas/FormattedPriceData' + tax: + $ref: '#/components/schemas/FormattedPriceData' + discount: + $ref: '#/components/schemas/FormattedPriceData' + paid: + $ref: '#/components/schemas/FormattedPriceData' + authorized: + $ref: '#/components/schemas/FormattedPriceData' + without_discount: + $ref: '#/components/schemas/FormattedPriceData' + CustomerCheckout: + title: Customer Checkout + type: object + properties: + data: + type: object + properties: + customer: + type: object + properties: + id: + description: The ID of the customer. + type: string + billing_address: + $ref: '#/components/schemas/BillingAddress' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + AccountCheckout: + title: Account Checkout + type: object + properties: + data: + type: object + properties: + account: + type: object + properties: + id: + description: The account ID. + type: string + member_id: + description: The account member ID. + type: string + contact: + type: object + properties: + name: + description: The name of the account member. + type: string + email: + description: The email address of the account member. + type: string + format: email + billing_address: + $ref: '#/components/schemas/BillingAddress' + shipping_address: + $ref: '#/components/schemas/ShippingAddress' + BillingAddress: + title: BillingAddress + type: object + required: + - first_name + - last_name + - line_1 + - region + - postcode + - country + properties: + company_name: + description: Company name of the billing recipient. + type: string + example: John Doe Enterprises + country: + description: Specifies the country of the billing address. + type: string + example: US + county: + description: Specifies the county of the billing address. + type: string + example: Orange + first_name: + description: First name of the billing recipient. + type: string + example: John + last_name: + description: Last name of the billing recipient. + type: string + example: Doe + line_1: + description: First line of the billing address. + type: string + example: 1 Sunny Street + line_2: + description: Second line of the billing address. + type: string + postcode: + description: Postcode of the billing address. + type: string + example: '92802' + region: + description: Specifies state, province, or region of the billing address. + type: string + example: CA + Contact: + title: Contact + type: object + properties: + email: + description: The email address of the contact. + type: string + example: johndoe@email.com + name: + description: The name of the contact. + type: string + example: John Doe + ShippingAddress: + title: ShippingAddress + type: object + required: + - first_name + - last_name + - line_1 + - region + - postcode + - country + properties: + company_name: + description: Company of the shipping recipient. + type: string + example: John Doe Enterprises + country: + description: Specifies the country of the shipping address. + type: string + example: US + county: + description: Specifies the county of the shipping address. + type: string + example: Orange + first_name: + description: First name of the shipping recipient. + type: string + example: John + last_name: + description: Last name of the shipping recipient. + type: string + example: Doe + line_1: + description: First line of the shipping address. + type: string + example: 1 Sunny Street + line_2: + description: Second line of the shipping address. + type: string + postcode: + description: Post code of the shipping address. + type: string + example: '92802' + region: + description: Specifies the state, province, or region of the shipping address. + type: string + example: CA + Response.Meta.Carts: + type: object + properties: + page: + $ref: '#/components/schemas/Response.PaginationPage' + results: + $ref: '#/components/schemas/Response.PaginationResults' + Response.Meta.Orders: + type: object + properties: + page: + $ref: '#/components/schemas/Response.PaginationPage' + results: + $ref: '#/components/schemas/Response.PaginationResults' + Response.PaginationPage: + type: object + properties: + current: + description: The current page. + type: integer + limit: + description: >- + The maximum number of records per page for this response. You can + set this value up to 100. + type: integer + offset: + description: >- + The current offset by number of records, not pages. Offset is + zero-based. + type: integer + total: + description: The total page count. + type: integer + Response.PaginationResults: + type: object + properties: + total: + description: The total page count. + type: integer + Response.PageLinks: + type: object + properties: + current: + description: Always the current page. + type: string + first: + description: Always the first page. + type: string + last: + description: If there is only one page, it is `null`. + type: string + next: + description: If there is only one page, it is `null`. + type: string + prev: + description: if the user is on the first page, it is `null`. + type: string + Response.Data: + type: object + properties: + data: {} + Response.Error: + type: array + properties: + detail: + type: string + status: + type: string + title: + type: string + Timestamps: + type: object + properties: + created_at: + description: The date this was created. + type: string + example: '2023-11-07T23:04:18.845Z' + updated_at: + description: The date this was last updated. + example: '2023-11-07T23:04:18.845Z' + CartTimestamps: + type: object + properties: + created_at: + type: string + example: '2023-11-07T23:04:18.845Z' + updated_at: + example: '2023-11-07T23:04:18.845Z' + expires_at: + example: '2023-11-12T23:04:18.845Z' + requestBodies: + bundle-configuration-data: + content: + application/json: + schema: + $ref: '#/components/schemas/bundle-configuration-data' + description: The bundle configuration. + required: true + products-for-cart-configuration: + content: + application/json: + schema: + $ref: '#/components/schemas/products-for-cart-configuration' + description: A list of product id or sku and bundle configuration for cart. + required: true + securitySchemes: + bearerAuth: + type: http + scheme: bearer + name: Authorization + in: header +x-tagGroups: + - name: Catalogs Introduction + tags: + - Catalogs + - Releases + - Rules + - Administrator Latest Releases Catalog API + - Shopper Catalog API + - name: Carts, Checkout, Orders Introduction + tags: + - Cart Management + - Account Cart Associations + - Customer Cart Associations + - Cart Items + - Checkout + - Orders + - Payments + - Transactions + - Custom Discounts + - Tax Items diff --git a/packages/shopper-common/package.json b/packages/shopper-common/package.json index d7e6e5ef..35719e1d 100644 --- a/packages/shopper-common/package.json +++ b/packages/shopper-common/package.json @@ -38,6 +38,7 @@ }, "dependencies": { "@elasticpath/js-sdk": "5.0.0", + "@epcc-sdk/sdks-shopper": "workspace:*", "tslib": "^2.6.2" }, "publishConfig": { diff --git a/packages/shopper-common/src/navigation/build-navigation.ts b/packages/shopper-common/src/navigation/build-navigation.ts index 5e0678fb..7cfe685e 100644 --- a/packages/shopper-common/src/navigation/build-navigation.ts +++ b/packages/shopper-common/src/navigation/build-navigation.ts @@ -1,17 +1,31 @@ -import type { Hierarchy, ElasticPath } from "@elasticpath/js-sdk" -import { - getHierarchies, - getHierarchyChildren, - getHierarchyNodes, -} from "./services/hierarchy" +import type { Client, Hierarchy } from "@epcc-sdk/sdks-shopper" import { ISchema, NavigationNode } from "./navigation-types" +import { + getByContextAllHierarchies, + getByContextHierarchyChildNodes, + getByContextHierarchyNodes, +} from "@epcc-sdk/sdks-shopper" export async function buildSiteNavigation( - client: ElasticPath, + client?: Client, ): Promise { // Fetch hierarchies to be used as top level nav - const hierarchies = await getHierarchies(client) - return constructTree(hierarchies, client) + const hierarchiesResponse = await getByContextAllHierarchies({ + client, + body: undefined, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, + }) + + if (!hierarchiesResponse.response.ok) { + throw new Error("Failed to fetch hierarchies") + } + + const hierarchies = hierarchiesResponse.data?.data + + return hierarchies ? constructTree(hierarchies, client) : [] } /** @@ -19,40 +33,76 @@ export async function buildSiteNavigation( */ function constructTree( hierarchies: Hierarchy[], - client: ElasticPath, + client?: Client, ): Promise { const tree = hierarchies .slice(0, 4) .map((hierarchy) => createNode({ - name: hierarchy.attributes.name, - id: hierarchy.id, - slug: hierarchy.attributes.slug, + name: hierarchy.attributes?.name!, + id: hierarchy.id!, + slug: hierarchy.attributes?.slug, }), ) .map(async (hierarchy) => { // Fetch first-level nav ('parent nodes') - the direct children of each hierarchy - const directChildren = await getHierarchyChildren(hierarchy.id, client) + const directChildrenResponse = await getByContextHierarchyChildNodes({ + client, + body: undefined, + path: { + hierarchy_id: hierarchy.id, + }, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, + }) + + if (!directChildrenResponse.response.ok) { + throw new Error("Failed to fetch hierarchy children") + } + + const directChildren = directChildrenResponse.data?.data ?? [] + // Fetch all nodes in each hierarchy (i.e. all 'child nodes' belonging to a hierarchy) - const allNodes = await getHierarchyNodes(hierarchy.id, client) + const allNodesResponse = await getByContextHierarchyNodes({ + client, + body: undefined, + path: { + hierarchy_id: hierarchy.id, + }, + query: { + "page[limit]": 100, + "page[offset]": 0, + }, + }) + + if (!allNodesResponse.response.ok) { + throw new Error("Failed to fetch hierarchy nodes") + } + + const allNodes = allNodesResponse.data?.data ?? [] // Build 2nd level by finding all 'child nodes' belonging to each first level featured-nodes - const directs = directChildren.slice(0, 4).map((child) => { - const children: ISchema[] = allNodes - .filter((node) => node?.relationships?.parent.data.id === child.id) - .map((node) => - createNode({ - name: node.attributes.name, - id: node.id, - slug: node.attributes.slug, - hrefBase: `${hierarchy.href}/${child.attributes.slug}`, - }), - ) + const directs = directChildren?.slice(0, 4).map((child) => { + const children: ISchema[] = + allNodes + ?.filter( + (node) => node?.relationships?.parent?.data.id === child.id, + ) + .map((node) => + createNode({ + name: node.attributes?.name!, + id: node.id!, + slug: node.attributes?.slug, + hrefBase: `${hierarchy.href}/${child.attributes?.slug}`, + }), + ) ?? [] return createNode({ - name: child.attributes.name, - id: child.id, - slug: child.attributes.slug, + name: child.attributes?.name!, + id: child.id!, + slug: child.attributes?.slug, hrefBase: hierarchy.href, children, }) diff --git a/packages/shopper-common/src/navigation/services/hierarchy.ts b/packages/shopper-common/src/navigation/services/hierarchy.ts deleted file mode 100644 index ed346b49..00000000 --- a/packages/shopper-common/src/navigation/services/hierarchy.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Node, Hierarchy } from "@elasticpath/js-sdk" -import { ElasticPath } from "@elasticpath/js-sdk" - -export async function getHierarchies( - client: ElasticPath, -): Promise { - const result = await client.ShopperCatalog.Hierarchies.All() - return result.data -} - -export async function getHierarchyChildren( - hierarchyId: string, - client: ElasticPath, -): Promise { - const result = await client.ShopperCatalog.Hierarchies.GetHierarchyChildren({ - hierarchyId, - }) - return result.data -} - -export async function getHierarchyNodes( - hierarchyId: string, - client: ElasticPath, -): Promise { - const result = await client.ShopperCatalog.Hierarchies.GetHierarchyNodes({ - hierarchyId, - }) - - return result.data -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 642b90ab..35f62616 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -554,6 +554,12 @@ importers: '@elasticpath/react-shopper-hooks': specifier: workspace:* version: link:../../packages/react-shopper-hooks + '@epcc-sdk/sdks-nextjs': + specifier: workspace:* + version: link:../../packages/sdks/nextjs + '@epcc-sdk/sdks-shopper': + specifier: workspace:* + version: link:../../packages/sdks/shopper '@floating-ui/react': specifier: ^0.26.3 version: 0.26.6(react-dom@18.3.1)(react@18.3.1) @@ -1249,11 +1255,65 @@ importers: specifier: ^0.31.1 version: 0.31.4 + packages/sdks/nextjs: + dependencies: + '@hey-api/client-fetch': + specifier: ^0.2.4 + version: 0.2.4 + devDependencies: + next: + specifier: ^14.0.0 + version: 14.0.0(@babel/core@7.23.2)(react-dom@18.3.1)(react@18.3.1) + typescript: + specifier: ^5.5.3 + version: 5.5.4 + + packages/sdks/pim: + dependencies: + '@hey-api/client-fetch': + specifier: ^0.1.7 + version: 0.1.14 + devDependencies: + '@hey-api/openapi-ts': + specifier: ^0.48.2 + version: 0.48.3(typescript@5.5.4) + typescript: + specifier: ^5.5.3 + version: 5.5.4 + + packages/sdks/shopper: + dependencies: + '@hey-api/client-fetch': + specifier: ^0.2.4 + version: 0.2.4 + devDependencies: + '@hey-api/openapi-ts': + specifier: ^0.52.10 + version: 0.52.10(typescript@5.5.4) + '@redocly/cli': + specifier: ^1.21.0 + version: 1.21.0(enzyme@3.11.0) + '@redocly/openapi-core': + specifier: ^1.21.0 + version: 1.21.0 + '@tanstack/react-query': + specifier: ^5.52.1 + version: 5.52.1(react@18.3.1) + lodash: + specifier: ^4.17.21 + version: 4.17.21 + typescript: + specifier: ^5.5.3 + version: 5.5.4 + packages/shopper-common: dependencies: '@elasticpath/js-sdk': specifier: 5.0.0 version: 5.0.0(encoding@0.1.13) + '@epcc-sdk/sdks-shopper': + specifier: workspace:* + version: link:../sdks/shopper tslib: specifier: ^2.6.2 version: 2.6.2 @@ -1553,6 +1613,24 @@ packages: - chokidar dev: false + /@apidevtools/json-schema-ref-parser@11.6.4: + resolution: {integrity: sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w==} + engines: {node: '>= 16'} + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + dev: true + + /@apidevtools/json-schema-ref-parser@11.7.0: + resolution: {integrity: sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog==} + engines: {node: '>= 16'} + dependencies: + '@jsdevtools/ono': 7.1.3 + '@types/json-schema': 7.0.15 + js-yaml: 4.1.0 + dev: true + /@ardatan/relay-compiler@12.0.0(graphql@16.8.1): resolution: {integrity: sha512-9anThAaj1dQr6IGmzBMcfzOQKTa5artjuPmw8NYK/fiGEMjADbSguBY2FMDykt+QhilR3wc9VA/3yVju7JHg7Q==} hasBin: true @@ -1851,7 +1929,7 @@ packages: '@babel/core': 7.23.2 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4 + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -1865,7 +1943,7 @@ packages: '@babel/core': 7.23.3 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4 + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -1879,7 +1957,7 @@ packages: '@babel/core': 7.25.2 '@babel/helper-compilation-targets': 7.22.15 '@babel/helper-plugin-utils': 7.22.5 - debug: 4.3.4 + debug: 4.3.6 lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -5064,7 +5142,7 @@ packages: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.4 '@babel/types': 7.23.4 - debug: 4.3.4 + debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -5127,6 +5205,23 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@cfaester/enzyme-adapter-react-18@0.8.0(enzyme@3.11.0)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-3Z3ThTUouHwz8oIyhTYQljEMNRFtlVyc3VOOHCbxs47U6cnXs8K9ygi/c1tv49s7MBlTXeIcuN+Ttd9aPtILFQ==} + peerDependencies: + enzyme: ^3.11.0 + react: '>=18' + react-dom: '>=18' + dependencies: + enzyme: 3.11.0 + enzyme-shallow-equal: 1.0.7 + function.prototype.name: 1.1.6 + has: 1.0.4 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-is: 18.2.0 + react-shallow-renderer: 16.15.0(react@18.3.1) + dev: true + /@changesets/apply-release-plan@6.1.4: resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} dependencies: @@ -6139,6 +6234,20 @@ packages: transitivePeerDependencies: - encoding + /@emotion/is-prop-valid@1.2.2: + resolution: {integrity: sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==} + dependencies: + '@emotion/memoize': 0.8.1 + dev: true + + /@emotion/memoize@0.8.1: + resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} + dev: true + + /@emotion/unitless@0.8.1: + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + dev: true + /@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@18.3.1): resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} peerDependencies: @@ -6847,6 +6956,10 @@ packages: resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@exodus/schemasafe@1.3.0: + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + dev: true + /@fal-works/esbuild-plugin-global-externals@2.1.2: resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} dev: true @@ -7550,6 +7663,47 @@ packages: react: 18.3.1 dev: false + /@hey-api/client-fetch@0.1.14: + resolution: {integrity: sha512-6RoO2prOVrQfx2wClJ7DkeIVWQokiRLIdqiuxvFTfWEQVfOc+hQhAw6/IijYrSM9cA7A7DzmHpzTLc/gbQ7/2Q==} + dev: false + + /@hey-api/client-fetch@0.2.4: + resolution: {integrity: sha512-SGTVAVw3PlKDLw+IyhNhb/jCH3P1P2xJzLxA8Kyz1g95HrkYOJdRpl9F5I7LLwo9aCIB7nwR2NrSeX7QaQD7vQ==} + dev: false + + /@hey-api/openapi-ts@0.48.3(typescript@5.5.4): + resolution: {integrity: sha512-R53Nr4Gicz77icS+RiH0fwHa9A0uFPtzsjC8SBaGwtOel5ZyxeBbayWE6HhE789hp3dok9pegwWncwwOrr4WFA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + typescript: ^5.x + dependencies: + '@apidevtools/json-schema-ref-parser': 11.6.4 + c12: 1.11.1 + camelcase: 8.0.0 + commander: 12.1.0 + handlebars: 4.7.8 + typescript: 5.5.4 + transitivePeerDependencies: + - magicast + dev: true + + /@hey-api/openapi-ts@0.52.10(typescript@5.5.4): + resolution: {integrity: sha512-ZjCETgc85VOEQvqObLxM0NUx87niv5LUfPk9N9BeVZ2zgvfFX8oT4LAzojc8UEyKDakI3elZKPPY843W3a+aFA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + typescript: ^5.x + dependencies: + '@apidevtools/json-schema-ref-parser': 11.7.0 + c12: 1.11.1 + commander: 12.1.0 + handlebars: 4.7.8 + typescript: 5.5.4 + transitivePeerDependencies: + - magicast + dev: true + /@hookform/error-message@2.0.1(react-dom@18.3.1)(react-hook-form@7.49.3)(react@18.3.1): resolution: {integrity: sha512-U410sAr92xgxT1idlu9WWOVjndxLdgPUHEB8Schr27C9eh7/xUnITWpCMF93s+lGiG++D4JnbSnrb5A21AdSNg==} peerDependencies: @@ -8345,7 +8499,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false optional: true /@next/swc-darwin-x64@14.0.0: @@ -8354,7 +8507,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false optional: true /@next/swc-linux-arm64-gnu@14.0.0: @@ -8363,7 +8515,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-arm64-musl@14.0.0: @@ -8372,7 +8523,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-x64-gnu@14.0.0: @@ -8381,7 +8531,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-linux-x64-musl@14.0.0: @@ -8390,7 +8539,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@next/swc-win32-arm64-msvc@14.0.0: @@ -8399,7 +8547,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false optional: true /@next/swc-win32-ia32-msvc@14.0.0: @@ -8408,7 +8555,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false optional: true /@next/swc-win32-x64-msvc@14.0.0: @@ -8417,7 +8563,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false optional: true /@nodelib/fs.scandir@2.1.5: @@ -9542,6 +9687,72 @@ packages: dependencies: '@babel/runtime': 7.23.8 + /@redocly/ajv@8.11.0: + resolution: {integrity: sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: true + + /@redocly/cli@1.21.0(enzyme@3.11.0): + resolution: {integrity: sha512-KPCHWrTXnIV01rgpgwnyQuwKhSol5pnNor20f6/szVrUcZ+vRCqKeZDR1CSMBYIXEsi0AknLV7WR8BCYyfYbog==} + engines: {node: '>=14.19.0', npm: '>=7.0.0'} + hasBin: true + dependencies: + '@redocly/openapi-core': 1.21.0 + abort-controller: 3.0.0 + chokidar: 3.6.0 + colorette: 1.4.0 + core-js: 3.33.1 + form-data: 4.0.0 + get-port-please: 3.1.2 + glob: 7.2.3 + handlebars: 4.7.8 + mobx: 6.13.1 + node-fetch: 2.7.0(encoding@0.1.13) + pluralize: 8.0.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + redoc: 2.1.5(core-js@3.33.1)(enzyme@3.11.0)(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1)(styled-components@6.1.12) + semver: 7.5.4 + simple-websocket: 9.1.0 + styled-components: 6.1.12(react-dom@18.3.1)(react@18.3.1) + yargs: 17.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - enzyme + - react-native + - supports-color + - utf-8-validate + dev: true + + /@redocly/config@0.9.0: + resolution: {integrity: sha512-rRd0pSiPC68AQGud2VbrHqUov1VHospfcYE2pFYmGYfZhzZfHBSiVaeiTY+CZmrhf5RB9aVdOHRCm25Vb6GFkQ==} + dev: true + + /@redocly/openapi-core@1.21.0: + resolution: {integrity: sha512-8KwL/0jiQBSJMNp1lSMLM1UeV2FW9DdqcjO0J9s5w7yL7ZN+SNh11MTp0zU4om/pGYExQ64hxLM/+7VdjznHRQ==} + engines: {node: '>=14.19.0', npm: '>=7.0.0'} + dependencies: + '@redocly/ajv': 8.11.0 + '@redocly/config': 0.9.0 + colorette: 1.4.0 + https-proxy-agent: 7.0.5 + js-levenshtein: 1.1.6 + js-yaml: 4.1.0 + lodash.isequal: 4.5.0 + minimatch: 5.1.6 + node-fetch: 2.7.0(encoding@0.1.13) + pluralize: 8.0.0 + yaml-ast-parser: 0.0.43 + transitivePeerDependencies: + - encoding + - supports-color + dev: true + /@repeaterjs/repeater@3.0.4: resolution: {integrity: sha512-AW8PKd6iX3vAZ0vA43nOUOnbq/X5ihgU+mSXXqunMkeQADGiqw/PY0JNeYtD5sr0PAy51YPgAPbDoeapv9r8WA==} dev: true @@ -10275,7 +10486,7 @@ packages: ts-dedent: 2.2.0 util: 0.12.5 util-deprecate: 1.0.2 - watchpack: 2.4.0 + watchpack: 2.4.1 ws: 8.14.2 transitivePeerDependencies: - bufferutil @@ -10708,7 +10919,6 @@ packages: resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==} dependencies: tslib: 2.6.2 - dev: false /@szmarczak/http-timer@5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} @@ -10729,6 +10939,10 @@ packages: /@tanstack/query-core@5.51.21: resolution: {integrity: sha512-POQxm42IUp6n89kKWF4IZi18v3fxQWFRolvBA6phNVmA8psdfB1MvDnGacCJdS+EOX12w/CyHM62z//rHmYmvw==} + /@tanstack/query-core@5.52.0: + resolution: {integrity: sha512-U1DOEgltjUwalN6uWYTewSnA14b+tE7lSylOiASKCAO61ENJeCq9VVD/TXHA6O5u9+6v5+UgGYBSccTKDoyMqw==} + dev: true + /@tanstack/query-devtools@5.32.1: resolution: {integrity: sha512-7Xq57Ctopiy/4atpb0uNY5VRuCqRS/1fi/WBCKKX6jHMa6cCgDuV/AQuiwRXcKARbq2OkVAOrW2v4xK9nTbcCA==} dev: true @@ -10752,6 +10966,15 @@ packages: '@tanstack/query-core': 5.51.21 react: 18.3.1 + /@tanstack/react-query@5.52.1(react@18.3.1): + resolution: {integrity: sha512-soyn4dNIUZ8US8NaPVXv06gkZFHaZnPfKWPDjRJjFRW3Y7WZ0jx72eT6zhw3VQlkMPysmXye8l35ewPHspKgbQ==} + peerDependencies: + react: ^18 || ^19 + dependencies: + '@tanstack/query-core': 5.52.0 + react: 18.3.1 + dev: true + /@testing-library/dom@9.3.3: resolution: {integrity: sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==} engines: {node: '>=14'} @@ -11397,6 +11620,10 @@ packages: resolution: {integrity: sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw==} dev: true + /@types/stylis@4.2.5: + resolution: {integrity: sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==} + dev: true + /@types/through@0.0.32: resolution: {integrity: sha512-7XsfXIsjdfJM2wFDRAtEWp3zb2aVPk5QeyZxGlVK57q4u26DczMHhJmlhr0Jqv0THwxam/L8REXkj8M2I/lcvw==} dependencies: @@ -11752,7 +11979,7 @@ packages: dependencies: '@vitest/utils': 0.29.8 p-limit: 4.0.0 - pathe: 1.1.1 + pathe: 1.1.2 dev: true /@vitest/runner@0.31.4: @@ -11761,7 +11988,7 @@ packages: '@vitest/utils': 0.31.4 concordance: 5.0.4 p-limit: 4.0.0 - pathe: 1.1.1 + pathe: 1.1.2 dev: true /@vitest/runner@0.34.6: @@ -11776,7 +12003,7 @@ packages: resolution: {integrity: sha512-LemvNumL3NdWSmfVAMpXILGyaXPkZbG5tyl6+RQSdcHnTj6hvA49UAI8jzez9oQyE/FWLKRSNqTGzsHuk89LRA==} dependencies: magic-string: 0.30.5 - pathe: 1.1.1 + pathe: 1.1.2 pretty-format: 27.5.1 dev: true @@ -12063,6 +12290,13 @@ packages: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} dev: false + /abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: true + /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -12093,20 +12327,12 @@ packages: acorn: 7.4.1 dev: true - /acorn-jsx@5.3.2(acorn@8.10.0): + /acorn-jsx@5.3.2(acorn@8.12.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.10.0 - - /acorn-jsx@5.3.2(acorn@8.11.2): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.11.2 - dev: false + acorn: 8.12.1 /acorn-walk@7.2.0: resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} @@ -12127,6 +12353,7 @@ packages: resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true + dev: true /acorn@8.11.2: resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} @@ -12137,7 +12364,6 @@ packages: resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} engines: {node: '>=0.4.0'} hasBin: true - dev: true /address@1.2.2: resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==} @@ -12152,7 +12378,7 @@ packages: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} dependencies: - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -12397,6 +12623,14 @@ packages: is-array-buffer: 3.0.2 dev: true + /array-buffer-byte-length@1.0.1: + resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + is-array-buffer: 3.0.4 + dev: true + /array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} @@ -12419,6 +12653,18 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + /array.prototype.filter@1.0.4: + resolution: {integrity: sha512-r+mCJ7zXgXElgR4IRC+fkvNCeoaavWBs6EdCso5Tbcf+iEMKzBU/His60lt34WEZ9vlb8wDkZvQGcVI5GwkfoQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-array-method-boxes-properly: 1.0.0 + es-object-atoms: 1.0.0 + is-string: 1.0.7 + dev: true + /array.prototype.findlastindex@1.2.3: resolution: {integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==} engines: {node: '>= 0.4'} @@ -12434,9 +12680,9 @@ packages: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.3 es-shim-unscopables: 1.0.2 dev: true @@ -12473,6 +12719,20 @@ packages: is-shared-array-buffer: 1.0.2 dev: true + /arraybuffer.prototype.slice@1.0.3: + resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + is-array-buffer: 3.0.4 + is-shared-array-buffer: 1.0.3 + dev: true + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} @@ -12598,6 +12858,13 @@ packages: engines: {node: '>= 0.4'} dev: true + /available-typed-arrays@1.0.7: + resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + engines: {node: '>= 0.4'} + dependencies: + possible-typed-array-names: 1.0.0 + dev: true + /axe-core@4.8.2: resolution: {integrity: sha512-/dlp0fxyM3R8YW7MFzaHWXrf4zzbr0vaYb23VBFCl83R7nWNPg/yaQw2Dc8jzCMmDVLhSdzH8MjrsuIUuvX+6g==} engines: {node: '>=4'} @@ -13154,6 +13421,28 @@ packages: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} + /c12@1.11.1: + resolution: {integrity: sha512-KDU0TvSvVdaYcQKQ6iPHATGz/7p/KiVjPg4vQrB6Jg/wX9R0yl5RZxWm9IoZqaIHD2+6PZd81+KMGwRr/lRIUg==} + peerDependencies: + magicast: ^0.3.4 + peerDependenciesMeta: + magicast: + optional: true + dependencies: + chokidar: 3.6.0 + confbox: 0.1.7 + defu: 6.1.4 + dotenv: 16.4.5 + giget: 1.2.3 + jiti: 1.21.6 + mlly: 1.7.1 + ohash: 1.1.3 + pathe: 1.1.2 + perfect-debounce: 1.0.0 + pkg-types: 1.2.0 + rc9: 2.1.2 + dev: true + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -13184,6 +13473,17 @@ packages: get-intrinsic: 1.2.2 set-function-length: 1.1.1 + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.2 + dev: true + /call-me-maybe@1.0.2: resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} dev: true @@ -13236,11 +13536,20 @@ packages: engines: {node: '>=14.16'} dev: false + /camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + dev: true + + /camelize@1.0.1: + resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} + dev: true + /caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001554 + caniuse-lite: 1.0.30001651 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 dev: false @@ -13250,7 +13559,6 @@ packages: /caniuse-lite@1.0.30001651: resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} - dev: true /capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -13392,7 +13700,6 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 domutils: 3.1.0 - dev: false /cheerio@1.0.0-rc.12: resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==} @@ -13405,7 +13712,6 @@ packages: htmlparser2: 8.0.2 parse5: 7.1.2 parse5-htmlparser2-tree-adapter: 7.0.0 - dev: false /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -13421,6 +13727,21 @@ packages: optionalDependencies: fsevents: 2.3.3 + /chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /chownr@1.1.4: resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} dev: true @@ -13447,6 +13768,12 @@ packages: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} + /citty@0.1.6: + resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==} + dependencies: + consola: 3.2.3 + dev: true + /cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} dev: true @@ -13463,7 +13790,6 @@ packages: /classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} - dev: false /clean-css@5.3.2: resolution: {integrity: sha512-JVJbM+f3d3Q704rF4bqQ5UUyTtuJ0JRKNbTKVEeujCCBoMdkEi+V+e8oktO9qGQNSvHrFTM6JZRXrUvGR1czww==} @@ -13554,7 +13880,6 @@ packages: /client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} - dev: false /cliui@5.0.0: resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} @@ -13572,6 +13897,14 @@ packages: wrap-ansi: 6.2.0 dev: true + /cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -13600,7 +13933,6 @@ packages: /clsx@2.0.0: resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} engines: {node: '>=6'} - dev: false /co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} @@ -13662,6 +13994,10 @@ packages: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} dev: false + /colorette@1.4.0: + resolution: {integrity: sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==} + dev: true + /colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} @@ -13695,6 +14031,11 @@ packages: engines: {node: '>=16'} dev: true + /commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + dev: true + /commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -13812,6 +14153,10 @@ packages: semver: 7.5.4 dev: false + /confbox@0.1.7: + resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + dev: true + /config-chain@1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} dependencies: @@ -13839,6 +14184,11 @@ packages: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} dev: false + /consola@3.2.3: + resolution: {integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==} + engines: {node: ^14.18.0 || >=16.10.0} + dev: true + /constant-case@3.0.4: resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==} dependencies: @@ -14039,6 +14389,11 @@ packages: type-fest: 1.4.0 dev: false + /css-color-keywords@1.0.0: + resolution: {integrity: sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==} + engines: {node: '>=4'} + dev: true + /css-declaration-sorter@6.4.1(postcss@8.4.31): resolution: {integrity: sha512-rtdthzxKuyq6IzqX6jEcIzQF/YqccluefyCYheovBOLhFT/drQA9zj/UbRAa9J7C0o6EG6u3E6g+vKkay7/k3g==} engines: {node: ^10 || ^12 || >=14} @@ -14117,7 +14472,14 @@ packages: domhandler: 5.0.3 domutils: 3.1.0 nth-check: 2.1.1 - dev: false + + /css-to-react-native@3.2.0: + resolution: {integrity: sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==} + dependencies: + camelize: 1.0.1 + css-color-keywords: 1.0.0 + postcss-value-parser: 4.2.0 + dev: true /css-tree@1.1.3: resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} @@ -14222,6 +14584,10 @@ packages: /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + /csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + dev: true + /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} dev: true @@ -14264,6 +14630,33 @@ packages: engines: {node: '>= 12'} dev: true + /data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + /dataloader@2.2.2: resolution: {integrity: sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==} dev: true @@ -14348,7 +14741,11 @@ packages: engines: {node: '>=0.10.0'} dev: true - /decode-named-character-reference@1.0.2: + /decko@1.2.0: + resolution: {integrity: sha512-m8FnyHXV1QX+S1cl+KPFDIl6NMkxtKsy6+U/aYyjrOqWMuwAwYWu7ePqrsUHtDR5Y8Yk2pi/KIDSgF+vT4cPOQ==} + dev: true + + /decode-named-character-reference@1.0.2: resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} dependencies: character-entities: 2.0.2 @@ -14454,6 +14851,15 @@ packages: gopd: 1.0.1 has-property-descriptors: 1.0.1 + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: true + /define-lazy-prop@2.0.0: resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} engines: {node: '>=8'} @@ -14477,6 +14883,10 @@ packages: resolution: {integrity: sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==} dev: true + /defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + dev: true + /del@6.1.1: resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==} engines: {node: '>=10'} @@ -14512,6 +14922,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + /destr@2.0.3: + resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + dev: true + /destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -14596,6 +15010,10 @@ packages: dependencies: path-type: 4.0.0 + /discontinuous-range@1.0.0: + resolution: {integrity: sha512-c68LpLbO+7kP/b1Hr1qs8/BJ09F5khZGTxqxZuhzxpmwJKOgRFHJWIb9/KmqnqHhLdO55aOxFH/EGBvUQbL/RQ==} + dev: true + /dlv@1.1.3: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} dev: true @@ -14647,7 +15065,6 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 entities: 4.5.0 - dev: false /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} @@ -14663,7 +15080,10 @@ packages: engines: {node: '>= 4'} dependencies: domelementtype: 2.3.0 - dev: false + + /dompurify@3.1.6: + resolution: {integrity: sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==} + dev: true /domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} @@ -14678,7 +15098,6 @@ packages: dom-serializer: 2.0.0 domelementtype: 2.3.0 domhandler: 5.0.3 - dev: false /dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} @@ -14713,6 +15132,11 @@ packages: engines: {node: '>=12'} dev: true + /dotenv@16.4.5: + resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} + engines: {node: '>=12'} + dev: true + /dset@3.1.2: resolution: {integrity: sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==} engines: {node: '>=4'} @@ -14844,6 +15268,40 @@ packages: hasBin: true dev: true + /enzyme-shallow-equal@1.0.7: + resolution: {integrity: sha512-/um0GFqUXnpM9SvKtje+9Tjoz3f1fpBC3eXRFrNs8kpYn69JljciYP7KZTqM/YQbUY9KUjvKB4jo/q+L6WGGvg==} + dependencies: + hasown: 2.0.0 + object-is: 1.1.5 + dev: true + + /enzyme@3.11.0: + resolution: {integrity: sha512-Dw8/Gs4vRjxY6/6i9wU0V+utmQO9kvh9XLnz3LIudviOnVYDEe2ec+0k+NQoMamn1VrjKgCUOWj5jG/5M5M0Qw==} + dependencies: + array.prototype.flat: 1.3.2 + cheerio: 1.0.0-rc.12 + enzyme-shallow-equal: 1.0.7 + function.prototype.name: 1.1.6 + has: 1.0.4 + html-element-map: 1.3.1 + is-boolean-object: 1.1.2 + is-callable: 1.2.7 + is-number-object: 1.0.7 + is-regex: 1.1.4 + is-string: 1.0.7 + is-subset: 0.1.1 + lodash.escape: 4.0.1 + lodash.isequal: 4.5.0 + object-inspect: 1.13.1 + object-is: 1.1.5 + object.assign: 4.1.5 + object.entries: 1.1.7 + object.values: 1.1.7 + raf: 3.4.1 + rst-selector-parser: 2.2.3 + string.prototype.trim: 1.2.9 + dev: true + /equals@1.0.5: resolution: {integrity: sha512-wI15a6ZoaaXPv+55+Vh2Kqn3+efKRv8QPtcGTjW5xmanMnQzESdAt566jevtMZyt3W/jwLDTzXpMph5ECDJ2zg==} dependencies: @@ -14900,6 +15358,74 @@ packages: which-typed-array: 1.1.13 dev: true + /es-abstract@1.23.3: + resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.1 + arraybuffer.prototype.slice: 1.0.3 + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 + es-define-property: 1.0.0 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 + es-set-tostringtag: 2.0.3 + es-to-primitive: 1.2.1 + function.prototype.name: 1.1.6 + get-intrinsic: 1.2.4 + get-symbol-description: 1.0.2 + globalthis: 1.0.3 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + internal-slot: 1.0.7 + is-array-buffer: 3.0.4 + is-callable: 1.2.7 + is-data-view: 1.0.1 + is-negative-zero: 2.0.3 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.3 + is-string: 1.0.7 + is-typed-array: 1.1.13 + is-weakref: 1.0.2 + object-inspect: 1.13.1 + object-keys: 1.1.1 + object.assign: 4.1.5 + regexp.prototype.flags: 1.5.2 + safe-array-concat: 1.1.2 + safe-regex-test: 1.0.3 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 + typed-array-buffer: 1.0.2 + typed-array-byte-length: 1.0.1 + typed-array-byte-offset: 1.0.2 + typed-array-length: 1.0.6 + unbox-primitive: 1.0.2 + which-typed-array: 1.1.15 + dev: true + + /es-array-method-boxes-properly@1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + dev: true + + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: true + /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: @@ -14944,6 +15470,13 @@ packages: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} dev: true + /es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + dev: true + /es-set-tostringtag@2.0.2: resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} engines: {node: '>= 0.4'} @@ -14953,10 +15486,19 @@ packages: hasown: 2.0.0 dev: true + /es-set-tostringtag@2.0.3: + resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + dev: true + /es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} dependencies: - hasown: 2.0.0 + hasown: 2.0.2 dev: true /es-to-primitive@1.2.1: @@ -14986,6 +15528,10 @@ packages: es6-symbol: 3.1.3 dev: true + /es6-promise@3.3.1: + resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} + dev: true + /es6-promise@4.2.8: resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} @@ -15175,7 +15721,7 @@ packages: peerDependencies: esbuild: '>=0.12 <1' dependencies: - debug: 4.3.4 + debug: 4.3.6 esbuild: 0.18.20 transitivePeerDependencies: - supports-color @@ -15958,8 +16504,8 @@ packages: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.10.0 - acorn-jsx: 5.3.2(acorn@8.10.0) + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) eslint-visitor-keys: 3.4.3 /esprima@3.1.3: @@ -16080,6 +16626,11 @@ packages: es5-ext: 0.10.62 dev: true + /event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: true + /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: false @@ -16120,6 +16671,21 @@ packages: strip-final-newline: 3.0.0 dev: true + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: true + /exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} @@ -16264,6 +16830,10 @@ packages: fast-decode-uri-component: 1.0.1 dev: true + /fast-safe-stringify@2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: true + /fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} dependencies: @@ -16533,6 +17103,10 @@ packages: is-callable: 1.2.7 dev: true + /foreach@2.0.6: + resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + dev: true + /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} @@ -16745,6 +17319,17 @@ packages: has-symbols: 1.0.3 hasown: 2.0.0 + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.3 + has-symbols: 1.0.3 + hasown: 2.0.2 + dev: true + /get-nonce@1.0.1: resolution: {integrity: sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==} engines: {node: '>=6'} @@ -16763,6 +17348,10 @@ packages: engines: {node: '>=8.0.0'} dev: true + /get-port-please@3.1.2: + resolution: {integrity: sha512-Gxc29eLs1fbn6LQ4jSU4vXjlwyZhF5HsGuMAa7gqBP4Rw4yxxltyDUuF5MBclFzDTXO+ACchGQoeela4DSfzdQ==} + dev: true + /get-port@5.1.1: resolution: {integrity: sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==} engines: {node: '>=8'} @@ -16784,6 +17373,11 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: true + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} @@ -16792,6 +17386,15 @@ packages: get-intrinsic: 1.2.2 dev: true + /get-symbol-description@1.0.2: + resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + get-intrinsic: 1.2.4 + dev: true + /get-tsconfig@4.7.2: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: @@ -16804,15 +17407,29 @@ packages: dependencies: colorette: 2.0.20 defu: 6.1.3 - https-proxy-agent: 7.0.2 + https-proxy-agent: 7.0.5 mri: 1.2.0 node-fetch-native: 1.4.1 - pathe: 1.1.1 + pathe: 1.1.2 tar: 6.2.0 transitivePeerDependencies: - supports-color dev: true + /giget@1.2.3: + resolution: {integrity: sha512-8EHPljDvs7qKykr6uw8b+lqLiUc/vUg+KVTI0uND4s63TdsZM2Xus3mflvF0DDG9SiM4RlCkFGL+7aAjRmV7KA==} + hasBin: true + dependencies: + citty: 0.1.6 + consola: 3.2.3 + defu: 6.1.4 + node-fetch-native: 1.6.4 + nypm: 0.3.9 + ohash: 1.1.3 + pathe: 1.1.2 + tar: 6.2.0 + dev: true + /github-slugger@1.5.0: resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} @@ -17147,10 +17764,21 @@ packages: dependencies: get-intrinsic: 1.2.2 + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: true + /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} + /has-proto@1.0.3: + resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + engines: {node: '>= 0.4'} + dev: true + /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} @@ -17162,6 +17790,13 @@ packages: has-symbols: 1.0.3 dev: true + /has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: true + /has-yarn@3.0.0: resolution: {integrity: sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -17178,6 +17813,13 @@ packages: dependencies: function-bind: 1.1.2 + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + /hast-util-from-parse5@8.0.1: resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==} dependencies: @@ -17337,6 +17979,13 @@ packages: resolution: {integrity: sha512-983Vyg8NwUE7JkZ6NmOqpCZ+sh1bKv2iYTlUkzlWmA5JD2acKoxd4KVxbMmxX/85mtfdnDmTFoNKcg5DGAvxNQ==} dev: false + /html-element-map@1.3.1: + resolution: {integrity: sha512-6XMlxrAFX4UEEGxctfFnmrFaaZFNf9i5fNuV5wZ3WWQ4FVaNP1aX1LkX9j2mfEx1NpjeE/rL3nmgEn23GdFmrg==} + dependencies: + array.prototype.filter: 1.0.4 + call-bind: 1.0.7 + dev: true + /html-entities@2.4.0: resolution: {integrity: sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==} dev: false @@ -17410,7 +18059,6 @@ packages: domhandler: 5.0.3 domutils: 3.1.0 entities: 4.5.0 - dev: false /http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} @@ -17449,7 +18097,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -17484,6 +18132,10 @@ packages: - debug dev: false + /http2-client@1.3.5: + resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} + dev: true + /http2-wrapper@2.2.0: resolution: {integrity: sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==} engines: {node: '>=10.19.0'} @@ -17497,7 +18149,7 @@ packages: engines: {node: '>= 6.0.0'} dependencies: agent-base: 5.1.1 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -17507,17 +18159,17 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true - /https-proxy-agent@7.0.2: - resolution: {integrity: sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==} + /https-proxy-agent@7.0.5: + resolution: {integrity: sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==} engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -17535,6 +18187,11 @@ packages: engines: {node: '>=14.18.0'} dev: true + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: true + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -17863,6 +18520,15 @@ packages: side-channel: 1.0.4 dev: true + /internal-slot@1.0.7: + resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + hasown: 2.0.2 + side-channel: 1.0.4 + dev: true + /interpret@1.4.0: resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} engines: {node: '>= 0.10'} @@ -17933,6 +18599,14 @@ packages: is-typed-array: 1.1.12 dev: true + /is-array-buffer@3.0.4: + resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + dev: true + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} @@ -17997,6 +18671,13 @@ packages: kind-of: 6.0.3 dev: false + /is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + dependencies: + is-typed-array: 1.1.13 + dev: true + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -18122,6 +18803,11 @@ packages: engines: {node: '>= 0.4'} dev: true + /is-negative-zero@2.0.3: + resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + engines: {node: '>= 0.4'} + dev: true + /is-node-process@1.2.0: resolution: {integrity: sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==} dev: true @@ -18237,6 +18923,13 @@ packages: call-bind: 1.0.5 dev: true + /is-shared-array-buffer@1.0.3: + resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + dev: true + /is-stream@1.1.0: resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} engines: {node: '>=0.10.0'} @@ -18265,6 +18958,10 @@ packages: better-path-resolve: 1.0.0 dev: true + /is-subset@0.1.1: + resolution: {integrity: sha512-6Ybun0IkarhmEqxXCNw/C0bna6Zb/TkfUX9UbwJtK6ObwAVCxmAP308WWTHviM/zAqXk05cdhYsUsZeGQh99iw==} + dev: true + /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} @@ -18279,6 +18976,13 @@ packages: which-typed-array: 1.1.13 dev: true + /is-typed-array@1.1.13: + resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} + engines: {node: '>= 0.4'} + dependencies: + which-typed-array: 1.1.15 + dev: true + /is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} dev: false @@ -18914,6 +19618,11 @@ packages: resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} hasBin: true + /jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + hasBin: true + dev: true + /jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} dev: true @@ -19019,6 +19728,12 @@ packages: /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + /json-pointer@0.6.2: + resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==} + dependencies: + foreach: 2.0.6 + dev: true + /json-schema-to-typescript@11.0.5: resolution: {integrity: sha512-ZNlvngzlPzjYYECbR+uJ9aUWo25Gw/VuwUytvcuKiwc6NaiZhMyf7qBsxZE2eixmj8AoQEQJhSRG7btln0sUDw==} engines: {node: '>=12.0.0'} @@ -19347,6 +20062,14 @@ packages: /lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} + /lodash.escape@4.0.1: + resolution: {integrity: sha512-nXEOnb/jK9g0DYMr1/Xvq6l5xMD7GDG55+GSYIYmS0G4tBk/hURD4JR9WCavs04t33WmJx9kCyp9vJ+mr4BOUw==} + dev: true + + /lodash.flattendeep@4.4.0: + resolution: {integrity: sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==} + dev: true + /lodash.flow@3.5.0: resolution: {integrity: sha512-ff3BX/tSioo+XojX4MOsOMhJw0nZoUEF011LX8g8d3gvjVbxd89cCio4BCXronjxcTUIJUoqKEUA+n4CqvvRPw==} @@ -19491,6 +20214,10 @@ packages: es5-ext: 0.10.62 dev: true + /lunr@2.3.9: + resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} + dev: true + /lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true @@ -19585,6 +20312,10 @@ packages: resolution: {integrity: sha512-0aF7ZmVon1igznGI4VS30yugpduQW3y3GkcgGJOp7d8x8QrizhigUxjI/m2UojsXXto+jLAH3KSz+xOJTiORjg==} dev: true + /mark.js@8.11.1: + resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + dev: true + /markdown-extensions@2.0.0: resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==} engines: {node: '>=16'} @@ -19603,6 +20334,12 @@ packages: react: 18.3.1 dev: true + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} + engines: {node: '>= 12'} + hasBin: true + dev: true + /md5-hex@3.0.1: resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} engines: {node: '>=8'} @@ -20089,8 +20826,8 @@ packages: /micromark-extension-mdxjs@3.0.0: resolution: {integrity: sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==} dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) + acorn: 8.12.1 + acorn-jsx: 5.3.2(acorn@8.12.1) micromark-extension-mdx-expression: 3.0.0 micromark-extension-mdx-jsx: 3.0.0 micromark-extension-mdx-md: 2.0.0 @@ -20281,7 +21018,7 @@ packages: resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} dependencies: '@types/debug': 4.1.10 - debug: 4.3.4 + debug: 4.3.6 decode-named-character-reference: 1.0.2 devlop: 1.1.0 micromark-core-commonmark: 2.0.0 @@ -20483,11 +21220,62 @@ packages: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: acorn: 8.10.0 - pathe: 1.1.1 + pathe: 1.1.2 pkg-types: 1.0.3 ufo: 1.3.1 dev: true + /mlly@1.7.1: + resolution: {integrity: sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==} + dependencies: + acorn: 8.12.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 + dev: true + + /mobx-react-lite@4.0.7(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-RjwdseshK9Mg8On5tyJZHtGD+J78ZnCnRaxeQDSiciKVQDUbfZcXhmld0VMxAwvcTnPEHZySGGewm467Fcpreg==} + peerDependencies: + mobx: ^6.9.0 + react: ^16.8.0 || ^17 || ^18 + react-dom: '*' + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + mobx: 6.13.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + use-sync-external-store: 1.2.0(react@18.3.1) + dev: true + + /mobx-react@9.1.1(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-gVV7AdSrAAxqXOJ2bAbGa5TkPqvITSzaPiiEkzpW4rRsMhSec7C2NBCJYILADHKp2tzOAIETGRsIY0UaCV5aEw==} + peerDependencies: + mobx: ^6.9.0 + react: ^16.8.0 || ^17 || ^18 + react-dom: '*' + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + mobx: 6.13.1 + mobx-react-lite: 4.0.7(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: true + + /mobx@6.13.1: + resolution: {integrity: sha512-ekLRxgjWJr8hVxj9ZKuClPwM/iHckx3euIJ3Np7zLVNtqJvfbbq7l370W/98C8EabdQ1pB5Jd3BbDWxJPNnaOg==} + dev: true + /moo@0.5.2: resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} dev: true @@ -20620,6 +21408,12 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: true + /natural-compare-lite@1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: true @@ -20627,6 +21421,16 @@ packages: /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + /nearley@2.20.1: + resolution: {integrity: sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==} + hasBin: true + dependencies: + commander: 2.20.3 + moo: 0.5.2 + railroad-diagrams: 1.0.0 + randexp: 0.4.6 + dev: true + /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} @@ -20656,7 +21460,7 @@ packages: '@next/env': 14.0.0 '@swc/helpers': 0.5.2 busboy: 1.6.0 - caniuse-lite: 1.0.30001554 + caniuse-lite: 1.0.30001651 postcss: 8.4.31 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -20675,7 +21479,6 @@ packages: transitivePeerDependencies: - '@babel/core' - babel-plugin-macros - dev: false /no-case@3.0.4: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} @@ -20709,10 +21512,21 @@ packages: skin-tone: 2.0.0 dev: false + /node-fetch-h2@2.3.0: + resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==} + engines: {node: 4.x || >=6.0.0} + dependencies: + http2-client: 1.3.5 + dev: true + /node-fetch-native@1.4.1: resolution: {integrity: sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==} dev: true + /node-fetch-native@1.6.4: + resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} + dev: true + /node-fetch@1.7.3: resolution: {integrity: sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==} dependencies: @@ -20756,6 +21570,12 @@ packages: dependencies: write-file-atomic: 1.3.4 + /node-readfiles@0.2.0: + resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==} + dependencies: + es6-promise: 3.3.1 + dev: true + /node-releases@2.0.13: resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} @@ -20830,6 +21650,61 @@ packages: resolution: {integrity: sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==} dev: true + /nypm@0.3.9: + resolution: {integrity: sha512-BI2SdqqTHg2d4wJh8P9A1W+bslg33vOE9IZDY6eR2QC+Pu1iNBVZUqczrd43rJb+fMzHU7ltAYKsEFY/kHMFcw==} + engines: {node: ^14.16.0 || >=16.10.0} + hasBin: true + dependencies: + citty: 0.1.6 + consola: 3.2.3 + execa: 8.0.1 + pathe: 1.1.2 + pkg-types: 1.2.0 + ufo: 1.5.4 + dev: true + + /oas-kit-common@1.0.8: + resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==} + dependencies: + fast-safe-stringify: 2.1.1 + dev: true + + /oas-linter@3.2.2: + resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==} + dependencies: + '@exodus/schemasafe': 1.3.0 + should: 13.2.3 + yaml: 1.10.2 + dev: true + + /oas-resolver@2.5.6: + resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==} + hasBin: true + dependencies: + node-fetch-h2: 2.3.0 + oas-kit-common: 1.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + dev: true + + /oas-schema-walker@1.1.5: + resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==} + dev: true + + /oas-validator@5.0.8: + resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==} + dependencies: + call-me-maybe: 1.0.2 + oas-kit-common: 1.0.8 + oas-linter: 3.2.2 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + reftools: 1.1.9 + should: 13.2.3 + yaml: 1.10.2 + dev: true + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -20872,13 +21747,23 @@ packages: has-symbols: 1.0.3 object-keys: 1.1.1 + /object.assign@4.1.5: + resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: true + /object.entries@1.1.7: resolution: {integrity: sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.3 dev: true /object.fromentries@2.0.7: @@ -20910,15 +21795,19 @@ packages: resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.5 + call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.3 + es-abstract: 1.23.3 dev: true /obuf@1.1.2: resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} dev: false + /ohash@1.1.3: + resolution: {integrity: sha512-zuHHiGTYTA1sYJ/wZN+t5HKZaH23i4yI1HMwbuXm24Nid7Dv0KcuRlKoNKS9UNfAVSBlnGLcuQrnOKWOZoEGaw==} + dev: true + /on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} @@ -20955,6 +21844,13 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 + /openapi-sampler@1.5.1: + resolution: {integrity: sha512-tIWIrZUKNAsbqf3bd9U1oH6JEXo8LNYuDlXw26By67EygpjT+ArFnsxxyTMjFWRfbqo5ozkvgSQDK69Gd8CddA==} + dependencies: + '@types/json-schema': 7.0.15 + json-pointer: 0.6.2 + dev: true + /opener@1.5.2: resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} hasBin: true @@ -21169,13 +22065,11 @@ packages: dependencies: domhandler: 5.0.3 parse5: 7.1.2 - dev: false /parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} dependencies: entities: 4.5.0 - dev: false /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -21287,7 +22181,6 @@ packages: /pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - dev: false /pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} @@ -21305,6 +22198,18 @@ packages: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} dev: true + /perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + dev: true + + /perfect-scrollbar@1.5.5: + resolution: {integrity: sha512-dzalfutyP3e/FOpdlhVryN4AJ5XDVauVWxybSkLZmakFE2sS3y3pc4JnSprw8tGmHvkaG5Edr5T7LBTZ+WWU2g==} + dev: true + + /performance-now@2.1.0: + resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + dev: true + /periscopic@3.1.0: resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} dependencies: @@ -21318,7 +22223,6 @@ packages: /picocolors@1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} - dev: true /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -21377,8 +22281,16 @@ packages: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: jsonc-parser: 3.2.0 - mlly: 1.4.2 - pathe: 1.1.1 + mlly: 1.7.1 + pathe: 1.1.2 + dev: true + + /pkg-types@1.2.0: + resolution: {integrity: sha512-+ifYuSSqOQ8CqP4MbZA5hDpb97n3E8SVWdJe+Wms9kj745lmd3b7EZJiqvmLwAlmRfjrI7Hi5z3kdBJ93lFNPA==} + dependencies: + confbox: 0.1.7 + mlly: 1.7.1 + pathe: 1.1.2 dev: true /pkg-up@3.1.0: @@ -21409,6 +22321,11 @@ packages: engines: {node: '>=4'} dev: true + /pluralize@8.0.0: + resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} + engines: {node: '>=4'} + dev: true + /polished@4.2.2: resolution: {integrity: sha512-Sz2Lkdxz6F2Pgnpi9U5Ng/WdWAUZxmHrNPoVlm3aAemxoy2Qy7LGjQg4uf8qKelDAUW94F4np3iH2YPf2qefcQ==} engines: {node: '>=10'} @@ -21416,6 +22333,11 @@ packages: '@babel/runtime': 7.23.8 dev: true + /possible-typed-array-names@1.0.0: + resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} + engines: {node: '>= 0.4'} + dev: true + /postcss-calc@8.2.4(postcss@8.4.31): resolution: {integrity: sha512-SmWMSJmB8MRnnULldx0lQIyhSNvuDl9HfrZkaqqE/WHAhToYsAvDq+yAsA/kIyINDszOp3Rh0GFoNuH5Ypsm3Q==} peerDependencies: @@ -21907,6 +22829,15 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.1 + source-map-js: 1.2.0 + dev: true + /posthog-node@3.1.2: resolution: {integrity: sha512-atPGYjiK+QvtseKKsrUxMrzN84sIVs9jTa7nx5hl999gJly1S3J5r0DApwZ69NKfJkVIeLTCJyT0kyS+7WqDSw==} engines: {node: '>=15.0.0'} @@ -22127,7 +23058,6 @@ packages: /prismjs@1.29.0: resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} engines: {node: '>=6'} - dev: false /process-nextick-args@1.0.7: resolution: {integrity: sha512-yN0WQmuCX63LP/TMvAg31nvT6m4vDqJEiiv2CAZqWOGNWutc9DfDk1NPYYmKUFmaVM2UwDowH4u5AHWYP/jxKw==} @@ -22228,7 +23158,7 @@ packages: engines: {node: '>=8.16.0'} dependencies: '@types/mime-types': 2.1.4 - debug: 4.3.4 + debug: 4.3.6 extract-zip: 1.7.0 https-proxy-agent: 4.0.0 mime: 2.6.0 @@ -22338,10 +23268,28 @@ packages: through2: 2.0.5 dev: true + /raf@3.4.1: + resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==} + dependencies: + performance-now: 2.1.0 + dev: true + + /railroad-diagrams@1.0.0: + resolution: {integrity: sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==} + dev: true + /ramda@0.29.0: resolution: {integrity: sha512-BBea6L67bYLtdbOqfp8f58fPMqEwx0doL+pAi8TZyp2YWz8R9G8z9x75CZI8W+ftqhFHCpEX2cRnUUXK130iKA==} dev: true + /randexp@0.4.6: + resolution: {integrity: sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==} + engines: {node: '>=0.12'} + dependencies: + discontinuous-range: 1.0.0 + ret: 0.1.15 + dev: true + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -22391,6 +23339,13 @@ packages: react-is: 18.2.0 dev: false + /rc9@2.1.2: + resolution: {integrity: sha512-btXCnMmRIBINM2LDZoEmOogIZU7Qe7zn4BpomSKZ/ykbLObuBdvG+mFq11DL6fjH1DRwHhrlgtYWG96bJiC7Cg==} + dependencies: + defu: 6.1.4 + destr: 2.0.3 + dev: true + /rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -22815,6 +23770,16 @@ packages: tiny-warning: 1.0.3 dev: false + /react-shallow-renderer@16.15.0(react@18.3.1): + resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + dependencies: + object-assign: 4.1.1 + react: 18.3.1 + react-is: 18.2.0 + dev: true + /react-style-singleton@2.2.1(@types/react@18.3.3)(react@18.3.1): resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} @@ -22831,6 +23796,16 @@ packages: react: 18.3.1 tslib: 2.6.2 + /react-tabs@6.0.2(react@18.3.1): + resolution: {integrity: sha512-aQXTKolnM28k3KguGDBSAbJvcowOQr23A+CUJdzJtOSDOtTwzEaJA+1U4KwhNL9+Obe+jFS7geuvA7ICQPXOnQ==} + peerDependencies: + react: ^18.0.0 + dependencies: + clsx: 2.0.0 + prop-types: 15.8.1 + react: 18.3.1 + dev: true + /react-textarea-autosize@8.3.4(@types/react@18.3.3)(react@18.2.0): resolution: {integrity: sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ==} engines: {node: '>=10'} @@ -23001,6 +23976,50 @@ packages: strip-indent: 3.0.0 dev: true + /redoc@2.1.5(core-js@3.33.1)(enzyme@3.11.0)(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1)(styled-components@6.1.12): + resolution: {integrity: sha512-POSbVg+7WLf+/5/c6GWLxL7+9t2D+1WlZdLN0a6qaCQc+ih3XYzteRBkXEN5kjrYrRNjdspfxTZkDLN5WV3Tzg==} + engines: {node: '>=6.9', npm: '>=3.0.0'} + peerDependencies: + core-js: ^3.1.4 + mobx: ^6.0.4 + react: ^16.8.4 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.4 || ^17.0.0 || ^18.0.0 + styled-components: ^4.1.1 || ^5.1.1 || ^6.0.5 + dependencies: + '@cfaester/enzyme-adapter-react-18': 0.8.0(enzyme@3.11.0)(react-dom@18.3.1)(react@18.3.1) + '@redocly/openapi-core': 1.21.0 + classnames: 2.5.1 + core-js: 3.33.1 + decko: 1.2.0 + dompurify: 3.1.6 + eventemitter3: 5.0.1 + json-pointer: 0.6.2 + lunr: 2.3.9 + mark.js: 8.11.1 + marked: 4.3.0 + mobx: 6.13.1 + mobx-react: 9.1.1(mobx@6.13.1)(react-dom@18.3.1)(react@18.3.1) + openapi-sampler: 1.5.1 + path-browserify: 1.0.1 + perfect-scrollbar: 1.5.5 + polished: 4.2.2 + prismjs: 1.29.0 + prop-types: 15.8.1 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-tabs: 6.0.2(react@18.3.1) + slugify: 1.4.7 + stickyfill: 1.1.1 + styled-components: 6.1.12(react-dom@18.3.1)(react@18.3.1) + swagger2openapi: 7.0.8 + url-template: 2.0.8 + transitivePeerDependencies: + - encoding + - enzyme + - react-native + - supports-color + dev: true + /reflect.getprototypeof@1.0.4: resolution: {integrity: sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==} engines: {node: '>= 0.4'} @@ -23013,6 +24032,10 @@ packages: which-builtin-type: 1.1.3 dev: true + /reftools@1.1.9: + resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==} + dev: true + /regenerate-unicode-properties@10.1.1: resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} engines: {node: '>=4'} @@ -23043,6 +24066,16 @@ packages: set-function-name: 2.0.1 dev: true + /regexp.prototype.flags@1.5.2: + resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-errors: 1.3.0 + set-function-name: 2.0.1 + dev: true + /regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} @@ -23323,6 +24356,11 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 + /ret@0.1.15: + resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} + engines: {node: '>=0.12'} + dev: true + /retry@0.13.1: resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} engines: {node: '>= 4'} @@ -23351,6 +24389,7 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true dependencies: glob: 7.2.3 @@ -23379,6 +24418,13 @@ packages: fsevents: 2.3.3 dev: true + /rst-selector-parser@2.2.3: + resolution: {integrity: sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==} + dependencies: + lodash.flattendeep: 4.4.0 + nearley: 2.20.1 + dev: true + /rtl-detect@1.1.2: resolution: {integrity: sha512-PGMBq03+TTG/p/cRB7HCLKJ1MgDIi07+QU1faSjiYRfmY5UsAttV9Hs08jDAHVwcOwmVLcSJkpwyfXszVjWfIQ==} dev: false @@ -23433,6 +24479,16 @@ packages: isarray: 2.0.5 dev: true + /safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.7 + get-intrinsic: 1.2.4 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -23451,6 +24507,15 @@ packages: is-regex: 1.1.4 dev: true + /safe-regex-test@1.0.3: + resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-regex: 1.1.4 + dev: true + /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} @@ -23664,6 +24729,18 @@ packages: gopd: 1.0.1 has-property-descriptors: 1.0.1 + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: true + /set-function-name@2.0.1: resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} engines: {node: '>= 0.4'} @@ -23731,6 +24808,44 @@ packages: rechoir: 0.6.2 dev: false + /should-equal@2.0.0: + resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==} + dependencies: + should-type: 1.4.0 + dev: true + + /should-format@3.0.3: + resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==} + dependencies: + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + dev: true + + /should-type-adaptors@1.1.0: + resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==} + dependencies: + should-type: 1.4.0 + should-util: 1.0.1 + dev: true + + /should-type@1.4.0: + resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==} + dev: true + + /should-util@1.0.1: + resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==} + dev: true + + /should@13.2.3: + resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==} + dependencies: + should-equal: 2.0.0 + should-format: 3.0.3 + should-type: 1.4.0 + should-type-adaptors: 1.1.0 + should-util: 1.0.1 + dev: true + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -23770,6 +24885,20 @@ packages: semver: 7.5.4 dev: true + /simple-websocket@9.1.0: + resolution: {integrity: sha512-8MJPnjRN6A8UCp1I+H/dSFyjwJhp6wta4hsVRhjf8w9qBHRzxYt14RaOcjvQnhD1N4yKOddEjflwMnQM4VtXjQ==} + dependencies: + debug: 4.3.6 + queue-microtask: 1.2.3 + randombytes: 2.1.0 + readable-stream: 3.6.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /sirv@1.0.19: resolution: {integrity: sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ==} engines: {node: '>= 10'} @@ -23861,6 +24990,11 @@ packages: /slide@1.1.6: resolution: {integrity: sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==} + /slugify@1.4.7: + resolution: {integrity: sha512-tf+h5W1IrjNm/9rKKj0JU2MDMruiopx0jjVA5zCdBtcGjfp0+c5rHw/zADLC3IeKlGHtVbHtpfzvYA0OYT+HKg==} + engines: {node: '>=8.0.0'} + dev: true + /smartwrap@2.0.2: resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} engines: {node: '>=6'} @@ -23897,6 +25031,11 @@ packages: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + /source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + dev: true + /source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} dependencies: @@ -23918,6 +25057,7 @@ packages: /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + requiresBuild: true /source-map@0.7.4: resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} @@ -23979,7 +25119,7 @@ packages: /spdy-transport@3.0.0: resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} dependencies: - debug: 4.3.4 + debug: 4.3.6 detect-node: 2.1.0 hpack.js: 2.1.6 obuf: 1.1.2 @@ -23993,7 +25133,7 @@ packages: resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} engines: {node: '>=6.0.0'} dependencies: - debug: 4.3.4 + debug: 4.3.6 handle-thing: 2.0.1 http-deceiver: 1.2.7 select-hose: 2.0.0 @@ -24074,6 +25214,10 @@ packages: /std-env@3.4.3: resolution: {integrity: sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==} + /stickyfill@1.1.1: + resolution: {integrity: sha512-GCp7vHAfpao+Qh/3Flh9DXEJ/qSi0KJwJw6zYlZOtRYXWUIpMM6mC2rIep/dK8RQqwW0KxGJIllmjPIBOGN8AA==} + dev: true + /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} @@ -24195,6 +25339,16 @@ packages: es-abstract: 1.22.3 dev: true + /string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-abstract: 1.23.3 + es-object-atoms: 1.0.0 + dev: true + /string.prototype.trimend@1.0.7: resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} dependencies: @@ -24203,6 +25357,14 @@ packages: es-abstract: 1.22.3 dev: true + /string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + /string.prototype.trimstart@1.0.7: resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} dependencies: @@ -24211,6 +25373,15 @@ packages: es-abstract: 1.22.3 dev: true + /string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + define-properties: 1.2.1 + es-object-atoms: 1.0.0 + dev: true + /string_decoder@1.0.3: resolution: {integrity: sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==} dependencies: @@ -24328,6 +25499,26 @@ packages: inline-style-parser: 0.1.1 dev: false + /styled-components@6.1.12(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-n/O4PzRPhbYI0k1vKKayfti3C/IGcPf+DqcrOB7O/ab9x4u/zjqraneT5N45+sIe87cxrCApXM8Bna7NYxwoTA==} + engines: {node: '>= 16'} + peerDependencies: + react: '>= 16.8.0' + react-dom: '>= 16.8.0' + dependencies: + '@emotion/is-prop-valid': 1.2.2 + '@emotion/unitless': 0.8.1 + '@types/stylis': 4.2.5 + css-to-react-native: 3.2.0 + csstype: 3.1.3 + postcss: 8.4.38 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + shallowequal: 1.1.0 + stylis: 4.3.2 + tslib: 2.6.2 + dev: true + /styled-jsx@5.1.1(@babel/core@7.23.2)(react@18.3.1): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} @@ -24344,7 +25535,6 @@ packages: '@babel/core': 7.23.2 client-only: 0.0.1 react: 18.3.1 - dev: false /stylehacks@5.1.1(postcss@8.4.31): resolution: {integrity: sha512-sBpcd5Hx7G6seo7b1LkpttvTz7ikD0LlH5RmdcBNb6fFR0Fl7LQwHDFr300q4cwUqi+IYrFGmsIHieMBfnN/Bw==} @@ -24357,6 +25547,10 @@ packages: postcss-selector-parser: 6.0.13 dev: false + /stylis@4.3.2: + resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} + dev: true + /sucrase@3.34.0: resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==} engines: {node: '>=8'} @@ -24430,6 +25624,25 @@ packages: picocolors: 1.0.0 stable: 0.1.8 + /swagger2openapi@7.0.8: + resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==} + hasBin: true + dependencies: + call-me-maybe: 1.0.2 + node-fetch: 2.7.0(encoding@0.1.13) + node-fetch-h2: 2.3.0 + node-readfiles: 0.2.0 + oas-kit-common: 1.0.8 + oas-resolver: 2.5.6 + oas-schema-walker: 1.1.5 + oas-validator: 5.0.8 + reftools: 1.1.9 + yaml: 1.10.2 + yargs: 17.7.2 + transitivePeerDependencies: + - encoding + dev: true + /swap-case@2.0.2: resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==} dependencies: @@ -25262,6 +26475,15 @@ packages: is-typed-array: 1.1.12 dev: true + /typed-array-buffer@1.0.2: + resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-typed-array: 1.1.13 + dev: true + /typed-array-byte-length@1.0.0: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} engines: {node: '>= 0.4'} @@ -25272,6 +26494,17 @@ packages: is-typed-array: 1.1.12 dev: true + /typed-array-byte-length@1.0.1: + resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + dev: true + /typed-array-byte-offset@1.0.0: resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} engines: {node: '>= 0.4'} @@ -25283,6 +26516,18 @@ packages: is-typed-array: 1.1.12 dev: true + /typed-array-byte-offset@1.0.2: + resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + dev: true + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: @@ -25291,6 +26536,18 @@ packages: is-typed-array: 1.1.12 dev: true + /typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-proto: 1.0.3 + is-typed-array: 1.1.13 + possible-typed-array-names: 1.0.0 + dev: true + /typedarray-to-buffer@3.1.5: resolution: {integrity: sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==} dependencies: @@ -25336,6 +26593,10 @@ packages: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} dev: true + /ufo@1.5.4: + resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + dev: true + /uglify-js@3.19.2: resolution: {integrity: sha512-S8KA6DDI47nQXJSi2ctQ629YzwOVs+bQML6DAtvy0wgNdpi+0ySpQK0g2pxBq2xfF2z3YCscu7NNA8nXT9PlIQ==} engines: {node: '>=0.8.0'} @@ -25507,8 +26768,8 @@ packages: /unplugin@1.5.1: resolution: {integrity: sha512-0QkvG13z6RD+1L1FoibQqnvTwVBXvS4XSPwAyinVgoOCl2jAgwzdUKmEj05o4Lt8xwQI85Hb6mSyYkcAGwZPew==} dependencies: - acorn: 8.11.2 - chokidar: 3.5.3 + acorn: 8.12.1 + chokidar: 3.6.0 webpack-sources: 3.2.3 webpack-virtual-modules: 0.6.1 dev: true @@ -25526,7 +26787,7 @@ packages: dependencies: browserslist: 4.22.1 escalade: 3.1.1 - picocolors: 1.0.0 + picocolors: 1.0.1 /update-browserslist-db@1.1.0(browserslist@4.23.3): resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} @@ -25595,6 +26856,10 @@ packages: webpack: 5.89.0 dev: false + /url-template@2.0.8: + resolution: {integrity: sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==} + dev: true + /urlpattern-polyfill@8.0.2: resolution: {integrity: sha512-Qp95D4TPJl1kC9SKigDcqgyM2VDVO4RiJc2d4qe5GrYm+zbIQCWWKAFaJNQ4BhdFeDGwBmAxqJBwWSJDb9T3BQ==} dev: true @@ -25715,7 +26980,6 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: react: 18.3.1 - dev: false /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -25819,7 +27083,7 @@ packages: cac: 6.7.14 debug: 4.3.4 mlly: 1.4.2 - pathe: 1.1.1 + pathe: 1.1.2 picocolors: 1.0.0 vite: 4.5.0(@types/node@18.7.3) transitivePeerDependencies: @@ -25841,7 +27105,7 @@ packages: cac: 6.7.14 debug: 4.3.4 mlly: 1.4.2 - pathe: 1.1.1 + pathe: 1.1.2 picocolors: 1.0.0 vite: 4.5.0(@types/node@18.7.3) transitivePeerDependencies: @@ -26578,6 +27842,17 @@ packages: has-tostringtag: 1.0.0 dev: true + /which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.7 + call-bind: 1.0.7 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.2 + dev: true + /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -26833,6 +28108,11 @@ packages: decamelize: 1.2.0 dev: true + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + /yargs-parser@21.0.1: resolution: {integrity: sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==} engines: {node: '>=12'} @@ -26874,6 +28154,19 @@ packages: yargs-parser: 18.1.3 dev: true + /yargs@17.0.1: + resolution: {integrity: sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==} + engines: {node: '>=12'} + dependencies: + cliui: 7.0.4 + escalade: 3.1.2 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.9 + dev: true + /yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index b361718d..3c76650b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,5 @@ packages: + - 'packages/sdks/*' - 'packages/*' - 'examples/*' - 'apps/*' \ No newline at end of file