From ae4247826638a93d674de0f15b0adffa206589b8 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 26 Mar 2025 12:46:11 -0400 Subject: [PATCH 01/93] fix: cache product list by query --- vtex/loaders/intelligentSearch/productList.ts | 7 +++---- vtex/loaders/legacy/productList.ts | 15 +++++---------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/vtex/loaders/intelligentSearch/productList.ts b/vtex/loaders/intelligentSearch/productList.ts index c920cb59d..eae248a5b 100644 --- a/vtex/loaders/intelligentSearch/productList.ts +++ b/vtex/loaders/intelligentSearch/productList.ts @@ -297,12 +297,11 @@ export const cacheKey = ( const url = new URL(req.url); - if ( - // Avoid cache on loader call over call and on search pages - (!isQueryList(props) && url.searchParams.has("q")) || ctx.isInvoke - ) { + // Avoid cache on loader call over call as it should be handled by the caller + if (ctx.isInvoke) { return null; } + const segment = getSegmentFromBag(ctx)?.token ?? ""; const params = new URLSearchParams([ ...getSearchParams(props, url.searchParams), diff --git a/vtex/loaders/legacy/productList.ts b/vtex/loaders/legacy/productList.ts index 97ce53647..00d8e456e 100644 --- a/vtex/loaders/legacy/productList.ts +++ b/vtex/loaders/legacy/productList.ts @@ -4,9 +4,8 @@ import { AppContext } from "../../mod.ts"; import { isFilterParam, toSegmentParams } from "../../utils/legacy.ts"; import { getSegmentFromBag, withSegmentCookie } from "../../utils/segment.ts"; import { withIsSimilarTo } from "../../utils/similars.ts"; -import { toProduct } from "../../utils/transform.ts"; +import { sortProducts, toProduct } from "../../utils/transform.ts"; import type { LegacyItem, LegacySort } from "../../utils/types.ts"; -import { sortProducts } from "../../utils/transform.ts"; /** * @title Collection ID @@ -286,10 +285,8 @@ export const cacheKey = ( const url = new URL(req.url); - if ( - // Avoid cache on loader call over call and on search pages - (!isTermProps(props) && url.searchParams.has("q")) || ctx.isInvoke - ) { + // Avoid cache on loader call over call as it should be handled by the caller + if (ctx.isInvoke) { return null; } @@ -304,10 +301,8 @@ export const cacheKey = ( params.append("skuids", skuIds.join(",")); } - if ( - isProductIDProps(props) - ) { - const productIds = [props.productIds ?? []].sort(); + if (isProductIDProps(props)) { + const productIds = [...props.productIds ?? []].sort(); params.append("productids", productIds.join(",")); } From 41dd7ec0206dee297b353f61932d9e7bc80f07ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Gaudencio=20do=20R=C3=AAgo?= Date: Wed, 18 Dec 2024 14:11:05 -0300 Subject: [PATCH 02/93] Cookie with subdomains --- vtex/utils/segment.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vtex/utils/segment.ts b/vtex/utils/segment.ts index 251e573f5..8f2960946 100644 --- a/vtex/utils/segment.ts +++ b/vtex/utils/segment.ts @@ -193,11 +193,15 @@ export const setSegmentBag = ( }); } + const hostname = (new URL(req.url)).hostname; + const cookieDomain = hostname.startsWith(".") ? hostname : `.${hostname}`; + // Avoid setting cookie when segment from request matches the one generated if (vtex_segment !== token) { setCookie(ctx.response.headers, { value: token, name: SEGMENT_COOKIE_NAME, + domain: hostname === "localhost" ? "localhost" : cookieDomain, path: "/", secure: true, httpOnly: true, From bd492c1f02842b8c69ded2b7780d54b7ac8e98a6 Mon Sep 17 00:00:00 2001 From: soutofernando Date: Tue, 24 Sep 2024 21:15:51 -0300 Subject: [PATCH 03/93] feat: make it possible to exclude routes from being proxied in vtex --- vtex/loaders/proxy.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/vtex/loaders/proxy.ts b/vtex/loaders/proxy.ts index 57d9c7a06..92f4696dc 100644 --- a/vtex/loaders/proxy.ts +++ b/vtex/loaders/proxy.ts @@ -30,6 +30,7 @@ const buildProxyRoutes = ( includeSiteMap, generateDecoSiteMap, excludePathsFromDecoSiteMap, + excludePathsFromVtexProxy, includeScriptsToHead, includeScriptsToBody, }: { @@ -38,6 +39,7 @@ const buildProxyRoutes = ( includeSiteMap?: string[]; generateDecoSiteMap?: boolean; excludePathsFromDecoSiteMap: string[]; + excludePathsFromVtexProxy?: string[]; includeScriptsToHead?: { includes?: Script[]; }; @@ -84,7 +86,10 @@ const buildProxyRoutes = ( }, }); }; - const routesFromPaths = [...PATHS_TO_PROXY, ...extraPaths].map( + const currentPathsToProxy = PATHS_TO_PROXY.filter((path) => + !excludePathsFromVtexProxy?.includes(path) + ); + const routesFromPaths = [...currentPathsToProxy, ...extraPaths].map( routeFromPath, ); @@ -142,6 +147,10 @@ export interface Props { * @title Exclude paths from /deco-sitemap.xml */ excludePathsFromDecoSiteMap?: string[]; + /** + * @title Exclude paths from VTEX PATHS_TO_PROXY + */ + excludePathsFromVtexProxy?: string[]; /** * @title Scripts to include on Html head */ @@ -165,6 +174,7 @@ function loader( includeSiteMap = [], generateDecoSiteMap = true, excludePathsFromDecoSiteMap = [], + excludePathsFromVtexProxy = [], includeScriptsToHead = { includes: [] }, includeScriptsToBody = { includes: [] }, }: Props, @@ -174,6 +184,7 @@ function loader( return buildProxyRoutes({ generateDecoSiteMap, excludePathsFromDecoSiteMap, + excludePathsFromVtexProxy, includeSiteMap, publicUrl: ctx.publicUrl, extraPaths: extraPathsToProxy, From 2108385e84d5149eaef474be143ed30a82d5e427 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Thu, 26 Sep 2024 09:27:36 -0400 Subject: [PATCH 04/93] feat: add session loaders feat: some payments related loaders feat: my account vtex profile (#899) feat: add the unitary order loader and start creating its typing fix: props user.ts feat: updateAddress action chore: rebuild manifest deno check add try catch remov throw feat: adds address list loader Co-authored-by: @yuri_assuncx feat: add loader to check if the password has already been changed fix: receive address update props feat: create adress action chore: fixes typing error pointing by linter chore: fixes typing error pointing by linter feat: get address by postal code loader feat: delete address action fix: get the addresses with all the information and some refacts fix: delete address fix: address typing change to promise allsettled [VTEX] fix: add new types to support headless account feature (#939) fix: add logged in user validation --- commerce/types.ts | 39 +++ power-reviews/loaders/productListingPage.ts | 26 +- vtex/actions/address/createAddress.ts | 67 +++++ vtex/actions/address/deleteAddress.ts | 58 ++++ vtex/actions/address/updateAddress.ts | 92 +++++++ vtex/actions/payments/delete.ts | 39 +++ vtex/actions/profile/newsletterProfile.ts | 60 ++++ vtex/actions/profile/updateProfile.ts | 93 +++++++ vtex/actions/sessions/delete.ts | 39 +++ vtex/loaders/address/getAddressByZIP.ts | 59 ++++ vtex/loaders/address/list.ts | 86 ++++++ vtex/loaders/orders/list.ts | 8 +- vtex/loaders/orders/order.ts | 39 +++ vtex/loaders/payments/info.ts | 55 ++++ vtex/loaders/payments/userPayments.ts | 61 +++++ vtex/loaders/profile/passwordLastUpdate.ts | 39 +++ vtex/loaders/sessions/info.ts | 68 +++++ vtex/loaders/user.ts | 33 ++- vtex/manifest.gen.ts | 288 +++++++++++--------- vtex/utils/client.ts | 4 + vtex/utils/types.ts | 159 ++++++++++- 21 files changed, 1258 insertions(+), 154 deletions(-) create mode 100644 vtex/actions/address/createAddress.ts create mode 100644 vtex/actions/address/deleteAddress.ts create mode 100644 vtex/actions/address/updateAddress.ts create mode 100644 vtex/actions/payments/delete.ts create mode 100644 vtex/actions/profile/newsletterProfile.ts create mode 100644 vtex/actions/profile/updateProfile.ts create mode 100644 vtex/actions/sessions/delete.ts create mode 100644 vtex/loaders/address/getAddressByZIP.ts create mode 100644 vtex/loaders/address/list.ts create mode 100644 vtex/loaders/orders/order.ts create mode 100644 vtex/loaders/payments/info.ts create mode 100644 vtex/loaders/payments/userPayments.ts create mode 100644 vtex/loaders/profile/passwordLastUpdate.ts create mode 100644 vtex/loaders/sessions/info.ts diff --git a/commerce/types.ts b/commerce/types.ts index 05e3b5430..0aa17f2cf 100644 --- a/commerce/types.ts +++ b/commerce/types.ts @@ -413,7 +413,27 @@ export interface Person extends Omit { taxID?: string; /** The telephone number. */ telephone?: string; + /** The birth date of the person. */ + birthDate?: string; + /** User's corporate name */ + corporateName?: string; + /** User's corporate document */ + corporateDocument?: string; + /** User's corporate trade name */ + tradeName?: string; + /** User's business phone */ + businessPhone?: string; + /** Whether the user is a corporation or not */ + isCorporate?: boolean; + /** Custom fields */ + customFields?: CustomFields[]; +} + +interface CustomFields { + key: string; + value: string; } + // NON SCHEMA.ORG Compliant. Should be removed ASAP export interface Author extends Omit { "@type": "Author"; @@ -597,6 +617,25 @@ export interface PostalAddress extends Omit { /** The street address. For example, 1600 Amphitheatre Pkwy. */ streetAddress?: string; } + +export interface PostalAddressVTEX extends Omit { + "@type": "PostalAddress"; + /** The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code. */ + addressCountry?: string; + /** The locality in which the street address is, and which is in the region. For example, Mountain View. */ + addressLocality?: string; + /** The region in which the locality is, and which is in the country. For example, California. */ + addressRegion?: string; + /** The postal code. For example, 94043. */ + postalCode?: string; + /** The street address. For example, 1600 Amphitheatre Pkwy. */ + streetAddress?: string; + receiverName: string | null; + addressName?: string; + complement: string | null; + addressId: string; +} + export interface LocationFeatureSpecification extends Omit { "@type": "LocationFeatureSpecification"; diff --git a/power-reviews/loaders/productListingPage.ts b/power-reviews/loaders/productListingPage.ts index 43c090dc9..12941e798 100644 --- a/power-reviews/loaders/productListingPage.ts +++ b/power-reviews/loaders/productListingPage.ts @@ -52,17 +52,27 @@ export default function productListingPage( }) ); - const fullReviewsResponse = await Promise.all(fullReviewsPromises); + const fullReviewsResponse = await Promise.allSettled(fullReviewsPromises); - const fullReviewsResults = await Promise.all( - fullReviewsResponse.map((review) => review.json()), + const fullReviewsResults = await Promise.allSettled( + fullReviewsResponse.map((response) => { + if (response.status === "fulfilled") { + return response.value.json(); + } else { + return null; + } + }), ); - const productsExtendeds = fullReviewsResults.map((review, idx) => { - return { - ...products[idx], - aggregateRating: toAggregateRating(review.results[0].rollup), - }; + const productsExtendeds = fullReviewsResults.map((result, idx) => { + if (result.status === "fulfilled" && result.value) { + return { + ...products[idx], + aggregateRating: toAggregateRating(result.value.results[0].rollup), + }; + } else { + return products[idx]; + } }); return { diff --git a/vtex/actions/address/createAddress.ts b/vtex/actions/address/createAddress.ts new file mode 100644 index 000000000..af849c53a --- /dev/null +++ b/vtex/actions/address/createAddress.ts @@ -0,0 +1,67 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface AddressInput { + name?: string; + addressName: string; + addressType?: string; + city?: string; + complement?: string; + country?: string; + geoCoordinates?: number[]; + neighborhood?: string; + number?: string; + postalCode?: string; + receiverName?: string; + reference?: string; + state?: string; + street?: string; +} + +interface SavedAddress { + id: string; + cacheId: string; +} + +async function action( + props: AddressInput, + req: Request, + ctx: AppContext, +): Promise< + | SavedAddress + | null +> { + const { io } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + const mutation = ` + mutation SaveAddress($address: AddressInput!) { + saveAddress(address: $address) @context(provider: "vtex.store-graphql") { + id + cacheId + } + }`; + + try { + const { saveAddress: savedAddress } = await io.query< + { saveAddress: SavedAddress }, + { address: AddressInput } + >( + { + query: mutation, + operationName: "SaveAddress", + variables: { + address: props, + }, + }, + { headers: { cookie } }, + ); + + return savedAddress; + } catch (error) { + console.error("Error saving address:", error); + return null; + } +} + +export default action; diff --git a/vtex/actions/address/deleteAddress.ts b/vtex/actions/address/deleteAddress.ts new file mode 100644 index 000000000..760afd133 --- /dev/null +++ b/vtex/actions/address/deleteAddress.ts @@ -0,0 +1,58 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface DeleteAddress { + addressId: string; +} + +interface AddressInput { + addressId: string; +} + +async function action( + { addressId }: AddressInput, + req: Request, + ctx: AppContext, +) { + const { io } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + const mutation = ` + mutation DeleteAddress($addressId: String) { + deleteAddress(id: $addressId) { + cacheId + addresses: address { + addressId: id + addressType + addressName + city + complement + country + neighborhood + number + postalCode + geoCoordinates + receiverName + reference + state + street + } + } + }`; + + try { + return await io.query( + { + query: mutation, + operationName: "DeleteAddress", + variables: { addressId }, + }, + { headers: { cookie } }, + ); + } catch (error) { + console.error("Error deleting address:", error); + return null; + } +} + +export default action; diff --git a/vtex/actions/address/updateAddress.ts b/vtex/actions/address/updateAddress.ts new file mode 100644 index 000000000..136ed41bc --- /dev/null +++ b/vtex/actions/address/updateAddress.ts @@ -0,0 +1,92 @@ +import { PostalAddressVTEX } from "../../../commerce/types.ts"; +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface Address { + name?: string; + addressName?: string; + addressType?: string; + city?: string; + complement: string | null; + country?: string; + geoCoordinates?: number[]; + neighborhood?: string; + number?: string; + postalCode?: string; + receiverName: string | null; + reference?: string; + state?: string; + street?: string; + addressId: string; +} + +async function action( + props: Address, + req: Request, + ctx: AppContext, +): Promise< + | PostalAddressVTEX + | null +> { + const { io } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + const { addressId, ...addressFields } = props; + + const mutation = ` + mutation UpdateAddress($addressId: String!, $addressFields: AddressInput) { + updateAddress(id: $addressId, fields: $addressFields) + @context(provider: "vtex.store-graphql") { + cacheId + addresses: address { + addressId: id + addressType + addressName + city + complement + country + neighborhood + number + postalCode + geoCoordinates + receiverName + reference + state + street + } + } + } + `; + + try { + const { updateAddress: updatedAddress } = await io.query< + { updateAddress: Address }, + { addressId: string; addressFields: Omit } + >( + { + query: mutation, + operationName: "UpdateAddress", + variables: { + addressId, + addressFields, + }, + }, + { headers: { cookie } }, + ); + + return { + "@type": "PostalAddress", + addressCountry: updatedAddress?.country, + addressLocality: updatedAddress?.city, + addressRegion: updatedAddress?.state, + postalCode: updatedAddress?.postalCode, + streetAddress: updatedAddress?.street, + receiverName: updatedAddress?.receiverName, + complement: updatedAddress?.complement, + addressId: updatedAddress?.addressId, + }; + } catch (error) { + console.error("Error updating address:", error); + return null; + } +} +export default action; diff --git a/vtex/actions/payments/delete.ts b/vtex/actions/payments/delete.ts new file mode 100644 index 000000000..341ecee37 --- /dev/null +++ b/vtex/actions/payments/delete.ts @@ -0,0 +1,39 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface DeleteCard { + deletePaymentToken: boolean; +} + +interface Props { + id: string; +} + +async function loader( + { id }: Props, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const mutation = `mutation DeleteCreditCardToken($tokenId: ID!) { + deletePaymentToken(tokenId: $tokenId) @context(provider: "vtex.my-cards-graphql@2.x") + }`; + + try { + return await io.query({ + query: mutation, + variables: { tokenId: id }, + }, { headers: { cookie } }); + } catch (e) { + console.error(e); + return null; + } +} + +export default loader; diff --git a/vtex/actions/profile/newsletterProfile.ts b/vtex/actions/profile/newsletterProfile.ts new file mode 100644 index 000000000..1f14b6403 --- /dev/null +++ b/vtex/actions/profile/newsletterProfile.ts @@ -0,0 +1,60 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface NewsletterInput { + email: string; + isNewsletterOptIn: boolean; +} + +const newsletterProfile = async ( + props: NewsletterInput, + req: Request, + ctx: AppContext, +): Promise => { + const { io } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + if (!props?.email) { + console.error("User profile not found or email is missing:", props.email); + return null; + } + + const mutation = ` + mutation SubscribeNewsletter($email: String!, $isNewsletterOptIn: Boolean!) { + subscribeNewsletter(email: $email, isNewsletterOptIn: $isNewsletterOptIn) + @context(provider: "vtex.store-graphql@2.x") + } + `; + + const variables = { + email: props.email, + isNewsletterOptIn: props.isNewsletterOptIn, + }; + + try { + await io.query<{ subscribeNewsletter: boolean }, unknown>( + { + query: mutation, + operationName: "SubscribeNewsletter", + variables, + }, + { + headers: { + cookie, + }, + }, + ); + + const result = await ctx.invoke("vtex/loaders/user.ts"); + const newsletterField = result?.customFields?.find((field) => + field.key === "isNewsletterOptIn" + ); + + return newsletterField?.value === "true"; + } catch (error) { + console.error("Error subscribing to newsletter:", error); + return null; + } +}; + +export default newsletterProfile; diff --git a/vtex/actions/profile/updateProfile.ts b/vtex/actions/profile/updateProfile.ts new file mode 100644 index 000000000..17c4f724b --- /dev/null +++ b/vtex/actions/profile/updateProfile.ts @@ -0,0 +1,93 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; +import { Person } from "../../../commerce/types.ts"; +import type { User } from "../../loaders/user.ts"; + +export interface UserMutation { + firstName?: string; + lastName?: string; + email?: string; + homePhone?: string | null; + gender?: string | null; + birthDate?: string | null; + corporateName?: string | null; + tradeName?: string | null; + businessPhone?: string | null; + isCorporate?: boolean; +} + +const updateProfile = async ( + props: UserMutation, + req: Request, + ctx: AppContext, +): Promise => { + const { io } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + if (!props?.email) { + console.error("User profile not found or email is missing:", props.email); + return null; + } + const mutation = ` + mutation UpdateProfile($input: ProfileInput!) { + updateProfile(fields: $input) @context(provider: "vtex.store-graphql") { + cacheId + firstName + lastName + birthDate + gender + homePhone + businessPhone + document + email + tradeName + corporateName + corporateDocument + stateRegistration + isCorporate + } + } + `; + + try { + const { updateProfile: updatedUser } = await io.query< + { updateProfile: User }, + { input: UserMutation } + >( + { + query: mutation, + operationName: "UpdateProfile", + variables: { + input: { + ...props, + email: props.email, + }, + }, + }, + { headers: { cookie } }, + ); + + return { + "@id": updatedUser?.userId ?? updatedUser.id, + email: updatedUser.email, + givenName: updatedUser?.firstName, + familyName: updatedUser?.lastName, + taxID: updatedUser?.document?.replace(/[^\d]/g, ""), + gender: updatedUser?.gender === "female" + ? "https://schema.org/Female" + : "https://schema.org/Male", + telephone: updatedUser?.homePhone, + birthDate: updatedUser?.birthDate, + corporateName: updatedUser?.tradeName, + corporateDocument: updatedUser?.corporateDocument, + businessPhone: updatedUser?.businessPhone, + isCorporate: updatedUser?.isCorporate, + customFields: updatedUser?.customFields, + }; + } catch (error) { + console.error("Error updating user profile:", error); + return null; + } +}; + +export default updateProfile; diff --git a/vtex/actions/sessions/delete.ts b/vtex/actions/sessions/delete.ts new file mode 100644 index 000000000..e55b77e31 --- /dev/null +++ b/vtex/actions/sessions/delete.ts @@ -0,0 +1,39 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface DeleteSession { + logOutFromSession: string; +} + +interface Props { + sessionId: string; +} + +async function loader( + { sessionId }: Props, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const mutation = `mutation LogOutFromSession($sessionId: ID) { + logOutFromSession(sessionId: $sessionId) @context(provider: "vtex.store-graphql@2.x") + }`; + + try { + return await io.query({ + query: mutation, + variables: { sessionId }, + }, { headers: { cookie } }); + } catch (e) { + console.error(e); + return null; + } +} + +export default loader; diff --git a/vtex/loaders/address/getAddressByZIP.ts b/vtex/loaders/address/getAddressByZIP.ts new file mode 100644 index 000000000..a7f7a1e53 --- /dev/null +++ b/vtex/loaders/address/getAddressByZIP.ts @@ -0,0 +1,59 @@ +import { AppContext } from "../../mod.ts"; + +interface Props { + /** + * @description User country code. Ex: USA + */ + countryCode: string; + /** + * @description User postal code. + */ + postalCode: string; +} + +interface AddressByPostalCode { + postalCode: string; + city: string; + state: string; + country: string; + street: string | null; + number: string | null; + neighborhood: string | null; + complement: string | null; + reference: string | null; + geoCoordinates: number[] | null; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { countryCode, postalCode } = props; + const { vcs } = ctx; + + try { + const addressByPostalCode = await vcs + ["GET /api/checkout/pub/postal-code/:countryCode/:postalCode"]({ + countryCode, + postalCode, + }) + .then((r) => r.json()) as AddressByPostalCode; + + return addressByPostalCode; + } catch (error) { + console.log(error); + return { + postalCode: "", + city: "", + state: "", + country: "", + street: null, + number: null, + neighborhood: null, + complement: null, + reference: null, + geoCoordinates: [], + }; + } +} diff --git a/vtex/loaders/address/list.ts b/vtex/loaders/address/list.ts new file mode 100644 index 000000000..eaadbba7b --- /dev/null +++ b/vtex/loaders/address/list.ts @@ -0,0 +1,86 @@ +import { Address } from "../../utils/types.ts"; +import { PostalAddressVTEX } from "../../../commerce/types.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; +import { AppContext } from "../../mod.ts"; + +export interface User { + id: string; + userId: string; + email: string; + firstName?: string; + lastName?: string; + profilePicture?: string; + gender?: string; + document?: string; + homePhone?: string; + birthDate?: string; + corporateDocument?: string; + corporateName?: string; + tradeName?: string; + businessPhone?: string; + isCorporate?: boolean; + customFields?: { key: string; value: string }[]; +} + +async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise< + PostalAddressVTEX[] | null +> { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const query = `query Addresses @context(scope: "private") { + profile { + cacheId + addresses: address { + addressId: id + addressType + addressName + city + complement + country + neighborhood + number + postalCode + geoCoordinates + receiverName + state + street + } + } + }`; + + try { + const { profile } = await io.query< + { profile: { addresses: Address[] } }, + null + >( + { query }, + { headers: { cookie } }, + ); + + return profile?.addresses?.map((address) => ({ + "@type": "PostalAddress", + addressCountry: address?.country, + addressLocality: address?.city, + addressRegion: address?.state, + postalCode: address?.postalCode, + streetAddress: address?.street, + receiverName: address?.receiverName, + addressName: address?.addressName, + complement: address?.complement, + addressId: address?.addressId, + })); + } catch (_) { + return null; + } +} + +export default loader; diff --git a/vtex/loaders/orders/list.ts b/vtex/loaders/orders/list.ts index 2921e0bcb..2895c267a 100644 --- a/vtex/loaders/orders/list.ts +++ b/vtex/loaders/orders/list.ts @@ -12,10 +12,14 @@ export default async function loader( props: Props, req: Request, ctx: AppContext, -): Promise { +): Promise { const { vcsDeprecated } = ctx; const { clientEmail, page = "0", per_page = "15" } = props; - const { cookie } = parseCookie(req.headers, ctx.account); + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } const ordersResponse = await vcsDeprecated ["GET /api/oms/user/orders"]( diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts new file mode 100644 index 000000000..2b4501206 --- /dev/null +++ b/vtex/loaders/orders/order.ts @@ -0,0 +1,39 @@ +import { RequestURLParam } from "../../../website/functions/requestToParam.ts"; +import { AppContext } from "../../mod.ts"; +import { OrderItem } from "../../utils/types.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface Props { + slug: RequestURLParam; +} + +export default async function loader( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const { slug } = props; + + const response = await vcsDeprecated["GET /api/oms/user/orders/:orderId"]( + { orderId: slug }, + { + headers: { + cookie, + }, + }, + ); + + if (response.ok) { + const order = await response.json(); + return order; + } + + return null; +} diff --git a/vtex/loaders/payments/info.ts b/vtex/loaders/payments/info.ts new file mode 100644 index 000000000..3390d23fd --- /dev/null +++ b/vtex/loaders/payments/info.ts @@ -0,0 +1,55 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +const query = `query getPaymentSystems { + paymentSystems { + name + groupName + requiresDocument + displayDocument + validator { + regex + mask + cardCodeMask + cardCodeRegex + } + } +}`; + +export interface PaymentSystem { + name: string; + groupName: string; + requiresDocument: boolean; + displayDocument: boolean; + validator: { + regex: string | null; + mask: string | null; + cardCodeMask: string | null; + cardCodeRegex: string | null; + }; +} + +export default async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +) { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + try { + const data = await io.query<{ paymentSystems: PaymentSystem[] }, null>( + { query }, + { headers: { cookie } }, + ); + + return data.paymentSystems; + } catch (e) { + console.error(e); + return null; + } +} diff --git a/vtex/loaders/payments/userPayments.ts b/vtex/loaders/payments/userPayments.ts new file mode 100644 index 000000000..78cd5f2d0 --- /dev/null +++ b/vtex/loaders/payments/userPayments.ts @@ -0,0 +1,61 @@ +// fetch("https://www.als.com/_v/private/graphql/v1?workspace=master&maxAge=long&appsEtag=remove&domain=store&locale=en-US&__bindingId=d8649f18-3877-43de-88e6-c45a81eddc02", { +// "headers": { +// "content-type": "application/json", +// }, +// "body": "{\"operationName\":\"Payments\",\"variables\":{},\"extensions\":{\"persistedQuery\":{\"version\":1,\"sha256Hash\":\"95af11127e44f1857144e38f18635e0d085113c3bfdda3e4b8bc99ae63e14e60\",\"sender\":\"vtex.my-cards@1.x\",\"provider\":\"vtex.store-graphql@2.x\"}}}", +// "method": "POST" +// }) + +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface Payment { + accountStatus: string | null; + cardNumber: string; + expirationDate: string; + id: string; + isExpired: boolean; + paymentSystem: string; + paymentSystemName: string; +} + +async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const query = `query getUserPayments { + profile { + payments { + accountStatus + cardNumber + expirationDate + id + isExpired + paymentSystem + paymentSystemName + } + } + }`; + + try { + const data = await io.query<{ profile: { payments: Payment[] } }, null>( + { query }, + { headers: { cookie } }, + ); + + return data.profile.payments; + } catch (e) { + console.error(e); + return null; + } +} + +export default loader; diff --git a/vtex/loaders/profile/passwordLastUpdate.ts b/vtex/loaders/profile/passwordLastUpdate.ts new file mode 100644 index 000000000..f60d69731 --- /dev/null +++ b/vtex/loaders/profile/passwordLastUpdate.ts @@ -0,0 +1,39 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface ProfilePassword { + passwordLastUpdate?: PasswordLastUpdate; +} + +export type PasswordLastUpdate = string | null; + +async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + console.log({ teste: payload?.userId }); + + const query = `query getUserProfile { profile { passwordLastUpdate }}`; + + try { + const { profile } = await io.query<{ profile: ProfilePassword }, null>( + { query }, + { headers: { cookie } }, + ); + + console.log({ profile }); + + return profile.passwordLastUpdate ?? null; + } catch (_) { + return null; + } +} + +export default loader; diff --git a/vtex/loaders/sessions/info.ts b/vtex/loaders/sessions/info.ts new file mode 100644 index 000000000..1739fd41c --- /dev/null +++ b/vtex/loaders/sessions/info.ts @@ -0,0 +1,68 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface LoginSessionInfo { + currentLoginSessionId: string; + loginSessions: LoginSession[]; +} + +export interface LoginSession { + id: string; + cacheId: string; + deviceType: string; + lastAccess: string; + city: string; + fullAddress: string; + ip: string; + browser: string; + os: string; + firstAccess: string; +} + +async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const query = `query getUserSessions { + loginSessionsInfo { + currentLoginSessionId + loginSessions { + id + cacheId + deviceType + lastAccess + city + fullAddress + ip + browser + os + firstAccess + } + } + }`; + + try { + const data = await io.query< + { loginSessionsInfo: LoginSessionInfo }, + null + >( + { query }, + { headers: { cookie } }, + ); + + return data.loginSessionsInfo; + } catch (e) { + console.error(e); + return null; + } +} + +export default loader; diff --git a/vtex/loaders/user.ts b/vtex/loaders/user.ts index 47a8ad03a..533b4a8f3 100644 --- a/vtex/loaders/user.ts +++ b/vtex/loaders/user.ts @@ -2,7 +2,7 @@ import { Person } from "../../commerce/types.ts"; import { AppContext } from "../mod.ts"; import { parseCookie } from "../utils/vtexId.ts"; -interface User { +export interface User { id: string; userId: string; email: string; @@ -12,7 +12,13 @@ interface User { gender?: string; document?: string; homePhone?: string; + birthDate?: string; + corporateDocument?: string; + corporateName?: string; + tradeName?: string; businessPhone?: string; + isCorporate?: boolean; + customFields?: { key: string; value: string }[]; } async function loader( @@ -28,7 +34,7 @@ async function loader( } const query = - "query getUserProfile { profile { id userId email firstName lastName profilePicture gender document homePhone businessPhone }}"; + `query getUserProfile { profile(customFields: "isNewsletterOptIn") { id userId email firstName lastName profilePicture gender document homePhone birthDate corporateDocument corporateName tradeName businessPhone isCorporate customFields { key value } }}`; try { const { profile: user } = await io.query<{ profile: User }, null>( @@ -37,17 +43,22 @@ async function loader( ); return { - "@id": user.userId ?? user.id, + "@id": user?.userId ?? user.id, email: user.email, - givenName: user.firstName, - familyName: user.lastName, + givenName: user?.firstName, + familyName: user?.lastName, taxID: user?.document?.replace(/[^\d]/g, ""), - gender: user.gender - ? user.gender === "f" - ? "https://schema.org/Female" - : "https://schema.org/Male" - : undefined, - telephone: user.homePhone ?? user.businessPhone, + gender: user?.gender === "female" + ? "https://schema.org/Female" + : "https://schema.org/Male", + telephone: user?.homePhone, + birthDate: user?.birthDate, + corporateName: user?.corporateName, + tradeName: user?.tradeName, + corporateDocument: user?.corporateDocument, + businessPhone: user?.businessPhone, + isCorporate: user?.isCorporate, + customFields: user?.customFields, }; } catch (_) { return null; diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index 921f1446c..f80a3c0c9 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -2,118 +2,139 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$$$$$$$0 from "./actions/analytics/sendEvent.ts"; -import * as $$$$$$$$$1 from "./actions/cart/addItems.ts"; -import * as $$$$$$$$$2 from "./actions/cart/addOfferings.ts"; -import * as $$$$$$$$$3 from "./actions/cart/clearOrderformMessages.ts"; -import * as $$$$$$$$$4 from "./actions/cart/getInstallment.ts"; -import * as $$$$$$$$$5 from "./actions/cart/removeItemAttachment.ts"; -import * as $$$$$$$$$6 from "./actions/cart/removeItems.ts"; -import * as $$$$$$$$$7 from "./actions/cart/removeOffering.ts"; -import * as $$$$$$$$$8 from "./actions/cart/simulation.ts"; -import * as $$$$$$$$$9 from "./actions/cart/updateAttachment.ts"; -import * as $$$$$$$$$10 from "./actions/cart/updateCoupons.ts"; -import * as $$$$$$$$$11 from "./actions/cart/updateGifts.ts"; -import * as $$$$$$$$$12 from "./actions/cart/updateItemAttachment.ts"; -import * as $$$$$$$$$13 from "./actions/cart/updateItemPrice.ts"; -import * as $$$$$$$$$14 from "./actions/cart/updateItems.ts"; -import * as $$$$$$$$$15 from "./actions/cart/updateProfile.ts"; -import * as $$$$$$$$$16 from "./actions/cart/updateUser.ts"; -import * as $$$$$$$$$17 from "./actions/masterdata/createDocument.ts"; -import * as $$$$$$$$$18 from "./actions/masterdata/updateDocument.ts"; -import * as $$$$$$$$$19 from "./actions/newsletter/subscribe.ts"; -import * as $$$$$$$$$20 from "./actions/notifyme.ts"; -import * as $$$$$$$$$21 from "./actions/review/submit.ts"; -import * as $$$$$$$$$22 from "./actions/trigger.ts"; -import * as $$$$$$$$$23 from "./actions/wishlist/addItem.ts"; -import * as $$$$$$$$$24 from "./actions/wishlist/removeItem.ts"; +import * as $$$$$$$$$0 from "./actions/address/createAddress.ts"; +import * as $$$$$$$$$1 from "./actions/address/deleteAddress.ts"; +import * as $$$$$$$$$2 from "./actions/address/updateAddress.ts"; +import * as $$$$$$$$$3 from "./actions/analytics/sendEvent.ts"; +import * as $$$$$$$$$4 from "./actions/cart/addItems.ts"; +import * as $$$$$$$$$5 from "./actions/cart/addOfferings.ts"; +import * as $$$$$$$$$6 from "./actions/cart/clearOrderformMessages.ts"; +import * as $$$$$$$$$7 from "./actions/cart/getInstallment.ts"; +import * as $$$$$$$$$8 from "./actions/cart/removeItemAttachment.ts"; +import * as $$$$$$$$$9 from "./actions/cart/removeItems.ts"; +import * as $$$$$$$$$10 from "./actions/cart/removeOffering.ts"; +import * as $$$$$$$$$11 from "./actions/cart/simulation.ts"; +import * as $$$$$$$$$12 from "./actions/cart/updateAttachment.ts"; +import * as $$$$$$$$$13 from "./actions/cart/updateCoupons.ts"; +import * as $$$$$$$$$14 from "./actions/cart/updateGifts.ts"; +import * as $$$$$$$$$15 from "./actions/cart/updateItemAttachment.ts"; +import * as $$$$$$$$$16 from "./actions/cart/updateItemPrice.ts"; +import * as $$$$$$$$$17 from "./actions/cart/updateItems.ts"; +import * as $$$$$$$$$18 from "./actions/cart/updateProfile.ts"; +import * as $$$$$$$$$19 from "./actions/cart/updateUser.ts"; +import * as $$$$$$$$$20 from "./actions/masterdata/createDocument.ts"; +import * as $$$$$$$$$21 from "./actions/masterdata/updateDocument.ts"; +import * as $$$$$$$$$22 from "./actions/newsletter/subscribe.ts"; +import * as $$$$$$$$$23 from "./actions/notifyme.ts"; +import * as $$$$$$$$$24 from "./actions/payments/delete.ts"; +import * as $$$$$$$$$25 from "./actions/profile/newsletterProfile.ts"; +import * as $$$$$$$$$26 from "./actions/profile/updateProfile.ts"; +import * as $$$$$$$$$27 from "./actions/review/submit.ts"; +import * as $$$$$$$$$28 from "./actions/sessions/delete.ts"; +import * as $$$$$$$$$29 from "./actions/trigger.ts"; +import * as $$$$$$$$$30 from "./actions/wishlist/addItem.ts"; +import * as $$$$$$$$$31 from "./actions/wishlist/removeItem.ts"; import * as $$$$0 from "./handlers/sitemap.ts"; -import * as $$$0 from "./loaders/cart.ts"; -import * as $$$1 from "./loaders/categories/tree.ts"; -import * as $$$2 from "./loaders/collections/list.ts"; -import * as $$$3 from "./loaders/config.ts"; -import * as $$$4 from "./loaders/intelligentSearch/productDetailsPage.ts"; -import * as $$$5 from "./loaders/intelligentSearch/productList.ts"; -import * as $$$6 from "./loaders/intelligentSearch/productListingPage.ts"; -import * as $$$7 from "./loaders/intelligentSearch/productSearchValidator.ts"; -import * as $$$8 from "./loaders/intelligentSearch/suggestions.ts"; -import * as $$$9 from "./loaders/intelligentSearch/topsearches.ts"; -import * as $$$10 from "./loaders/legacy/brands.ts"; -import * as $$$11 from "./loaders/legacy/pageType.ts"; -import * as $$$12 from "./loaders/legacy/productDetailsPage.ts"; -import * as $$$13 from "./loaders/legacy/productList.ts"; -import * as $$$14 from "./loaders/legacy/productListingPage.ts"; -import * as $$$15 from "./loaders/legacy/relatedProductsLoader.ts"; -import * as $$$16 from "./loaders/legacy/suggestions.ts"; -import * as $$$17 from "./loaders/logistics/getSalesChannelById.ts"; -import * as $$$18 from "./loaders/logistics/listPickupPoints.ts"; -import * as $$$19 from "./loaders/logistics/listPickupPointsByLocation.ts"; -import * as $$$20 from "./loaders/logistics/listSalesChannelById.ts"; -import * as $$$21 from "./loaders/logistics/listStockByStore.ts"; -import * as $$$22 from "./loaders/masterdata/searchDocuments.ts"; -import * as $$$23 from "./loaders/navbar.ts"; -import * as $$$24 from "./loaders/options/productIdByTerm.ts"; -import * as $$$25 from "./loaders/orders/list.ts"; -import * as $$$26 from "./loaders/paths/PDPDefaultPath.ts"; -import * as $$$27 from "./loaders/paths/PLPDefaultPath.ts"; -import * as $$$28 from "./loaders/product/extend.ts"; -import * as $$$29 from "./loaders/product/extensions/detailsPage.ts"; -import * as $$$30 from "./loaders/product/extensions/list.ts"; -import * as $$$31 from "./loaders/product/extensions/listingPage.ts"; -import * as $$$32 from "./loaders/product/extensions/suggestions.ts"; -import * as $$$33 from "./loaders/product/wishlist.ts"; -import * as $$$34 from "./loaders/promotion/getPromotionById.ts"; -import * as $$$35 from "./loaders/proxy.ts"; -import * as $$$36 from "./loaders/user.ts"; -import * as $$$37 from "./loaders/wishlist.ts"; -import * as $$$38 from "./loaders/workflow/product.ts"; -import * as $$$39 from "./loaders/workflow/products.ts"; +import * as $$$0 from "./loaders/address/getAddressByZIP.ts"; +import * as $$$1 from "./loaders/address/list.ts"; +import * as $$$2 from "./loaders/cart.ts"; +import * as $$$3 from "./loaders/categories/tree.ts"; +import * as $$$4 from "./loaders/collections/list.ts"; +import * as $$$5 from "./loaders/config.ts"; +import * as $$$6 from "./loaders/intelligentSearch/productDetailsPage.ts"; +import * as $$$7 from "./loaders/intelligentSearch/productList.ts"; +import * as $$$8 from "./loaders/intelligentSearch/productListingPage.ts"; +import * as $$$9 from "./loaders/intelligentSearch/productSearchValidator.ts"; +import * as $$$10 from "./loaders/intelligentSearch/suggestions.ts"; +import * as $$$11 from "./loaders/intelligentSearch/topsearches.ts"; +import * as $$$12 from "./loaders/legacy/brands.ts"; +import * as $$$13 from "./loaders/legacy/pageType.ts"; +import * as $$$14 from "./loaders/legacy/productDetailsPage.ts"; +import * as $$$15 from "./loaders/legacy/productList.ts"; +import * as $$$16 from "./loaders/legacy/productListingPage.ts"; +import * as $$$17 from "./loaders/legacy/relatedProductsLoader.ts"; +import * as $$$18 from "./loaders/legacy/suggestions.ts"; +import * as $$$19 from "./loaders/logistics/getSalesChannelById.ts"; +import * as $$$20 from "./loaders/logistics/listPickupPoints.ts"; +import * as $$$21 from "./loaders/logistics/listPickupPointsByLocation.ts"; +import * as $$$22 from "./loaders/logistics/listSalesChannelById.ts"; +import * as $$$23 from "./loaders/logistics/listStockByStore.ts"; +import * as $$$24 from "./loaders/masterdata/searchDocuments.ts"; +import * as $$$25 from "./loaders/navbar.ts"; +import * as $$$26 from "./loaders/options/productIdByTerm.ts"; +import * as $$$27 from "./loaders/orders/list.ts"; +import * as $$$28 from "./loaders/orders/order.ts"; +import * as $$$29 from "./loaders/paths/PDPDefaultPath.ts"; +import * as $$$30 from "./loaders/paths/PLPDefaultPath.ts"; +import * as $$$31 from "./loaders/payments/info.ts"; +import * as $$$32 from "./loaders/payments/userPayments.ts"; +import * as $$$33 from "./loaders/product/extend.ts"; +import * as $$$34 from "./loaders/product/extensions/detailsPage.ts"; +import * as $$$35 from "./loaders/product/extensions/list.ts"; +import * as $$$36 from "./loaders/product/extensions/listingPage.ts"; +import * as $$$37 from "./loaders/product/extensions/suggestions.ts"; +import * as $$$38 from "./loaders/product/wishlist.ts"; +import * as $$$39 from "./loaders/profile/passwordLastUpdate.ts"; +import * as $$$40 from "./loaders/promotion/getPromotionById.ts"; +import * as $$$41 from "./loaders/proxy.ts"; +import * as $$$42 from "./loaders/sessions/info.ts"; +import * as $$$43 from "./loaders/user.ts"; +import * as $$$44 from "./loaders/wishlist.ts"; +import * as $$$45 from "./loaders/workflow/product.ts"; +import * as $$$46 from "./loaders/workflow/products.ts"; import * as $$$$$$0 from "./sections/Analytics/Vtex.tsx"; import * as $$$$$$$$$$0 from "./workflows/events.ts"; import * as $$$$$$$$$$1 from "./workflows/product/index.ts"; const manifest = { "loaders": { - "vtex/loaders/cart.ts": $$$0, - "vtex/loaders/categories/tree.ts": $$$1, - "vtex/loaders/collections/list.ts": $$$2, - "vtex/loaders/config.ts": $$$3, - "vtex/loaders/intelligentSearch/productDetailsPage.ts": $$$4, - "vtex/loaders/intelligentSearch/productList.ts": $$$5, - "vtex/loaders/intelligentSearch/productListingPage.ts": $$$6, - "vtex/loaders/intelligentSearch/productSearchValidator.ts": $$$7, - "vtex/loaders/intelligentSearch/suggestions.ts": $$$8, - "vtex/loaders/intelligentSearch/topsearches.ts": $$$9, - "vtex/loaders/legacy/brands.ts": $$$10, - "vtex/loaders/legacy/pageType.ts": $$$11, - "vtex/loaders/legacy/productDetailsPage.ts": $$$12, - "vtex/loaders/legacy/productList.ts": $$$13, - "vtex/loaders/legacy/productListingPage.ts": $$$14, - "vtex/loaders/legacy/relatedProductsLoader.ts": $$$15, - "vtex/loaders/legacy/suggestions.ts": $$$16, - "vtex/loaders/logistics/getSalesChannelById.ts": $$$17, - "vtex/loaders/logistics/listPickupPoints.ts": $$$18, - "vtex/loaders/logistics/listPickupPointsByLocation.ts": $$$19, - "vtex/loaders/logistics/listSalesChannelById.ts": $$$20, - "vtex/loaders/logistics/listStockByStore.ts": $$$21, - "vtex/loaders/masterdata/searchDocuments.ts": $$$22, - "vtex/loaders/navbar.ts": $$$23, - "vtex/loaders/options/productIdByTerm.ts": $$$24, - "vtex/loaders/orders/list.ts": $$$25, - "vtex/loaders/paths/PDPDefaultPath.ts": $$$26, - "vtex/loaders/paths/PLPDefaultPath.ts": $$$27, - "vtex/loaders/product/extend.ts": $$$28, - "vtex/loaders/product/extensions/detailsPage.ts": $$$29, - "vtex/loaders/product/extensions/list.ts": $$$30, - "vtex/loaders/product/extensions/listingPage.ts": $$$31, - "vtex/loaders/product/extensions/suggestions.ts": $$$32, - "vtex/loaders/product/wishlist.ts": $$$33, - "vtex/loaders/promotion/getPromotionById.ts": $$$34, - "vtex/loaders/proxy.ts": $$$35, - "vtex/loaders/user.ts": $$$36, - "vtex/loaders/wishlist.ts": $$$37, - "vtex/loaders/workflow/product.ts": $$$38, - "vtex/loaders/workflow/products.ts": $$$39, + "vtex/loaders/address/getAddressByZIP.ts": $$$0, + "vtex/loaders/address/list.ts": $$$1, + "vtex/loaders/cart.ts": $$$2, + "vtex/loaders/categories/tree.ts": $$$3, + "vtex/loaders/collections/list.ts": $$$4, + "vtex/loaders/config.ts": $$$5, + "vtex/loaders/intelligentSearch/productDetailsPage.ts": $$$6, + "vtex/loaders/intelligentSearch/productList.ts": $$$7, + "vtex/loaders/intelligentSearch/productListingPage.ts": $$$8, + "vtex/loaders/intelligentSearch/productSearchValidator.ts": $$$9, + "vtex/loaders/intelligentSearch/suggestions.ts": $$$10, + "vtex/loaders/intelligentSearch/topsearches.ts": $$$11, + "vtex/loaders/legacy/brands.ts": $$$12, + "vtex/loaders/legacy/pageType.ts": $$$13, + "vtex/loaders/legacy/productDetailsPage.ts": $$$14, + "vtex/loaders/legacy/productList.ts": $$$15, + "vtex/loaders/legacy/productListingPage.ts": $$$16, + "vtex/loaders/legacy/relatedProductsLoader.ts": $$$17, + "vtex/loaders/legacy/suggestions.ts": $$$18, + "vtex/loaders/logistics/getSalesChannelById.ts": $$$19, + "vtex/loaders/logistics/listPickupPoints.ts": $$$20, + "vtex/loaders/logistics/listPickupPointsByLocation.ts": $$$21, + "vtex/loaders/logistics/listSalesChannelById.ts": $$$22, + "vtex/loaders/logistics/listStockByStore.ts": $$$23, + "vtex/loaders/masterdata/searchDocuments.ts": $$$24, + "vtex/loaders/navbar.ts": $$$25, + "vtex/loaders/options/productIdByTerm.ts": $$$26, + "vtex/loaders/orders/list.ts": $$$27, + "vtex/loaders/orders/order.ts": $$$28, + "vtex/loaders/paths/PDPDefaultPath.ts": $$$29, + "vtex/loaders/paths/PLPDefaultPath.ts": $$$30, + "vtex/loaders/payments/info.ts": $$$31, + "vtex/loaders/payments/userPayments.ts": $$$32, + "vtex/loaders/product/extend.ts": $$$33, + "vtex/loaders/product/extensions/detailsPage.ts": $$$34, + "vtex/loaders/product/extensions/list.ts": $$$35, + "vtex/loaders/product/extensions/listingPage.ts": $$$36, + "vtex/loaders/product/extensions/suggestions.ts": $$$37, + "vtex/loaders/product/wishlist.ts": $$$38, + "vtex/loaders/profile/passwordLastUpdate.ts": $$$39, + "vtex/loaders/promotion/getPromotionById.ts": $$$40, + "vtex/loaders/proxy.ts": $$$41, + "vtex/loaders/sessions/info.ts": $$$42, + "vtex/loaders/user.ts": $$$43, + "vtex/loaders/wishlist.ts": $$$44, + "vtex/loaders/workflow/product.ts": $$$45, + "vtex/loaders/workflow/products.ts": $$$46, }, "handlers": { "vtex/handlers/sitemap.ts": $$$$0, @@ -122,31 +143,38 @@ const manifest = { "vtex/sections/Analytics/Vtex.tsx": $$$$$$0, }, "actions": { - "vtex/actions/analytics/sendEvent.ts": $$$$$$$$$0, - "vtex/actions/cart/addItems.ts": $$$$$$$$$1, - "vtex/actions/cart/addOfferings.ts": $$$$$$$$$2, - "vtex/actions/cart/clearOrderformMessages.ts": $$$$$$$$$3, - "vtex/actions/cart/getInstallment.ts": $$$$$$$$$4, - "vtex/actions/cart/removeItemAttachment.ts": $$$$$$$$$5, - "vtex/actions/cart/removeItems.ts": $$$$$$$$$6, - "vtex/actions/cart/removeOffering.ts": $$$$$$$$$7, - "vtex/actions/cart/simulation.ts": $$$$$$$$$8, - "vtex/actions/cart/updateAttachment.ts": $$$$$$$$$9, - "vtex/actions/cart/updateCoupons.ts": $$$$$$$$$10, - "vtex/actions/cart/updateGifts.ts": $$$$$$$$$11, - "vtex/actions/cart/updateItemAttachment.ts": $$$$$$$$$12, - "vtex/actions/cart/updateItemPrice.ts": $$$$$$$$$13, - "vtex/actions/cart/updateItems.ts": $$$$$$$$$14, - "vtex/actions/cart/updateProfile.ts": $$$$$$$$$15, - "vtex/actions/cart/updateUser.ts": $$$$$$$$$16, - "vtex/actions/masterdata/createDocument.ts": $$$$$$$$$17, - "vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$18, - "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$19, - "vtex/actions/notifyme.ts": $$$$$$$$$20, - "vtex/actions/review/submit.ts": $$$$$$$$$21, - "vtex/actions/trigger.ts": $$$$$$$$$22, - "vtex/actions/wishlist/addItem.ts": $$$$$$$$$23, - "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$24, + "vtex/actions/address/createAddress.ts": $$$$$$$$$0, + "vtex/actions/address/deleteAddress.ts": $$$$$$$$$1, + "vtex/actions/address/updateAddress.ts": $$$$$$$$$2, + "vtex/actions/analytics/sendEvent.ts": $$$$$$$$$3, + "vtex/actions/cart/addItems.ts": $$$$$$$$$4, + "vtex/actions/cart/addOfferings.ts": $$$$$$$$$5, + "vtex/actions/cart/clearOrderformMessages.ts": $$$$$$$$$6, + "vtex/actions/cart/getInstallment.ts": $$$$$$$$$7, + "vtex/actions/cart/removeItemAttachment.ts": $$$$$$$$$8, + "vtex/actions/cart/removeItems.ts": $$$$$$$$$9, + "vtex/actions/cart/removeOffering.ts": $$$$$$$$$10, + "vtex/actions/cart/simulation.ts": $$$$$$$$$11, + "vtex/actions/cart/updateAttachment.ts": $$$$$$$$$12, + "vtex/actions/cart/updateCoupons.ts": $$$$$$$$$13, + "vtex/actions/cart/updateGifts.ts": $$$$$$$$$14, + "vtex/actions/cart/updateItemAttachment.ts": $$$$$$$$$15, + "vtex/actions/cart/updateItemPrice.ts": $$$$$$$$$16, + "vtex/actions/cart/updateItems.ts": $$$$$$$$$17, + "vtex/actions/cart/updateProfile.ts": $$$$$$$$$18, + "vtex/actions/cart/updateUser.ts": $$$$$$$$$19, + "vtex/actions/masterdata/createDocument.ts": $$$$$$$$$20, + "vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$21, + "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$22, + "vtex/actions/notifyme.ts": $$$$$$$$$23, + "vtex/actions/payments/delete.ts": $$$$$$$$$24, + "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$25, + "vtex/actions/profile/updateProfile.ts": $$$$$$$$$26, + "vtex/actions/review/submit.ts": $$$$$$$$$27, + "vtex/actions/sessions/delete.ts": $$$$$$$$$28, + "vtex/actions/trigger.ts": $$$$$$$$$29, + "vtex/actions/wishlist/addItem.ts": $$$$$$$$$30, + "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$31, }, "workflows": { "vtex/workflows/events.ts": $$$$$$$$$$0, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index 7fb63b193..6794f41e7 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -9,6 +9,7 @@ import { LegacyProduct, LegacySort, OrderForm, + OrderItem, PageType, PortalSuggestion, ProductSearchResult, @@ -248,6 +249,9 @@ export interface VTEXCommerceStable { "GET /api/oms/user/orders": { response: Userorderslist; }; + "GET /api/oms/user/orders/:orderId": { + response: OrderItem; + }; } export interface SP { diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 89b86ec21..a433c6bdb 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -62,11 +62,12 @@ export interface ClientProfileData { export interface ClientPreferencesData { locale: string; - optinNewsLetter: null; + optinNewsLetter: boolean; } export interface ItemMetadata { - items: ItemMetadataItem[]; + items?: ItemMetadataItem[]; + Items?: ItemMetadataItemUppercase[]; } export interface ItemMetadataItem { @@ -82,6 +83,19 @@ export interface ItemMetadataItem { assemblyOptions: AssemblyOption[]; } +export interface ItemMetadataItemUppercase { + Id: string; + Seller: string; + Name: string; + SkuName: string; + ProductId: string; + RefId: string; + Ean: null | string; + ImageUrl: string; + DetailUrl: string; + AssemblyOptions: AssemblyOption[]; +} + export interface AssemblyOption { id: Name; name: Name; @@ -259,11 +273,43 @@ export interface Fields { skuName?: string; } +export interface Transaction { + isActive: boolean; + transactionId: string; + merchantName: string; + payments: Payment[]; +} + +export interface Payment { + id: string; + paymentSystem: string; + paymentSystemName: string; + value: number; + installments: number; + referenceValue: number; + cardHolder: string | null; + cardNumber: string | null; + firstDigits: string | null; + lastDigits: string | null; + cvv2: string | null; + expireMonth: string | null; + expireYear: string | null; + url: string; + giftCardId: null; + giftCardName: null; + giftCardCaption: null; + redemptionCode: null; + group: string; + tid: null; + dueDate: Date; +} + export interface PaymentData { updateStatus: string; installmentOptions: InstallmentOption[]; paymentSystems: PaymentSystem[]; payments: unknown[]; + transactions: Transaction[]; giftCards: unknown[]; giftCardMessages: unknown[]; availableAccounts: unknown[]; @@ -364,7 +410,8 @@ export interface ShippingData { export interface Address { addressType: string; - receiverName: null; + addressName: string; + receiverName: string | null; addressId: string; isDisposable: boolean; postalCode: string; @@ -382,8 +429,16 @@ export interface Address { export interface LogisticsInfo { itemIndex: number; selectedSla: SelectedSla | null; + price: number; + listPrice: number; + sellingPrice: number; + deliveryCompany: string; + shippingEstimate: string; + shippingEstimateDate: string; selectedDeliveryChannel: SelectedDeliveryChannel; addressId: string; + pickupPointId: string; + pickupStoreInfo: PickupStoreInfo; slas: Sla[]; shipsTo: string[]; itemId: string; @@ -1291,6 +1346,7 @@ export interface Order { invoiceOutput: string[]; isAllDelivered: boolean; isAnyDelivered: boolean; + itemMetadata: ItemMetadata; items: OrderFormItem[]; lastChange: string; lastMessageUnread: string; @@ -1313,6 +1369,103 @@ export interface Order { workflowInRetry: boolean; } +export interface OrderItem { + orderId: string; + sequence: string; + origin: string; + sellerOrderId: string; + salesChannel: string; + affiliateId: string; + workflowIsInError: boolean; + orderGroup: string; + status: string; + statusDescription: string; + value: number; + allowCancellation: boolean; + allowEdition?: boolean; + authorizedDate: string; + callCenterOperatorData: string; + cancelReason: string; + cancellationData: { + RequestedByUser: boolean; + RequestedBySystem: boolean; + RequestedBySellerNotification: boolean; + RequestedByPaymentNotification: boolean; + Reason: string; + CancellationDate: string; + }; + cancellationRequests?: { + id: string; + reason: string; + cancellationRequestDate: string; + requestedByUser: boolean; + deniedBySeller: boolean; + deniedBySellerReason: string | null; + cancellationRequestDenyDate: string | null; + }[] | null; + changesAttachment: string; + checkedInPickupPointId: string | null; + paymentData: PaymentData; + shippingData: ShippingData; + clientPreferencesData: ClientPreferencesData; + clientProfileData: ClientProfileData; + totals: Total[]; + commercialConditionData?: string | null; + creationDate: string; + // deno-lint-ignore no-explicit-any + customData?: Record | null; + followUpEmail?: string; + giftRegistryData?: GiftRegistry | null; + hostname: string; + invoiceData: string | null; + invoicedDate: string | null; + isCheckedIn: boolean; + isCompleted: boolean; + sellers?: { + id: string; + name: string; + logo: string; + fulfillmentEndpoint: string; + }[]; + itemMetadata: ItemMetadata; + items: OrderFormItem[]; + lastChange: string; + lastMessage: string; + marketingData: OrderFormMarketingData | null; + marketplace: Marketplace; + marketplaceItems: []; + marketplaceOrderId: string; + marketplaceServicesEndpoint: string; + merchantName: string; + openTextField: string | null; +} + +interface Marketplace { + baseURL: string; + // deno-lint-ignore no-explicit-any + isCertified?: any | null; + name: string; +} + +interface OrderFormMarketingData { + utmCampaign?: string; + utmMedium?: string; + utmSource?: string; + utmiCampaign?: string; + utmiPart?: string; + utmipage?: string; + marketingTags?: string | string[]; +} + +interface GiftRegistry { + attachmentId: string; + giftRegistryId: string; + giftRegistryType: string; + giftRegistryTypeName: string; + addressId: string; + description: string; +} + export interface Orders { facets: Facet[]; list: Order[]; From c416e5a01fde9f4a959710895f7d33090ca407c1 Mon Sep 17 00:00:00 2001 From: "@yuri_assuncx" Date: Mon, 28 Oct 2024 13:52:04 -0300 Subject: [PATCH 05/93] [VTEX] Feat: add new types and cancel order action (#945) --- vtex/actions/orders/cancel.ts | 43 +++++++++++++++++++++++++++++++++++ vtex/manifest.gen.ts | 34 ++++++++++++++------------- vtex/utils/client.ts | 7 ++++++ vtex/utils/types.ts | 27 ++++++++++++++++++++++ 4 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 vtex/actions/orders/cancel.ts diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts new file mode 100644 index 000000000..c6dfa38d1 --- /dev/null +++ b/vtex/actions/orders/cancel.ts @@ -0,0 +1,43 @@ +import { parseCookie } from "../../utils/vtexId.ts"; +import { AppContext } from "../../mod.ts"; +import { CanceledOrder } from "../../utils/types.ts"; + +interface Props { + orderId: string; + reason: string; +} + +async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + return null; + } + + const { orderId, reason } = props; + + const response = await vcsDeprecated + ["POST /api/oms/user/orders/:orderId/cancel"]( + { orderId }, + { + body: { reason }, + headers: { + cookie, + }, + }, + ); + + if (response.ok) { + const canceledOrder = await response.json(); + return canceledOrder; + } + + return null; +} + +export default action; diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index f80a3c0c9..7a1b1e417 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -26,14 +26,15 @@ import * as $$$$$$$$$20 from "./actions/masterdata/createDocument.ts"; import * as $$$$$$$$$21 from "./actions/masterdata/updateDocument.ts"; import * as $$$$$$$$$22 from "./actions/newsletter/subscribe.ts"; import * as $$$$$$$$$23 from "./actions/notifyme.ts"; -import * as $$$$$$$$$24 from "./actions/payments/delete.ts"; -import * as $$$$$$$$$25 from "./actions/profile/newsletterProfile.ts"; -import * as $$$$$$$$$26 from "./actions/profile/updateProfile.ts"; -import * as $$$$$$$$$27 from "./actions/review/submit.ts"; -import * as $$$$$$$$$28 from "./actions/sessions/delete.ts"; -import * as $$$$$$$$$29 from "./actions/trigger.ts"; -import * as $$$$$$$$$30 from "./actions/wishlist/addItem.ts"; -import * as $$$$$$$$$31 from "./actions/wishlist/removeItem.ts"; +import * as $$$$$$$$$24 from "./actions/orders/cancel.ts"; +import * as $$$$$$$$$25 from "./actions/payments/delete.ts"; +import * as $$$$$$$$$26 from "./actions/profile/newsletterProfile.ts"; +import * as $$$$$$$$$27 from "./actions/profile/updateProfile.ts"; +import * as $$$$$$$$$28 from "./actions/review/submit.ts"; +import * as $$$$$$$$$29 from "./actions/sessions/delete.ts"; +import * as $$$$$$$$$30 from "./actions/trigger.ts"; +import * as $$$$$$$$$31 from "./actions/wishlist/addItem.ts"; +import * as $$$$$$$$$32 from "./actions/wishlist/removeItem.ts"; import * as $$$$0 from "./handlers/sitemap.ts"; import * as $$$0 from "./loaders/address/getAddressByZIP.ts"; import * as $$$1 from "./loaders/address/list.ts"; @@ -167,14 +168,15 @@ const manifest = { "vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$21, "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$22, "vtex/actions/notifyme.ts": $$$$$$$$$23, - "vtex/actions/payments/delete.ts": $$$$$$$$$24, - "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$25, - "vtex/actions/profile/updateProfile.ts": $$$$$$$$$26, - "vtex/actions/review/submit.ts": $$$$$$$$$27, - "vtex/actions/sessions/delete.ts": $$$$$$$$$28, - "vtex/actions/trigger.ts": $$$$$$$$$29, - "vtex/actions/wishlist/addItem.ts": $$$$$$$$$30, - "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$31, + "vtex/actions/orders/cancel.ts": $$$$$$$$$24, + "vtex/actions/payments/delete.ts": $$$$$$$$$25, + "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$26, + "vtex/actions/profile/updateProfile.ts": $$$$$$$$$27, + "vtex/actions/review/submit.ts": $$$$$$$$$28, + "vtex/actions/sessions/delete.ts": $$$$$$$$$29, + "vtex/actions/trigger.ts": $$$$$$$$$30, + "vtex/actions/wishlist/addItem.ts": $$$$$$$$$31, + "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$32, }, "workflows": { "vtex/workflows/events.ts": $$$$$$$$$$0, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index 6794f41e7..0f1feb091 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -1,6 +1,7 @@ import { Userorderslist } from "./openapi/vcs.openapi.gen.ts"; import { Brand, + CanceledOrder, Category, CreateNewDocument, FacetSearchResult, @@ -252,6 +253,12 @@ export interface VTEXCommerceStable { "GET /api/oms/user/orders/:orderId": { response: OrderItem; }; + "POST /api/oms/user/orders/:orderId/cancel": { + response: CanceledOrder; + body: { + reason: string; + }; + }; } export interface SP { diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index a433c6bdb..2097514bb 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1369,6 +1369,24 @@ export interface Order { workflowInRetry: boolean; } +export interface Package { + cfop: string | null; + invoiceNumber: string; + invoiceValue: number; + invoiceUrl: string | null; + issuanceDate: string; + trackingNumber: string | null; + invoiceKey: string; + trackingUrl: string | null; + embeddedInvoice: string; + courierStatus: { + status: string | null; + finished: boolean; + deliveredDate: string; + }; + type: "Input" | "Output"; +} + export interface OrderItem { orderId: string; sequence: string; @@ -1386,6 +1404,9 @@ export interface OrderItem { authorizedDate: string; callCenterOperatorData: string; cancelReason: string; + packageAttachment: { + packages: Package[]; + } | null; cancellationData: { RequestedByUser: boolean; RequestedBySystem: boolean; @@ -1440,6 +1461,12 @@ export interface OrderItem { openTextField: string | null; } +export interface CanceledOrder { + date: string; + orderId: string; + receipt: string | null; +} + interface Marketplace { baseURL: string; // deno-lint-ignore no-explicit-any From 037d02722922e61627710926aec97df733ae3459 Mon Sep 17 00:00:00 2001 From: guitavano Date: Mon, 28 Oct 2024 22:53:56 -0300 Subject: [PATCH 06/93] fix brand canonical --- vtex/utils/legacy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vtex/utils/legacy.ts b/vtex/utils/legacy.ts index 759964974..ef12d5b5e 100644 --- a/vtex/utils/legacy.ts +++ b/vtex/utils/legacy.ts @@ -136,7 +136,8 @@ export const pageTypesToSeo = ( noIndexing: hasMapTermOrSkuId, canonical: toCanonical( new URL( - (current.url && current.pageType !== "Collection") + (current.url && current.pageType !== "Collection" && + current.pageType !== "Brand") ? current.url.replace(/.+\.vtexcommercestable\.com\.br/, "") .toLowerCase() : url, From 3fa4be9944414385a43118862859d0849b334220 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Tue, 29 Oct 2024 15:08:12 -0300 Subject: [PATCH 07/93] fix: change product cancellation route --- vtex/actions/orders/cancel.ts | 2 +- vtex/utils/client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts index c6dfa38d1..6f1982370 100644 --- a/vtex/actions/orders/cancel.ts +++ b/vtex/actions/orders/cancel.ts @@ -22,7 +22,7 @@ async function action( const { orderId, reason } = props; const response = await vcsDeprecated - ["POST /api/oms/user/orders/:orderId/cancel"]( + ["POST /api/oms/pvt/orders/:orderId/cancel"]( { orderId }, { body: { reason }, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index 0f1feb091..f2546079e 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -253,7 +253,7 @@ export interface VTEXCommerceStable { "GET /api/oms/user/orders/:orderId": { response: OrderItem; }; - "POST /api/oms/user/orders/:orderId/cancel": { + "POST /api/oms/pvt/orders/:orderId/cancel": { response: CanceledOrder; body: { reason: string; From db7c3ca46a7e8683082cad31b402194db97bfbe7 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 30 Oct 2024 03:14:24 -0300 Subject: [PATCH 08/93] add brand to breadcrumb --- vtex/utils/legacy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vtex/utils/legacy.ts b/vtex/utils/legacy.ts index ef12d5b5e..79dab88cc 100644 --- a/vtex/utils/legacy.ts +++ b/vtex/utils/legacy.ts @@ -84,10 +84,11 @@ export const pageTypesToBreadcrumbList = ( pages: PageType[], baseUrl: string, ) => { + console.log({ pages }); const filteredPages = pages .filter(({ pageType }) => pageType === "Category" || pageType === "Department" || - pageType === "SubCategory" + pageType === "SubCategory" || pageType === "Brand" ); return filteredPages.map((page, index) => { From 00dc0ae1a90f80acf9ce57b9348515453f0a7338 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 30 Oct 2024 03:29:51 -0300 Subject: [PATCH 09/93] remove console log --- vtex/utils/legacy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtex/utils/legacy.ts b/vtex/utils/legacy.ts index 79dab88cc..07e832b2b 100644 --- a/vtex/utils/legacy.ts +++ b/vtex/utils/legacy.ts @@ -84,7 +84,7 @@ export const pageTypesToBreadcrumbList = ( pages: PageType[], baseUrl: string, ) => { - console.log({ pages }); + const filteredPages = pages .filter(({ pageType }) => pageType === "Category" || pageType === "Department" || From 03d781a930dcad7cde03613111f38d7d3d8af914 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 30 Oct 2024 06:33:02 -0300 Subject: [PATCH 10/93] fix orderPlaced page --- vtex/loaders/orders/order.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index 2b4501206..cebadf0d9 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -12,17 +12,13 @@ export default async function loader( req: Request, ctx: AppContext, ): Promise { - const { vcsDeprecated } = ctx; - const { cookie, payload } = parseCookie(req.headers, ctx.account); - - if (!payload?.sub || !payload?.userId) { - return null; - } + const { vcs } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); const { slug } = props; - const response = await vcsDeprecated["GET /api/oms/user/orders/:orderId"]( - { orderId: slug }, + const response = await vcs["GET /api/oms/user/orders/:orderId"]( + { orderId: slug + "-01" }, { headers: { cookie, From 6cda6cf0f6f7a69a370bb056fd12487d13506c29 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 30 Oct 2024 06:42:40 -0300 Subject: [PATCH 11/93] fixfixfix --- vtex/loaders/orders/order.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index cebadf0d9..0cc1e1cac 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -18,7 +18,7 @@ export default async function loader( const { slug } = props; const response = await vcs["GET /api/oms/user/orders/:orderId"]( - { orderId: slug + "-01" }, + { orderId: slug.includes("-") ? slug : slug + "-01" }, { headers: { cookie, From 37badd6d5f821b204ad5a85ec2ddfb32fe39182d Mon Sep 17 00:00:00 2001 From: guitavano Date: Thu, 31 Oct 2024 12:06:51 -0300 Subject: [PATCH 12/93] improve cache --- power-reviews/loaders/productDetailsPage.ts | 2 ++ power-reviews/loaders/productListingPage.ts | 2 ++ vtex/loaders/config.ts | 2 ++ vtex/loaders/logistics/listPickupPoints.ts | 2 ++ 4 files changed, 8 insertions(+) diff --git a/power-reviews/loaders/productDetailsPage.ts b/power-reviews/loaders/productDetailsPage.ts index 406f7c658..1b01c75d2 100644 --- a/power-reviews/loaders/productDetailsPage.ts +++ b/power-reviews/loaders/productDetailsPage.ts @@ -78,3 +78,5 @@ export default function productDetailsPage( }; }; } + +export const cache = "no-cache"; \ No newline at end of file diff --git a/power-reviews/loaders/productListingPage.ts b/power-reviews/loaders/productListingPage.ts index 12941e798..f914118a1 100644 --- a/power-reviews/loaders/productListingPage.ts +++ b/power-reviews/loaders/productListingPage.ts @@ -81,3 +81,5 @@ export default function productListingPage( }; }; } + +export const cache = "no-cache"; diff --git a/vtex/loaders/config.ts b/vtex/loaders/config.ts index eb1083fba..25f7214f8 100644 --- a/vtex/loaders/config.ts +++ b/vtex/loaders/config.ts @@ -23,3 +23,5 @@ const loader = (_props: unknown, _req: Request, ctx: AppContext): Config => ({ }); export default loader; + +export const cache = "no-cache"; \ No newline at end of file diff --git a/vtex/loaders/logistics/listPickupPoints.ts b/vtex/loaders/logistics/listPickupPoints.ts index 7c06bc3ae..9d63b7a57 100644 --- a/vtex/loaders/logistics/listPickupPoints.ts +++ b/vtex/loaders/logistics/listPickupPoints.ts @@ -15,3 +15,5 @@ export default async function loader( return pickupPoints.map((pickup) => toPlace(pickup)); } + +export const cache = "stale-while-revalidate"; \ No newline at end of file From 55b639a60603eec6f8c37b922a7ee32d63d29253 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Thu, 31 Oct 2024 17:27:15 -0300 Subject: [PATCH 13/93] fix: add new type --- power-reviews/loaders/productDetailsPage.ts | 2 +- vtex/loaders/config.ts | 2 +- vtex/loaders/logistics/listPickupPoints.ts | 2 +- vtex/utils/legacy.ts | 1 - vtex/utils/openapi/vcs.openapi.gen.ts | 7683 ++++++++++--------- vtex/utils/types.ts | 6 + 6 files changed, 3910 insertions(+), 3786 deletions(-) diff --git a/power-reviews/loaders/productDetailsPage.ts b/power-reviews/loaders/productDetailsPage.ts index 1b01c75d2..0e05e61d6 100644 --- a/power-reviews/loaders/productDetailsPage.ts +++ b/power-reviews/loaders/productDetailsPage.ts @@ -79,4 +79,4 @@ export default function productDetailsPage( }; } -export const cache = "no-cache"; \ No newline at end of file +export const cache = "no-cache"; diff --git a/vtex/loaders/config.ts b/vtex/loaders/config.ts index 25f7214f8..2c9daa378 100644 --- a/vtex/loaders/config.ts +++ b/vtex/loaders/config.ts @@ -24,4 +24,4 @@ const loader = (_props: unknown, _req: Request, ctx: AppContext): Config => ({ export default loader; -export const cache = "no-cache"; \ No newline at end of file +export const cache = "no-cache"; diff --git a/vtex/loaders/logistics/listPickupPoints.ts b/vtex/loaders/logistics/listPickupPoints.ts index 9d63b7a57..5f31804e2 100644 --- a/vtex/loaders/logistics/listPickupPoints.ts +++ b/vtex/loaders/logistics/listPickupPoints.ts @@ -16,4 +16,4 @@ export default async function loader( return pickupPoints.map((pickup) => toPlace(pickup)); } -export const cache = "stale-while-revalidate"; \ No newline at end of file +export const cache = "stale-while-revalidate"; diff --git a/vtex/utils/legacy.ts b/vtex/utils/legacy.ts index 07e832b2b..9b66cfcdc 100644 --- a/vtex/utils/legacy.ts +++ b/vtex/utils/legacy.ts @@ -84,7 +84,6 @@ export const pageTypesToBreadcrumbList = ( pages: PageType[], baseUrl: string, ) => { - const filteredPages = pages .filter(({ pageType }) => pageType === "Category" || pageType === "Department" || diff --git a/vtex/utils/openapi/vcs.openapi.gen.ts b/vtex/utils/openapi/vcs.openapi.gen.ts index c870b409d..6d0166fd6 100644 --- a/vtex/utils/openapi/vcs.openapi.gen.ts +++ b/vtex/utils/openapi/vcs.openapi.gen.ts @@ -7,6 +7,8 @@ // To generate this file: deno task start // +import { OrderItem } from "../types.ts"; + export type SkuComplement = { /** @@ -65,19 +67,22 @@ export type SavePersonalData = boolean export type OptinNewsLetter = boolean export interface OpenAPI { + "GET /api/oms/user/orders/:orderId": { + response: OrderItem; + }; /** - * Retrieves a specific promotion by its Promotion ID or a specific tax by its tax ID. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Retrieves a specific promotion by its Promotion ID or a specific tax by its tax ID. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint. To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "GET /api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration": { @@ -651,83 +656,135 @@ percentualDiscountValueList?: number[] } } /** - * Searches Master Data v1 documents with highly customizable filters. - * - * > Learn more about [Master Data v1 search queries](https://developers.vtex.com/vtex-rest-api/docs/how-the-queries-in-master-data-v1-work). - * - * ## Query Examples - * - * - * ### Simple filter - * - * ``` - * /dataentities/CL/search?email=my@email.com - * ``` - * - * ### Complex filter - * - * ``` - * /dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01) - * ``` - * - * ### Filter by range - * - * #### Date Range - * - * ``` - * /dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01 - * ``` - * - * #### Range numeric fields - * - * ``` - * /dataentities/CL/search?_where=age between 18 AND 25 - * ``` - * - * ### Partial filter - * - * ``` - * /dataentities/CL/search?firstName=*Maria* - * ``` - * - * ### Filter for null values - * - * ``` - * /dataentities/CL/search?_where=firstName is null - * ``` - * - * ### Filter for non-null values - * - * ``` - * /dataentities/CL/search?_where=firstName is not null - * ``` - * - * ### Filter for difference - * ``` - * /dataentities/CL/search?_where=firstName<>maria - * ``` - * - * ### Filter greater than or less than - * ``` - * /dataentities/CL/search?_where=number>5 - * /dataentities/CL/search?_where=date<2001-01-01 + * Searches Master Data v1 documents with highly customizable filters. + * + * > Learn more about [Master Data v1 search queries](https://developers.vtex.com/vtex-rest-api/docs/how-the-queries-in-master-data-v1-work). + * + * ## Query Examples + * + * + * ### Simple filter + * + * ``` + * /dataentities/CL/search?email=my@email.com + * ``` + * + * ### Complex filter + * + * ``` + * /dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01) + * ``` + * + * ### Filter by range + * + * #### Date Range + * + * ``` + * /dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01 * ``` - * - * > Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * + * #### Range numeric fields + * + * ``` + * /dataentities/CL/search?_where=age between 18 AND 25 + * ``` + * + * ### Partial filter + * + * ``` + * /dataentities/CL/search?firstName=*Maria* + * ``` + * + * ### Filter for null values + * + * ``` + * /dataentities/CL/search?_where=firstName is null + * ``` + * + * ### Filter for non-null values + * + * ``` + * /dataentities/CL/search?_where=firstName is not null + * ``` + * + * ### Filter for difference + * ``` + * /dataentities/CL/search?_where=firstName<>maria + * ``` + * + * ### Filter greater than or less than + * ``` + * /dataentities/CL/search?_where=number>5 + * /dataentities/CL/search?_where=date<2001-01-01 + * ``` + * /dataentities/CL/search?email=my@email.com + * ``` + * + * ### Complex filter + * + * ``` + * /dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01) + * ``` + * + * ### Filter by range + * + * #### Date Range + * + * ``` + * /dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01 + * ``` + * + * #### Range numeric fields + * + * ``` + * /dataentities/CL/search?_where=age between 18 AND 25 + * ``` + * + * ### Partial filter + * + * ``` + * /dataentities/CL/search?firstName=*Maria* + * ``` + * + * ### Filter for null values + * + * ``` + * /dataentities/CL/search?_where=firstName is null + * ``` + * + * ### Filter for non-null values + * + * ``` + * /dataentities/CL/search?_where=firstName is not null + * ``` + * + * ### Filter for difference + * ``` + * /dataentities/CL/search?_where=firstName<>maria + * ``` + * + * ### Filter greater than or less than + * ``` + * /dataentities/CL/search?_where=number>5 + * /dataentities/CL/search?_where=date<2001-01-01 + * ``` + * + * +> Avoid sending too many requests with wildcards (`*`) in the search parameters or that use the `keyword` parameter. This may lead to this endpoint being temporarily blocked for your account. If this happens you will receive an error with status code `503`. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "GET /api/dataentities/:acronym/search": { @@ -797,8 +854,8 @@ warehouseName?: string } } /** - * Retrieves information about [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store. - * + * Retrieves information about [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store. + * * >⚠️ The response is limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. */ "GET /api/logistics/pvt/configuration/pickuppoints": { @@ -808,9 +865,9 @@ warehouseName?: string response: PickupPoint[] } /** - * Retrieves the IDs of products and SKUs. - * > 📘 Onboarding guide - * > + * Retrieves the IDs of products and SKUs. + * > 📘 Onboarding guide + * > * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. */ "GET /api/catalog_system/pvt/products/GetProductAndSkuIds": { @@ -871,22 +928,22 @@ DocumentId?: string } } /** - * Creates a partial document, sending only some of the fields. - * - * > You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Creates a partial document, sending only some of the fields. + * + * > You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "PATCH /api/dataentities/:acronym/documents": { @@ -904,21 +961,21 @@ id?: string response: IdHrefDocumentID } /** - * Retrieves a document. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Retrieves a document. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Read only documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "GET /api/dataentities/:acronym/documents/:id": { @@ -931,47 +988,47 @@ _fields?: string response: Document } /** - * Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID. - * - * >ℹ️ You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. - * - * ## Custom field types - * - * The table below presents the types of custom fields you can use when creating or updating documents in Master Data v1 and example values. - * - * | Field Type| Example value | - * | - | - | - * | Boolean | `true` | - * | Currency | `2.5` | - * | Date | `1992-11-17` | - * | Date_Time | `2016-09-14T19:21:01.3163733Z` | - * | Decimal | `2.5` | - * | Email | `meu@email.com` | - * | Integer | `1000000` | - * | Long | `1000000000` | - * | Percent | `85.42` | - * | Time | `23:50` | - * | URL | `https://www.vtex.com` | - * | Varchar10 | `Lorem ipsu` | - * | Varchar50 | `Lorem ipsum dolor sit amet, consectetur adipiscing` | - * | Varchar750 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | - * | Varchar100 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | - * | Relationship | `5eb31afb-7ab0-11e6-94b4-0a44686e393f` | - * | Text | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | - * - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID. + * + * >ℹ️ You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + * + * ## Custom field types + * + * The table below presents the types of custom fields you can use when creating or updating documents in Master Data v1 and example values. + * + * | Field Type| Example value | + * | - | - | + * | Boolean | `true` | + * | Currency | `2.5` | + * | Date | `1992-11-17` | + * | Date_Time | `2016-09-14T19:21:01.3163733Z` | + * | Decimal | `2.5` | + * | Email | `meu@email.com` | + * | Integer | `1000000` | + * | Long | `1000000000` | + * | Percent | `85.42` | + * | Time | `23:50` | + * | URL | `https://www.vtex.com` | + * | Varchar10 | `Lorem ipsu` | + * | Varchar50 | `Lorem ipsum dolor sit amet, consectetur adipiscing` | + * | Varchar750 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + * | Varchar100 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + * | Relationship | `5eb31afb-7ab0-11e6-94b4-0a44686e393f` | + * | Text | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` | + * + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "PUT /api/dataentities/:acronym/documents/:id": { @@ -987,41 +1044,41 @@ body: { } } /** - * Deletes a document. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Deletes a document. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "DELETE /api/dataentities/:acronym/documents/:id": { } /** - * Updates a subset of fields of a document, without impacting the other fields. - * - * >ℹ️ You can use this request to update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * + * Updates a subset of fields of a document, without impacting the other fields. + * + * >ℹ️ You can use this request to update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. */ "PATCH /api/dataentities/:acronym/documents/:id": { @@ -1033,9 +1090,9 @@ body: { } } /** - * Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. - * > 📘 Onboarding guide - * > + * Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. + * > 📘 Onboarding guide + * > * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. */ "GET /api/catalog/pvt/product/:productId": { @@ -1077,9 +1134,9 @@ IsVisible?: boolean */ Description?: string /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. * */ DescriptionShort?: string @@ -1088,8 +1145,8 @@ DescriptionShort?: string */ ReleaseDate?: string /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. * */ KeyWords?: string @@ -1171,9 +1228,9 @@ IsVisible?: boolean */ Description?: string /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. * */ DescriptionShort?: string @@ -1182,8 +1239,8 @@ DescriptionShort?: string */ ReleaseDate?: string /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. * */ KeyWords?: string @@ -1264,9 +1321,9 @@ IsVisible?: boolean */ Description?: string /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. * */ DescriptionShort?: string @@ -1275,8 +1332,8 @@ DescriptionShort?: string */ ReleaseDate?: string /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. * */ KeyWords?: string @@ -1507,119 +1564,119 @@ LomadeeCampaignCode?: string } } /** - * Retrieves data about the product and all SKUs related to it by the product's ID. - * ## Response body example - * - * ```json - * { - * "productId": 9, - * "name": "Camisa Masculina", - * "salesChannel": "2", - * "available": true, - * "displayMode": "lista", - * "dimensions": [ - * "Cores", - * "Tamanho", - * "País de origem", - * "Gênero" - * ], - * "dimensionsInputType": { - * "Cores": "Combo", - * "Tamanho": "Combo", - * "País de origem": "Combo", - * "Gênero": "Combo" - * }, - * "dimensionsMap": { - * "Cores": [ - * "Amarelo", - * "Azul", - * "Vermelho" - * ], - * "Tamanho": [ - * "P", - * "M", - * "G" - * ], - * "País de origem": [ - * "Brasil" - * ], - * "Gênero": [ - * "Masculino" - * ] - * }, - * "skus": [ - * { - * "sku": 310118454, - * "skuname": "Amarela - G", - * "dimensions": { - * "Cores": "Amarelo", - * "Tamanho": "G", - * "País de origem": "Brasil", - * "Gênero": "Masculino" - * }, - * "available": false, - * "availablequantity": 0, - * "cacheVersionUsedToCallCheckout": null, - * "listPriceFormated": "R$ 0,00", - * "listPrice": 0, - * "taxFormated": "R$ 0,00", - * "taxAsInt": 0, - * "bestPriceFormated": "R$ 9.999.876,00", - * "bestPrice": 999987600, - * "spotPrice": 999987600, - * "installments": 0, - * "installmentsValue": 0, - * "installmentsInsterestRate": null, - * "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155467-292-292/image-5d7ad76ad1954c53adecab4138319034.jpg?v=637321899584500000", - * "sellerId": "1", - * "seller": "lojadobreno", - * "measures": { - * "cubicweight": 1.0000, - * "height": 5.0000, - * "length": 20.0000, - * "weight": 200.0000, - * "width": 20.0000 - * }, - * "unitMultiplier": 1.0000, - * "rewardValue": 0 - * }, - * { - * "sku": 310118455, - * "skuname": "Vermelha - M", - * "dimensions": { - * "Cores": "Vermelho", - * "Tamanho": "M", - * "País de origem": "Brasil", - * "Gênero": "Masculino" - * }, - * "available": true, - * "availablequantity": 99999, - * "cacheVersionUsedToCallCheckout": "38395F1AEF59DF5CEAEDE472328145CD_", - * "listPriceFormated": "R$ 0,00", - * "listPrice": 0, - * "taxFormated": "R$ 0,00", - * "taxAsInt": 0, - * "bestPriceFormated": "R$ 20,00", - * "bestPrice": 2000, - * "spotPrice": 2000, - * "installments": 1, - * "installmentsValue": 2000, - * "installmentsInsterestRate": 0, - * "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155468-292-292/image-601a6099aace48b89d26fc9f22e8e611.jpg?v=637321906602470000", - * "sellerId": "pedrostore", - * "seller": "pedrostore", - * "measures": { - * "cubicweight": 0.4167, - * "height": 5.0000, - * "length": 20.0000, - * "weight": 200.0000, - * "width": 20.0000 - * }, - * "unitMultiplier": 1.0000, - * "rewardValue": 0 - * } - * ] - * } + * Retrieves data about the product and all SKUs related to it by the product's ID. + * ## Response body example + * + * ```json + * { + * "productId": 9, + * "name": "Camisa Masculina", + * "salesChannel": "2", + * "available": true, + * "displayMode": "lista", + * "dimensions": [ + * "Cores", + * "Tamanho", + * "País de origem", + * "Gênero" + * ], + * "dimensionsInputType": { + * "Cores": "Combo", + * "Tamanho": "Combo", + * "País de origem": "Combo", + * "Gênero": "Combo" + * }, + * "dimensionsMap": { + * "Cores": [ + * "Amarelo", + * "Azul", + * "Vermelho" + * ], + * "Tamanho": [ + * "P", + * "M", + * "G" + * ], + * "País de origem": [ + * "Brasil" + * ], + * "Gênero": [ + * "Masculino" + * ] + * }, + * "skus": [ + * { + * "sku": 310118454, + * "skuname": "Amarela - G", + * "dimensions": { + * "Cores": "Amarelo", + * "Tamanho": "G", + * "País de origem": "Brasil", + * "Gênero": "Masculino" + * }, + * "available": false, + * "availablequantity": 0, + * "cacheVersionUsedToCallCheckout": null, + * "listPriceFormated": "R$ 0,00", + * "listPrice": 0, + * "taxFormated": "R$ 0,00", + * "taxAsInt": 0, + * "bestPriceFormated": "R$ 9.999.876,00", + * "bestPrice": 999987600, + * "spotPrice": 999987600, + * "installments": 0, + * "installmentsValue": 0, + * "installmentsInsterestRate": null, + * "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155467-292-292/image-5d7ad76ad1954c53adecab4138319034.jpg?v=637321899584500000", + * "sellerId": "1", + * "seller": "lojadobreno", + * "measures": { + * "cubicweight": 1.0000, + * "height": 5.0000, + * "length": 20.0000, + * "weight": 200.0000, + * "width": 20.0000 + * }, + * "unitMultiplier": 1.0000, + * "rewardValue": 0 + * }, + * { + * "sku": 310118455, + * "skuname": "Vermelha - M", + * "dimensions": { + * "Cores": "Vermelho", + * "Tamanho": "M", + * "País de origem": "Brasil", + * "Gênero": "Masculino" + * }, + * "available": true, + * "availablequantity": 99999, + * "cacheVersionUsedToCallCheckout": "38395F1AEF59DF5CEAEDE472328145CD_", + * "listPriceFormated": "R$ 0,00", + * "listPrice": 0, + * "taxFormated": "R$ 0,00", + * "taxAsInt": 0, + * "bestPriceFormated": "R$ 20,00", + * "bestPrice": 2000, + * "spotPrice": 2000, + * "installments": 1, + * "installmentsValue": 2000, + * "installmentsInsterestRate": 0, + * "image": "https://lojadobreno.vteximg.com.br/arquivos/ids/155468-292-292/image-601a6099aace48b89d26fc9f22e8e611.jpg?v=637321906602470000", + * "sellerId": "pedrostore", + * "seller": "pedrostore", + * "measures": { + * "cubicweight": 0.4167, + * "height": 5.0000, + * "length": 20.0000, + * "weight": 200.0000, + * "width": 20.0000 + * }, + * "unitMultiplier": 1.0000, + * "rewardValue": 0 + * } + * ] + * } * ``` */ "GET /api/catalog_system/pub/products/variations/:productId": { @@ -1787,98 +1844,98 @@ rewardValue?: number response: number } /** - * This endpoint allows two types of request: - * - * **Type 1:** Creating a new Product as well as a new Category path (including subcategories) and a new Brand by using `CategoryPath` and `BrandName` parameters. - * - * **Type 2:** Creating a new Product given an existing `BrandId` and an existing `CategoryId`. - * - * When creating a product, regardless of the type of request, if there is a need to create a new product with a specific custom product ID, specify the `Id` (integer) in the request body. Otherwise, VTEX will generate the ID automatically. - * - * ## Request body examples - * - * ### Type 1 - * - * Request to create a product, associating it to a new Category and a new Brand by using `CategoryPath` and `BrandName`: - * - * ```json - * { - * "Name": "Black T-Shirt", - * "CategoryPath": "Mens/Clothing/T-Shirts", - * "BrandName": "Nike", - * "RefId": "31011706925", - * "Title": "Black T-Shirt", - * "LinkId": "tshirt-black", - * "Description": "This is a cool Tshirt", - * "ReleaseDate": "2022-01-01T00:00:00", - * "IsVisible": true, - * "IsActive": true, - * "TaxCode": "", - * "MetaTagDescription": "tshirt black", - * "ShowWithoutStock": true, - * "Score": 1 - * } - * ``` - * - * ### Type 2 - * - * Request to create a product, associating it to an existing `CategoryId` and `BrandId`: - * - * ```json - * { - * "Name": "insert product test", - * "DepartmentId": 1, - * "CategoryId": 2, - * "BrandId": 2000000, - * "LinkId": "insert-product-test", - * "RefId": "310117869", - * "IsVisible": true, - * "Description": "texto de descrição", - * "DescriptionShort": "Utilize o CEP 04548-005 para frete grátis", - * "ReleaseDate": "2019-01-01T00:00:00", - * "KeyWords": "teste,teste2", - * "Title": "product de teste", - * "IsActive": true, - * "TaxCode": "", - * "MetaTagDescription": "tag test", - * "SupplierId": 1, - * "ShowWithoutStock": true, - * "AdWordsRemarketingCode": null, - * "LomadeeCampaignCode": null, - * "Score": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 52, - * "Name": "insert product test", - * "DepartmentId": 1, - * "CategoryId": 2, - * "BrandId": 2000000, - * "LinkId": "insert-product-test", - * "RefId": "310117869", - * "IsVisible": true, - * "Description": "texto de descrição", - * "DescriptionShort": "Utilize o CEP 04548-005 para frete grátis", - * "ReleaseDate": "2019-01-01T00:00:00", - * "KeyWords": "teste,teste2", - * "Title": "product de teste", - * "IsActive": true, - * "TaxCode": "", - * "MetaTagDescription": "tag test", - * "SupplierId": 1, - * "ShowWithoutStock": true, - * "AdWordsRemarketingCode": null, - * "LomadeeCampaignCode": null, - * "Score": 1 - * } - * ``` - * - * > 📘 Onboarding guide - * > + * This endpoint allows two types of request: + * + * **Type 1:** Creating a new Product as well as a new Category path (including subcategories) and a new Brand by using `CategoryPath` and `BrandName` parameters. + * + * **Type 2:** Creating a new Product given an existing `BrandId` and an existing `CategoryId`. + * + * When creating a product, regardless of the type of request, if there is a need to create a new product with a specific custom product ID, specify the `Id` (integer) in the request body. Otherwise, VTEX will generate the ID automatically. + * + * ## Request body examples + * + * ### Type 1 + * + * Request to create a product, associating it to a new Category and a new Brand by using `CategoryPath` and `BrandName`: + * + * ```json + * { + * "Name": "Black T-Shirt", + * "CategoryPath": "Mens/Clothing/T-Shirts", + * "BrandName": "Nike", + * "RefId": "31011706925", + * "Title": "Black T-Shirt", + * "LinkId": "tshirt-black", + * "Description": "This is a cool Tshirt", + * "ReleaseDate": "2022-01-01T00:00:00", + * "IsVisible": true, + * "IsActive": true, + * "TaxCode": "", + * "MetaTagDescription": "tshirt black", + * "ShowWithoutStock": true, + * "Score": 1 + * } + * ``` + * + * ### Type 2 + * + * Request to create a product, associating it to an existing `CategoryId` and `BrandId`: + * + * ```json + * { + * "Name": "insert product test", + * "DepartmentId": 1, + * "CategoryId": 2, + * "BrandId": 2000000, + * "LinkId": "insert-product-test", + * "RefId": "310117869", + * "IsVisible": true, + * "Description": "texto de descrição", + * "DescriptionShort": "Utilize o CEP 04548-005 para frete grátis", + * "ReleaseDate": "2019-01-01T00:00:00", + * "KeyWords": "teste,teste2", + * "Title": "product de teste", + * "IsActive": true, + * "TaxCode": "", + * "MetaTagDescription": "tag test", + * "SupplierId": 1, + * "ShowWithoutStock": true, + * "AdWordsRemarketingCode": null, + * "LomadeeCampaignCode": null, + * "Score": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 52, + * "Name": "insert product test", + * "DepartmentId": 1, + * "CategoryId": 2, + * "BrandId": 2000000, + * "LinkId": "insert-product-test", + * "RefId": "310117869", + * "IsVisible": true, + * "Description": "texto de descrição", + * "DescriptionShort": "Utilize o CEP 04548-005 para frete grátis", + * "ReleaseDate": "2019-01-01T00:00:00", + * "KeyWords": "teste,teste2", + * "Title": "product de teste", + * "IsActive": true, + * "TaxCode": "", + * "MetaTagDescription": "tag test", + * "SupplierId": 1, + * "ShowWithoutStock": true, + * "AdWordsRemarketingCode": null, + * "LomadeeCampaignCode": null, + * "Score": 1 + * } + * ``` + * + * > 📘 Onboarding guide + * > * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. */ "POST /api/catalog/pvt/product": { @@ -1924,9 +1981,9 @@ IsVisible?: boolean */ Description?: string /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. * */ DescriptionShort?: string @@ -1935,8 +1992,8 @@ DescriptionShort?: string */ ReleaseDate?: string /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. * */ KeyWords?: string @@ -2017,9 +2074,9 @@ IsVisible?: boolean */ Description?: string /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. * */ DescriptionShort?: string @@ -2028,8 +2085,8 @@ DescriptionShort?: string */ ReleaseDate?: string /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. * */ KeyWords?: string @@ -2074,72 +2131,72 @@ Score?: number } } /** - * Retrieves all specifications of a product by the product's ID. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - * - * ### Response body example - * - * ```json - * [ - * { - * "Value": [ - * "Iron", - * "Plastic" - * ], - * "Id": 30, - * "Name": "Material" - * } - * ] + * Retrieves all specifications of a product by the product's ID. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + * + * ### Response body example + * + * ```json + * [ + * { + * "Value": [ + * "Iron", + * "Plastic" + * ], + * "Id": 30, + * "Name": "Material" + * } + * ] * ``` */ "GET /api/catalog_system/pvt/products/:productId/specification": { response: GetorUpdateProductSpecification[] } /** - * Updates the value of a product specification by the product's ID. The ID or name can be used to identify what product specification will be updated. Specification fields must be previously created in your Catalog. - * - * ### Request body example - * - * ```json - * [ - * { - * "Value": [ - * "Iron", - * "Plastic" - * ], - * "Id": 30, - * "Name": "Material" - * } - * ] + * Updates the value of a product specification by the product's ID. The ID or name can be used to identify what product specification will be updated. Specification fields must be previously created in your Catalog. + * + * ### Request body example + * + * ```json + * [ + * { + * "Value": [ + * "Iron", + * "Plastic" + * ], + * "Id": 30, + * "Name": "Material" + * } + * ] * ``` */ "POST /api/catalog_system/pvt/products/:productId/specification": { body: GetorUpdateProductSpecification[] } /** - * Retrieves information of all specifications of a product by the product's ID. - * - * ### Response body example - * - * ```json - * [ - * { - * "Id": 227, - * "ProductId": 1, - * "FieldId": 33, - * "FieldValueId": 135, - * "Text": "ValueA" - * }, - * { - * "Id": 228, - * "ProductId": 1, - * "FieldId": 34, - * "FieldValueId": 1, - * "Text": "Giant" - * } - * ] + * Retrieves information of all specifications of a product by the product's ID. + * + * ### Response body example + * + * ```json + * [ + * { + * "Id": 227, + * "ProductId": 1, + * "FieldId": 33, + * "FieldValueId": 135, + * "Text": "ValueA" + * }, + * { + * "Id": 228, + * "ProductId": 1, + * "FieldId": 34, + * "FieldValueId": 1, + * "Text": "Giant" + * } + * ] * ``` */ "GET /api/catalog/pvt/product/:productId/specification": { @@ -2167,27 +2224,27 @@ Text?: string }[] } /** - * Associates a previously defined Specification to a Product. - * - * ### Request body example - * - * ```json - * { - * "FieldId": 19, - * "FieldValueId": 1, - * "Text": "test" - * } - * ``` - * - * ### Response body example - * - * ```json - * { - * "Id": 41, - * "FieldId": 19, - * "FieldValueId": 1, - * "Text": "test" - * } + * Associates a previously defined Specification to a Product. + * + * ### Request body example + * + * ```json + * { + * "FieldId": 19, + * "FieldValueId": 1, + * "Text": "test" + * } + * ``` + * + * ### Response body example + * + * ```json + * { + * "Id": 41, + * "FieldId": 19, + * "FieldValueId": 1, + * "Text": "test" + * } * ``` */ "POST /api/catalog/pvt/product/:productId/specification": { @@ -2241,43 +2298,43 @@ Text?: string } /** - * Associates a specification to a product using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. - * - * ## Request body example - * - * ```json - * { - * "FieldName": "Material", - * "GroupName": "Additional Information", - * "RootLevelSpecification": false, - * "FieldValues": [ - * "Cotton", - * "Polyester" - * ] - * } - * ``` - * - * - * ## Response body example - * - * ```json - * [ - * { - * "Id": 53, - * "ProductId": 3, - * "FieldId": 21, - * "FieldValueId": 60, - * "Text": "Cotton" - * }, - * { - * "Id": 54, - * "ProductId": 3, - * "FieldId": 21, - * "FieldValueId": 61, - * "Text": "Polyester" - * } - * ] - * ``` + * Associates a specification to a product using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. + * + * ## Request body example + * + * ```json + * { + * "FieldName": "Material", + * "GroupName": "Additional Information", + * "RootLevelSpecification": false, + * "FieldValues": [ + * "Cotton", + * "Polyester" + * ] + * } + * ``` + * + * + * ## Response body example + * + * ```json + * [ + * { + * "Id": 53, + * "ProductId": 3, + * "FieldId": 21, + * "FieldValueId": 60, + * "Text": "Cotton" + * }, + * { + * "Id": 54, + * "ProductId": 3, + * "FieldId": 21, + * "FieldValueId": 61, + * "Text": "Polyester" + * } + * ] + * ``` * */ "PUT /api/catalog/pvt/product/:productId/specificationvalue": { @@ -2326,26 +2383,26 @@ Text?: string }[] } /** - * Retrieves the IDs of all SKUs in your store. Presents the results with page size and pagination. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - * - * ### Response body example - * - * ```json - * [ - * 1, - * 2, - * 3, - * 4, - * 5, - * 6, - * 7, - * 8, - * 9, - * 10 - * ] + * Retrieves the IDs of all SKUs in your store. Presents the results with page size and pagination. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + * + * ### Response body example + * + * ```json + * [ + * 1, + * 2, + * 3, + * 4, + * 5, + * 6, + * 7, + * 8, + * 9, + * 10 + * ] * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitids": { @@ -2365,209 +2422,209 @@ pagesize: number response: number[] } /** - * Retrieves context of an SKU. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - * - * ## Response body example - * - * ```json - * { - * "Id": 2001773, - * "ProductId": 2001426, - * "NameComplete": "Tabela de Basquete", - * "ComplementName": "", - * "ProductName": "Tabela de Basquete", - * "ProductDescription": "Tabela de Basquete", - * "SkuName": "Tabela de Basquete", - * "ProductRefId": "0987", - * "TaxCode": "", - * "IsActive": true, - * "IsTransported": true, - * "IsInventoried": true, - * "IsGiftCardRecharge": false, - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952-55-55/7508800GG.jpg", - * "DetailUrl": "/tabela-de-basquete/p", - * "CSCIdentification": null, - * "BrandId": "2000018", - * "BrandName": "MARCA ARGOLO TESTE", - * "IsBrandActive": true, - * "Dimension": { - * "cubicweight": 81.6833, - * "height": 65, - * "length": 58, - * "weight": 10000, - * "width": 130 - * }, - * "RealDimension": { - * "realCubicWeight": 274.1375, - * "realHeight": 241, - * "realLength": 65, - * "realWeight": 9800, - * "realWidth": 105 - * }, - * "ManufacturerCode": "", - * "IsKit": false, - * "KitItems": [], - * "Services": [], - * "Categories": [], - * "CategoriesFullPath": [ - * "/1/10/", - * "/1/", - * "/20/" - * ], - * "Attachments": [ - * { - * "Id": 3, - * "Name": "Mensagem", - * "Keys": [ - * "nome;20", - * "foto;40" - * ], - * "Fields": [ - * { - * "FieldName": "nome", - * "MaxCaracters": "20", - * "DomainValues": "Adalberto,Pedro,João" - * }, - * { - * "FieldName": "foto", - * "MaxCaracters": "40", - * "DomainValues": null - * } - * ], - * "IsActive": true, - * "IsRequired": false - * } - * ], - * "Collections": [], - * "SkuSellers": [ - * { - * "SellerId": "1", - * "StockKeepingUnitId": 2001773, - * "SellerStockKeepingUnitId": "2001773", - * "IsActive": true, - * "FreightCommissionPercentage": 0, - * "ProductCommissionPercentage": 0 - * } - * ], - * "SalesChannels": [ - * 1, - * 2, - * 3, - * 10 - * ], - * "Images": [ - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", - * "ImageName": "", - * "FileId": 168952 - * }, - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168953/7508800_1GG.jpg", - * "ImageName": "", - * "FileId": 168953 - * }, - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168954/7508800_2GG.jpg", - * "ImageName": "", - * "FileId": 168954 - * } - * ], - * "Videos": [ - * "www.google.com" - * ], - * "SkuSpecifications": [ - * { - * "FieldId": 102, - * "FieldName": "Cor", - * "FieldValueIds": [ - * 266 - * ], - * "FieldValues": [ - * "Padrão" - * ], - * "IsFilter": false, - * "FieldGroupId": 11, - * "FieldGroupName": "Especificações" - * } - * ], - * "ProductSpecifications": [ - * { - * "FieldId": 7, - * "FieldName": "Faixa Etária", - * "FieldValueIds": [ - * 58, - * 56, - * 55, - * 52 - * ], - * "FieldValues": [ - * "5 a 6 anos", - * "7 a 8 anos", - * "9 a 10 anos", - * "Acima de 10 anos" - * ], - * "IsFilter": true, - * "FieldGroupId": 17, - * "FieldGroupName": "NewGroupName 2" - * }, - * { - * "FieldId": 23, - * "FieldName": "Fabricante", - * "FieldValueIds": [], - * "FieldValues": [ - * "Xalingo" - * ], - * "IsFilter": false, - * "FieldGroupId": 17, - * "FieldGroupName": "NewGroupName 2" - * } - * ], - * "ProductClustersIds": "176,187,192,194,211,217,235,242", - * "PositionsInClusters": { - * "151": 3, - * "152": 0, - * "158": 1 - * }, - * "ProductClusterNames": { - * "151": "asdfghj", - * "152": "George", - * "158": "Coleção halloween" - * }, - * "ProductClusterHighlights": { - * "151": "asdfghj", - * "152": "George" - * }, - * "ProductCategoryIds": "/59/", - * "IsDirectCategoryActive": false, - * "ProductGlobalCategoryId": null, - * "ProductCategories": { - * "59": "Brinquedos" - * }, - * "CommercialConditionId": 1, - * "RewardValue": 100.0, - * "AlternateIds": { - * "Ean": "8781", - * "RefId": "878181" - * }, - * "AlternateIdValues": [ - * "8781", - * "878181" - * ], - * "EstimatedDateArrival": "", - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "InformationSource": "Indexer", - * "ModalType": "", - * "KeyWords": "basquete, tabela", - * "ReleaseDate": "2020-01-06T00:00:00", - * "ProductIsVisible": true, - * "ShowIfNotAvailable": true, - * "IsProductActive": true, - * "ProductFinalScore": 0 - * } + * Retrieves context of an SKU. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + * + * ## Response body example + * + * ```json + * { + * "Id": 2001773, + * "ProductId": 2001426, + * "NameComplete": "Tabela de Basquete", + * "ComplementName": "", + * "ProductName": "Tabela de Basquete", + * "ProductDescription": "Tabela de Basquete", + * "SkuName": "Tabela de Basquete", + * "ProductRefId": "0987", + * "TaxCode": "", + * "IsActive": true, + * "IsTransported": true, + * "IsInventoried": true, + * "IsGiftCardRecharge": false, + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952-55-55/7508800GG.jpg", + * "DetailUrl": "/tabela-de-basquete/p", + * "CSCIdentification": null, + * "BrandId": "2000018", + * "BrandName": "MARCA ARGOLO TESTE", + * "IsBrandActive": true, + * "Dimension": { + * "cubicweight": 81.6833, + * "height": 65, + * "length": 58, + * "weight": 10000, + * "width": 130 + * }, + * "RealDimension": { + * "realCubicWeight": 274.1375, + * "realHeight": 241, + * "realLength": 65, + * "realWeight": 9800, + * "realWidth": 105 + * }, + * "ManufacturerCode": "", + * "IsKit": false, + * "KitItems": [], + * "Services": [], + * "Categories": [], + * "CategoriesFullPath": [ + * "/1/10/", + * "/1/", + * "/20/" + * ], + * "Attachments": [ + * { + * "Id": 3, + * "Name": "Mensagem", + * "Keys": [ + * "nome;20", + * "foto;40" + * ], + * "Fields": [ + * { + * "FieldName": "nome", + * "MaxCaracters": "20", + * "DomainValues": "Adalberto,Pedro,João" + * }, + * { + * "FieldName": "foto", + * "MaxCaracters": "40", + * "DomainValues": null + * } + * ], + * "IsActive": true, + * "IsRequired": false + * } + * ], + * "Collections": [], + * "SkuSellers": [ + * { + * "SellerId": "1", + * "StockKeepingUnitId": 2001773, + * "SellerStockKeepingUnitId": "2001773", + * "IsActive": true, + * "FreightCommissionPercentage": 0, + * "ProductCommissionPercentage": 0 + * } + * ], + * "SalesChannels": [ + * 1, + * 2, + * 3, + * 10 + * ], + * "Images": [ + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", + * "ImageName": "", + * "FileId": 168952 + * }, + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168953/7508800_1GG.jpg", + * "ImageName": "", + * "FileId": 168953 + * }, + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168954/7508800_2GG.jpg", + * "ImageName": "", + * "FileId": 168954 + * } + * ], + * "Videos": [ + * "www.google.com" + * ], + * "SkuSpecifications": [ + * { + * "FieldId": 102, + * "FieldName": "Cor", + * "FieldValueIds": [ + * 266 + * ], + * "FieldValues": [ + * "Padrão" + * ], + * "IsFilter": false, + * "FieldGroupId": 11, + * "FieldGroupName": "Especificações" + * } + * ], + * "ProductSpecifications": [ + * { + * "FieldId": 7, + * "FieldName": "Faixa Etária", + * "FieldValueIds": [ + * 58, + * 56, + * 55, + * 52 + * ], + * "FieldValues": [ + * "5 a 6 anos", + * "7 a 8 anos", + * "9 a 10 anos", + * "Acima de 10 anos" + * ], + * "IsFilter": true, + * "FieldGroupId": 17, + * "FieldGroupName": "NewGroupName 2" + * }, + * { + * "FieldId": 23, + * "FieldName": "Fabricante", + * "FieldValueIds": [], + * "FieldValues": [ + * "Xalingo" + * ], + * "IsFilter": false, + * "FieldGroupId": 17, + * "FieldGroupName": "NewGroupName 2" + * } + * ], + * "ProductClustersIds": "176,187,192,194,211,217,235,242", + * "PositionsInClusters": { + * "151": 3, + * "152": 0, + * "158": 1 + * }, + * "ProductClusterNames": { + * "151": "asdfghj", + * "152": "George", + * "158": "Coleção halloween" + * }, + * "ProductClusterHighlights": { + * "151": "asdfghj", + * "152": "George" + * }, + * "ProductCategoryIds": "/59/", + * "IsDirectCategoryActive": false, + * "ProductGlobalCategoryId": null, + * "ProductCategories": { + * "59": "Brinquedos" + * }, + * "CommercialConditionId": 1, + * "RewardValue": 100.0, + * "AlternateIds": { + * "Ean": "8781", + * "RefId": "878181" + * }, + * "AlternateIdValues": [ + * "8781", + * "878181" + * ], + * "EstimatedDateArrival": "", + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "InformationSource": "Indexer", + * "ModalType": "", + * "KeyWords": "basquete, tabela", + * "ReleaseDate": "2020-01-06T00:00:00", + * "ProductIsVisible": true, + * "ShowIfNotAvailable": true, + * "IsProductActive": true, + * "ProductFinalScore": 0 + * } * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId": { @@ -2580,38 +2637,38 @@ sc?: number response: GetSKUandContext } /** - * Retrieves information about a specific SKU by its `RefId`. - * - * ### Response body example - * - * ```json - * { - * "Id": 1, - * "ProductId": 1, - * "IsActive": true, - * "Name": "Royal Canin Feline Urinary 500g", - * "RefId": "0001", - * "PackagedHeight": 6.0000, - * "PackagedLength": 24.0000, - * "PackagedWidth": 14.0000, - * "PackagedWeightKg": 550.0000, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 1.0000, - * "IsKit": false, - * "CreationDate": "2020-03-12T15:42:00", - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 1.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": null - * } + * Retrieves information about a specific SKU by its `RefId`. + * + * ### Response body example + * + * ```json + * { + * "Id": 1, + * "ProductId": 1, + * "IsActive": true, + * "Name": "Royal Canin Feline Urinary 500g", + * "RefId": "0001", + * "PackagedHeight": 6.0000, + * "PackagedLength": 24.0000, + * "PackagedWidth": 14.0000, + * "PackagedWeightKg": 550.0000, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 1.0000, + * "IsKit": false, + * "CreationDate": "2020-03-12T15:42:00", + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 1.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": null + * } * ``` */ "GET /api/catalog/pvt/stockkeepingunit": { @@ -2729,111 +2786,111 @@ Videos?: (null | string) } } /** - * - * - * Creates a new SKU. - * - * If there is a need to create a new SKU with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. - * - * ### Request body example (custom ID) - * - * ```json - * { - * "Id": 1, - * "ProductId": 310117069, - * "IsActive": false, - * "ActivateIfPossible": true, - * "Name": "sku test", - * "RefId": "125478", - * "Ean": "8949461894984", - * "PackagedHeight": 10, - * "PackagedLength": 10, - * "PackagedWidth": 10, - * "PackagedWeightKg": 10, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 0.1667, - * "IsKit": false, - * "CreationDate": null, - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "123", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ "https://www.youtube.com/" ] - * } - * ``` - * - * ### Request body example (automatically generated ID) - * - * ```json - * { - * "ProductId": 310117069, - * "IsActive": false, - * "ActivateIfPossible": true, - * "Name": "sku test", - * "RefId": "125478", - * "Ean": "8949461894984", - * "PackagedHeight": 10, - * "PackagedLength": 10, - * "PackagedWidth": 10, - * "PackagedWeightKg": 10, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 0.1667, - * "IsKit": false, - * "CreationDate": null, - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "123", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ "https://www.youtube.com/" ] - * } - * ``` - * - * ### Response body example - * - * ```json - * { - * "Id":1, - * "ProductId": 310117069, - * "IsActive": false, - * "ActivateIfPossible": true, - * "Name": "sku test", - * "RefId": "125478", - * "Ean": "8949461894984", - * "PackagedHeight": 10, - * "PackagedLength": 10, - * "PackagedWidth": 10, - * "PackagedWeightKg": 10, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 0.1667, - * "IsKit": false, - * "CreationDate": null, - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "123", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ "https://www.youtube.com/" ] - * } + * + * + * Creates a new SKU. + * + * If there is a need to create a new SKU with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. + * + * ### Request body example (custom ID) + * + * ```json + * { + * "Id": 1, + * "ProductId": 310117069, + * "IsActive": false, + * "ActivateIfPossible": true, + * "Name": "sku test", + * "RefId": "125478", + * "Ean": "8949461894984", + * "PackagedHeight": 10, + * "PackagedLength": 10, + * "PackagedWidth": 10, + * "PackagedWeightKg": 10, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 0.1667, + * "IsKit": false, + * "CreationDate": null, + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "123", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ "https://www.youtube.com/" ] + * } + * ``` + * + * ### Request body example (automatically generated ID) + * + * ```json + * { + * "ProductId": 310117069, + * "IsActive": false, + * "ActivateIfPossible": true, + * "Name": "sku test", + * "RefId": "125478", + * "Ean": "8949461894984", + * "PackagedHeight": 10, + * "PackagedLength": 10, + * "PackagedWidth": 10, + * "PackagedWeightKg": 10, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 0.1667, + * "IsKit": false, + * "CreationDate": null, + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "123", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ "https://www.youtube.com/" ] + * } + * ``` + * + * ### Response body example + * + * ```json + * { + * "Id":1, + * "ProductId": 310117069, + * "IsActive": false, + * "ActivateIfPossible": true, + * "Name": "sku test", + * "RefId": "125478", + * "Ean": "8949461894984", + * "PackagedHeight": 10, + * "PackagedLength": 10, + * "PackagedWidth": 10, + * "PackagedWeightKg": 10, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 0.1667, + * "IsKit": false, + * "CreationDate": null, + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "123", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ "https://www.youtube.com/" ] + * } * ``` */ "POST /api/catalog/pvt/stockkeepingunit": { @@ -3059,12 +3116,12 @@ Videos?: string[] } } /** - * Retrieves an SKU ID by the SKU's Reference ID. - * - * ### Response body example - * - * ```json - * "310118450" + * Retrieves an SKU ID by the SKU's Reference ID. + * + * ### Response body example + * + * ```json + * "310118450" * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId": { @@ -3074,205 +3131,205 @@ Videos?: string[] response: string } /** - * Retrieves an SKU by its Alternate ID. - * - * ### Response body example - * - * ```json - * { - * "Id": 310118450, - * "ProductId": 2, - * "NameComplete": "Caixa de Areia Azul Petmate sku test", - * "ComplementName": "", - * "ProductName": "Caixa de Areia Azul Petmate", - * "ProductDescription": "", - * "ProductRefId": "", - * "TaxCode": "", - * "SkuName": "sku test", - * "IsActive": true, - * "IsTransported": true, - * "IsInventoried": true, - * "IsGiftCardRecharge": false, - * "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451-55-55/caixa-areia-azul-petmate.jpg?v=637139451191670000", - * "DetailUrl": "/caixa-de-areia-azul-petmate/p", - * "CSCIdentification": null, - * "BrandId": "2000005", - * "BrandName": "Petmate", - * "IsBrandActive": true, - * "Dimension": { - * "cubicweight": 0.2083, - * "height": 10.0000, - * "length": 10.0000, - * "weight": 10.0000, - * "width": 10.0000 - * }, - * "RealDimension": { - * "realCubicWeight": 0.000, - * "realHeight": 0.0, - * "realLength": 0.0, - * "realWeight": 0.0, - * "realWidth": 0.0 - * }, - * "ManufacturerCode": "123", - * "IsKit": false, - * "KitItems": [], - * "Services": [], - * "Categories": [], - * "CategoriesFullPath": [ - * "/3/15/", - * "/3/", - * "/1/" - * ], - * "Attachments": [], - * "Collections": [], - * "SkuSellers": [ - * { - * "SellerId": "1", - * "StockKeepingUnitId": 310118450, - * "SellerStockKeepingUnitId": "310118450", - * "IsActive": true, - * "FreightCommissionPercentage": 0.0, - * "ProductCommissionPercentage": 0.0 - * } - * ], - * "SalesChannels": [ - * 1, - * 3 - * ], - * "Images": [ - * { - * "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451/caixa-areia-azul-petmate.jpg?v=637139451191670000", - * "ImageName": null, - * "FileId": 155451 - * } - * ], - * "Videos": [], - * "SkuSpecifications": [], - * "ProductSpecifications": [], - * "ProductClustersIds": "151,158", - * "PositionsInClusters": { - * "151": 1, - * "158": 2 - * }, - * "ProductClusterNames": { - * "151": "asdfghj", - * "158": "Coleção halloween" - * }, - * "ProductClusterHighlights": { - * "151": "asdfghj" - * }, - * "ProductCategoryIds": "/3/15/", - * "IsDirectCategoryActive": true, - * "ProductGlobalCategoryId": 5000, - * "ProductCategories": { - * "15": "Caixa de Areia", - * "3": "Higiene", - * "1": "Alimentação" - * }, - * "CommercialConditionId": 1, - * "RewardValue": 0.0, - * "AlternateIds": { - * "RefId": "1" - * }, - * "AlternateIdValues": [ - * "1" - * ], - * "EstimatedDateArrival": null, - * "MeasurementUnit": "un", - * "UnitMultiplier": 1.0000, - * "InformationSource": null, - * "ModalType": null, - * "KeyWords": "", - * "ReleaseDate": "2020-01-06T00:00:00Z", - * "ProductIsVisible": true, - * "ShowIfNotAvailable": true, - * "IsProductActive": true, - * "ProductFinalScore": 0 - * } + * Retrieves an SKU by its Alternate ID. + * + * ### Response body example + * + * ```json + * { + * "Id": 310118450, + * "ProductId": 2, + * "NameComplete": "Caixa de Areia Azul Petmate sku test", + * "ComplementName": "", + * "ProductName": "Caixa de Areia Azul Petmate", + * "ProductDescription": "", + * "ProductRefId": "", + * "TaxCode": "", + * "SkuName": "sku test", + * "IsActive": true, + * "IsTransported": true, + * "IsInventoried": true, + * "IsGiftCardRecharge": false, + * "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451-55-55/caixa-areia-azul-petmate.jpg?v=637139451191670000", + * "DetailUrl": "/caixa-de-areia-azul-petmate/p", + * "CSCIdentification": null, + * "BrandId": "2000005", + * "BrandName": "Petmate", + * "IsBrandActive": true, + * "Dimension": { + * "cubicweight": 0.2083, + * "height": 10.0000, + * "length": 10.0000, + * "weight": 10.0000, + * "width": 10.0000 + * }, + * "RealDimension": { + * "realCubicWeight": 0.000, + * "realHeight": 0.0, + * "realLength": 0.0, + * "realWeight": 0.0, + * "realWidth": 0.0 + * }, + * "ManufacturerCode": "123", + * "IsKit": false, + * "KitItems": [], + * "Services": [], + * "Categories": [], + * "CategoriesFullPath": [ + * "/3/15/", + * "/3/", + * "/1/" + * ], + * "Attachments": [], + * "Collections": [], + * "SkuSellers": [ + * { + * "SellerId": "1", + * "StockKeepingUnitId": 310118450, + * "SellerStockKeepingUnitId": "310118450", + * "IsActive": true, + * "FreightCommissionPercentage": 0.0, + * "ProductCommissionPercentage": 0.0 + * } + * ], + * "SalesChannels": [ + * 1, + * 3 + * ], + * "Images": [ + * { + * "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451/caixa-areia-azul-petmate.jpg?v=637139451191670000", + * "ImageName": null, + * "FileId": 155451 + * } + * ], + * "Videos": [], + * "SkuSpecifications": [], + * "ProductSpecifications": [], + * "ProductClustersIds": "151,158", + * "PositionsInClusters": { + * "151": 1, + * "158": 2 + * }, + * "ProductClusterNames": { + * "151": "asdfghj", + * "158": "Coleção halloween" + * }, + * "ProductClusterHighlights": { + * "151": "asdfghj" + * }, + * "ProductCategoryIds": "/3/15/", + * "IsDirectCategoryActive": true, + * "ProductGlobalCategoryId": 5000, + * "ProductCategories": { + * "15": "Caixa de Areia", + * "3": "Higiene", + * "1": "Alimentação" + * }, + * "CommercialConditionId": 1, + * "RewardValue": 0.0, + * "AlternateIds": { + * "RefId": "1" + * }, + * "AlternateIdValues": [ + * "1" + * ], + * "EstimatedDateArrival": null, + * "MeasurementUnit": "un", + * "UnitMultiplier": 1.0000, + * "InformationSource": null, + * "ModalType": null, + * "KeyWords": "", + * "ReleaseDate": "2020-01-06T00:00:00Z", + * "ProductIsVisible": true, + * "ShowIfNotAvailable": true, + * "IsProductActive": true, + * "ProductFinalScore": 0 + * } * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitbyalternateId/:alternateId": { response: GetSKUAltID } /** - * Retrieves a list with the SKUs related to a product by the product's ID. - * - * ### Response body example - * - * ```json - * [ - * { - * "IsPersisted": true, - * "IsRemoved": false, - * "Id": 2000035, - * "ProductId": 2000024, - * "IsActive": true, - * "Name": "33 - Preto", - * "Height": 8, - * "RealHeight": null, - * "Width": 15, - * "RealWidth": null, - * "Length": 8, - * "RealLength": null, - * "WeightKg": 340, - * "RealWeightKg": null, - * "ModalId": 1, - * "RefId": "", - * "CubicWeight": 0.2, - * "IsKit": false, - * "IsDynamicKit": null, - * "InternalNote": null, - * "DateUpdated": "2015-11-06T19:10:00", - * "RewardValue": 0.01, - * "CommercialConditionId": 1, - * "EstimatedDateArrival": "", - * "FlagKitItensSellApart": false, - * "ManufacturerCode": "", - * "ReferenceStockKeepingUnitId": null, - * "Position": 0, - * "EditionSkuId": null, - * "ApprovedAdminId": 123, - * "EditionAdminId": 123, - * "ActivateIfPossible": true, - * "SupplierCode": null, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "IsInventoried": null, - * "IsTransported": null, - * "IsGiftCardRecharge": null, - * "ModalType": "" - * } - * ] + * Retrieves a list with the SKUs related to a product by the product's ID. + * + * ### Response body example + * + * ```json + * [ + * { + * "IsPersisted": true, + * "IsRemoved": false, + * "Id": 2000035, + * "ProductId": 2000024, + * "IsActive": true, + * "Name": "33 - Preto", + * "Height": 8, + * "RealHeight": null, + * "Width": 15, + * "RealWidth": null, + * "Length": 8, + * "RealLength": null, + * "WeightKg": 340, + * "RealWeightKg": null, + * "ModalId": 1, + * "RefId": "", + * "CubicWeight": 0.2, + * "IsKit": false, + * "IsDynamicKit": null, + * "InternalNote": null, + * "DateUpdated": "2015-11-06T19:10:00", + * "RewardValue": 0.01, + * "CommercialConditionId": 1, + * "EstimatedDateArrival": "", + * "FlagKitItensSellApart": false, + * "ManufacturerCode": "", + * "ReferenceStockKeepingUnitId": null, + * "Position": 0, + * "EditionSkuId": null, + * "ApprovedAdminId": 123, + * "EditionAdminId": 123, + * "ActivateIfPossible": true, + * "SupplierCode": null, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "IsInventoried": null, + * "IsTransported": null, + * "IsGiftCardRecharge": null, + * "ModalType": "" + * } + * ] * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId": { response: SkulistbyProductId[] } /** - * Receives a list of Reference IDs and returns a list with the corresponding SKU IDs. - * - * >⚠️ The list of Reference IDs in the request body cannot have repeated Reference IDs, or the API will return an error 500. - * - * ## Request body example - * - * ```json - * [ - * "123", - * "D25133K-B2", - * "14-556", - * "DCF880L2-BR" - * ] - * ``` - * - * ### Response body example - * - * ```json - * { - * "123": "435", - * "D25133K-B2": "4351", - * "14-556": "3155", - * "DCF880L2-BR": "4500" - * } + * Receives a list of Reference IDs and returns a list with the corresponding SKU IDs. + * + * >⚠️ The list of Reference IDs in the request body cannot have repeated Reference IDs, or the API will return an error 500. + * + * ## Request body example + * + * ```json + * [ + * "123", + * "D25133K-B2", + * "14-556", + * "DCF880L2-BR" + * ] + * ``` + * + * ### Response body example + * + * ```json + * { + * "123": "435", + * "D25133K-B2": "4351", + * "14-556": "3155", + * "DCF880L2-BR": "4500" + * } * ``` */ "POST /api/catalog_system/pub/sku/stockkeepingunitidsbyrefids": { @@ -3291,44 +3348,44 @@ response: { } } /** - * Retrieves a specific SKU by its ID. - * - * ### Response body example - * - * ```json - * { - * "Id": 1, - * "ProductId": 1, - * "IsActive": true, - * "ActivateIfPossible": true, - * "Name": "Ração Royal Canin Feline Urinary 500g", - * "RefId": "0001", - * "PackagedHeight": 6.5000, - * "PackagedLength": 24.0000, - * "PackagedWidth": 14.0000, - * "PackagedWeightKg": 550.0000, - * "Height": 2.2000, - * "Length": 4.4000, - * "Width": 3.3000, - * "WeightKg": 1.1000, - * "CubicWeight": 0.4550, - * "IsKit": false, - * "CreationDate": "2021-06-08T15:25:00", - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 300.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ - * "www.google.com" - * ] - * } - * ``` - * > 📘 Onboarding guide - * > + * Retrieves a specific SKU by its ID. + * + * ### Response body example + * + * ```json + * { + * "Id": 1, + * "ProductId": 1, + * "IsActive": true, + * "ActivateIfPossible": true, + * "Name": "Ração Royal Canin Feline Urinary 500g", + * "RefId": "0001", + * "PackagedHeight": 6.5000, + * "PackagedLength": 24.0000, + * "PackagedWidth": 14.0000, + * "PackagedWeightKg": 550.0000, + * "Height": 2.2000, + * "Length": 4.4000, + * "Width": 3.3000, + * "WeightKg": 1.1000, + * "CubicWeight": 0.4550, + * "IsKit": false, + * "CreationDate": "2021-06-08T15:25:00", + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 300.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ + * "www.google.com" + * ] + * } + * ``` + * > 📘 Onboarding guide + * > * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. */ "GET /api/catalog/pvt/stockkeepingunit/:skuId": { @@ -3440,72 +3497,72 @@ Videos?: string[] } } /** - * Updates an existing SKU. - * - * ### Request body example - * - * ```json - * { - * "Id": 310118448, - * "ProductId": 310117069, - * "IsActive": true, - * "ActivateIfPossible": true, - * "Name": "sku test", - * "RefId": "125478", - * "PackagedHeight": 10, - * "PackagedLength": 10, - * "PackagedWidth": 10, - * "PackagedWeightKg": 10, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 0.1667, - * "IsKit": false, - * "CreationDate": null, - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "123", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ "https://www.youtube.com/" ] - * } - * ``` - * - * ### Response body example - * - * ```json - * { - * "Id": 310118449, - * "ProductId": 1, - * "IsActive": true, - * "ActivateIfPossible": true, - * "Name": "sku test", - * "RefId": "1254789", - * "PackagedHeight": 10.0, - * "PackagedLength": 10.0, - * "PackagedWidth": 10.0, - * "PackagedWeightKg": 10.0, - * "Height": null, - * "Length": null, - * "Width": null, - * "WeightKg": null, - * "CubicWeight": 0.1667, - * "IsKit": false, - * "CreationDate": "2020-04-22T12:12:47.5219561", - * "RewardValue": null, - * "EstimatedDateArrival": null, - * "ManufacturerCode": "123", - * "CommercialConditionId": 1, - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "ModalType": null, - * "KitItensSellApart": false, - * "Videos": [ "https://www.youtube.com/" ] - * } + * Updates an existing SKU. + * + * ### Request body example + * + * ```json + * { + * "Id": 310118448, + * "ProductId": 310117069, + * "IsActive": true, + * "ActivateIfPossible": true, + * "Name": "sku test", + * "RefId": "125478", + * "PackagedHeight": 10, + * "PackagedLength": 10, + * "PackagedWidth": 10, + * "PackagedWeightKg": 10, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 0.1667, + * "IsKit": false, + * "CreationDate": null, + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "123", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ "https://www.youtube.com/" ] + * } + * ``` + * + * ### Response body example + * + * ```json + * { + * "Id": 310118449, + * "ProductId": 1, + * "IsActive": true, + * "ActivateIfPossible": true, + * "Name": "sku test", + * "RefId": "1254789", + * "PackagedHeight": 10.0, + * "PackagedLength": 10.0, + * "PackagedWidth": 10.0, + * "PackagedWeightKg": 10.0, + * "Height": null, + * "Length": null, + * "Width": null, + * "WeightKg": null, + * "CubicWeight": 0.1667, + * "IsKit": false, + * "CreationDate": "2020-04-22T12:12:47.5219561", + * "RewardValue": null, + * "EstimatedDateArrival": null, + * "ManufacturerCode": "123", + * "CommercialConditionId": 1, + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "ModalType": null, + * "KitItensSellApart": false, + * "Videos": [ "https://www.youtube.com/" ] + * } * ``` */ "PUT /api/catalog/pvt/stockkeepingunit/:skuId": { @@ -3719,56 +3776,56 @@ Videos?: string[] } } /** - * Retrieves an existing SKU Complement by its SKU ID. - * - * ## Response body example - * - * ```json - * [ - * { - * "Id": 61, - * "SkuId": 7, - * "ParentSkuId": 1, - * "ComplementTypeId": 1 - * } - * ] + * Retrieves an existing SKU Complement by its SKU ID. + * + * ## Response body example + * + * ```json + * [ + * { + * "Id": 61, + * "SkuId": 7, + * "ParentSkuId": 1, + * "ComplementTypeId": 1 + * } + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/complement": { response: SkuComplement } /** - * Retrieves all the existing SKU Complements with the same Complement Type ID of a specific SKU. - * - * ## Response body example - * - * ```json - * [ - * { - * "Id": 61, - * "SkuId": 7, - * "ParentSkuId": 1, - * "ComplementTypeId": 1 - * } - * ] + * Retrieves all the existing SKU Complements with the same Complement Type ID of a specific SKU. + * + * ## Response body example + * + * ```json + * [ + * { + * "Id": 61, + * "SkuId": 7, + * "ParentSkuId": 1, + * "ComplementTypeId": 1 + * } + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/complement/:complementTypeId": { response: SkuComplement } /** - * Retrieves all the existing SKU complements with the same complement type ID of a specific SKU. - * - * ## Response body example - * - * ```json - * { - * "ParentSkuId": 1, - * "ComplementSkuIds": [ - * 7 - * ], - * "Type": "1" - * } + * Retrieves all the existing SKU complements with the same complement type ID of a specific SKU. + * + * ## Response body example + * + * ```json + * { + * "ParentSkuId": 1, + * "ComplementSkuIds": [ + * 7 + * ], + * "Type": "1" + * } * ``` */ "GET /api/catalog_system/pvt/sku/complements/:parentSkuId/:type": { @@ -3788,27 +3845,27 @@ Type: string } } /** - * Creates a new SKU Complement on a Parent SKU. - * - * ## Request body example - * - * ```json - * { - * "SkuId": 2, - * "ParentSkuId": 1, - * "ComplementTypeId": 2 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 62, - * "SkuId": 2, - * "ParentSkuId": 1, - * "ComplementTypeId": 2 - * } + * Creates a new SKU Complement on a Parent SKU. + * + * ## Request body example + * + * ```json + * { + * "SkuId": 2, + * "ParentSkuId": 1, + * "ComplementTypeId": 2 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 62, + * "SkuId": 2, + * "ParentSkuId": 1, + * "ComplementTypeId": 2 + * } * ``` */ "POST /api/catalog/pvt/skucomplement": { @@ -3829,17 +3886,17 @@ ComplementTypeId: number response: SkuComplement } /** - * Retrieves an existing SKU Complement by its SKU Complement ID. - * - * ## Response body example - * - * ```json - * { - * "Id": 62, - * "SkuId": 2, - * "ParentSkuId": 1, - * "ComplementTypeId": 2 - * } + * Retrieves an existing SKU Complement by its SKU Complement ID. + * + * ## Response body example + * + * ```json + * { + * "Id": 62, + * "SkuId": 2, + * "ParentSkuId": 1, + * "ComplementTypeId": 2 + * } * ``` */ "GET /api/catalog/pvt/skucomplement/:skuComplementId": { @@ -3852,176 +3909,176 @@ response: SkuComplement } /** - * Retrieves an SKU by its EAN ID. - * ## Response body example - * - * ```json - * { - * "Id": 2001773, - * "ProductId": 2001426, - * "NameComplete": "Tabela de Basquete", - * "ProductName": "Tabela de Basquete", - * "ProductDescription": "Tabela de Basquete", - * "SkuName": "Tabela de Basquete", - * "IsActive": true, - * "IsTransported": true, - * "IsInventoried": true, - * "IsGiftCardRecharge": false, - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952-55-55/7508800GG.jpg", - * "DetailUrl": "/tabela-de-basquete/p", - * "CSCIdentification": null, - * "BrandId": "2000018", - * "BrandName": "MARCA ARGOLO TESTE", - * "Dimension": { - * "cubicweight": 81.6833, - * "height": 65, - * "length": 58, - * "weight": 10000, - * "width": 130 - * }, - * "RealDimension": { - * "realCubicWeight": 274.1375, - * "realHeight": 241, - * "realLength": 65, - * "realWeight": 9800, - * "realWidth": 105 - * }, - * "ManufacturerCode": "", - * "IsKit": false, - * "KitItems": [], - * "Services": [], - * "Categories": [], - * "Attachments": [ - * { - * "Id": 3, - * "Name": "Mensagem", - * "Keys": [ - * "nome;20", - * "foto;40" - * ], - * "Fields": [ - * { - * "FieldName": "nome", - * "MaxCaracters": "20", - * "DomainValues": "Adalberto,Pedro,João" - * }, - * { - * "FieldName": "foto", - * "MaxCaracters": "40", - * "DomainValues": null - * } - * ], - * "IsActive": true, - * "IsRequired": false - * } - * ], - * "Collections": [], - * "SkuSellers": [ - * { - * "SellerId": "1", - * "StockKeepingUnitId": 2001773, - * "SellerStockKeepingUnitId": "2001773", - * "IsActive": true, - * "FreightCommissionPercentage": 0, - * "ProductCommissionPercentage": 0 - * } - * ], - * "SalesChannels": [ - * 1, - * 2, - * 3, - * 10 - * ], - * "Images": [ - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", - * "ImageName": "", - * "FileId": 168952 - * }, - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168953/7508800_1GG.jpg", - * "ImageName": "", - * "FileId": 168953 - * }, - * { - * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168954/7508800_2GG.jpg", - * "ImageName": "", - * "FileId": 168954 - * } - * ], - * "SkuSpecifications": [ - * { - * "FieldId": 102, - * "FieldName": "Cor", - * "FieldValueIds": [ - * 266 - * ], - * "FieldValues": [ - * "Padrão" - * ] - * } - * ], - * "ProductSpecifications": [ - * { - * "FieldId": 7, - * "FieldName": "Faixa Etária", - * "FieldValueIds": [ - * 58, - * 56, - * 55, - * 52 - * ], - * "FieldValues": [ - * "5 a 6 anos", - * "7 a 8 anos", - * "9 a 10 anos", - * "Acima de 10 anos" - * ] - * }, - * { - * "FieldId": 23, - * "FieldName": "Fabricante", - * "FieldValueIds": [], - * "FieldValues": [ - * "Xalingo" - * ] - * } - * ], - * "ProductClustersIds": "176,187,192,194,211,217,235,242", - * "ProductCategoryIds": "/59/", - * "ProductGlobalCategoryId": null, - * "ProductCategories": { - * "59": "Brinquedos" - * }, - * "CommercialConditionId": 1, - * "RewardValue": 100.0, - * "AlternateIds": { - * "Ean": "8781", - * "RefId": "878181" - * }, - * "AlternateIdValues": [ - * "8781", - * "878181" - * ], - * "EstimatedDateArrival": "", - * "MeasurementUnit": "un", - * "UnitMultiplier": 2.0000, - * "InformationSource": null, - * "ModalType": "" - * } + * Retrieves an SKU by its EAN ID. + * ## Response body example + * + * ```json + * { + * "Id": 2001773, + * "ProductId": 2001426, + * "NameComplete": "Tabela de Basquete", + * "ProductName": "Tabela de Basquete", + * "ProductDescription": "Tabela de Basquete", + * "SkuName": "Tabela de Basquete", + * "IsActive": true, + * "IsTransported": true, + * "IsInventoried": true, + * "IsGiftCardRecharge": false, + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952-55-55/7508800GG.jpg", + * "DetailUrl": "/tabela-de-basquete/p", + * "CSCIdentification": null, + * "BrandId": "2000018", + * "BrandName": "MARCA ARGOLO TESTE", + * "Dimension": { + * "cubicweight": 81.6833, + * "height": 65, + * "length": 58, + * "weight": 10000, + * "width": 130 + * }, + * "RealDimension": { + * "realCubicWeight": 274.1375, + * "realHeight": 241, + * "realLength": 65, + * "realWeight": 9800, + * "realWidth": 105 + * }, + * "ManufacturerCode": "", + * "IsKit": false, + * "KitItems": [], + * "Services": [], + * "Categories": [], + * "Attachments": [ + * { + * "Id": 3, + * "Name": "Mensagem", + * "Keys": [ + * "nome;20", + * "foto;40" + * ], + * "Fields": [ + * { + * "FieldName": "nome", + * "MaxCaracters": "20", + * "DomainValues": "Adalberto,Pedro,João" + * }, + * { + * "FieldName": "foto", + * "MaxCaracters": "40", + * "DomainValues": null + * } + * ], + * "IsActive": true, + * "IsRequired": false + * } + * ], + * "Collections": [], + * "SkuSellers": [ + * { + * "SellerId": "1", + * "StockKeepingUnitId": 2001773, + * "SellerStockKeepingUnitId": "2001773", + * "IsActive": true, + * "FreightCommissionPercentage": 0, + * "ProductCommissionPercentage": 0 + * } + * ], + * "SalesChannels": [ + * 1, + * 2, + * 3, + * 10 + * ], + * "Images": [ + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", + * "ImageName": "", + * "FileId": 168952 + * }, + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168953/7508800_1GG.jpg", + * "ImageName": "", + * "FileId": 168953 + * }, + * { + * "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168954/7508800_2GG.jpg", + * "ImageName": "", + * "FileId": 168954 + * } + * ], + * "SkuSpecifications": [ + * { + * "FieldId": 102, + * "FieldName": "Cor", + * "FieldValueIds": [ + * 266 + * ], + * "FieldValues": [ + * "Padrão" + * ] + * } + * ], + * "ProductSpecifications": [ + * { + * "FieldId": 7, + * "FieldName": "Faixa Etária", + * "FieldValueIds": [ + * 58, + * 56, + * 55, + * 52 + * ], + * "FieldValues": [ + * "5 a 6 anos", + * "7 a 8 anos", + * "9 a 10 anos", + * "Acima de 10 anos" + * ] + * }, + * { + * "FieldId": 23, + * "FieldName": "Fabricante", + * "FieldValueIds": [], + * "FieldValues": [ + * "Xalingo" + * ] + * } + * ], + * "ProductClustersIds": "176,187,192,194,211,217,235,242", + * "ProductCategoryIds": "/59/", + * "ProductGlobalCategoryId": null, + * "ProductCategories": { + * "59": "Brinquedos" + * }, + * "CommercialConditionId": 1, + * "RewardValue": 100.0, + * "AlternateIds": { + * "Ean": "8781", + * "RefId": "878181" + * }, + * "AlternateIdValues": [ + * "8781", + * "878181" + * ], + * "EstimatedDateArrival": "", + * "MeasurementUnit": "un", + * "UnitMultiplier": 2.0000, + * "InformationSource": null, + * "ModalType": "" + * } * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitbyean/:ean": { response: GetSKUAltID } /** - * Retrieves the EAN of the SKU. - * ## Response body example - * - * ```json - * [ - * "1234567890123" - * ] + * Retrieves the EAN of the SKU. + * ## Response body example + * + * ```json + * [ + * "1234567890123" + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/ean": { @@ -4049,24 +4106,24 @@ response: string[] } /** - * Associates an existing SKU to an existing Attachment. - * ## Request body example - * - * ```json - * { - * "AttachmentId": 1, - * "SkuId": 7 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 31, - * "AttachmentId": 1, - * "SkuId": 7 - * } + * Associates an existing SKU to an existing Attachment. + * ## Request body example + * + * ```json + * { + * "AttachmentId": 1, + * "SkuId": 7 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 31, + * "AttachmentId": 1, + * "SkuId": 7 + * } * ``` */ "POST /api/catalog/pvt/skuattachment": { @@ -4114,17 +4171,17 @@ attachmentId?: number } } /** - * Retrieves existing SKU Attachments by SKU ID. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 97, - * "AttachmentId": 1, - * "SkuId": 1 - * } - * ] + * Retrieves existing SKU Attachments by SKU ID. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 97, + * "AttachmentId": 1, + * "SkuId": 1 + * } + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/attachment": { @@ -4154,16 +4211,17 @@ SkuId?: number } /** * Associates attachments to an SKU based on a given SKU ID and attachment names. - * This request removes existing SKU attachment associations and recreates the associations with the attachments being sent. - * ## Request body example - * - * ```json - * { - * "SkuId": 1, - * "AttachmentNames": [ - * "T-Shirt Customization" - * ] - * } + * +This request removes existing SKU attachment associations and recreates the associations with the attachments being sent. + * ## Request body example + * + * ```json + * { + * "SkuId": 1, + * "AttachmentNames": [ + * "T-Shirt Customization" + * ] + * } * ``` */ "POST /api/catalog_system/pvt/sku/associateattachments": { @@ -4179,36 +4237,36 @@ AttachmentNames: string[] } } /** - * Gets general information about all Files in the SKU. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 549, - * "ArchiveId": 155485, - * "SkuId": 310118490, - * "Name": "chimera-cat-quimera-5", - * "IsMain": true, - * "Label": "miau" - * }, - * { - * "Id": 550, - * "ArchiveId": 155486, - * "SkuId": 310118490, - * "Name": "Gato-siames", - * "IsMain": false, - * "Label": "Gato siames" - * }, - * { - * "Id": 555, - * "ArchiveId": 155491, - * "SkuId": 310118490, - * "Name": "Cat-Sleeping-Pics", - * "IsMain": false, - * "Label": null - * } - * ] + * Gets general information about all Files in the SKU. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 549, + * "ArchiveId": 155485, + * "SkuId": 310118490, + * "Name": "chimera-cat-quimera-5", + * "IsMain": true, + * "Label": "miau" + * }, + * { + * "Id": 550, + * "ArchiveId": 155486, + * "SkuId": 310118490, + * "Name": "Gato-siames", + * "IsMain": false, + * "Label": "Gato siames" + * }, + * { + * "Id": 555, + * "ArchiveId": 155491, + * "SkuId": 310118490, + * "Name": "Cat-Sleeping-Pics", + * "IsMain": false, + * "Label": null + * } + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/file": { @@ -4243,31 +4301,31 @@ Label?: (null | string) }[] } /** - * Creates a new Image for an SKU based on its URL or on a form-data request body. - * ## Request body example - * - * ```json - * { - * "IsMain": true, - * "Label": "", - * "Name": "Royal-Canin-Feline-Urinary-SO", - * "Text": null, - * "Url": "https://1.bp.blogspot.com/_SLQk9aAv9-o/S7NNbJPv7NI/AAAAAAAAAN8/V1LcO0ViDc4/s1600/waterbottle.jpg" - * - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 503, - * "ArchiveId": 155491, - * "SkuId": 1, - * "Name": "Royal-Canin-Feline-Urinary-SO", - * "IsMain": true, - * "Label": "" - * } + * Creates a new Image for an SKU based on its URL or on a form-data request body. + * ## Request body example + * + * ```json + * { + * "IsMain": true, + * "Label": "", + * "Name": "Royal-Canin-Feline-Urinary-SO", + * "Text": null, + * "Url": "https://1.bp.blogspot.com/_SLQk9aAv9-o/S7NNbJPv7NI/AAAAAAAAAN8/V1LcO0ViDc4/s1600/waterbottle.jpg" + * + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 503, + * "ArchiveId": 155491, + * "SkuId": 1, + * "Name": "Royal-Canin-Feline-Urinary-SO", + * "IsMain": true, + * "Label": "" + * } * ``` */ "POST /api/catalog/pvt/stockkeepingunit/:skuId/file": { @@ -4302,29 +4360,29 @@ Label?: string } /** - * Updates a new Image on an SKU based on its URL or on a form-data request body. - * ## Request body example - * - * ```json - * { - * "IsMain": true, - * "Label": null, - * "Name": "toilet-paper", - * "Text": null, - * "Url": "https://images-na.ssl-images-amazon.com/images/I/81DLLXaGI7L._SL1500_.jpg" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 508, - * "ArchiveId": 155491, - * "SkuId": 7, - * "IsMain": true, - * "Label": null - * } + * Updates a new Image on an SKU based on its URL or on a form-data request body. + * ## Request body example + * + * ```json + * { + * "IsMain": true, + * "Label": null, + * "Name": "toilet-paper", + * "Text": null, + * "Url": "https://images-na.ssl-images-amazon.com/images/I/81DLLXaGI7L._SL1500_.jpg" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 508, + * "ArchiveId": 155491, + * "SkuId": 7, + * "IsMain": true, + * "Label": null + * } * ``` */ "PUT /api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId": { @@ -4359,26 +4417,26 @@ Label?: string } /** - * Copy all existing files from an SKU to another SKU. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 1964, - * "ArchiveId": 155404, - * "SkuId": 1, - * "IsMain": true, - * "Label": "" - * }, - * { - * "Id": 1965, - * "ArchiveId": 155429, - * "SkuId": 1, - * "IsMain": false, - * "Label": "" - * } - * ] + * Copy all existing files from an SKU to another SKU. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 1964, + * "ArchiveId": 155404, + * "SkuId": 1, + * "IsMain": true, + * "Label": "" + * }, + * { + * "Id": 1965, + * "ArchiveId": 155429, + * "SkuId": 1, + * "IsMain": false, + * "Label": "" + * } + * ] * ``` */ "PUT /api/catalog/pvt/stockkeepingunit/copy/:skuIdfrom/:skuIdto/file/": { @@ -4415,17 +4473,17 @@ Label?: (null | string) } /** - * Retrieves general information about the components of an SKU Kit by SKU ID or Parent SKU ID. - * ## Response body example - * - * ```json - * { - * "Id": 7, - * "StockKeepingUnitParent": 7, - * "StockKeepingUnitId": 1, - * "Quantity": 1, - * "UnitPrice": 50.0000 - * } + * Retrieves general information about the components of an SKU Kit by SKU ID or Parent SKU ID. + * ## Response body example + * + * ```json + * { + * "Id": 7, + * "StockKeepingUnitParent": 7, + * "StockKeepingUnitId": 1, + * "Quantity": 1, + * "UnitPrice": 50.0000 + * } * ``` */ "GET /api/catalog/pvt/stockkeepingunitkit": { @@ -4442,27 +4500,27 @@ parentSkuId?: number response: SkuKit } /** - * Adds a component to a specific Kit. - * ## Request body example - * - * ```json - * { - * "StockKeepingUnitParent": 7, - * "StockKeepingUnitId": 1, - * "Quantity": 1, - * "UnitPrice": 50.0000 - * } - * ``` - * ## Response body example - * - * ```json - * { - * "Id": 7, - * "StockKeepingUnitParent": 7, - * "StockKeepingUnitId": 1, - * "Quantity": 1, - * "UnitPrice": 50.0000 - * } + * Adds a component to a specific Kit. + * ## Request body example + * + * ```json + * { + * "StockKeepingUnitParent": 7, + * "StockKeepingUnitId": 1, + * "Quantity": 1, + * "UnitPrice": 50.0000 + * } + * ``` + * ## Response body example + * + * ```json + * { + * "Id": 7, + * "StockKeepingUnitParent": 7, + * "StockKeepingUnitId": 1, + * "Quantity": 1, + * "UnitPrice": 50.0000 + * } * ``` */ "POST /api/catalog/pvt/stockkeepingunitkit": { @@ -4516,21 +4574,21 @@ response: SkuKit /** * > ⚠️ Check out the updated version of the SKU Seller endpoints in our [SKU Bindings API documentation](https://developers.vtex.com/vtex-rest-api/reference/getbyskuid). If you are doing this integration for the first time, we recommend that you follow the updated documentation. * - * Retrieves the details of a seller's SKU given a seller ID and the SKU ID in the seller's store. - * ## Response body example - * - * ```json - * { - * "IsPersisted": true, - * "IsRemoved": false, - * "SkuSellerId": 799, - * "SellerId": "myseller", - * "StockKeepingUnitId": 50, - * "SellerStockKeepingUnitId": "502", - * "IsActive": true, - * "UpdateDate": "2018-10-11T04:52:42.1", - * "RequestedUpdateDate": null - * } + * Retrieves the details of a seller's SKU given a seller ID and the SKU ID in the seller's store. + * ## Response body example + * + * ```json + * { + * "IsPersisted": true, + * "IsRemoved": false, + * "SkuSellerId": 799, + * "SellerId": "myseller", + * "StockKeepingUnitId": 50, + * "SellerStockKeepingUnitId": "502", + * "IsActive": true, + * "UpdateDate": "2018-10-11T04:52:42.1", + * "RequestedUpdateDate": null + * } * ``` */ "GET /api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId": { @@ -4596,79 +4654,79 @@ RequestedUpdateDate: (null | string) } /** - * > ⚠️ Check out the updated version of the SKU Seller endpoints in our [SKU Bindings API documentation](https://developers.vtex.com/vtex-rest-api/reference/getbyskuid). If you are doing this integration for the first time, we recommend that you follow the updated documentation. - * - * The seller is responsible for suggesting new SKUs to be sold in the VTEX marketplace and also for informing the marketplace about changes in their SKUs that already exist in the marketplace. Both actions start with a catalog notification, which is made by this request. - * - * With this notification, the seller is telling the marketplace that something has changed about a specific SKU, like its name or description, or that this is a new SKU that the seller would like to offer to the marketplace. The body of the request should be empty. - * - * > ⚠️ Do not use this endpoint for price and inventory changes, because these types of updates should be notified using Marketplace API. For price changes, we recommend using the [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) endpoint. For inventory changes, use [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory). - * - * ## Example - * - * Let's say your seller has the ID `123` in the marketplace and you want to inform the marketplace that has been a change in the SKU with ID `700`. - * - * In this case, you would have to replace the `sellerId` parameter with the value `123` and the `skuId` parameter with the value `700`. The URL of the request would be the following. - * - * ``` - * https://{{accountName}}.vtexcommercestable.com.br/api/catalog_system/pvt/skuseller/changenotification/123/700 - * ``` - * - * ## Response codes - * - * The following response codes are possible for this request. - * - * * **404:** the SKU was not found in the marketplace. The body of the response, in this case, should follow this format: "Seller StockKeepingUnit `{{skuId}}` not found for this seller id `{{sellerId}}`". This means that the seller can now proceed with sending an offer to the marketplace in order to suggest that this SKU is sold there. - * * **200:** the SKU whose ID was informed in the URL already exists in the marketplace and was found. The marketplace can now proceed with a fulfillment simulation in order to get updated information about this SKU's inventory and price. - * * **429:** Failure due to too many requests. + * > ⚠️ Check out the updated version of the SKU Seller endpoints in our [SKU Bindings API documentation](https://developers.vtex.com/vtex-rest-api/reference/getbyskuid). If you are doing this integration for the first time, we recommend that you follow the updated documentation. + * + * The seller is responsible for suggesting new SKUs to be sold in the VTEX marketplace and also for informing the marketplace about changes in their SKUs that already exist in the marketplace. Both actions start with a catalog notification, which is made by this request. + * + * With this notification, the seller is telling the marketplace that something has changed about a specific SKU, like its name or description, or that this is a new SKU that the seller would like to offer to the marketplace. The body of the request should be empty. + * + * > ⚠️ Do not use this endpoint for price and inventory changes, because these types of updates should be notified using Marketplace API. For price changes, we recommend using the [Notify marketplace of price update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/price) endpoint. For inventory changes, use [Notify marketplace of inventory update](https://developers.vtex.com/docs/api-reference/marketplace-apis#post-/notificator/-sellerId-/changenotification/-skuId-/inventory). + * + * ## Example + * + * Let's say your seller has the ID `123` in the marketplace and you want to inform the marketplace that has been a change in the SKU with ID `700`. + * + * In this case, you would have to replace the `sellerId` parameter with the value `123` and the `skuId` parameter with the value `700`. The URL of the request would be the following. + * + * ``` + * https://{{accountName}}.vtexcommercestable.com.br/api/catalog_system/pvt/skuseller/changenotification/123/700 + * ``` + * + * ## Response codes + * + * The following response codes are possible for this request. + * + * * **404:** the SKU was not found in the marketplace. The body of the response, in this case, should follow this format: "Seller StockKeepingUnit `{{skuId}}` not found for this seller id `{{sellerId}}`". This means that the seller can now proceed with sending an offer to the marketplace in order to suggest that this SKU is sold there. + * * **200:** the SKU whose ID was informed in the URL already exists in the marketplace and was found. The marketplace can now proceed with a fulfillment simulation in order to get updated information about this SKU's inventory and price. + * * **429:** Failure due to too many requests. * * **403:** Failure in the authentication. */ "POST /api/catalog_system/pvt/skuseller/changenotification/:skuId": { } /** - * Retrieves an SKU Service. - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "SkuServiceTypeId": 1, - * "SkuServiceValueId": 1, - * "SkuId": 1, - * "Name": "name", - * "Text": "text", - * "IsActive": false - * } + * Retrieves an SKU Service. + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "SkuServiceTypeId": 1, + * "SkuServiceValueId": 1, + * "SkuId": 1, + * "Name": "name", + * "Text": "text", + * "IsActive": false + * } * ``` */ "GET /api/catalog/pvt/skuservice/:skuServiceId": { response: SKUService } /** - * Updates an SKU Service. - * ## Request body example - * - * ```json - * { - * "Name": "name", - * "Text": "text", - * "IsActive": false - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "SkuServiceTypeId": 1, - * "SkuServiceValueId": 1, - * "SkuId": 1, - * "Name": "name", - * "Text": "text", - * "IsActive": false - * } + * Updates an SKU Service. + * ## Request body example + * + * ```json + * { + * "Name": "name", + * "Text": "text", + * "IsActive": false + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "SkuServiceTypeId": 1, + * "SkuServiceValueId": 1, + * "SkuId": 1, + * "Name": "name", + * "Text": "text", + * "IsActive": false + * } * ``` */ "PUT /api/catalog/pvt/skuservice/:skuServiceId": { @@ -4739,24 +4797,24 @@ IsActive: boolean response: SKUService } /** - * Associates an Attachment for an existing SKU Service Type. - * ## Request body example - * - * ```json - * { - * "AttachmentId": 1, - * "SkuServiceTypeId": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "AttachmentId": 1, - * "SkuServiceTypeId": 1 - * } + * Associates an Attachment for an existing SKU Service Type. + * ## Request body example + * + * ```json + * { + * "AttachmentId": 1, + * "SkuServiceTypeId": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "AttachmentId": 1, + * "SkuServiceTypeId": 1 + * } * ``` */ "POST /api/catalog/pvt/skuservicetypeattachment": { @@ -4807,36 +4865,36 @@ skuServiceTypeId?: number } /** - * Creates a new SKU Service Type. - * ## Request body example - * - * ```json - * { - * "Name": "Test API Sku Services", - * "IsActive": true, - * "ShowOnProductFront": true, - * "ShowOnCartFront": true, - * "ShowOnAttachmentFront": true, - * "ShowOnFileUpload": true, - * "IsGiftCard": true, - * "IsRequired": true - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 2, - * "Name": "Teste API Sku Services", - * "IsActive": true, - * "ShowOnProductFront": true, - * "ShowOnCartFront": true, - * "ShowOnAttachmentFront": true, - * "ShowOnFileUpload": true, - * "IsGiftCard": true, - * "IsRequired": true - * } + * Creates a new SKU Service Type. + * ## Request body example + * + * ```json + * { + * "Name": "Test API Sku Services", + * "IsActive": true, + * "ShowOnProductFront": true, + * "ShowOnCartFront": true, + * "ShowOnAttachmentFront": true, + * "ShowOnFileUpload": true, + * "IsGiftCard": true, + * "IsRequired": true + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 2, + * "Name": "Teste API Sku Services", + * "IsActive": true, + * "ShowOnProductFront": true, + * "ShowOnCartFront": true, + * "ShowOnAttachmentFront": true, + * "ShowOnFileUpload": true, + * "IsGiftCard": true, + * "IsRequired": true + * } * ``` */ "POST /api/catalog/pvt/skuservicetype": { @@ -4844,57 +4902,57 @@ body: SKUServiceTypeRequest response: SKUServiceTypeResponse } /** - * Retrieves information about an existing SKU Service Type. - * ## Response body example: - * - * ```json - * { - * "Id": 2, - * "Name": "Test API SKU Services", - * "IsActive": true, - * "ShowOnProductFront": true, - * "ShowOnCartFront": true, - * "ShowOnAttachmentFront": true, - * "ShowOnFileUpload": true, - * "IsGiftCard": true, - * "IsRequired": true - * } + * Retrieves information about an existing SKU Service Type. + * ## Response body example: + * + * ```json + * { + * "Id": 2, + * "Name": "Test API SKU Services", + * "IsActive": true, + * "ShowOnProductFront": true, + * "ShowOnCartFront": true, + * "ShowOnAttachmentFront": true, + * "ShowOnFileUpload": true, + * "IsGiftCard": true, + * "IsRequired": true + * } * ``` */ "GET /api/catalog/pvt/skuservicetype/:skuServiceTypeId": { response: SKUServiceTypeResponse } /** - * Updates an existing SKU Service Type. - * ## Request body example - * - * ```json - * { - * "Name": "Test API Sku Services", - * "IsActive": true, - * "ShowOnProductFront": true, - * "ShowOnCartFront": true, - * "ShowOnAttachmentFront": true, - * "ShowOnFileUpload": true, - * "IsGiftCard": true, - * "IsRequired": true - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 2, - * "Name": "Teste API Sku Services", - * "IsActive": true, - * "ShowOnProductFront": true, - * "ShowOnCartFront": true, - * "ShowOnAttachmentFront": true, - * "ShowOnFileUpload": true, - * "IsGiftCard": true, - * "IsRequired": true - * } + * Updates an existing SKU Service Type. + * ## Request body example + * + * ```json + * { + * "Name": "Test API Sku Services", + * "IsActive": true, + * "ShowOnProductFront": true, + * "ShowOnCartFront": true, + * "ShowOnAttachmentFront": true, + * "ShowOnFileUpload": true, + * "IsGiftCard": true, + * "IsRequired": true + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 2, + * "Name": "Teste API Sku Services", + * "IsActive": true, + * "ShowOnProductFront": true, + * "ShowOnCartFront": true, + * "ShowOnAttachmentFront": true, + * "ShowOnFileUpload": true, + * "IsGiftCard": true, + * "IsRequired": true + * } * ``` */ "PUT /api/catalog/pvt/skuservicetype/:skuServiceTypeId": { @@ -4908,28 +4966,28 @@ response: SKUServiceTypeResponse } /** - * Creates an SKU Service Value for an existing SKU Service Type. - * ## Request body example - * - * ```json - * { - * "SkuServiceTypeId": 2, - * "Name": "Test ServiceValue API", - * "Value": 10.5, - * "Cost": 10.5 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 2, - * "SkuServiceTypeId": 2, - * "Name": "Test ServiceValue API", - * "Value": 10.5, - * "Cost": 10.5 - * } + * Creates an SKU Service Value for an existing SKU Service Type. + * ## Request body example + * + * ```json + * { + * "SkuServiceTypeId": 2, + * "Name": "Test ServiceValue API", + * "Value": 10.5, + * "Cost": 10.5 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 2, + * "SkuServiceTypeId": 2, + * "Name": "Test ServiceValue API", + * "Value": 10.5, + * "Cost": 10.5 + * } * ``` */ "POST /api/catalog/pvt/skuservicevalue": { @@ -4937,45 +4995,45 @@ body: SKUServiceValueRequest response: SKUServiceValueResponse } /** - * Retrieves an existing SKU Service Value. - * ## Response body example - * - * ```json - * { - * "Id": 2, - * "SkuServiceTypeId": 2, - * "Name": "Test ServiceValue API", - * "Value": 10.5, - * "Cost": 10.5 - * } + * Retrieves an existing SKU Service Value. + * ## Response body example + * + * ```json + * { + * "Id": 2, + * "SkuServiceTypeId": 2, + * "Name": "Test ServiceValue API", + * "Value": 10.5, + * "Cost": 10.5 + * } * ``` */ "GET /api/catalog/pvt/skuservicevalue/:skuServiceValueId": { response: SKUServiceValueResponse } /** - * Updates an existing SKU Service Value. - * ## Request body example - * - * ```json - * { - * "SkuServiceTypeId": 2, - * "Name": "Test ServiceValue API", - * "Value": 10.5, - * "Cost": 10.5 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 2, - * "SkuServiceTypeId": 2, - * "Name": "Test ServiceValue API", - * "Value": 10.5, - * "Cost": 10.5 - * } + * Updates an existing SKU Service Value. + * ## Request body example + * + * ```json + * { + * "SkuServiceTypeId": 2, + * "Name": "Test ServiceValue API", + * "Value": 10.5, + * "Cost": 10.5 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 2, + * "SkuServiceTypeId": 2, + * "Name": "Test ServiceValue API", + * "Value": 10.5, + * "Cost": 10.5 + * } * ``` */ "PUT /api/catalog/pvt/skuservicevalue/:skuServiceValueId": { @@ -4989,52 +5047,52 @@ response: SKUServiceValueResponse } /** - * Retrieves information about an SKU's Specifications. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 427, - * "SkuId": 7, - * "FieldId": 32, - * "FieldValueId": 131, - * "Text": "500g" - * }, - * { - * "Id": 428, - * "SkuId": 7, - * "FieldId": 40, - * "FieldValueId": 133, - * "Text": "A" - * } - * ] + * Retrieves information about an SKU's Specifications. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 427, + * "SkuId": 7, + * "FieldId": 32, + * "FieldValueId": 131, + * "Text": "500g" + * }, + * { + * "Id": 428, + * "SkuId": 7, + * "FieldId": 40, + * "FieldValueId": 133, + * "Text": "A" + * } + * ] * ``` */ "GET /api/catalog/pvt/stockkeepingunit/:skuId/specification": { response: SKUSpecificationResponse[] } /** - * Associates a previously created Specification to an SKU. - * ## Request body example - * - * ```json - * { - * "FieldId": 65, - * "FieldValueId": 138 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 730, - * "SkuId": 31, - * "FieldId": 65, - * "FieldValueId": 138, - * "Text": "Size" - * } + * Associates a previously created Specification to an SKU. + * ## Request body example + * + * ```json + * { + * "FieldId": 65, + * "FieldValueId": 138 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 730, + * "SkuId": 31, + * "FieldId": 65, + * "FieldValueId": 138, + * "Text": "Size" + * } * ``` */ "POST /api/catalog/pvt/stockkeepingunit/:skuId/specification": { @@ -5051,29 +5109,29 @@ FieldValueId?: number response: SKUSpecificationResponse } /** - * Updates an existing Specification on an existing SKU. This endpoint only updates the `FieldValueId`. - * ## Request body example - * - * ```json - * { - * "Id": 65, - * "SkuId": 21, - * "FieldId": 32, - * "FieldValueId": 131, - * "Text": "Red" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 65, - * "SkuId": 21, - * "FieldId": 32, - * "FieldValueId": 131, - * "Text": "Red" - * } + * Updates an existing Specification on an existing SKU. This endpoint only updates the `FieldValueId`. + * ## Request body example + * + * ```json + * { + * "Id": 65, + * "SkuId": 21, + * "FieldId": 32, + * "FieldValueId": 131, + * "Text": "Red" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 65, + * "SkuId": 21, + * "FieldId": 32, + * "FieldValueId": 131, + * "Text": "Red" + * } * ``` */ "PUT /api/catalog/pvt/stockkeepingunit/:skuId/specification": { @@ -5114,35 +5172,35 @@ response: SKUSpecificationResponse[] } /** - * Associates a specification to an SKU using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. - * - * ## Request body example - * - * ```json - * { - * "FieldName": "Size", - * "GroupName": "Sizes", - * "RootLevelSpecification": false, - * "FieldValues": [ - * "M" - * ] - * } - * ``` - * - * - * ## Response body example - * - * ```json - * [ - * { - * "Id": 419, - * "SkuId": 5, - * "FieldId": 22, - * "FieldValueId": 62, - * "Text": "M" - * } - * ] - * ``` + * Associates a specification to an SKU using specification name and group name. Automatically creates the informed group, specification and values if they had not been created before. + * + * ## Request body example + * + * ```json + * { + * "FieldName": "Size", + * "GroupName": "Sizes", + * "RootLevelSpecification": false, + * "FieldValues": [ + * "M" + * ] + * } + * ``` + * + * + * ## Response body example + * + * ```json + * [ + * { + * "Id": 419, + * "SkuId": 5, + * "FieldId": 22, + * "FieldValueId": 62, + * "Text": "M" + * } + * ] + * ``` * */ "PUT /api/catalog/pvt/stockkeepingunit/:skuId/specificationvalue": { @@ -5193,22 +5251,22 @@ Text?: string /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Associates a single SKU to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Request body example - * - * ```json - * { - * "SkuId": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "SubCollectionId": 17, - * "SkuId": 1 - * } + * Associates a single SKU to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Request body example + * + * ```json + * { + * "SkuId": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "SubCollectionId": 17, + * "SkuId": 1 + * } * ``` */ "POST /api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit": { @@ -5238,196 +5296,196 @@ SkuId?: number } /** - * Retrieves the Category Tree of your store. Get all the category levels registered in the Catalog or define the level up to which you want to get. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - * ## Response body example - * - * ```json - * [ - * { - * "id": 1, - * "name": "Alimentação", - * "hasChildren": true, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao", - * "children": [ - * { - * "id": 6, - * "name": "Bebedouro", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/bebedouro", - * "children": [], - * "Title": "Bebedouro para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 7, - * "name": "Comedouro", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/comedouro", - * "children": [], - * "Title": "Comedouro para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 8, - * "name": "Biscoitos", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/biscoitos", - * "children": [], - * "Title": "Biscoitos para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 9, - * "name": "Petiscos", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/petiscos", - * "children": [], - * "Title": "Petiscos para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 10, - * "name": "Ração Seca", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-seca", - * "children": [], - * "Title": "Ração Seca para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 11, - * "name": "Ração Úmida", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-umida", - * "children": [], - * "Title": "Ração Úmida para Gatos", - * "MetaTagDescription": "" - * } - * ], - * "Title": "Alimentação para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 2, - * "name": "Brinquedos", - * "hasChildren": true, - * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos", - * "children": [ - * { - * "id": 12, - * "name": "Bolinhas", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/bolinhas", - * "children": [], - * "Title": "Bolinhas para Gatos", - * "MetaTagDescription": "" - * }, - * { - * "id": 13, - * "name": "Ratinhos", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/ratinhos", - * "children": [], - * "Title": "Ratinhos", - * "MetaTagDescription": "" - * }, - * { - * "id": 19, - * "name": "Arranhador para gato", - * "hasChildren": false, - * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/arranhador-para-gato", - * "children": [], - * "Title": "Brinquedo Arranhador para gatos", - * "MetaTagDescription": "Arranhador gatos é indispensável no lar com felinos. Ideais para afiar as unhas e garantir a diversão" - * } - * ], - * "Title": "Brinquedos para Gatos", - * "MetaTagDescription": "" - * } - * ] + * Retrieves the Category Tree of your store. Get all the category levels registered in the Catalog or define the level up to which you want to get. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + * ## Response body example + * + * ```json + * [ + * { + * "id": 1, + * "name": "Alimentação", + * "hasChildren": true, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao", + * "children": [ + * { + * "id": 6, + * "name": "Bebedouro", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/bebedouro", + * "children": [], + * "Title": "Bebedouro para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 7, + * "name": "Comedouro", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/comedouro", + * "children": [], + * "Title": "Comedouro para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 8, + * "name": "Biscoitos", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/biscoitos", + * "children": [], + * "Title": "Biscoitos para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 9, + * "name": "Petiscos", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/petiscos", + * "children": [], + * "Title": "Petiscos para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 10, + * "name": "Ração Seca", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-seca", + * "children": [], + * "Title": "Ração Seca para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 11, + * "name": "Ração Úmida", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/alimentacao/racao-umida", + * "children": [], + * "Title": "Ração Úmida para Gatos", + * "MetaTagDescription": "" + * } + * ], + * "Title": "Alimentação para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 2, + * "name": "Brinquedos", + * "hasChildren": true, + * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos", + * "children": [ + * { + * "id": 12, + * "name": "Bolinhas", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/bolinhas", + * "children": [], + * "Title": "Bolinhas para Gatos", + * "MetaTagDescription": "" + * }, + * { + * "id": 13, + * "name": "Ratinhos", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/ratinhos", + * "children": [], + * "Title": "Ratinhos", + * "MetaTagDescription": "" + * }, + * { + * "id": 19, + * "name": "Arranhador para gato", + * "hasChildren": false, + * "url": "https://lojadobreno.vtexcommercestable.com.br/brinquedos/arranhador-para-gato", + * "children": [], + * "Title": "Brinquedo Arranhador para gatos", + * "MetaTagDescription": "Arranhador gatos é indispensável no lar com felinos. Ideais para afiar as unhas e garantir a diversão" + * } + * ], + * "Title": "Brinquedos para Gatos", + * "MetaTagDescription": "" + * } + * ] * ``` */ "GET /api/catalog_system/pub/category/tree/:categoryLevels": { response: GetCategoryTree[] } /** - * Retrieves general information about a Category. - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": "", - * "AdWordsRemarketingCode": "", - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 3367, - * "StockKeepingUnitSelectionMode": "LIST", - * "Score": null, - * "LinkId": "Alimentacao", - * "HasChildren": true - * } + * Retrieves general information about a Category. + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": "", + * "AdWordsRemarketingCode": "", + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 3367, + * "StockKeepingUnitSelectionMode": "LIST", + * "Score": null, + * "LinkId": "Alimentacao", + * "HasChildren": true + * } * ``` */ "GET /api/catalog/pvt/category/:categoryId": { response: Category } /** - * Updates a previously existing Category. - * - * ## Request body example - * - * ```json - * { - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": null, - * "AdWordsRemarketingCode": null, - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 604, - * "StockKeepingUnitSelectionMode": "SPECIFICATION", - * "Score": null - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": "", - * "AdWordsRemarketingCode": "", - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 604, - * "StockKeepingUnitSelectionMode": "LIST", - * "Score": null, - * "LinkId": "Alimentacao", - * "HasChildren": true - * } + * Updates a previously existing Category. + * + * ## Request body example + * + * ```json + * { + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": null, + * "AdWordsRemarketingCode": null, + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 604, + * "StockKeepingUnitSelectionMode": "SPECIFICATION", + * "Score": null + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": "", + * "AdWordsRemarketingCode": "", + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 604, + * "StockKeepingUnitSelectionMode": "LIST", + * "Score": null, + * "LinkId": "Alimentacao", + * "HasChildren": true + * } * ``` */ "PUT /api/catalog/pvt/category/:categoryId": { @@ -5494,75 +5552,75 @@ StockKeepingUnitSelectionMode: string response: Category } /** - * Creates a new Category. - * - * If there is a need to create a new category with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. - * - * ## Request body example (automatically generated ID) - * - * ```json - * { - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": null, - * "AdWordsRemarketingCode": null, - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 604, - * "StockKeepingUnitSelectionMode": "SPECIFICATION", - * "Score": null - * } - * ``` - * - * ## Request body example (custom ID) - * - * ```json - * { - * "Id": 1, - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": null, - * "AdWordsRemarketingCode": null, - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 604, - * "StockKeepingUnitSelectionMode": "SPECIFICATION", - * "Score": null - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Home Appliances", - * "FatherCategoryId": null, - * "Title": "Home Appliances", - * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", - * "Keywords": "Kitchen, Laundry, Appliances", - * "IsActive": true, - * "LomadeeCampaignCode": "", - * "AdWordsRemarketingCode": "", - * "ShowInStoreFront": true, - * "ShowBrandFilter": true, - * "ActiveStoreFrontLink": true, - * "GlobalCategoryId": 604, - * "StockKeepingUnitSelectionMode": "LIST", - * "Score": null, - * "LinkId": "Alimentacao", - * "HasChildren": true - * } + * Creates a new Category. + * + * If there is a need to create a new category with a specific custom ID, specify the `Id` (integer) in the request. Otherwise, VTEX will generate the ID automatically. + * + * ## Request body example (automatically generated ID) + * + * ```json + * { + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": null, + * "AdWordsRemarketingCode": null, + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 604, + * "StockKeepingUnitSelectionMode": "SPECIFICATION", + * "Score": null + * } + * ``` + * + * ## Request body example (custom ID) + * + * ```json + * { + * "Id": 1, + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": null, + * "AdWordsRemarketingCode": null, + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 604, + * "StockKeepingUnitSelectionMode": "SPECIFICATION", + * "Score": null + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Home Appliances", + * "FatherCategoryId": null, + * "Title": "Home Appliances", + * "Description": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now.", + * "Keywords": "Kitchen, Laundry, Appliances", + * "IsActive": true, + * "LomadeeCampaignCode": "", + * "AdWordsRemarketingCode": "", + * "ShowInStoreFront": true, + * "ShowBrandFilter": true, + * "ActiveStoreFrontLink": true, + * "GlobalCategoryId": 604, + * "StockKeepingUnitSelectionMode": "LIST", + * "Score": null, + * "LinkId": "Alimentacao", + * "HasChildren": true + * } * ``` */ "POST /api/catalog/pvt/category": { @@ -5570,21 +5628,21 @@ body: CreateCategoryRequest response: Category } /** - * Retrieves Similar Categories from a Product. - * - * ## Response body example - * - * ```json - * [ - * { - * "ProductId": 1, - * "CategoryId": 1 - * }, - * { - * "ProductId": 1, - * "CategoryId": 20 - * } - * ] + * Retrieves Similar Categories from a Product. + * + * ## Response body example + * + * ```json + * [ + * { + * "ProductId": 1, + * "CategoryId": 1 + * }, + * { + * "ProductId": 1, + * "CategoryId": 20 + * } + * ] * ``` */ "GET /api/catalog/pvt/product/:productId/similarcategory/": { @@ -5603,15 +5661,15 @@ CategoryId?: number }[] } /** - * Adds a Similar Category to a Product. - * - * ## Response body example - * - * ```json - * { - * "ProductId": 1, - * "StoreId": 1 - * } + * Adds a Similar Category to a Product. + * + * ## Response body example + * + * ```json + * { + * "ProductId": 1, + * "StoreId": 1 + * } * ``` */ "POST /api/catalog/pvt/product/:productId/similarcategory/:categoryId": { @@ -5636,68 +5694,68 @@ StoreId?: number } /** - * Retrieves all specifications from a category by its ID. - * - * ## Response body example - * - * ```json - * [ - * { - * "Name": "Specification A", - * "CategoryId": 1, - * "FieldId": 33, - * "IsActive": true, - * "IsStockKeepingUnit": false - * }, - * { - * "Name": "Specification B", - * "CategoryId": 1, - * "FieldId": 34, - * "IsActive": true, - * "IsStockKeepingUnit": false - * }, - * { - * "Name": "Specification C", - * "CategoryId": 1, - * "FieldId": 35, - * "IsActive": false, - * "IsStockKeepingUnit": false - * } - * ] + * Retrieves all specifications from a category by its ID. + * + * ## Response body example + * + * ```json + * [ + * { + * "Name": "Specification A", + * "CategoryId": 1, + * "FieldId": 33, + * "IsActive": true, + * "IsStockKeepingUnit": false + * }, + * { + * "Name": "Specification B", + * "CategoryId": 1, + * "FieldId": 34, + * "IsActive": true, + * "IsStockKeepingUnit": false + * }, + * { + * "Name": "Specification C", + * "CategoryId": 1, + * "FieldId": 35, + * "IsActive": false, + * "IsStockKeepingUnit": false + * } + * ] * ``` */ "GET /api/catalog_system/pub/specification/field/listByCategoryId/:categoryId": { response: CategorySpecification } /** - * Lists all specifications including the current category and the level zero specifications from a category by its ID. - * - * ## Response body example - * - * ```json - * [ - * { - * "Name": "Specification A", - * "CategoryId": 1, - * "FieldId": 33, - * "IsActive": true, - * "IsStockKeepingUnit": false - * }, - * { - * "Name": "Specification B", - * "CategoryId": 1, - * "FieldId": 34, - * "IsActive": true, - * "IsStockKeepingUnit": false - * }, - * { - * "Name": "Specification C", - * "CategoryId": 1, - * "FieldId": 35, - * "IsActive": false, - * "IsStockKeepingUnit": false - * } - * ] + * Lists all specifications including the current category and the level zero specifications from a category by its ID. + * + * ## Response body example + * + * ```json + * [ + * { + * "Name": "Specification A", + * "CategoryId": 1, + * "FieldId": 33, + * "IsActive": true, + * "IsStockKeepingUnit": false + * }, + * { + * "Name": "Specification B", + * "CategoryId": 1, + * "FieldId": 34, + * "IsActive": true, + * "IsStockKeepingUnit": false + * }, + * { + * "Name": "Specification C", + * "CategoryId": 1, + * "FieldId": 35, + * "IsActive": false, + * "IsStockKeepingUnit": false + * } + * ] * ``` */ "GET /api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId": { @@ -5706,22 +5764,22 @@ response: CategorySpecification /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Associates a single Category to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Request body example - * - * ```json - * { - * "CategoryId": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "SubCollectionId": 17, - * "CategoryId": 1 - * } + * Associates a single Category to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Request body example + * + * ```json + * { + * "CategoryId": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "SubCollectionId": 17, + * "CategoryId": 1 + * } * ``` */ "POST /api/catalog/pvt/subcollection/:subCollectionId/category": { @@ -5751,37 +5809,37 @@ CategoryId?: number } /** - * Retrieves all Brands registered in the store's Catalog. - * >⚠️ This route's response is limited to 20k results. If you need to obtain more results, please use the [Get Brand List](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-brand-list) endpoint instead to get a paginated response. - * ## Response body example - * - * ```json - * [ - * { - * "id": 9280, - * "name": "Brand", - * "isActive": true, - * "title": "Brand", - * "metaTagDescription": "Brand", - * "imageUrl": null - * }, - * { - * "id": 2000000, - * "name": "Orma Carbon", - * "isActive": true, - * "title": "Orma Carbon", - * "metaTagDescription": "Orma Carbon", - * "imageUrl": null - * }, - * { - * "id": 2000001, - * "name": "Pedigree", - * "isActive": true, - * "title": "Pedigree", - * "metaTagDescription": "", - * "imageUrl": null - * } - * ] + * Retrieves all Brands registered in the store's Catalog. + * >⚠️ This route's response is limited to 20k results. If you need to obtain more results, please use the [Get Brand List](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-brand-list) endpoint instead to get a paginated response. + * ## Response body example + * + * ```json + * [ + * { + * "id": 9280, + * "name": "Brand", + * "isActive": true, + * "title": "Brand", + * "metaTagDescription": "Brand", + * "imageUrl": null + * }, + * { + * "id": 2000000, + * "name": "Orma Carbon", + * "isActive": true, + * "title": "Orma Carbon", + * "metaTagDescription": "Orma Carbon", + * "imageUrl": null + * }, + * { + * "id": 2000001, + * "name": "Pedigree", + * "isActive": true, + * "title": "Pedigree", + * "metaTagDescription": "", + * "imageUrl": null + * } + * ] * ``` */ "GET /api/catalog_system/pvt/brand/list": { @@ -5791,44 +5849,44 @@ CategoryId?: number response: BrandGet[] } /** - * Retrieves all Brands registered in the store's Catalog by page number. - * ## Response body example - * - * ```json - * { - * "items": [ - * { - * "id": 2000000, - * "name": "Farm", - * "isActive": true, - * "title": "Farm", - * "metaTagDescription": "Farm", - * "imageUrl": null - * }, - * { - * "id": 2000001, - * "name": "Adidas", - * "isActive": true, - * "title": "", - * "metaTagDescription": "", - * "imageUrl": null - * }, - * { - * "id": 2000002, - * "name": "Brastemp", - * "isActive": true, - * "title": "Brastemp", - * "metaTagDescription": "Brastemp", - * "imageUrl": null - * } - * ], - * "paging": { - * "page": 1, - * "perPage": 3, - * "total": 6, - * "pages": 2 - * } - * } + * Retrieves all Brands registered in the store's Catalog by page number. + * ## Response body example + * + * ```json + * { + * "items": [ + * { + * "id": 2000000, + * "name": "Farm", + * "isActive": true, + * "title": "Farm", + * "metaTagDescription": "Farm", + * "imageUrl": null + * }, + * { + * "id": 2000001, + * "name": "Adidas", + * "isActive": true, + * "title": "", + * "metaTagDescription": "", + * "imageUrl": null + * }, + * { + * "id": 2000002, + * "name": "Brastemp", + * "isActive": true, + * "title": "Brastemp", + * "metaTagDescription": "Brastemp", + * "imageUrl": null + * } + * ], + * "paging": { + * "page": 1, + * "perPage": 3, + * "total": 6, + * "pages": 2 + * } + * } * ``` */ "GET /api/catalog_system/pvt/brand/pagedlist": { @@ -5871,41 +5929,41 @@ pages: number } } /** - * Retrieves a specific Brand by its ID. - * ## Response body example - * - * ```json - * { - * "id": 7000000, - * "name": "Pedigree", - * "isActive": true, - * "title": "Pedigree", - * "metaTagDescription": "Pedigree", - * "imageUrl": null - * } + * Retrieves a specific Brand by its ID. + * ## Response body example + * + * ```json + * { + * "id": 7000000, + * "name": "Pedigree", + * "isActive": true, + * "title": "Pedigree", + * "metaTagDescription": "Pedigree", + * "imageUrl": null + * } * ``` */ "GET /api/catalog_system/pvt/brand/:brandId": { response: BrandGet } /** - * Creates a new Brand. - * ## Request and response body example - * - * ```json - * { - * "Id": 2000013, - * "Name": "Orma Carbon", - * "Text": "Orma Carbon", - * "Keywords": "orma", - * "SiteTitle": "Orma Carbon", - * "Active": true, - * "MenuHome": true, - * "AdWordsRemarketingCode": "", - * "LomadeeCampaignCode": "", - * "Score": null, - * "LinkId": "orma-carbon" - * } + * Creates a new Brand. + * ## Request and response body example + * + * ```json + * { + * "Id": 2000013, + * "Name": "Orma Carbon", + * "Text": "Orma Carbon", + * "Keywords": "orma", + * "SiteTitle": "Orma Carbon", + * "Active": true, + * "MenuHome": true, + * "AdWordsRemarketingCode": "", + * "LomadeeCampaignCode": "", + * "Score": null, + * "LinkId": "orma-carbon" + * } * ``` */ "POST /api/catalog/pvt/brand": { @@ -5913,46 +5971,46 @@ body: BrandCreateUpdate response: BrandCreateUpdate } /** - * Retrieves information about a specific Brand and its context. - * ## Response body example - * - * ```json - * { - * "Id": 2000013, - * "Name": "Orma Carbon", - * "Text": "Orma Carbon", - * "Keywords": "orma", - * "SiteTitle": "Orma Carbon", - * "Active": true, - * "MenuHome": true, - * "AdWordsRemarketingCode": "", - * "LomadeeCampaignCode": "", - * "Score": null, - * "LinkId": "orma-carbon" - * } + * Retrieves information about a specific Brand and its context. + * ## Response body example + * + * ```json + * { + * "Id": 2000013, + * "Name": "Orma Carbon", + * "Text": "Orma Carbon", + * "Keywords": "orma", + * "SiteTitle": "Orma Carbon", + * "Active": true, + * "MenuHome": true, + * "AdWordsRemarketingCode": "", + * "LomadeeCampaignCode": "", + * "Score": null, + * "LinkId": "orma-carbon" + * } * ``` */ "GET /api/catalog/pvt/brand/:brandId": { response: BrandCreateUpdate } /** - * Updates a previously existing Brand. - * ## Request and response body example - * - * ```json - * { - * "Id": 2000013, - * "Name": "Orma Carbon", - * "Text": "Orma Carbon", - * "Keywords": "orma", - * "SiteTitle": "Orma Carbon", - * "Active": true, - * "MenuHome": true, - * "AdWordsRemarketingCode": "", - * "LomadeeCampaignCode": "", - * "Score": null, - * "LinkId": "orma-carbon" - * } + * Updates a previously existing Brand. + * ## Request and response body example + * + * ```json + * { + * "Id": 2000013, + * "Name": "Orma Carbon", + * "Text": "Orma Carbon", + * "Keywords": "orma", + * "SiteTitle": "Orma Carbon", + * "Active": true, + * "MenuHome": true, + * "AdWordsRemarketingCode": "", + * "LomadeeCampaignCode": "", + * "Score": null, + * "LinkId": "orma-carbon" + * } * ``` */ "PUT /api/catalog/pvt/brand/:brandId": { @@ -5968,22 +6026,22 @@ response: BrandCreateUpdate /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Associates a single Brand to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Request body example - * - * ```json - * { - * "BrandId": 2000000 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "SubCollectionId": 17, - * "BrandId": 2000000 - * } + * Associates a single Brand to a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Request body example + * + * ```json + * { + * "BrandId": 2000000 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "SubCollectionId": 17, + * "BrandId": 2000000 + * } * ``` */ "POST /api/catalog/pvt/subcollection/:subCollectionId/brand": { @@ -6013,79 +6071,79 @@ BrandId?: number } /** - * Gets information about a registered attachment. - * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. - * ## Response body example - * - * ```json - * { - * "Id": 8, - * "Name": "Test", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic test", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * } + * Gets information about a registered attachment. + * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + * ## Response body example + * + * ```json + * { + * "Id": 8, + * "Name": "Test", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic test", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * } * ``` */ "GET /api/catalog/pvt/attachment/:attachmentid": { response: AttachmentResponse } /** - * Updates a previously existing SKU attachment with new information. - * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. - * ## Request body example - * - * ```json - * { - * "Name": "Test", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic test", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * } - * ``` - * ## Response body example - * - * ```json - * { - * "Id": 8, - * "Name": "Test", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic test", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * } + * Updates a previously existing SKU attachment with new information. + * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + * ## Request body example + * + * ```json + * { + * "Name": "Test", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic test", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * } + * ``` + * ## Response body example + * + * ```json + * { + * "Id": 8, + * "Name": "Test", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic test", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * } * ``` */ "PUT /api/catalog/pvt/attachment/:attachmentid": { @@ -6099,50 +6157,50 @@ response: AttachmentResponse } /** - * Creates a new SKU attachment. - * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. - * ## Request body example - * - * ```json - * { - * "Name": "Test", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic test", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * } - * ``` - * ## Response body example - * - * ```json - * { - * "Id": 8, - * "Name": "Test", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic test", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * } + * Creates a new SKU attachment. + * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + * ## Request body example + * + * ```json + * { + * "Name": "Test", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic test", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * } + * ``` + * ## Response body example + * + * ```json + * { + * "Id": 8, + * "Name": "Test", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic test", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * } * ``` */ "POST /api/catalog/pvt/attachment": { @@ -6150,151 +6208,151 @@ body: AttachmentRequest response: AttachmentResponse } /** - * Retrieves information about all registered attachments. - * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. - * ## Response body example - * - * ```json - * { - * "Page": 1, - * "Size": 11, - * "TotalRows": 11, - * "TotalPage": 1, - * "Data": [ - * { - * "Id": 1, - * "Name": "Acessórios do bicho", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "extra", - * "MaxCaracters": "", - * "DomainValues": "[0-3]#1[1-2][1]pricetable1;#3[0-2][0]pricetable2;#5[0-2][0]pricetable3" - * } - * ] - * }, - * { - * "Id": 2, - * "Name": "Sobrenome", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 3, - * "Name": "Assinatura Teste", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": " vtex.subscription.key.frequency", - * "MaxCaracters": "", - * "DomainValues": "1 day, 7 day, 1 month, 6 month" - * }, - * { - * "FieldName": "vtex.subscription.key.validity.begin", - * "MaxCaracters": "", - * "DomainValues": "1" - * }, - * { - * "FieldName": "vtex.subscription.key.validity.end", - * "MaxCaracters": "", - * "DomainValues": "31" - * }, - * { - * "FieldName": "vtex.subscription.key.purchaseday", - * "MaxCaracters": "", - * "DomainValues": "1, 2, 20, 31" - * } - * ] - * }, - * { - * "Id": 5, - * "Name": "teste", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 6, - * "Name": "teste2", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 7, - * "Name": "vtex.subscription.teste3", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 8, - * "Name": "teste api nova", - * "IsRequired": true, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "Basic teste", - * "MaxCaracters": "", - * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - * }, - * { - * "FieldName": "teste", - * "MaxCaracters": "", - * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" - * } - * ] - * }, - * { - * "Id": 9, - * "Name": "vtex.subscription.teste", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 10, - * "Name": "Montagens", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [] - * }, - * { - * "Id": 11, - * "Name": "vtex.subscription.subscription", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "vtex.subscription.key.frequency", - * "MaxCaracters": "15", - * "DomainValues": "1 month" - * }, - * { - * "FieldName": "vtex.subscription.key.purchaseday", - * "MaxCaracters": "15", - * "DomainValues": "1,15,28" - * } - * ] - * }, - * { - * "Id": 12, - * "Name": "T-Shirt Customization", - * "IsRequired": false, - * "IsActive": true, - * "Domains": [ - * { - * "FieldName": "T-Shirt Name", - * "MaxCaracters": "15", - * "DomainValues": "[]" - * } - * ] - * } - * ] - * } + * Retrieves information about all registered attachments. + * >⚠️ To understand the specific syntax for Assembly Options attachments, read the [Assembly Options](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH#assembly-options-syntax) documentation. + * ## Response body example + * + * ```json + * { + * "Page": 1, + * "Size": 11, + * "TotalRows": 11, + * "TotalPage": 1, + * "Data": [ + * { + * "Id": 1, + * "Name": "Acessórios do bicho", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "extra", + * "MaxCaracters": "", + * "DomainValues": "[0-3]#1[1-2][1]pricetable1;#3[0-2][0]pricetable2;#5[0-2][0]pricetable3" + * } + * ] + * }, + * { + * "Id": 2, + * "Name": "Sobrenome", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 3, + * "Name": "Assinatura Teste", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": " vtex.subscription.key.frequency", + * "MaxCaracters": "", + * "DomainValues": "1 day, 7 day, 1 month, 6 month" + * }, + * { + * "FieldName": "vtex.subscription.key.validity.begin", + * "MaxCaracters": "", + * "DomainValues": "1" + * }, + * { + * "FieldName": "vtex.subscription.key.validity.end", + * "MaxCaracters": "", + * "DomainValues": "31" + * }, + * { + * "FieldName": "vtex.subscription.key.purchaseday", + * "MaxCaracters": "", + * "DomainValues": "1, 2, 20, 31" + * } + * ] + * }, + * { + * "Id": 5, + * "Name": "teste", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 6, + * "Name": "teste2", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 7, + * "Name": "vtex.subscription.teste3", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 8, + * "Name": "teste api nova", + * "IsRequired": true, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "Basic teste", + * "MaxCaracters": "", + * "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + * }, + * { + * "FieldName": "teste", + * "MaxCaracters": "", + * "DomainValues": "[0-10]#8[0-3][0]medium;#9[0-3][0]medium;#10[0-3][0]medium;#11[0-3][0]medium;#36[0-3][0]medium;#37[0-3][0]medium;#38[0-3][0]medium" + * } + * ] + * }, + * { + * "Id": 9, + * "Name": "vtex.subscription.teste", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 10, + * "Name": "Montagens", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [] + * }, + * { + * "Id": 11, + * "Name": "vtex.subscription.subscription", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "vtex.subscription.key.frequency", + * "MaxCaracters": "15", + * "DomainValues": "1 month" + * }, + * { + * "FieldName": "vtex.subscription.key.purchaseday", + * "MaxCaracters": "15", + * "DomainValues": "1,15,28" + * } + * ] + * }, + * { + * "Id": 12, + * "Name": "T-Shirt Customization", + * "IsRequired": false, + * "IsActive": true, + * "Domains": [ + * { + * "FieldName": "T-Shirt Name", + * "MaxCaracters": "15", + * "DomainValues": "[]" + * } + * ] + * } + * ] + * } * ``` */ "GET /api/catalog/pvt/attachments": { @@ -6476,22 +6534,22 @@ SpecificationFieldId?: number /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Retrieves general information of a Collection. - * - * ## Response body example - * - * ```json - * { - * "Id": 159, - * "Name": "Winter", - * "Description": null, - * "Searchable": false, - * "Highlight": false, - * "DateFrom": "2021-09-27T10:47:00", - * "DateTo": "2027-09-27T10:47:00", - * "TotalProducts": 0, - * "Type": "Manual" - * } + * Retrieves general information of a Collection. + * + * ## Response body example + * + * ```json + * { + * "Id": 159, + * "Name": "Winter", + * "Description": null, + * "Searchable": false, + * "Highlight": false, + * "DateFrom": "2021-09-27T10:47:00", + * "DateTo": "2027-09-27T10:47:00", + * "TotalProducts": 0, + * "Type": "Manual" + * } * ``` */ "GET /api/catalog/pvt/collection/:collectionId": { @@ -6537,33 +6595,33 @@ Type?: string /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Updates a previously created Collection. - * ## Request body example - * - * ```json - * { - * "Name": "Winter", - * "Searchable": false, - * "Highlight": false, - * "DateFrom": "2021-09-27T10:47:00", - * "DateTo": "2027-09-27T10:47:00" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 159, - * "Name": "Winter", - * "Description": null, - * "Searchable": false, - * "Highlight": false, - * "DateFrom": "2021-09-27T10:47:00", - * "DateTo": "2027-09-27T10:47:00", - * "TotalProducts": 0, - * "Type": "Manual" - * } + * Updates a previously created Collection. + * ## Request body example + * + * ```json + * { + * "Name": "Winter", + * "Searchable": false, + * "Highlight": false, + * "DateFrom": "2021-09-27T10:47:00", + * "DateTo": "2027-09-27T10:47:00" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 159, + * "Name": "Winter", + * "Description": null, + * "Searchable": false, + * "Highlight": false, + * "DateFrom": "2021-09-27T10:47:00", + * "DateTo": "2027-09-27T10:47:00", + * "TotalProducts": 0, + * "Type": "Manual" + * } * ``` */ "PUT /api/catalog/pvt/collection/:collectionId": { @@ -6639,33 +6697,33 @@ Type?: string /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Creates a new Collection. - * ## Request body example - * - * ```json - * { - * "Name": "Winter", - * "Searchable": false, - * "Highlight": false, - * "DateFrom": "2021-09-27T10:47:00", - * "DateTo": "2027-09-27T10:47:00" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 159, - * "Name": "Winter", - * "Description": null, - * "Searchable": false, - * "Highlight": false, - * "DateFrom": "2021-09-27T10:47:00", - * "DateTo": "2027-09-27T10:47:00", - * "TotalProducts": 0, - * "Type": "Manual" - * } + * Creates a new Collection. + * ## Request body example + * + * ```json + * { + * "Name": "Winter", + * "Searchable": false, + * "Highlight": false, + * "DateFrom": "2021-09-27T10:47:00", + * "DateTo": "2027-09-27T10:47:00" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 159, + * "Name": "Winter", + * "Description": null, + * "Searchable": false, + * "Highlight": false, + * "DateFrom": "2021-09-27T10:47:00", + * "DateTo": "2027-09-27T10:47:00", + * "TotalProducts": 0, + * "Type": "Manual" + * } * ``` */ "POST /api/catalog/pvt/collection": { @@ -6733,36 +6791,36 @@ Type?: string /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Retrieves all Subcollections given a Collection ID. A Subcollection is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 12, - * "CollectionId": 149, - * "Name": "Subcollection", - * "Type": "Inclusive", - * "PreSale": false, - * "Release": true - * }, - * { - * "Id": 13, - * "CollectionId": 149, - * "Name": "Test", - * "Type": "Exclusive", - * "PreSale": true, - * "Release": false - * }, - * { - * "Id": 14, - * "CollectionId": 149, - * "Name": "asdfghj", - * "Type": "Inclusive", - * "PreSale": false, - * "Release": false - * } - * ] + * Retrieves all Subcollections given a Collection ID. A Subcollection is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 12, + * "CollectionId": 149, + * "Name": "Subcollection", + * "Type": "Inclusive", + * "PreSale": false, + * "Release": true + * }, + * { + * "Id": 13, + * "CollectionId": 149, + * "Name": "Test", + * "Type": "Exclusive", + * "PreSale": true, + * "Release": false + * }, + * { + * "Id": 14, + * "CollectionId": 149, + * "Name": "asdfghj", + * "Type": "Inclusive", + * "PreSale": false, + * "Release": false + * } + * ] * ``` */ "GET /api/catalog/pvt/collection/:collectionId/subcollection": { @@ -6796,18 +6854,18 @@ Release?: boolean /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Retrieves information about a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Response body example - * - * ```json - * { - * "Id": 13, - * "CollectionId": 149, - * "Name": "Test", - * "Type": "Exclusive", - * "PreSale": true, - * "Release": false - * } + * Retrieves information about a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Response body example + * + * ```json + * { + * "Id": 13, + * "CollectionId": 149, + * "Name": "Test", + * "Type": "Exclusive", + * "PreSale": true, + * "Release": false + * } * ``` */ "GET /api/catalog/pvt/subcollection/:subCollectionId": { @@ -6841,18 +6899,18 @@ Release?: boolean /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Updates a previously created Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * - * ## Request or response body example - * - * ```json - * { - * "CollectionId": 149, - * "Name": "Test", - * "Type": "Exclusive", - * "PreSale": true, - * "Release": false - * } + * Updates a previously created Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * + * ## Request or response body example + * + * ```json + * { + * "CollectionId": 149, + * "Name": "Test", + * "Type": "Exclusive", + * "PreSale": true, + * "Release": false + * } * ``` */ "PUT /api/catalog/pvt/subcollection/:subCollectionId": { @@ -6916,29 +6974,29 @@ Release?: boolean /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Creates a new Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. A Subcollection can be either “Exclusive” (all the products contained in it will not be used) or “Inclusive” (all the products contained in it will be used). - * ## Request body example - * - * ```json - * { - * "CollectionId": 149, - * "Name": "Test", - * "Type": "Exclusive", - * "PreSale": true, - * "Release": false - * } - * ``` - * ## Response body example - * - * ```json - * { - * "Id": 13, - * "CollectionId": 149, - * "Name": "Test", - * "Type": "Exclusive", - * "PreSale": true, - * "Release": false - * } + * Creates a new Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. A Subcollection can be either “Exclusive” (all the products contained in it will not be used) or “Inclusive” (all the products contained in it will be used). + * ## Request body example + * + * ```json + * { + * "CollectionId": 149, + * "Name": "Test", + * "Type": "Exclusive", + * "PreSale": true, + * "Release": false + * } + * ``` + * ## Response body example + * + * ```json + * { + * "Id": 13, + * "CollectionId": 149, + * "Name": "Test", + * "Type": "Exclusive", + * "PreSale": true, + * "Release": false + * } * ``` */ "POST /api/catalog/pvt/subcollection": { @@ -6994,15 +7052,15 @@ Release?: boolean /** * >⚠️ There are two ways to configure collections, through Legacy CMS Portal or using the Beta Collection module. This endpoint is compatible with [collections configured through the Legacy CMS Portal](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L). * - * Edits the position of an SKU that already exists in the Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - * ## Request body example - * - * ```json - * { - * "skuId": 1, - * "position": 1, - * "subCollectionId": 17 - * } + * Edits the position of an SKU that already exists in the Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + * ## Request body example + * + * ```json + * { + * "skuId": 1, + * "position": 1, + * "subCollectionId": 17 + * } * ``` */ "POST /api/catalog/pvt/collection/:collectionId/position": { @@ -7022,29 +7080,29 @@ subCollectionId: number } } /** - * Retrieves information of a Product or SKU Specification. - * ## Response body example - * - * ```json - * { - * "Id": 88, - * "FieldTypeId": 1, - * "CategoryId": 4, - * "FieldGroupId": 20, - * "Name": "Material", - * "Description": "Composition of the product.", - * "Position": 1, - * "IsFilter": true, - * "IsRequired": true, - * "IsOnProductDetails": false, - * "IsStockKeepingUnit": false, - * "IsWizard": false, - * "IsActive": true, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": "Cotton" - * } - * ``` + * Retrieves information of a Product or SKU Specification. + * ## Response body example + * + * ```json + * { + * "Id": 88, + * "FieldTypeId": 1, + * "CategoryId": 4, + * "FieldGroupId": 20, + * "Name": "Material", + * "Description": "Composition of the product.", + * "Position": 1, + * "IsFilter": true, + * "IsRequired": true, + * "IsOnProductDetails": false, + * "IsStockKeepingUnit": false, + * "IsWizard": false, + * "IsActive": true, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": "Cotton" + * } + * ``` * */ "GET /api/catalog/pvt/specification/:specificationId": { @@ -7117,53 +7175,53 @@ DefaultValue: (null | string) } } /** - * Updates a Product Specification or SKU Specification. - * - * >⚠️ It is not possible to edit `FieldTypeId`, `CategoryId`, `FieldGroupId` or `IsStockKeepingUnit` in this API call. - * - * ## Request body example - * - * ```json - * { - * "FieldTypeId": 1, - * "CategoryId": 4, - * "FieldGroupId": 20, - * "Name": "Material", - * "Description": "Composition of the product.", - * "Position": 1, - * "IsFilter": true, - * "IsRequired": true, - * "IsOnProductDetails": false, - * "IsStockKeepingUnit": false, - * "IsActive": true, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": "Leather" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 88, - * "FieldTypeId": 1, - * "CategoryId": 4, - * "FieldGroupId": 20, - * "Name": "Material", - * "Description": "Composition of the product.", - * "Position": 1, - * "IsFilter": true, - * "IsRequired": true, - * "IsOnProductDetails": false, - * "IsStockKeepingUnit": false, - * "IsWizard": false, - * "IsActive": true, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": "Leather" - * } - * ``` + * Updates a Product Specification or SKU Specification. + * + * >⚠️ It is not possible to edit `FieldTypeId`, `CategoryId`, `FieldGroupId` or `IsStockKeepingUnit` in this API call. + * + * ## Request body example + * + * ```json + * { + * "FieldTypeId": 1, + * "CategoryId": 4, + * "FieldGroupId": 20, + * "Name": "Material", + * "Description": "Composition of the product.", + * "Position": 1, + * "IsFilter": true, + * "IsRequired": true, + * "IsOnProductDetails": false, + * "IsStockKeepingUnit": false, + * "IsActive": true, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": "Leather" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 88, + * "FieldTypeId": 1, + * "CategoryId": 4, + * "FieldGroupId": 20, + * "Name": "Material", + * "Description": "Composition of the product.", + * "Position": 1, + * "IsFilter": true, + * "IsRequired": true, + * "IsOnProductDetails": false, + * "IsStockKeepingUnit": false, + * "IsWizard": false, + * "IsActive": true, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": "Leather" + * } + * ``` * */ "PUT /api/catalog/pvt/specification/:specificationId": { @@ -7256,14 +7314,14 @@ Name?: string */ Description?: (null | string) /** - * Store Framework - Deprecated. - * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. * */ Position?: number /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter?: boolean @@ -7272,8 +7330,8 @@ IsFilter?: boolean */ IsRequired?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails?: boolean @@ -7290,14 +7348,14 @@ IsWizard?: (null | boolean) */ IsActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive?: boolean @@ -7308,50 +7366,50 @@ DefaultValue?: string } } /** - * Creates a new Product or SKU Specification. - * ## Request body example - * - * ```json - * { - * "FieldTypeId": 1, - * "CategoryId": 4, - * "FieldGroupId": 20, - * "Name": "Material", - * "Description": "Composition of the product.", - * "Position": 1, - * "IsFilter": true, - * "IsRequired": true, - * "IsOnProductDetails": false, - * "IsStockKeepingUnit": false, - * "IsActive": true, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": "Cotton" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 88, - * "FieldTypeId": 1, - * "CategoryId": 4, - * "FieldGroupId": 20, - * "Name": "Material", - * "Description": "Composition of the product.", - * "Position": 1, - * "IsFilter": true, - * "IsRequired": true, - * "IsOnProductDetails": false, - * "IsStockKeepingUnit": false, - * "IsWizard": false, - * "IsActive": true, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": "Cotton" - * } - * ``` + * Creates a new Product or SKU Specification. + * ## Request body example + * + * ```json + * { + * "FieldTypeId": 1, + * "CategoryId": 4, + * "FieldGroupId": 20, + * "Name": "Material", + * "Description": "Composition of the product.", + * "Position": 1, + * "IsFilter": true, + * "IsRequired": true, + * "IsOnProductDetails": false, + * "IsStockKeepingUnit": false, + * "IsActive": true, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": "Cotton" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 88, + * "FieldTypeId": 1, + * "CategoryId": 4, + * "FieldGroupId": 20, + * "Name": "Material", + * "Description": "Composition of the product.", + * "Position": 1, + * "IsFilter": true, + * "IsRequired": true, + * "IsOnProductDetails": false, + * "IsStockKeepingUnit": false, + * "IsWizard": false, + * "IsActive": true, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": "Cotton" + * } + * ``` * */ "POST /api/catalog/pvt/specification": { @@ -7377,14 +7435,14 @@ Name: string */ Description?: (null | string) /** - * Store Framework - Deprecated. - * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. * */ Position?: number /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter?: boolean @@ -7393,8 +7451,8 @@ IsFilter?: boolean */ IsRequired?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails?: boolean @@ -7411,14 +7469,14 @@ IsWizard?: (null | boolean) */ IsActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive?: boolean @@ -7453,14 +7511,14 @@ Name?: string */ Description?: (null | string) /** - * Store Framework - Deprecated. - * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. * */ Position?: number /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter?: boolean @@ -7469,8 +7527,8 @@ IsFilter?: boolean */ IsRequired?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails?: boolean @@ -7487,14 +7545,14 @@ IsWizard?: (null | boolean) */ IsActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive?: boolean @@ -7505,35 +7563,35 @@ DefaultValue?: string } } /** - * Retrieves details from a specification field by this field's ID. - * >⚠️ This is a legacy endpoint. We recommend using [Get Specification](https://developers.vtex.com/vtex-rest-api/reference/get_api-catalog-pvt-specification-specificationid) instead. - * - * ## Response body example - * - * ```json - * { - * "Name": "Material", - * "CategoryId": 4, - * "FieldId": 88, - * "IsActive": true, - * "IsRequired": true, - * "FieldTypeId": 1, - * "FieldTypeName": "Texto", - * "FieldValueId": null, - * "Description": "Composition of the product.", - * "IsStockKeepingUnit": false, - * "IsFilter": true, - * "IsOnProductDetails": false, - * "Position": 1, - * "IsWizard": false, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": true, - * "DefaultValue": null, - * "FieldGroupId": 20, - * "FieldGroupName": "Clothes specifications" - * } - * ``` - * + * Retrieves details from a specification field by this field's ID. + * >⚠️ This is a legacy endpoint. We recommend using [Get Specification](https://developers.vtex.com/vtex-rest-api/reference/get_api-catalog-pvt-specification-specificationid) instead. + * + * ## Response body example + * + * ```json + * { + * "Name": "Material", + * "CategoryId": 4, + * "FieldId": 88, + * "IsActive": true, + * "IsRequired": true, + * "FieldTypeId": 1, + * "FieldTypeName": "Texto", + * "FieldValueId": null, + * "Description": "Composition of the product.", + * "IsStockKeepingUnit": false, + * "IsFilter": true, + * "IsOnProductDetails": false, + * "Position": 1, + * "IsWizard": false, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": true, + * "DefaultValue": null, + * "FieldGroupId": 20, + * "FieldGroupName": "Clothes specifications" + * } + * ``` + * * */ "GET /api/catalog_system/pub/specification/fieldGet/:fieldId": { @@ -7575,20 +7633,20 @@ Description?: (null | string) */ IsStockKeepingUnit?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal - This position number is used in ordering the specifications both in the navigation menu and in the specification listing on the product page. * */ Position?: number @@ -7597,14 +7655,14 @@ Position?: number */ IsWizard?: (null | boolean) /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive?: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive?: boolean @@ -7623,38 +7681,38 @@ FieldGroupName?: string } } /** - * Creates a specification field in a category. - * >⚠️ This is a legacy endpoint. We recommend using [Create Specification](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-post-specification) instead. - * - * ## Request body example - * - * ```json - * { - * "Name": "Material", - * "CategoryId": 4, - * "FieldId": 88, - * "IsActive": true, - * "IsRequired": true, - * "FieldTypeId": 1, - * "FieldValueId": 1, - * "IsStockKeepingUnit": false, - * "Description": "Composition of the product.", - * "IsFilter": true, - * "IsOnProductDetails": false, - * "Position": 1, - * "IsWizard": false, - * "IsTopMenuLinkActive": true, - * "IsSideMenuLinkActive": true, - * "DefaultValue": null, - * "FieldGroupId": 20, - * "FieldGroupName": "Clothes specifications" - * } - * ``` - * - * ## Response body example - * - * ```json - * 89 + * Creates a specification field in a category. + * >⚠️ This is a legacy endpoint. We recommend using [Create Specification](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-post-specification) instead. + * + * ## Request body example + * + * ```json + * { + * "Name": "Material", + * "CategoryId": 4, + * "FieldId": 88, + * "IsActive": true, + * "IsRequired": true, + * "FieldTypeId": 1, + * "FieldValueId": 1, + * "IsStockKeepingUnit": false, + * "Description": "Composition of the product.", + * "IsFilter": true, + * "IsOnProductDetails": false, + * "Position": 1, + * "IsWizard": false, + * "IsTopMenuLinkActive": true, + * "IsSideMenuLinkActive": true, + * "DefaultValue": null, + * "FieldGroupId": 20, + * "FieldGroupName": "Clothes specifications" + * } + * ``` + * + * ## Response body example + * + * ```json + * 89 * ``` */ "POST /api/catalog_system/pvt/specification/field": { @@ -7665,37 +7723,37 @@ body: SpecificationsInsertFieldRequest response: number } /** - * Updates a specification field in a category. - * >⚠️ This is a legacy endpoint. We recommend using [Update Specification](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-put-specification) instead. - * - * ## Request body example - * - * ```json - * { - * "FieldId": 89, - * "Name": "Material", - * "CategoryId": 4, - * "IsActive": true, - * "IsRequired": true, - * "FieldTypeId": 1, - * "Description": "Composition of the product.", - * "IsStockKeepingUnit": false, - * "IsFilter": true, - * "IsOnProductDetails": true, - * "Position": 1, - * "IsWizard": false, - * "IsTopMenuLinkActive": false, - * "IsSideMenuLinkActive": false, - * "DefaultValue": "Cotton", - * "FieldGroupId": 20, - * "FieldGroupName": "Clothes specifications" - * } - * ``` - * - * ## Response body example - * - * ```json - * 89 + * Updates a specification field in a category. + * >⚠️ This is a legacy endpoint. We recommend using [Update Specification](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-put-specification) instead. + * + * ## Request body example + * + * ```json + * { + * "FieldId": 89, + * "Name": "Material", + * "CategoryId": 4, + * "IsActive": true, + * "IsRequired": true, + * "FieldTypeId": 1, + * "Description": "Composition of the product.", + * "IsStockKeepingUnit": false, + * "IsFilter": true, + * "IsOnProductDetails": true, + * "Position": 1, + * "IsWizard": false, + * "IsTopMenuLinkActive": false, + * "IsSideMenuLinkActive": false, + * "DefaultValue": "Cotton", + * "FieldGroupId": 20, + * "FieldGroupName": "Clothes specifications" + * } + * ``` + * + * ## Response body example + * + * ```json + * 89 * ``` */ "PUT /api/catalog_system/pvt/specification/field": { @@ -7706,20 +7764,20 @@ body: SpecificationsInsertFieldUpdateRequest response: number } /** - * Retrieves details from a specification field's value by this value's ID. - * >⚠️ This is a legacy endpoint. We recommend using [Get Specification Value](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-specification-value-id) instead. - * - * ## Response body example - * - * ```json - * { - * "FieldValueId": 143, - * "FieldId": 34, - * "Name": "TesteInsert", - * "Text": "Value Description", - * "IsActive": true, - * "Position": 100 - * } + * Retrieves details from a specification field's value by this value's ID. + * >⚠️ This is a legacy endpoint. We recommend using [Get Specification Value](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-get-specification-value-id) instead. + * + * ## Response body example + * + * ```json + * { + * "FieldValueId": 143, + * "FieldId": 34, + * "Name": "TesteInsert", + * "Text": "Value Description", + * "IsActive": true, + * "Position": 100 + * } * ``` */ "GET /api/catalog_system/pvt/specification/fieldValue/:fieldValueId": { @@ -7751,88 +7809,88 @@ Position?: number } } /** - * Gets a list of all specification values from a Specification Field by this field's ID. - * - * ## Response body example - * - * ```json - * [ - * { - * "FieldValueId": 52, - * "Value": "0 a 6 meses", - * "IsActive": true, - * "Position": 1 - * }, - * { - * "FieldValueId": 53, - * "Value": "1 a 2 anos", - * "IsActive": true, - * "Position": 4 - * }, - * { - * "FieldValueId": 54, - * "Value": "3 a 4 anos", - * "IsActive": true, - * "Position": 3 - * }, - * { - * "FieldValueId": 55, - * "Value": "5 a 6 anos", - * "IsActive": true, - * "Position": 2 - * }, - * { - * "FieldValueId": 56, - * "Value": "7 a 8 anos", - * "IsActive": true, - * "Position": 5 - * }, - * { - * "FieldValueId": 57, - * "Value": "9 a 10 anos", - * "IsActive": true, - * "Position": 6 - * }, - * { - * "FieldValueId": 58, - * "Value": "Acima de 10 anos", - * "IsActive": true, - * "Position": 7 - * } - * ] + * Gets a list of all specification values from a Specification Field by this field's ID. + * + * ## Response body example + * + * ```json + * [ + * { + * "FieldValueId": 52, + * "Value": "0 a 6 meses", + * "IsActive": true, + * "Position": 1 + * }, + * { + * "FieldValueId": 53, + * "Value": "1 a 2 anos", + * "IsActive": true, + * "Position": 4 + * }, + * { + * "FieldValueId": 54, + * "Value": "3 a 4 anos", + * "IsActive": true, + * "Position": 3 + * }, + * { + * "FieldValueId": 55, + * "Value": "5 a 6 anos", + * "IsActive": true, + * "Position": 2 + * }, + * { + * "FieldValueId": 56, + * "Value": "7 a 8 anos", + * "IsActive": true, + * "Position": 5 + * }, + * { + * "FieldValueId": 57, + * "Value": "9 a 10 anos", + * "IsActive": true, + * "Position": 6 + * }, + * { + * "FieldValueId": 58, + * "Value": "Acima de 10 anos", + * "IsActive": true, + * "Position": 7 + * } + * ] * ``` */ "GET /api/catalog_system/pub/specification/fieldvalue/:fieldId": { response: GetSpecFieldValue[] } /** - * Creates a specification field value by the specification field's ID. - * >⚠️ This is a legacy endpoint. We recommend using [Create Specification Value](https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/specificationvalue) instead. - * - * - * ## Request body example - * - * ```json - * { - * "FieldId": 34, - * "Name": "Cotton", - * "Text": "Cotton fibers", - * "IsActive": true, - * "Position": 100 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "FieldValueId": 143, - * "FieldId": 34, - * "Name": "Cotton", - * "Text": "Cotton fibers", - * "IsActive": true, - * "Position": 100 - * } + * Creates a specification field value by the specification field's ID. + * >⚠️ This is a legacy endpoint. We recommend using [Create Specification Value](https://developers.vtex.com/docs/api-reference/catalog-api#post-/api/catalog/pvt/specificationvalue) instead. + * + * + * ## Request body example + * + * ```json + * { + * "FieldId": 34, + * "Name": "Cotton", + * "Text": "Cotton fibers", + * "IsActive": true, + * "Position": 100 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "FieldValueId": 143, + * "FieldId": 34, + * "Name": "Cotton", + * "Text": "Cotton fibers", + * "IsActive": true, + * "Position": 100 + * } * ``` */ "POST /api/catalog_system/pvt/specification/fieldValue": { @@ -7865,27 +7923,27 @@ Position?: number } } /** - * Updates a specification field value by the specification field's ID. - * >⚠️ This is a legacy endpoint. We recommend using [Update Specification Field Value](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-put-specification-value-id) instead. - * - * - * ## Request body example - * - * ```json - * { - * "FieldId": 1, - * "FieldValueId": 143, - * "Name": "Cotton", - * "Text": "Cotton fibers", - * "IsActive": true, - * "Position": 100 - * } - * ``` - * - * ## Response body example (200 OK) - * - * ```json - * "Field Value Updated" + * Updates a specification field value by the specification field's ID. + * >⚠️ This is a legacy endpoint. We recommend using [Update Specification Field Value](https://developers.vtex.com/vtex-rest-api/reference/catalog-api-put-specification-value-id) instead. + * + * + * ## Request body example + * + * ```json + * { + * "FieldId": 1, + * "FieldValueId": 143, + * "Name": "Cotton", + * "Text": "Cotton fibers", + * "IsActive": true, + * "Position": 100 + * } + * ``` + * + * ## Response body example (200 OK) + * + * ```json + * "Field Value Updated" * ``` */ "PUT /api/catalog_system/pvt/specification/fieldValue": { @@ -7896,18 +7954,18 @@ body: SpecificationsUpdateFieldValueRequest response: string } /** - * Retrieves general information about a Specification Value. - * ## Response body example - * - * ```json - * { - * "FieldValueId": 143, - * "FieldId": 34, - * "Name": "Cotton", - * "Text": "Cotton fibers", - * "IsActive": true, - * "Position": 100 - * } + * Retrieves general information about a Specification Value. + * ## Response body example + * + * ```json + * { + * "FieldValueId": 143, + * "FieldId": 34, + * "Name": "Cotton", + * "Text": "Cotton fibers", + * "IsActive": true, + * "Position": 100 + * } * ``` */ "GET /api/catalog/pvt/specificationvalue/:specificationValueId": { @@ -7939,30 +7997,30 @@ Position?: number } } /** - * Updates a new Specification Value for a Category. - * ## Request body example - * - * ```json - * { - * "FieldId": 193, - * "Name": "Metal", - * "Text": null, - * "IsActive": true, - * "Position": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "FieldValueId": 360, - * "FieldId": 193, - * "Name": "Metal", - * "Text": null, - * "IsActive": true, - * "Position": 1 - * } + * Updates a new Specification Value for a Category. + * ## Request body example + * + * ```json + * { + * "FieldId": 193, + * "Name": "Metal", + * "Text": null, + * "IsActive": true, + * "Position": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "FieldValueId": 360, + * "FieldId": 193, + * "Name": "Metal", + * "Text": null, + * "IsActive": true, + * "Position": 1 + * } * ``` */ "PUT /api/catalog/pvt/specificationvalue/:specificationValueId": { @@ -8018,29 +8076,29 @@ Position?: number } } /** - * Creates a new Specification Value for a Category. - * ## Request body example - * - * ```json - * { - * "FieldId": 193, - * "Name": "Metal", - * "IsActive": true, - * "Position": 1 - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "FieldValueId": 360, - * "FieldId": 193, - * "Name": "Metal", - * "Text": null, - * "IsActive": true, - * "Position": 1 - * } + * Creates a new Specification Value for a Category. + * ## Request body example + * + * ```json + * { + * "FieldId": 193, + * "Name": "Metal", + * "IsActive": true, + * "Position": 1 + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "FieldValueId": 360, + * "FieldId": 193, + * "Name": "Metal", + * "Text": null, + * "IsActive": true, + * "Position": 1 + * } * ``` */ "POST /api/catalog/pvt/specificationvalue": { @@ -8096,66 +8154,66 @@ Position?: number } } /** - * Retrieves a list of specification groups by the category ID. - * ## Response body example - * - * ```json - * [ - * { - * "CategoryId": 1, - * "Id": 5, - * "Name": "Materials", - * "Position": 2 - * }, - * { - * "CategoryId": 1, - * "Id": 6, - * "Name": "Sizes", - * "Position": 3 - * } - * ] + * Retrieves a list of specification groups by the category ID. + * ## Response body example + * + * ```json + * [ + * { + * "CategoryId": 1, + * "Id": 5, + * "Name": "Materials", + * "Position": 2 + * }, + * { + * "CategoryId": 1, + * "Id": 6, + * "Name": "Sizes", + * "Position": 3 + * } + * ] * ``` */ "GET /api/catalog_system/pvt/specification/groupbycategory/:categoryId": { response: SpecificationsGroup[] } /** - * Retrieves details from a specification group by the ID of the group. - * ## Response body example - * - * ```json - * { - * "CategoryId": 1, - * "Id": 6, - * "Name": "Sizes", - * "Position": 3 - * } + * Retrieves details from a specification group by the ID of the group. + * ## Response body example + * + * ```json + * { + * "CategoryId": 1, + * "Id": 6, + * "Name": "Sizes", + * "Position": 3 + * } * ``` */ "GET /api/catalog_system/pub/specification/groupGet/:groupId": { response: SpecificationsGroup } /** - * Create a specification group. - * >⚠️ It is also possible to create a Specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. - * ## Request body example - * - * ```json - * { - * "CategoryId": 1, - * "Name": "Sizes" - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 6, - * "CategoryId": 1, - * "Name": "Sizes", - * "Position": 3 - * } + * Create a specification group. + * >⚠️ It is also possible to create a Specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. + * ## Request body example + * + * ```json + * { + * "CategoryId": 1, + * "Name": "Sizes" + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 6, + * "CategoryId": 1, + * "Name": "Sizes", + * "Position": 3 + * } * ``` */ "POST /api/catalog/pvt/specificationgroup": { @@ -8174,25 +8232,25 @@ CategoryId?: number */ Name?: string /** - * Store Framework - Deprecated. + * Store Framework - Deprecated. * Legacy CMS Portal - Specification Group Position. */ Position?: number } } /** - * Update a specification group. - * >⚠️ It is also possible to update a Specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. - * - * ## Request and response body example - * - * ```json - * { - * "CategoryId": 1, - * "Id": 17, - * "Name": "NewGroupName", - * "Position": 1 - * } + * Update a specification group. + * >⚠️ It is also possible to update a Specification Group by using an alternative legacy route: `/api/catalog_system/pvt/specification/group`. + * + * ## Request and response body example + * + * ```json + * { + * "CategoryId": 1, + * "Id": 17, + * "Name": "NewGroupName", + * "Position": 1 + * } * ``` */ "PUT /api/catalog/pvt/specificationgroup/:groupId": { @@ -8234,16 +8292,16 @@ Position?: number } } /** - * Retrieves general information about unmapped Specifications of a Seller's SKU in a Marketplace. - * ## Response body example - * - * ```json - * { - * "Id": 1010, - * "SkuId": 310119072, - * "SpecificationName": "size", - * "SpecificationValue": "Small" - * } + * Retrieves general information about unmapped Specifications of a Seller's SKU in a Marketplace. + * ## Response body example + * + * ```json + * { + * "Id": 1010, + * "SkuId": 310119072, + * "SpecificationName": "size", + * "SpecificationValue": "Small" + * } * ``` */ "GET /api/catalog/pvt/specification/nonstructured/:id": { @@ -8273,18 +8331,18 @@ SpecificationValue?: string } /** - * Gets general information about unmapped Specifications of a Seller's SKU in a Marketplace by SKU ID. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 1010, - * "SkuId": 310119072, - * "SpecificationName": "size", - * "SpecificationValue": "Small" - * } - * ] + * Gets general information about unmapped Specifications of a Seller's SKU in a Marketplace by SKU ID. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 1010, + * "SkuId": 310119072, + * "SpecificationName": "size", + * "SpecificationValue": "Small" + * } + * ] * ``` */ "GET /api/catalog/pvt/specification/nonstructured": { @@ -8325,35 +8383,35 @@ skuId: number } } /** - * Retrieves a list with details about the store's sales channels. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 1, - * "Name": "Loja Principal", - * "IsActive": true, - * "ProductClusterId": null, - * "CountryCode": "BRA", - * "CultureInfo": "pt-BR", - * "TimeZone": "E. South America Standard Time", - * "CurrencyCode": "BRL", - * "CurrencySymbol": "R$", - * "CurrencyLocale": 1046, - * "CurrencyFormatInfo": { - * "CurrencyDecimalDigits": 1, - * "CurrencyDecimalSeparator": ",", - * "CurrencyGroupSeparator": ".", - * "CurrencyGroupSize": 3, - * "StartsWithCurrencySymbol": true - * }, - * "Origin": null, - * "Position": 2, - * "ConditionRule": null, - * "CurrencyDecimalDigits": 1 - * } - * ] + * Retrieves a list with details about the store's sales channels. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 1, + * "Name": "Loja Principal", + * "IsActive": true, + * "ProductClusterId": null, + * "CountryCode": "BRA", + * "CultureInfo": "pt-BR", + * "TimeZone": "E. South America Standard Time", + * "CurrencyCode": "BRL", + * "CurrencySymbol": "R$", + * "CurrencyLocale": 1046, + * "CurrencyFormatInfo": { + * "CurrencyDecimalDigits": 1, + * "CurrencyDecimalSeparator": ",", + * "CurrencyGroupSeparator": ".", + * "CurrencyGroupSize": 3, + * "StartsWithCurrencySymbol": true + * }, + * "Origin": null, + * "Position": 2, + * "ConditionRule": null, + * "CurrencyDecimalDigits": 1 + * } + * ] * ``` */ "GET /api/catalog_system/pvt/saleschannel/list": { @@ -8442,34 +8500,34 @@ CurrencyDecimalDigits?: number }[] } /** - * Retrieves a specific sales channel by its ID. - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Loja Principal", - * "IsActive": true, - * "ProductClusterId": null, - * "CountryCode": "BRA", - * "CultureInfo": "pt-BR", - * "TimeZone": "E. South America Standard Time", - * "CurrencyCode": "BRL", - * "CurrencySymbol": "R$", - * "CurrencyLocale": 1046, - * "CurrencyFormatInfo": { - * "CurrencyDecimalDigits": 1, - * "CurrencyDecimalSeparator": ",", - * "CurrencyGroupSeparator": ".", - * "CurrencyGroupSize": 3, - * "StartsWithCurrencySymbol": true - * }, - * "Origin": null, - * "Position": 2, - * "ConditionRule": null, - * "CurrencyDecimalDigits": 1 - * } + * Retrieves a specific sales channel by its ID. + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Loja Principal", + * "IsActive": true, + * "ProductClusterId": null, + * "CountryCode": "BRA", + * "CultureInfo": "pt-BR", + * "TimeZone": "E. South America Standard Time", + * "CurrencyCode": "BRL", + * "CurrencySymbol": "R$", + * "CurrencyLocale": 1046, + * "CurrencyFormatInfo": { + * "CurrencyDecimalDigits": 1, + * "CurrencyDecimalSeparator": ",", + * "CurrencyGroupSeparator": ".", + * "CurrencyGroupSize": 3, + * "StartsWithCurrencySymbol": true + * }, + * "Origin": null, + * "Position": 2, + * "ConditionRule": null, + * "CurrencyDecimalDigits": 1 + * } * ``` */ "GET /api/catalog_system/pub/saleschannel/:salesChannelId": { @@ -9115,38 +9173,38 @@ TrustPolicy?: string } } /** - * Creates a new Supplier. - * ## Request body example - * - * ```json - * { - * "Name": "Supplier", - * "CorporateName": "TopStore", - * "StateInscription": "", - * "Cnpj": "33304981001272", - * "Phone": "3333333333", - * "CellPhone": "4444444444", - * "CorportePhone": "5555555555", - * "Email": "email@email.com", - * "IsActive": true - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Supplier", - * "CorporateName": "TopStore", - * "StateInscription": "", - * "Cnpj": "33304981001272", - * "Phone": "3333333333", - * "CellPhone": "4444444444", - * "CorportePhone": "5555555555", - * "Email": "email@email.com", - * "IsActive": true - * } + * Creates a new Supplier. + * ## Request body example + * + * ```json + * { + * "Name": "Supplier", + * "CorporateName": "TopStore", + * "StateInscription": "", + * "Cnpj": "33304981001272", + * "Phone": "3333333333", + * "CellPhone": "4444444444", + * "CorportePhone": "5555555555", + * "Email": "email@email.com", + * "IsActive": true + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Supplier", + * "CorporateName": "TopStore", + * "StateInscription": "", + * "Cnpj": "33304981001272", + * "Phone": "3333333333", + * "CellPhone": "4444444444", + * "CorportePhone": "5555555555", + * "Email": "email@email.com", + * "IsActive": true + * } * ``` */ "POST /api/catalog/pvt/supplier": { @@ -9154,38 +9212,38 @@ body: SupplierRequest response: SupplierResponse } /** - * Updates general information of an existing Supplier. - * ## Request body example - * - * ```json - * { - * "Name": "Supplier", - * "CorporateName": "TopStore", - * "StateInscription": "", - * "Cnpj": "33304981001272", - * "Phone": "3333333333", - * "CellPhone": "4444444444", - * "CorportePhone": "5555555555", - * "Email": "email@email.com", - * "IsActive": true - * } - * ``` - * - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Supplier", - * "CorporateName": "TopStore", - * "StateInscription": "", - * "Cnpj": "33304981001272", - * "Phone": "3333333333", - * "CellPhone": "4444444444", - * "CorportePhone": "5555555555", - * "Email": "email@email.com", - * "IsActive": true - * } + * Updates general information of an existing Supplier. + * ## Request body example + * + * ```json + * { + * "Name": "Supplier", + * "CorporateName": "TopStore", + * "StateInscription": "", + * "Cnpj": "33304981001272", + * "Phone": "3333333333", + * "CellPhone": "4444444444", + * "CorportePhone": "5555555555", + * "Email": "email@email.com", + * "IsActive": true + * } + * ``` + * + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Supplier", + * "CorporateName": "TopStore", + * "StateInscription": "", + * "Cnpj": "33304981001272", + * "Phone": "3333333333", + * "CellPhone": "4444444444", + * "CorportePhone": "5555555555", + * "Email": "email@email.com", + * "IsActive": true + * } * ``` */ "PUT /api/catalog/pvt/supplier/:supplierId": { @@ -9199,28 +9257,28 @@ response: SupplierResponse } /** - * Retrieves a list of Trade Policies associated to a Product based on the Product's ID. - * ## Response body example - * - * ```json - * [ - * { - * "ProductId": 1, - * "StoreId": 1 - * }, - * { - * "ProductId": 1, - * "StoreId": 2 - * }, - * { - * "ProductId": 1, - * "StoreId": 3 - * }, - * { - * "ProductId": 1, - * "StoreId": 4 - * } - * ] + * Retrieves a list of Trade Policies associated to a Product based on the Product's ID. + * ## Response body example + * + * ```json + * [ + * { + * "ProductId": 1, + * "StoreId": 1 + * }, + * { + * "ProductId": 1, + * "StoreId": 2 + * }, + * { + * "ProductId": 1, + * "StoreId": 3 + * }, + * { + * "ProductId": 1, + * "StoreId": 4 + * } + * ] * ``` */ "GET /api/catalog/pvt/product/:productId/salespolicy": { @@ -9248,34 +9306,34 @@ StoreId?: number } /** - * Retrieves a list of SKU IDs of a Trade Policy. - * ## Response body example - * - * ```json - * [ - * 405380, - * 405381, - * 405382, - * 405383, - * 405384, - * 405385, - * 405386, - * 405387, - * 405388, - * 405389, - * 405390, - * 405391, - * 405392, - * 405393, - * 405394, - * 405395, - * 405396, - * 405397, - * 405398, - * 405399, - * 405400, - * 405556 - * ] + * Retrieves a list of SKU IDs of a Trade Policy. + * ## Response body example + * + * ```json + * [ + * 405380, + * 405381, + * 405382, + * 405383, + * 405384, + * 405385, + * 405386, + * 405387, + * 405388, + * 405389, + * 405390, + * 405391, + * 405392, + * 405393, + * 405394, + * 405395, + * 405396, + * 405397, + * 405398, + * 405399, + * 405400, + * 405556 + * ] * ``` */ "GET /api/catalog_system/pvt/sku/stockkeepingunitidsbysaleschannel": { @@ -9303,55 +9361,55 @@ onlyAssigned?: boolean response: number[] } /** - * Retrieve details of a Product's Indexed Information in XML format. - * ## Response body example - * - * ```xml - * " - * \n - * \n - * - * true - * 0 - * 2 - * - * * - * - * instanceId:394dbdc8-b1f4-4dea-adfa-1ec104f3bfe1 - * productId:1 - * - * - * - * - * - * - * - * - * - * \n - * \n" + * Retrieve details of a Product's Indexed Information in XML format. + * ## Response body example + * + * ```xml + * " + * \n + * \n + * + * true + * 0 + * 2 + * + * * + * + * instanceId:394dbdc8-b1f4-4dea-adfa-1ec104f3bfe1 + * productId:1 + * + * + * + * + * + * + * + * + * + * \n + * \n" * ``` */ "GET /api/catalog_system/pvt/products/GetIndexedInfo/:productId": { } /** - * Lists all commercial conditions on the store. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 1, - * "Name": "Padrão", - * "IsDefault": true - * }, - * { - * "Id": 2, - * "Name": "Teste Fast", - * "IsDefault": false - * } - * ] + * Lists all commercial conditions on the store. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 1, + * "Name": "Padrão", + * "IsDefault": true + * }, + * { + * "Id": 2, + * "Name": "Teste Fast", + * "IsDefault": false + * } + * ] * ``` */ "GET /api/catalog_system/pvt/commercialcondition/list": { @@ -9371,15 +9429,15 @@ IsDefault?: boolean }[] } /** - * Retrieves information of a commercial condition by its ID. - * ## Response body example - * - * ```json - * { - * "Id": 1, - * "Name": "Padrão", - * "IsDefault": true - * } + * Retrieves information of a commercial condition by its ID. + * ## Response body example + * + * ```json + * { + * "Id": 1, + * "Name": "Padrão", + * "IsDefault": true + * } * ``` */ "GET /api/catalog_system/pvt/commercialcondition/:commercialConditionId": { @@ -9573,22 +9631,23 @@ fileUrl?: (null | string) } } /** - * This endpoint is used to simulate a cart in VTEX Checkout. - * - * It receives an **SKU ID**, the **quantity** of items in the cart and the ID of the **Seller**. - * - * It sends back all information about the cart, such as the selling price of each item, rates and benefits data, payment and logistics info. - * - * This is useful whenever you need to know the availability of fulfilling an order for a specific cart setting, since the API response will let you know the updated price, inventory and shipping data. - * + * This endpoint is used to simulate a cart in VTEX Checkout. + * + * It receives an **SKU ID**, the **quantity** of items in the cart and the ID of the **Seller**. + * + * It sends back all information about the cart, such as the selling price of each item, rates and benefits data, payment and logistics info. + * + * This is useful whenever you need to know the availability of fulfilling an order for a specific cart setting, since the API response will let you know the updated price, inventory and shipping data. + * * **Important**: The fields (`sku id`, `quantity`, `seller`, `country`, `postalCode` and `geoCoordinates`) are just examples of content that you can simulate in your cart. You can add more fields to the request as per your need. Access the [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) guide to check the available fields. */ "POST /api/checkout/pub/orderForms/simulation": { searchParams: { /** * This parameter defines which promotions apply to the simulation. Use `0` for simulations at cart stage, which means all promotions apply. In case of window simulation use `1`, which indicates promotions that apply nominal discounts over the total purchase value shouldn't be considered on the simulation. - * - * Note that if this not sent, the parameter is `1`. + * + * +Note that if this not sent, the parameter is `1`. */ RnbBehavior?: number /** @@ -10332,13 +10391,14 @@ assemblyOptions?: any[] } } /** - * You can use this request to get your current shopping cart information (`orderFormId`) or to create a new cart. - * - * **Important**: To create a new empty shopping cart you need to send this request with the query param `forceNewCart=true`. - * + * You can use this request to get your current shopping cart information (`orderFormId`) or to create a new cart. + * + * **Important**: To create a new empty shopping cart you need to send this request with the query param `forceNewCart=true`. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` obtained in response is the identification code of the newly created cart. - * - * > This request has a time out of 45 seconds. + * + * +> This request has a time out of 45 seconds. */ "GET /api/checkout/pub/orderForm": { searchParams: { @@ -10349,11 +10409,12 @@ forceNewCart?: boolean } } /** - * Use this request to get all information associated to a given shopping cart. - * + * Use this request to get all information associated to a given shopping cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 45 seconds. + * + * +> This request has a time out of 45 seconds. */ "GET /api/checkout/pub/orderForm/:orderFormId": { searchParams: { @@ -10364,12 +10425,12 @@ refreshOutdatedData?: boolean } } /** - * This request removes all items from a given cart, leaving it empty. - * - * You must send an empty JSON in the body of the request. - * - * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * + * This request removes all items from a given cart, leaving it empty. + * + * You must send an empty JSON in the body of the request. + * + * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + * * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. */ "POST /api/checkout/pub/orderForm/:orderFormId/items/removeAll": { @@ -10384,10 +10445,10 @@ response: { } } /** - * This call removes all user information, making a cart anonymous while leaving the items. - * - * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information about it. Hence, the `orderFormId` is the identification code of a given cart. - * + * This call removes all user information, making a cart anonymous while leaving the items. + * + * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information about it. Hence, the `orderFormId` is the identification code of a given cart. + * * This call works by creating a new orderForm, setting a new cookie, and returning a redirect 302 to the cart URL (`/checkout/#/orderform`). */ "GET /checkout/changeToAnonymousUser/:orderFormId": { @@ -10395,22 +10456,26 @@ response: { } /** * You can use this request to: - * - * 1. Change the quantity of one or more items in a specific cart. - * 2. Remove an item from the cart (by sending the `quantity` value = `0` in the request body). - * - * **Important**: To remove all items from the cart at the same time, use the [Remove all items](https://developers.vtex.com/vtex-rest-api/reference/removeallitems) endpoint. - * + * + * +1. Change the quantity of one or more items in a specific cart. + * +2. Remove an item from the cart (by sending the `quantity` value = `0` in the request body). + * + * **Important**: To remove all items from the cart at the same time, use the [Remove all items](https://developers.vtex.com/vtex-rest-api/reference/removeallitems) endpoint. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 45 seconds. + * + * +> This request has a time out of 45 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/items/update": { searchParams: { /** * In order to optimize performance, this parameter allows some information to not be updated when there are changes in the minicart. For instance, if a shopper adds another unit of a given SKU to the cart, it may not be necessary to recalculate payment information, which could impact performance. - * - * This array accepts strings and currently the only possible value is `”paymentData”`. + * + * +This array accepts strings and currently the only possible value is `”paymentData”`. */ allowedOutdatedData?: any[] } @@ -11517,18 +11582,20 @@ ascending?: boolean } } /** - * Use this request to add a new item to the shopping cart. - * + * Use this request to add a new item to the shopping cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 45 seconds. + * + * +> This request has a time out of 45 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/items": { searchParams: { /** * In order to optimize performance, this parameter allows some information to not be updated when there are changes in the minicart. For instance, if a shopper adds another unit of a given SKU to the cart, it may not be necessary to recalculate payment information, which could impact performance. - * - * This array accepts strings and currently the only possible value is `”paymentData”`. + * + * +This array accepts strings and currently the only possible value is `”paymentData”`. */ allowedOutdatedData?: any[] } @@ -12644,15 +12711,18 @@ ascending?: boolean } /** * You can use this request to: - * - * 1. Change the quantity or price of one or more items to the shopping cart. - * 2. Add a new item to the shopping cart. - * - * **Important**: To add a new item to the shopping cart, do not send the string `index` in the request body. - * + * + * +1. Change the quantity or price of one or more items to the shopping cart. + * +2. Add a new item to the shopping cart. + * + * **Important**: To add a new item to the shopping cart, do not send the string `index` in the request body. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure that represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 45 seconds. + * + * +> This request has a time out of 45 seconds. */ "PATCH /api/checkout/pub/orderForm/:orderFormId/items": { body: { @@ -13789,26 +13859,30 @@ ascending?: boolean } } /** - * This request changes the price of an SKU in a cart. - * + * This request changes the price of an SKU in a cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * You need to inform which cart you are referring to, by sending its `orderFormId` and what is the item whose price you want to change, by sending its `itemIndex`. - * - * You also need to pass the new price value in the body. - * - * Remember that, to use this endpoint, the feature of *manual price* must be active. To check if it's active, use the [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm) endpoint. To make it active, use the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) endpoint, making the `allowManualPrice` field `true`. - * - * > Whenever you use this request to change the price of an item, all items in that cart with the same SKU are affected by this change. This applies even to items that share the SKU but have been separated into different objects in the `items` array due to customizations or attachments, for example. + * + * +You need to inform which cart you are referring to, by sending its `orderFormId` and what is the item whose price you want to change, by sending its `itemIndex`. + * + * +You also need to pass the new price value in the body. + * + * +Remember that, to use this endpoint, the feature of *manual price* must be active. To check if it's active, use the [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm) endpoint. To make it active, use the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) endpoint, making the `allowManualPrice` field `true`. + * + * +> Whenever you use this request to change the price of an item, all items in that cart with the same SKU are affected by this change. This applies even to items that share the SKU but have been separated into different objects in the `items` array due to customizations or attachments, for example. */ "PUT /api/checkout/pub/orderForm/:orderFormId/items/:itemIndex/price": { body: PriceChangeRequest } /** - * When a shopper provides an email address at Checkout, the platform tries to retrieve existing profile information for that email and add it to the shopping cart information. Use this request if you want to change this behavior for a given cart, meaning profile information will not be included in the order automattically. - * - * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * + * When a shopper provides an email address at Checkout, the platform tries to retrieve existing profile information for that email and add it to the shopping cart information. Use this request if you want to change this behavior for a given cart, meaning profile information will not be included in the order automattically. + * + * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + * * Note that this request will only work if you have not sent the `clientProfileData` to the cart yet. Sending it to a cart that already has a `clientProfileData` should return a status `403 Forbidden` error, with an `Access denied` message. */ "PATCH /api/checkout/pub/orderForm/:orderFormId/profile": { @@ -13821,12 +13895,15 @@ ignoreProfileData?: boolean } /** * Retrieve a client's profile information by providing an email address. - * - * If the response body fields are empty, the following situations may have occurred: - * - * 1. There is no client registered with the email address provided in your store, or; - * 2. Client profile is invalid or incomplete. However, you can use the query parameter `ensureComplete=false` to get incomplete profiles. For more information, see [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-customer-information-automatic-fill-in--2Nuu3xAFzdhIzJIldAdtan). - * + * + * +If the response body fields are empty, the following situations may have occurred: + * + * +1. There is no client registered with the email address provided in your store, or; + * +2. Client profile is invalid or incomplete. However, you can use the query parameter `ensureComplete=false` to get incomplete profiles. For more information, see [SmartCheckout - Customer information automatic fill-in](https://help.vtex.com/en/tutorial/smartcheckout-customer-information-automatic-fill-in--2Nuu3xAFzdhIzJIldAdtan). + * * >⚠️ The authentication of this endpoint can change depending on the customer context. If you are consulting information from a customer with a complete profile on the store, the response will return the customer's data masked. You can only access the customer data with an authenticated request. */ "GET /api/checkout/pub/profiles": { @@ -13982,12 +14059,13 @@ isComplete?: boolean } } /** - * Use this request to include client profile information to a given shopping cart. - * + * Use this request to include client profile information to a given shopping cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. - * + * + * +> This request has a time out of 12 seconds. + * * >⚠️ The authentication of this endpoint can change depending on the customer context. If you are modifying information from a customer with a complete profile on the store, the response will return the customer's data masked. You can only access the customer data with an authenticated request. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/clientProfileData": { @@ -14046,14 +14124,15 @@ isCorporate?: boolean } } /** - * Use this request to include shipping information and/or selected delivery option to a given shopping cart. - * - * To add shipping addresses send the `selectedAddresses` array. For delivery option use the `logisticsInfo` array. - * + * Use this request to include shipping information and/or selected delivery option to a given shopping cart. + * + * To add shipping addresses send the `selectedAddresses` array. For delivery option use the `logisticsInfo` array. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. - * + * + * +> This request has a time out of 12 seconds. + * * >⚠️ The authentication of this endpoint can change depending on the customer context. If you are modifying information from a customer with a complete profile on the store, the response will return the customer's data masked. You can only access the customer data with an authenticated request. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/shippingData": { @@ -15195,11 +15274,12 @@ itemsOrdination?: (null | { } } /** - * Use this request to include client preferences information to a given shopping cart. - * + * Use this request to include client preferences information to a given shopping cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. + * + * +> This request has a time out of 12 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData": { body: { @@ -15215,18 +15295,20 @@ optinNewsLetter?: boolean response: any } /** - * Use this request to include marketing information to a given shopping cart. - * + * Use this request to include marketing information to a given shopping cart. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. + * + * +> This request has a time out of 12 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/marketingData": { body: { /** * Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/vtex-rest-api/reference/orderform#orderformsimulation) request to check which coupons might apply before placing the order. - * - * To send more than one coupon code to the same cart, use commas. E.g.`"sales25, blackfriday30"`. + * + * +To send more than one coupon code to the same cart, use commas. E.g.`"sales25, blackfriday30"`. */ coupon?: string /** @@ -15260,11 +15342,12 @@ utmiCampaign?: string } } /** - * Use this request to include payment information to a given shopping cart. The payment information attachment in the shopping cart does not determine the final order payment method in itself. However, it allows tha platform to update any relevant information that may be impacted by the payment method. - * + * Use this request to include payment information to a given shopping cart. The payment information attachment in the shopping cart does not determine the final order payment method in itself. However, it allows tha platform to update any relevant information that may be impacted by the payment method. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. + * + * +> This request has a time out of 12 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/paymentData": { body: { @@ -15312,11 +15395,12 @@ hasDefaultBillingAddress?: boolean } } /** - * This endpoint is used for the merchant to add to the cart any relevant information that is related to the context of a specific order. - * + * This endpoint is used for the merchant to add to the cart any relevant information that is related to the context of a specific order. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * > This request has a time out of 12 seconds. + * + * +> This request has a time out of 12 seconds. */ "POST /api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData": { body: { @@ -15339,11 +15423,13 @@ salesAssociateId?: string } /** * Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The values of these custom fields can then be updated by this request. - * - * To do that, you need to inform the ID of the app you created with the configuration API (`appId`). - * - * In the body of the request, for each field created in this app (`appFieldName`) you will inform a value (`appFieldValue`). - * + * + * +To do that, you need to inform the ID of the app you created with the configuration API (`appId`). + * + * +In the body of the request, for each field created in this app (`appFieldName`) you will inform a value (`appFieldValue`). + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. */ "PUT /api/checkout/pub/orderForm/:orderFormId/customData/:appId": { @@ -15357,11 +15443,13 @@ response: any } /** * Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The value of a specific custom field can then be updated by this request. - * - * To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). - * - * In the body of the request, you will inform the new value (`appFieldValue`, passed through the body) of the specific field created in this app (identified by the `appFieldName` parameter, passed through the URL). - * + * + * +To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). + * + * +In the body of the request, you will inform the new value (`appFieldValue`, passed through the body) of the specific field created in this app (identified by the `appFieldName` parameter, passed through the URL). + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. */ "PUT /api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName": { @@ -15369,20 +15457,24 @@ body: SetsinglecustomfieldvalueRequest } /** * Your account may create `apps`, which contain custom fields, through the [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm) request. The value of a specific custom field can be removed by this request. - * - * To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). - * - * You also need to iform the specific field created in this app (identified by the `appFieldName` parameter, also passed through the URL) whose value you want to remove. + * + * +To do that, you need to inform in the URL the ID of the app you created with the configuration API (`appId`). + * + * +You also need to iform the specific field created in this app (identified by the `appFieldName` parameter, also passed through the URL) whose value you want to remove. */ "DELETE /api/checkout/pub/orderForm/:orderFormId/customData/:appId/:appFieldName": { } /** * Retrieves the settings that are currently applied to every orderForm in the account. - * - * These settings are defined by the request [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm). - * - * Always use this request to retrieve the current configuration before performing an update. By doing so you ensure that you are modifying only the properties you want. + * + * +These settings are defined by the request [Update orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pvt/configuration/orderForm). + * + * +Always use this request to retrieve the current configuration before performing an update. By doing so you ensure that you are modifying only the properties you want. */ "GET /api/checkout/pvt/configuration/orderForm": { response: { @@ -15467,11 +15559,15 @@ maxNumberOfWhiteLabelSellers?: (null | number) maskFirstPurchaseData?: (null | boolean) /** * Configures reCAPTCHA validation for the account, defining in which situations the shopper will be prompted to validate a purchase with reCAPTCHA. Learn more about [reCAPTCHA validation for VTEX stores](https://help.vtex.com/en/tutorial/using-recaptcha-at-checkout--18Te3oDd7f4qcjKu9jhNzP) - * - * Possible values are: - * - `"never"`: no purchases are validated with reCAPTCHA. - * - `"always"`: every purchase is validated with reCAPTCHA. - * - `"vtexCriteria"`: only some purchases are validated with reCAPTCHA in order to minimize friction and improve shopping experience. VTEX's algorithm determines which sessions are trustworthy and which should be validated with reCAPTCHA. This is the recommended option. + * + * +Possible values are: + * +- `"never"`: no purchases are validated with reCAPTCHA. + * +- `"always"`: every purchase is validated with reCAPTCHA. + * +- `"vtexCriteria"`: only some purchases are validated with reCAPTCHA in order to minimize friction and improve shopping experience. VTEX's algorithm determines which sessions are trustworthy and which should be validated with reCAPTCHA. This is the recommended option. */ recaptchaValidation?: string /** @@ -15490,37 +15586,41 @@ cartAgeToUseNewCardSeconds?: number } /** * Determines settings that will apply to every orderForm in the account. - * - * For example, if you create an app using this request, every orderForm of this account will have the custom fields created though it. - * - * >ℹ️ Always retrieve the current configuration before performing an update to ensure that you are modifying only the properties you want. Otherwise, old values can be overwritten. To retrieve the current configuration, use the request [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm). + * + * +For example, if you create an app using this request, every orderForm of this account will have the custom fields created though it. + * + * +>ℹ️ Always retrieve the current configuration before performing an update to ensure that you are modifying only the properties you want. Otherwise, old values can be overwritten. To retrieve the current configuration, use the request [Get orderForm configuration](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pvt/configuration/orderForm). */ "POST /api/checkout/pvt/configuration/orderForm": { body: UpdateorderFormconfigurationRequest } /** * Retrieves a marketplace’s window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. - * - * The default period for this window is of 2 days, but it can be configured by the request Update window to change seller. + * + * +The default period for this window is of 2 days, but it can be configured by the request Update window to change seller. */ "GET /api/checkout/pvt/configuration/window-to-change-seller": { } /** * Updates a marketplace’s window to change seller, that is, the period when it is possible to choose another seller to fulfill a given order after the original seller has canceled it. - * - * It is possible to check the current window using the request Get window to change seller. + * + * +It is possible to check the current window using the request Get window to change seller. */ "POST /api/checkout/pvt/configuration/window-to-change-seller": { body: WaitingTime } /** - * This request removes all messages from the `messages` field of the orderForm , leaving it empty. - * - * You must send an empty JSON in the body of the request. - * - * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * + * This request removes all messages from the `messages` field of the orderForm , leaving it empty. + * + * You must send an empty JSON in the body of the request. + * + * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. + * * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. */ "POST /api/checkout/pub/orderForm/:orderFormId/messages/clear": { @@ -16610,13 +16710,15 @@ ascending?: boolean } } /** - * Retrieves possible amount of installments and respective values for a given cart with a given payment method. - * + * Retrieves possible amount of installments and respective values for a given cart with a given payment method. + * * The [orderForm](https://developers.vtex.com/docs/guides/orderform-fields) is the data structure which represents a shopping cart and contains all information pertaining to it. Hence, the `orderFormId` is the identification code of a given cart. - * - * This endpoint can be used to get the installment options for only one payment method at a time. - * - * This endpoint should be called only after the selected `orderForm` already has a `paymentData`. + * + * +This endpoint can be used to get the installment options for only one payment method at a time. + * + * +This endpoint should be called only after the selected `orderForm` already has a `paymentData`. */ "GET /api/checkout/pub/orderForm/:orderFormId/installments": { searchParams: { @@ -16628,12 +16730,15 @@ paymentSystem: number } /** * Use this request to add coupons to a given shopping cart. - * - * To add multiple coupons to the same cart, you need to: - * - * 1. Request the activation of this feature through the [Support VTEX](https://help.vtex.com/support) if this is the first time you perform this action on your store. - * 2. Submit all coupon codes in the same requisition separated by commas. E.g.: {"text": "freeshipping, discount10, holiday30"}. - * + * + * +To add multiple coupons to the same cart, you need to: + * + * +1. Request the activation of this feature through the [Support VTEX](https://help.vtex.com/support) if this is the first time you perform this action on your store. + * +2. Submit all coupon codes in the same requisition separated by commas. E.g.: {"text": "freeshipping, discount10, holiday30"}. + * * For more information on multiple coupons, access the [coupons tutorial](https://help.vtex.com/en/tutorial/creating-a-coupon-beta--7lMk3MmhNp2IEccyGApxU). */ "POST /api/checkout/pub/orderForm/:orderFormId/coupons": { @@ -17724,8 +17829,9 @@ ascending?: boolean } /** * Retrieves information on pickup points close to a given location determined by geocoordinates or postal code. - * - * The pickup points returned are not necessarily all active ones. Make sure to validate the information consumed by integrations. + * + * +The pickup points returned are not necessarily all active ones. Make sure to validate the information consumed by integrations. */ "GET /api/checkout/pub/pickup-points": { searchParams: { @@ -17871,8 +17977,8 @@ ClosingTime?: string } } /** - * Retrieves address information for a given postal code and country. - * + * Retrieves address information for a given postal code and country. + * * This request can be used to implement auto complete functionality when a customer needs to fill in an address. */ "GET /api/checkout/pub/postal-code/:countryCode/:postalCode": { @@ -17880,8 +17986,9 @@ ClosingTime?: string } /** * This endpoint places an order from an existing `orderForm` object, meaning an existing cart. - * - * After the creation of an order with this request, you have five minutes to send payment information and then request payment processing. + * + * +After the creation of an order with this request, you have five minutes to send payment information and then request payment processing. */ "POST /api/checkout/pub/orderForm/:orderFormId/transaction": { body: { @@ -17906,8 +18013,8 @@ response: { } } /** - * Places order without having any prior cart information. This means all information on items, client, payment and shipping must be sent in the body. - * + * Places order without having any prior cart information. This means all information on items, client, payment and shipping must be sent in the body. + * * >⚠️ The authentication of this endpoint is required if you are creating an order with an item that has an attachment that creates a Subscription. For more information, access [Subscriptions API](https://developers.vtex.com/docs/api-reference/subscriptions-api-v3). */ "PUT /api/checkout/pub/orders": { @@ -18024,10 +18131,12 @@ isGift?: boolean }[] /** * Customer's profile information. The `email` functions as a customer's ID. - * - * For customers already in your database, sending only the email address is enough to register the order to the shopper’s existing account. - * - * > If the shopper exists in you database but is not logged in, sending other profile information along with the email will cause the platform to fail placing the order. This happens because this action is interpreted as an attempt to edit profile data, which is not possible unless the customer is logged in to the store. + * + * +For customers already in your database, sending only the email address is enough to register the order to the shopper’s existing account. + * + * +> If the shopper exists in you database but is not logged in, sending other profile information along with the email will cause the platform to fail placing the order. This happens because this action is interpreted as an attempt to edit profile data, which is not possible unless the customer is logged in to the store. */ clientProfileData: { /** @@ -18085,8 +18194,9 @@ isCorporate?: boolean shippingData: { /** * Shipping address. - * - * For customers already in your data base, it is enough to send this object only with an `addressId`, which you may obtain from a [Cart simulation request](https://developers.vtex.com/vtex-rest-api/reference/shopping-cart#cartsimulation), for example. + * + * +For customers already in your data base, it is enough to send this object only with an `addressId`, which you may obtain from a [Cart simulation request](https://developers.vtex.com/vtex-rest-api/reference/shopping-cart#cartsimulation), for example. */ address?: { /** @@ -19440,21 +19550,26 @@ salesAssociateId?: string } /** * Order processing callback request, which is made after an order's payment is approved. - * - * > This request has to be made within five minutes after the [Place order](https://developers.vtex.com/docs/api-reference/checkout-api#put-/api/checkout/pub/orders) or [Place order from existing cart](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/transaction) request has been made, or else, the order will not be processed. + * + * +> This request has to be made within five minutes after the [Place order](https://developers.vtex.com/docs/api-reference/checkout-api#put-/api/checkout/pub/orders) or [Place order from existing cart](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/transaction) request has been made, or else, the order will not be processed. */ "POST /api/checkout/pub/gatewayCallback/:orderGroup": { } /** * Retrieves a list of sellers that cater to a specific region or address, according to your setup of our [regionalization feature](https://help.vtex.com/en/tutorial/setting-up-price-and-availability-of-skus-by-region--12ne58BmvYsYuGsimmugoc#). Learn more about [Region v2](https://developers.vtex.com/docs/guides/region-v2-release). - * - * To access the list of sellers, you must choose one of the following methods: - * - * 1. Send the identification of the list of sellers (`regionId`) as a path parameter through the URL. Or; - * 2. Send the `country` (3-digit ISO code) and at least one of the two values (`postal Code` or `geo Coordinates`) as query parameters through the URL. For this method, it is also allowed to send both values (`postalCode` or `geoCoordinates`) in the same request. - * - * > The `regionId` and `country` parameters are indicated as required in this documentation. However, only one of them should be sent in the request according to one of the methods mentioned above. + * + * +To access the list of sellers, you must choose one of the following methods: + * + * +1. Send the identification of the list of sellers (`regionId`) as a path parameter through the URL. Or; + * +2. Send the `country` (3-digit ISO code) and at least one of the two values (`postal Code` or `geo Coordinates`) as query parameters through the URL. For this method, it is also allowed to send both values (`postalCode` or `geoCoordinates`) in the same request. + * + * +> The `regionId` and `country` parameters are indicated as required in this documentation. However, only one of them should be sent in the request according to one of the methods mentioned above. */ "GET /api/checkout/pub/regions/:regionId": { searchParams: { @@ -19496,29 +19611,29 @@ logo?: (null | string) } } /** - * Lists all orders from a given customer, filtering by their email. - * - * > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). - * - * > Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | OMS | OMS access | **View order** | - * - * You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): - * - * | **Role** | **Resource** | - * | --------------- | ----------------- | - * | Call center operator | View order | - * | OMS - Read only | View order | - * - * >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). - * + * Lists all orders from a given customer, filtering by their email. + * + * > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + * + * > Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | OMS | OMS access | **View order** | + * + * You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + * + * | **Role** | **Resource** | + * | --------------- | ----------------- | + * | Call center operator | View order | + * | OMS - Read only | View order | + * + * >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). + * * To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). */ "GET /api/oms/user/orders": { @@ -20994,8 +21109,8 @@ Name: string */ Text?: string /** - * Store Framework - Deprecated. - * Legacy CMS Portal - Alternative search terms that will lead to the specific brand. The user can find the desired brand even when misspelling it. Used especially when words are of foreign origin and have a distinct spelling that is transcribed into a generic one, or when small spelling mistakes occur. + * Store Framework - Deprecated. + * Legacy CMS Portal - Alternative search terms that will lead to the specific brand. The user can find the desired brand even when misspelling it. Used especially when words are of foreign origin and have a distinct spelling that is transcribed into a generic one, or when small spelling mistakes occur. * */ Keywords?: string @@ -21014,14 +21129,14 @@ AdWordsRemarketingCode?: string */ LomadeeCampaignCode?: string /** - * Store Framework - Deprecated - * Legacy CMS Portal - Value used to set the priority on the search result page. + * Store Framework - Deprecated + * Legacy CMS Portal - Value used to set the priority on the search result page. * */ Score?: number /** - * Store Framework - Deprecated. - * Legacy CMS Portal - Defines if the Brand appears in the Department Menu control (``). + * Store Framework - Deprecated. + * Legacy CMS Portal - Defines if the Brand appears in the Department Menu control (``). * */ MenuHome?: boolean @@ -21138,14 +21253,14 @@ Description: string */ IsStockKeepingUnit: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails: boolean @@ -21159,14 +21274,14 @@ Position: number */ IsWizard: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive: boolean @@ -21221,14 +21336,14 @@ Description: string */ IsStockKeepingUnit: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. * */ IsFilter: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. * */ IsOnProductDetails: boolean @@ -21242,14 +21357,14 @@ Position: number */ IsWizard: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification visible in the store's upper menu. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification visible in the store's upper menu. * */ IsTopMenuLinkActive: boolean /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. + * Store Framework - Deprecated. + * Legacy CMS Portal - To make the specification field clickable in the search navigation bar. * */ IsSideMenuLinkActive: boolean @@ -21718,11 +21833,15 @@ maxNumberOfWhiteLabelSellers?: number maskFirstPurchaseData?: boolean /** * Configures reCAPTCHA validation for the account, defining in which situations the shopper will be prompted to validate a purchase with reCAPTCHA. Learn more about [reCAPTCHA validation for VTEX stores](https://help.vtex.com/tutorial/recaptcha-no-checkout--18Te3oDd7f4qcjKu9jhNzP) - * - * Possible values are: - * - `"never"`: no purchases are validated with reCAPTCHA. - * - `"always"`: every purchase is validated with reCAPTCHA. - * - `"vtexCriteria"`: only some purchases are validated with reCAPTCHA in order to minimize friction and improve shopping experience. VTEX’s algorithm determines which sessions are trustworthy and which should be validated with reCAPTCHA. This is the recommended option. + * + * +Possible values are: + * +- `"never"`: no purchases are validated with reCAPTCHA. + * +- `"always"`: every purchase is validated with reCAPTCHA. + * +- `"vtexCriteria"`: only some purchases are validated with reCAPTCHA in order to minimize friction and improve shopping experience. VTEX’s algorithm determines which sessions are trustworthy and which should be validated with reCAPTCHA. This is the recommended option. */ recaptchaValidation?: string /** diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 2097514bb..c15cc43ee 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -175,6 +175,12 @@ export interface AdditionalInfo { offeringInfo: null; offeringType: null; offeringTypeId: null; + categories: CategoryItem[]; +} + +export interface CategoryItem { + id: number; + name: string; } export interface AttachmentOffering { From c5dbc1cedf11860d149ffcca1ca71503a83f9b80 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Thu, 31 Oct 2024 18:23:54 -0300 Subject: [PATCH 14/93] fix: add new type --- vtex/utils/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index c15cc43ee..04e06ac50 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1448,6 +1448,7 @@ export interface OrderItem { invoicedDate: string | null; isCheckedIn: boolean; isCompleted: boolean; + storePreferencesData: StorePreferencesData; sellers?: { id: string; name: string; From 94c3caabfd53283649b5f4dd7112592e5da70886 Mon Sep 17 00:00:00 2001 From: "@yuri_assuncx" Date: Mon, 4 Nov 2024 11:54:13 -0300 Subject: [PATCH 15/93] feat: add new prop and body item to cancel order action (#951) --- vtex/actions/orders/cancel.ts | 5 +++-- vtex/utils/client.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts index 6f1982370..78401327b 100644 --- a/vtex/actions/orders/cancel.ts +++ b/vtex/actions/orders/cancel.ts @@ -5,6 +5,7 @@ import { CanceledOrder } from "../../utils/types.ts"; interface Props { orderId: string; reason: string; + requestedByUser: boolean; } async function action( @@ -19,13 +20,13 @@ async function action( return null; } - const { orderId, reason } = props; + const { orderId, reason, requestedByUser } = props; const response = await vcsDeprecated ["POST /api/oms/pvt/orders/:orderId/cancel"]( { orderId }, { - body: { reason }, + body: { reason, requestedByUser }, headers: { cookie, }, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index f2546079e..9866e4b8f 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -257,6 +257,7 @@ export interface VTEXCommerceStable { response: CanceledOrder; body: { reason: string; + requestedByUser: boolean; }; }; } From dbb75fa53dfbb8b100e30f7923a0f11d9741a4f5 Mon Sep 17 00:00:00 2001 From: Dex Date: Mon, 4 Nov 2024 19:07:44 -0300 Subject: [PATCH 16/93] (feat): creating an action for vtex masterdata's updatePartialDocument (#949) --- .../masterdata/updatePartialDocument.ts | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 vtex/actions/masterdata/updatePartialDocument.ts diff --git a/vtex/actions/masterdata/updatePartialDocument.ts b/vtex/actions/masterdata/updatePartialDocument.ts new file mode 100644 index 000000000..996a76cba --- /dev/null +++ b/vtex/actions/masterdata/updatePartialDocument.ts @@ -0,0 +1,43 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface Props { + data: Record; + acronym: string; + documentId: string; + isPrivateEntity?: boolean; +} + +/** + * @docs https://developers.vtex.com/docs/api-reference/master-data-api-v2#patch-/api/dataentities/-dataEntityName-/documents/-id- + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { vcs, vcsDeprecated } = ctx; + const { data, acronym, documentId, isPrivateEntity } = props; + const { cookie } = parseCookie(req.headers, ctx.account); + + const requestOptions = { + body: data, + headers: { + accept: "application/json", + "content-type": "application/json", + cookie, + }, + }; + + await (isPrivateEntity + ? vcs[`PATCH /api/dataentities/:acronym/documents/:documentId`]( + { acronym, documentId }, + requestOptions, + ) + : vcsDeprecated[`PATCH /api/dataentities/:acronym/documents/:documentId`]( + { acronym, documentId }, + requestOptions, + )); +}; + +export default action; From e86208f32eced9d1851515ee561fe78064d2f0ea Mon Sep 17 00:00:00 2001 From: guitavano Date: Tue, 5 Nov 2024 14:59:34 -0300 Subject: [PATCH 17/93] chec before render seo tags --- website/components/Seo.tsx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/website/components/Seo.tsx b/website/components/Seo.tsx index ad875a050..1f23ef6ac 100644 --- a/website/components/Seo.tsx +++ b/website/components/Seo.tsx @@ -62,25 +62,25 @@ function Component({ return ( - {renderTemplateString(titleTemplate, title)} - {renderTemplateString(titleTemplate, title)}} + {description && - - + />} + {themeColor && } + {favicon && } {/* Twitter tags */} - - - - + {title && } + {description && } + {image && } + {twitterCard && } {/* OpenGraph tags */} - - - - + {title && } + {description && } + {type && } + {image && } {/* Link tags */} {canonical && } From 64f065db361fe351113dd97580f4b060964623e2 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Tue, 5 Nov 2024 15:22:49 -0300 Subject: [PATCH 18/93] feat: update types for materData and OrderItem --- .../masterdata/updatePartialDocument.ts | 4 +- vtex/loaders/orders/order.ts | 16 +- vtex/manifest.gen.ts | 46 +- vtex/utils/client.ts | 4 + vtex/utils/openapi/vcs.openapi.gen.ts | 2088 +++- vtex/utils/openapi/vcs.openapi.json | 8760 ++++++++++++++++- vtex/utils/types.ts | 7 +- 7 files changed, 10683 insertions(+), 242 deletions(-) diff --git a/vtex/actions/masterdata/updatePartialDocument.ts b/vtex/actions/masterdata/updatePartialDocument.ts index 996a76cba..445b9f0dc 100644 --- a/vtex/actions/masterdata/updatePartialDocument.ts +++ b/vtex/actions/masterdata/updatePartialDocument.ts @@ -30,8 +30,8 @@ const action = async ( }; await (isPrivateEntity - ? vcs[`PATCH /api/dataentities/:acronym/documents/:documentId`]( - { acronym, documentId }, + ? vcs["PATCH /api/dataentities/:acronym/documents/:id"]( + { acronym, id: documentId }, requestOptions, ) : vcsDeprecated[`PATCH /api/dataentities/:acronym/documents/:documentId`]( diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index 0cc1e1cac..e2c968e1b 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -1,6 +1,6 @@ import { RequestURLParam } from "../../../website/functions/requestToParam.ts"; import { AppContext } from "../../mod.ts"; -import { OrderItem } from "../../utils/types.ts"; +import { Userorderdetails } from "../../utils/openapi/vcs.openapi.gen.ts"; import { parseCookie } from "../../utils/vtexId.ts"; export interface Props { @@ -11,14 +11,22 @@ export default async function loader( props: Props, req: Request, ctx: AppContext, -): Promise { +): Promise { const { vcs } = ctx; - const { cookie } = parseCookie(req.headers, ctx.account); + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + // sub is userEmail + if (!payload?.sub || !payload?.userId) { + return null; + } const { slug } = props; const response = await vcs["GET /api/oms/user/orders/:orderId"]( - { orderId: slug.includes("-") ? slug : slug + "-01" }, + { + orderId: slug.includes("-") ? slug : slug + "-01", + clientEmail: payload?.sub, + }, { headers: { cookie, diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index 7a1b1e417..1d95b3e79 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -24,17 +24,18 @@ import * as $$$$$$$$$18 from "./actions/cart/updateProfile.ts"; import * as $$$$$$$$$19 from "./actions/cart/updateUser.ts"; import * as $$$$$$$$$20 from "./actions/masterdata/createDocument.ts"; import * as $$$$$$$$$21 from "./actions/masterdata/updateDocument.ts"; -import * as $$$$$$$$$22 from "./actions/newsletter/subscribe.ts"; -import * as $$$$$$$$$23 from "./actions/notifyme.ts"; -import * as $$$$$$$$$24 from "./actions/orders/cancel.ts"; -import * as $$$$$$$$$25 from "./actions/payments/delete.ts"; -import * as $$$$$$$$$26 from "./actions/profile/newsletterProfile.ts"; -import * as $$$$$$$$$27 from "./actions/profile/updateProfile.ts"; -import * as $$$$$$$$$28 from "./actions/review/submit.ts"; -import * as $$$$$$$$$29 from "./actions/sessions/delete.ts"; -import * as $$$$$$$$$30 from "./actions/trigger.ts"; -import * as $$$$$$$$$31 from "./actions/wishlist/addItem.ts"; -import * as $$$$$$$$$32 from "./actions/wishlist/removeItem.ts"; +import * as $$$$$$$$$22 from "./actions/masterdata/updatePartialDocument.ts"; +import * as $$$$$$$$$23 from "./actions/newsletter/subscribe.ts"; +import * as $$$$$$$$$24 from "./actions/notifyme.ts"; +import * as $$$$$$$$$25 from "./actions/orders/cancel.ts"; +import * as $$$$$$$$$26 from "./actions/payments/delete.ts"; +import * as $$$$$$$$$27 from "./actions/profile/newsletterProfile.ts"; +import * as $$$$$$$$$28 from "./actions/profile/updateProfile.ts"; +import * as $$$$$$$$$29 from "./actions/review/submit.ts"; +import * as $$$$$$$$$30 from "./actions/sessions/delete.ts"; +import * as $$$$$$$$$31 from "./actions/trigger.ts"; +import * as $$$$$$$$$32 from "./actions/wishlist/addItem.ts"; +import * as $$$$$$$$$33 from "./actions/wishlist/removeItem.ts"; import * as $$$$0 from "./handlers/sitemap.ts"; import * as $$$0 from "./loaders/address/getAddressByZIP.ts"; import * as $$$1 from "./loaders/address/list.ts"; @@ -166,17 +167,18 @@ const manifest = { "vtex/actions/cart/updateUser.ts": $$$$$$$$$19, "vtex/actions/masterdata/createDocument.ts": $$$$$$$$$20, "vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$21, - "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$22, - "vtex/actions/notifyme.ts": $$$$$$$$$23, - "vtex/actions/orders/cancel.ts": $$$$$$$$$24, - "vtex/actions/payments/delete.ts": $$$$$$$$$25, - "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$26, - "vtex/actions/profile/updateProfile.ts": $$$$$$$$$27, - "vtex/actions/review/submit.ts": $$$$$$$$$28, - "vtex/actions/sessions/delete.ts": $$$$$$$$$29, - "vtex/actions/trigger.ts": $$$$$$$$$30, - "vtex/actions/wishlist/addItem.ts": $$$$$$$$$31, - "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$32, + "vtex/actions/masterdata/updatePartialDocument.ts": $$$$$$$$$22, + "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$23, + "vtex/actions/notifyme.ts": $$$$$$$$$24, + "vtex/actions/orders/cancel.ts": $$$$$$$$$25, + "vtex/actions/payments/delete.ts": $$$$$$$$$26, + "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$27, + "vtex/actions/profile/updateProfile.ts": $$$$$$$$$28, + "vtex/actions/review/submit.ts": $$$$$$$$$29, + "vtex/actions/sessions/delete.ts": $$$$$$$$$30, + "vtex/actions/trigger.ts": $$$$$$$$$31, + "vtex/actions/wishlist/addItem.ts": $$$$$$$$$32, + "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$33, }, "workflows": { "vtex/workflows/events.ts": $$$$$$$$$$0, diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index 9866e4b8f..afe62a9ba 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -244,6 +244,10 @@ export interface VTEXCommerceStable { response: CreateNewDocument; body: Record; }; + "PATCH /api/dataentities/:acronym/documents/:documentId": { + response: CreateNewDocument; + body: Record; + }; "GET /api/catalog_system/pub/brand/list": { response: Brand[]; }; diff --git a/vtex/utils/openapi/vcs.openapi.gen.ts b/vtex/utils/openapi/vcs.openapi.gen.ts index 6d0166fd6..29f7b5b58 100644 --- a/vtex/utils/openapi/vcs.openapi.gen.ts +++ b/vtex/utils/openapi/vcs.openapi.gen.ts @@ -7,8 +7,6 @@ // To generate this file: deno task start // -import { OrderItem } from "../types.ts"; - export type SkuComplement = { /** @@ -67,9 +65,6 @@ export type SavePersonalData = boolean export type OptinNewsLetter = boolean export interface OpenAPI { - "GET /api/oms/user/orders/:orderId": { - response: OrderItem; - }; /** * Retrieves a specific promotion by its Promotion ID or a specific tax by its tax ID. * @@ -828,138 +823,6 @@ accountName?: string dataEntityId?: string }[] } -"GET /api/logistics/pvt/inventory/skus/:skuId": { -response: { -/** - * Unique identifier of the SKU. - */ -skuId?: string -/** - * List of warehouses. - */ -balance?: { -hasUnlimitedQuantity?: boolean -leadTime?: string -reservedQuantity?: number -totalQuantity?: number -/** - * Warehouse ID. - */ -warehouseId?: string -/** - * Warehouse name. - */ -warehouseName?: string -}[] -} -} -/** - * Retrieves information about [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store. - * - * >⚠️ The response is limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. - */ -"GET /api/logistics/pvt/configuration/pickuppoints": { -/** - * List of pickup points, limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. - */ -response: PickupPoint[] -} -/** - * Retrieves the IDs of products and SKUs. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - */ -"GET /api/catalog_system/pvt/products/GetProductAndSkuIds": { -searchParams: { -/** - * ID of the category from which you need to retrieve Products and SKUs. - */ -categoryId?: number -/** - * Insert the ID that will start the request result. - */ -_from?: number -/** - * Insert the ID that will end the request result. - */ -_to?: number -} -response: { -/** - * Object composed by Product IDs and SKU IDs, where the parent ID is from Products and the SKU IDs are the Child IDs. - */ -data?: { -/** - * Array with SKU IDs of a certain product. - */ -"Product ID"?: number[] -} -/** - * Object with information about the product and SKUs list. - */ -range?: { -/** - * Total quantity of SKUs. - */ -total?: number -/** - * Initial product ID. - */ -from?: number -/** - * Final product ID. - */ -to?: number -} -} -} -/** - * Create a new document - */ -"POST /api/dataentities/:acronym/documents": { -body: { -anyProperty?: string -} -response: { -Id?: string -Href?: string -DocumentId?: string -} -} -/** - * Creates a partial document, sending only some of the fields. - * - * > You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. - * - * ## Permissions - * - * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: - * - * | **Product** | **Category** | **Resource** | - * | --------------- | ----------------- | ----------------- | - * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | - * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | - * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | - * - * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). - * - * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. - */ -"PATCH /api/dataentities/:acronym/documents": { -body: { -/** - * Unique identifier of the document to be created. - */ -id?: string -/** - * Field(s) to be filled in and its respective value(s). - */ -"{fieldName}"?: string -[k: string]: any -} -response: IdHrefDocumentID -} /** * Retrieves a document. * @@ -1089,116 +952,248 @@ body: { } } -/** - * Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. - * > 📘 Onboarding guide - * > - * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. - */ -"GET /api/catalog/pvt/product/:productId": { +"GET /api/logistics/pvt/inventory/skus/:skuId": { response: { /** - * Product’s unique numerical identifier. - */ -Id?: number -/** - * Product's name. Limited to 150 characters. - */ -Name?: string -/** - * Department ID according to the product's category. - */ -DepartmentId?: number -/** - * Category ID associated with this product. - */ -CategoryId?: number -/** - * Brand ID associated with this product. - */ -BrandId?: number -/** - * Slug that will be used to build the product page URL. If it not informed, it will be generated according to the product's name replacing spaces and special characters by hyphens (`-`). + * Unique identifier of the SKU. */ -LinkId?: string +skuId?: string /** - * Product Reference Code. + * List of warehouses. */ -RefId?: string +balance?: { +hasUnlimitedQuantity?: boolean +leadTime?: string +reservedQuantity?: number +totalQuantity?: number /** - * Shows (`true`) or hides (`false`) the product in search result and product pages, but the product can still be added to the shopping cart. Usually applicable for gifts. + * Warehouse ID. */ -IsVisible?: boolean +warehouseId?: string /** - * Product description. + * Warehouse name. */ -Description?: string +warehouseName?: string +}[] +} +} /** - * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: - * Store Framework: `$product.DescriptionShort`. - * Legacy CMS Portal: ``. + * Retrieves information about [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store. * + * >⚠️ The response is limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. */ -DescriptionShort?: string +"GET /api/logistics/pvt/configuration/pickuppoints": { /** - * Used to assist in the ordering of the search result of the site. Using the `O=OrderByReleaseDateDESC` query string, you can pull this value and show the display order by release date. This attribute is also used as a condition for dynamic collections. + * List of pickup points, limited to 1.000 pickup points. If you need more than 1000 results, you can use the [List paged pickup points](https://developers.vtex.com/docs/api-reference/logistics-api#get-/api/logistics/pvt/configuration/pickuppoints/_search) endpoint. */ -ReleaseDate?: string +response: PickupPoint[] +} /** - * Store Framework: Deprecated. - * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. - * + * Retrieves the IDs of products and SKUs. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. */ -KeyWords?: string +"GET /api/catalog_system/pvt/products/GetProductAndSkuIds": { +searchParams: { /** - * Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO. + * ID of the category from which you need to retrieve Products and SKUs. */ -Title?: string +categoryId?: number /** - * Activate (`true`) or inactivate (`false`) product. + * Insert the ID that will start the request result. */ -IsActive?: boolean +_from?: number /** - * Product tax code, used for tax calculation. + * Insert the ID that will end the request result. */ -TaxCode?: string +_to?: number +} +response: { /** - * Brief description of the product for SEO. It is recommended not to exceed 150 characters. + * Object composed by Product IDs and SKU IDs, where the parent ID is from Products and the SKU IDs are the Child IDs. */ -MetaTagDescription?: string +data?: { /** - * @deprecated + * Array with SKU IDs of a certain product. */ -SupplierId?: (null | number) +"Product ID"?: number[] +} /** - * If `true`, activates the [Notify Me](https://help.vtex.com/en/tutorial/setting-up-the-notify-me-option--2VqVifQuf6Co2KG048Yu6e) option when the product is out of stock. + * Object with information about the product and SKUs list. */ -ShowWithoutStock?: boolean +range?: { /** - * @deprecated - * This is a legacy field. Do not take this information into consideration. + * Total quantity of SKUs. */ -AdWordsRemarketingCode?: string +total?: number /** - * @deprecated - * This is a legacy field. Do not take this information into consideration. + * Initial product ID. */ -LomadeeCampaignCode?: string +from?: number /** - * Value used to set the priority on the search result page. + * Final product ID. */ -Score?: number +to?: number +} } } /** - * Updates an existing Product. + * Create a new document */ -"PUT /api/catalog/pvt/product/:productId": { +"POST /api/dataentities/:acronym/documents": { body: { -/** - * Product's name. Limited to 150 characters. - */ -Name: string +anyProperty?: string +} +response: { +Id?: string +Href?: string +DocumentId?: string +} +} +/** + * Creates a partial document, sending only some of the fields. + * + * > You can use this request to create documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** | + * | Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** | + * | Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** | + * + * There are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + * + * >❗ To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations. + */ +"PATCH /api/dataentities/:acronym/documents": { +body: { +/** + * Unique identifier of the document to be created. + */ +id?: string +/** + * Field(s) to be filled in and its respective value(s). + */ +"{fieldName}"?: string +[k: string]: any +} +response: IdHrefDocumentID +} +/** + * Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. + * > 📘 Onboarding guide + * > + * > Check the new [Catalog onboarding guide](https://developers.vtex.com/vtex-rest-api/docs/catalog-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Catalog and is organized by focusing on the developer's journey. + */ +"GET /api/catalog/pvt/product/:productId": { +response: { +/** + * Product’s unique numerical identifier. + */ +Id?: number +/** + * Product's name. Limited to 150 characters. + */ +Name?: string +/** + * Department ID according to the product's category. + */ +DepartmentId?: number +/** + * Category ID associated with this product. + */ +CategoryId?: number +/** + * Brand ID associated with this product. + */ +BrandId?: number +/** + * Slug that will be used to build the product page URL. If it not informed, it will be generated according to the product's name replacing spaces and special characters by hyphens (`-`). + */ +LinkId?: string +/** + * Product Reference Code. + */ +RefId?: string +/** + * Shows (`true`) or hides (`false`) the product in search result and product pages, but the product can still be added to the shopping cart. Usually applicable for gifts. + */ +IsVisible?: boolean +/** + * Product description. + */ +Description?: string +/** + * Short product description. This information can be displayed on both the product page and the shelf, using the following controls: + * Store Framework: `$product.DescriptionShort`. + * Legacy CMS Portal: ``. + * + */ +DescriptionShort?: string +/** + * Used to assist in the ordering of the search result of the site. Using the `O=OrderByReleaseDateDESC` query string, you can pull this value and show the display order by release date. This attribute is also used as a condition for dynamic collections. + */ +ReleaseDate?: string +/** + * Store Framework: Deprecated. + * Legacy CMS Portal: Keywords or synonyms related to the product, separated by comma (`,`). "Television", for example, can have a substitute word like "TV". This field is important to make your searches more comprehensive. + * + */ +KeyWords?: string +/** + * Product's Title tag. Limited to 150 characters. It is presented in the browser tab and corresponds to the title of the product page. This field is important for SEO. + */ +Title?: string +/** + * Activate (`true`) or inactivate (`false`) product. + */ +IsActive?: boolean +/** + * Product tax code, used for tax calculation. + */ +TaxCode?: string +/** + * Brief description of the product for SEO. It is recommended not to exceed 150 characters. + */ +MetaTagDescription?: string +/** + * @deprecated + */ +SupplierId?: (null | number) +/** + * If `true`, activates the [Notify Me](https://help.vtex.com/en/tutorial/setting-up-the-notify-me-option--2VqVifQuf6Co2KG048Yu6e) option when the product is out of stock. + */ +ShowWithoutStock?: boolean +/** + * @deprecated + * This is a legacy field. Do not take this information into consideration. + */ +AdWordsRemarketingCode?: string +/** + * @deprecated + * This is a legacy field. Do not take this information into consideration. + */ +LomadeeCampaignCode?: string +/** + * Value used to set the priority on the search result page. + */ +Score?: number +} +} +/** + * Updates an existing Product. + */ +"PUT /api/catalog/pvt/product/:productId": { +body: { +/** + * Product's name. Limited to 150 characters. + */ +Name: string /** * Department ID according to the product's category. */ @@ -19653,6 +19648,66 @@ per_page: string } response: Userorderslist } +/** + * Lists all details from an order, through the perspective of the customer who placed the order. + * + * > You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). + * + * > Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | OMS | OMS access | **View order** | + * + * You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + * + * | **Role** | **Resource** | + * | --------------- | ----------------- | + * | Call center operator | View order | + * | OMS - Read only | View order | + * + * >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). + * + * To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + */ +"GET /api/oms/user/orders/:orderId": { +searchParams: { +/** + * Customer email. + */ +clientEmail: string +} +response: Userorderdetails +} +} +/** + * Object representing each document. + */ +export interface Document { +/** + * Custom property. + */ +"{customProperty}"?: string +/** + * Unique identifier of the document. + */ +id: string +/** + * Unique identifier of the account. + */ +accountId: string +/** + * Account name. + */ +accountName: string +/** + * Two-letter string that identifies the data entity. + */ +dataEntityId: string } /** * Pickup point information. @@ -22096,3 +22151,1620 @@ Facets: { } } +export interface Userorderdetails { +/** + * Order ID is a unique code that identifies an order. + */ +orderId: string +/** + * Sequence is a six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`. + */ +sequence: string +/** + * Marketplace order ID. + */ +marketplaceOrderId: string +/** + * Marketplace services endpoint. + */ +marketplaceServicesEndpoint: string +/** + * ID of the seller related to the order. It can be a VTEX seller or an external seller. + */ +sellerOrderId: string +/** + * Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types), which can be `Marketplace`, `Fulfillment` or `Chain`. + */ +origin: string +/** + * Corresponds to the three-digit [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order. + */ +affiliateId: string +/** + * Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order. + */ +salesChannel: string +/** + * Name of the merchant. + */ +merchantName: string +/** + * Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). + */ +status: string +/** + * Indicates if the order workflow is in an error state. + */ +workflowIsInError: boolean +/** + * @deprecated + * `Deprecated`. Status description which is displayed on the Admin panel. This field is obsolete and may not return any value. + */ +statusDescription: string +/** + * Order's total amount. + */ +value: number +/** + * Order's creation date. + */ +creationDate: string +/** + * Order's last change date. + */ +lastChange: string +/** + * Order's group ID. + */ +orderGroup: string +/** + * List with details about orders' totals. + */ +totals: Total[] +/** + * Information about order's items. + */ +items: OrderItem[] +/** + * Marketplace details object. + */ +marketplaceItems: string[] +clientProfileData: ClientProfileData +/** + * Information about gift list, when it applies. + */ +giftRegistryData: string +/** + * Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs. + */ +marketingData: { +/** + * Object ID. The expected value is `marketingData`. + */ +id?: string +/** + * Value of the `utm_source` parameter of the URL that led to the request. + */ +utmSource?: string +/** + * UTM Source Parameters. + */ +utmPartner?: string +/** + * Value of the `utm_medium` parameter of the URL that led to the request. + */ +utmMedium?: string +/** + * Value of the `utm_campaign` parameter of the URL that led to the request. + */ +utmCampaign?: string +/** + * Coupon code. + */ +coupon?: string +/** + * Internal UTM value `utmi_cp`. + */ +utmiCampaign?: string +/** + * Internal UTM value `utmi_p`. + */ +utmipage?: string +/** + * Internal UTM value `utmi_pc`. + */ +utmiPart?: string +/** + * Marketing tags information. This field can be used to register campaign data or informative tags regarding promotions. + */ +marketingTags?: string[] +} +ratesAndBenefitsData: RatesAndBenefitsData +shippingData: ShippingData +paymentData: PaymentData +packageAttachment: PackageAttachment +/** + * List of all sellers associated with the order. + */ +sellers: Seller[] +/** + * Call center operator responsible for the order. + */ +callCenterOperatorData: string +/** + * Email of the store's employee responsible for managing the order. + */ +followUpEmail: string +/** + * Last sent transactional message. + */ +lastMessage: string +/** + * Account Hostname registered in License Manager. + */ +hostname: string +/** + * Information pertinent to the order's invoice. + */ +invoiceData: { + +} +changesAttachment: ChangesAttachment +/** + * Optional field with order's additional information. This field must be filled in using the following format: + * +``` + * +{ + * "fieldExample": "ValueExample" + * } + * +``` + * +. + */ +openTextField: string +/** + * Rounding error total amount, if it applies. For example, in orders with a discount over non-integer multiplier items, the rounding price is performed per item, not after the sum of all items. That can cause a difference in the total discount amount, which is informed in this field. + */ +roundingError: number +/** + * [Order form](https://developers.vtex.com/docs/guides/orderform-fields) ID. + */ +orderFormId: string +/** + * Information about commercial conditions. + */ +commercialConditionData: string +/** + * When set as `true`, the order's payment has been settled, and when set as `false`, it has not been settled yet. + */ +isCompleted: boolean +/** + * Custom information in the order. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt. + */ +customData: string +storePreferencesData: StorePreferencesData +/** + * When set as `true`, the order can be canceled, and when set as `false`, it is no longer possible to cancel the order. + */ +allowCancellation: boolean +/** + * When set as `true`, the order can be edited, and when set as `false`, it is no longer possible to edit the order. + */ +allowEdition: boolean +/** + * This field is set `true` when the order was made via inStore and `false` when it was not. + */ +isCheckedIn: boolean +marketplace: Marketplace +/** + * Authorized order date. + */ +authorizedDate: string +/** + * Order's invoice date. + */ +invoicedDate: string +/** + * Reason for order cancellation. + */ +cancelReason: string +itemMetadata: ItemMetadata +subscriptionData: SubscriptionData +taxData: TaxData +/** + * If the field `isCheckedIn` is set as `true`, the `checkedInPickupPointId` will retrieve the ID of the physical store where the order was made. + */ +checkedInPickupPointId: string +cancellationData: CancellationData +clientPreferencesData: ClientPreferencesData +/** + * Details of cancellation requests made for the order. + */ +cancellationRequests: { +/** + * ID of the cancellation request. + */ +id?: string +/** + * Reason for the cancellation request. + */ +reason?: string +/** + * Date when the cancellation was requested. + */ +cancellationRequestDate?: string +/** + * Indicates if the request was made by the user. + */ +requestedByUser?: boolean +/** + * Indicates if the cancellation request was denied by the seller. + */ +deniedBySeller?: boolean +/** + * Reason for denial by the seller. + */ +deniedBySellerReason?: string +/** + * Date when the cancellation request was denied. + */ +cancellationRequestDenyDate?: string +}[] +minItems?: 0 +} +/** + * Object about order's totals. + */ +export interface Total { +/** + * Code that identifies if the information is about `Items`, `Discounts`, `Shipping`, `Tax` or `Change`. + */ +id: string +/** + * Name of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`. + */ +name: string +/** + * Total amount of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`. + */ +value: number +} +/** + * Information about an individual item in the order. + */ +export interface OrderItem { +/** + * Unique identifier for the item in the order. + */ +uniqueId: string +/** + * SKU identifier of the item. + */ +id: string +/** + * Product ID associated with the item. + */ +productId: string +/** + * European Article Number (EAN) for the item, if applicable. + */ +ean: string +/** + * Identifier to lock the item in the order. + */ +lockId: string +/** + * Attachment details associated with the item. + */ +itemAttachment: { +/** + * Content of the attachment. + */ +content?: { + +} +/** + * Name of the attachment, if applicable. + */ +name?: string +} +/** + * Additional attachments for the item. + */ +attachments: { + +}[] +/** + * Quantity of the item in the order. + */ +quantity: number +/** + * Identifier of the seller providing the item. + */ +seller: string +/** + * Name of the item as displayed to the customer. + */ +name: string +/** + * Reference ID for the item. + */ +refId: string +/** + * Price of the item. + */ +price: number +/** + * List price of the item. + */ +listPrice: number +/** + * Manually defined price for the item, if applicable. + */ +manualPrice: number +/** + * Tags associated with the pricing of the item. + */ +priceTags: { + +}[] +/** + * URL of the item's image. + */ +imageUrl: string +/** + * URL for more details about the item. + */ +detailUrl: string +/** + * List of components included with the item. + */ +components: { + +}[] +/** + * Items bundled with this item. + */ +bundleItems: { + +}[] +/** + * Parameters associated with the item. + */ +params: { + +}[] +/** + * List of offerings related to the item. + */ +offerings: { + +}[] +/** + * Offerings attached to the item. + */ +attachmentOfferings: { +name?: string +required?: boolean +schema?: { + +} +}[] +/** + * SKU identifier as defined by the seller. + */ +sellerSku: string +/** + * Date until the price is valid. + */ +priceValidUntil: string +/** + * Commission on the item, if applicable. + */ +commission: number +/** + * Tax applied to the item. + */ +tax: number +/** + * Date when the item will be available for sale. + */ +preSaleDate: string +/** + * Additional information about the item. + */ +additionalInfo: { +/** + * Name of the brand associated with the item. + */ +brandName?: string +/** + * ID of the brand associated with the item. + */ +brandId?: string +/** + * String of category IDs associated with the item. + */ +categoriesIds?: string +/** + * Product cluster ID for the item. + */ +productClusterId?: string +/** + * ID of the commercial condition associated with the item. + */ +commercialConditionId?: string +/** + * Dimensions of the item. + */ +dimension?: { +/** + * Cubic weight of the item. + */ +cubicweight?: number +/** + * Height of the item. + */ +height?: number +/** + * Length of the item. + */ +length?: number +/** + * Weight of the item. + */ +weight?: number +/** + * Width of the item. + */ +width?: number +} +/** + * List of categories associated with the item. + */ +categories?: { +/** + * ID of the category. + */ +id: number +/** + * Name of the category. + */ +name: string +}[] +} +/** + * Unit of measurement for the item. + */ +measurementUnit: string +/** + * Multiplier for the measurement unit. + */ +unitMultiplier: number +/** + * Final selling price of the item. + */ +sellingPrice: number +/** + * Indicates if the item is a gift. + */ +isGift: boolean +/** + * Shipping cost for the item, if applicable. + */ +shippingPrice: number +/** + * Reward value associated with the item. + */ +rewardValue: number +/** + * Freight commission on the item. + */ +freightCommission: number +/** + * Detailed information about the item's price structure. + */ +priceDefinitions: { +sellingPrices?: { +value?: number +quantity?: number +}[] +calculatedSellingPrice?: number +total?: number +} +/** + * Tax code associated with the item. + */ +taxCode: string +/** + * Index of the parent item, if this item is part of a bundle. + */ +parentItemIndex: number +/** + * Assembly binding of the parent item, if applicable. + */ +parentAssemblyBinding: string +/** + * ID of the call center operator handling the item. + */ +callCenterOperator: string +/** + * Serial numbers associated with the item. + */ +serialNumbers: string +/** + * List of assemblies related to the item. + */ +assemblies: { + +}[] +/** + * Cost price of the item. + */ +costPrice: number +} +/** + * Object with information on the client's profile. + */ +export interface ClientProfileData { +/** + * Object ID, the expected value is `clientProfileData`. + */ +id: string +/** + * Customer's email. + */ +email: string +/** + * Customer's first name. + */ +firstName: string +/** + * Customer's last name. + */ +lastName: string +/** + * Type of the document informed by the customer. + */ +documentType: string +/** + * Document identification code informed by the customer. + */ +document: string +/** + * Customers's phone number. + */ +phone: string +/** + * If the customer is a legal entity, here goes the corporate name. + */ +corporateName: string +/** + * If the customer is a legal entity, here goes the trade name. + */ +tradeName: string +/** + * If the customer is a legal entity, here goes the corporate document. + */ +corporateDocument: string +/** + * If the customer is a legal entity, here goes the state inscription. + */ +stateInscription: string +/** + * If the customer is a legal entity, here goes the corpany's phone number. + */ +corporatePhone: string +/** + * The value is `true` when the customer is a legal entity and `false` when not. + */ +isCorporate: boolean +/** + * Customer user profile ID. + */ +userProfileId: string +/** + * Identification of the class the customer belongs to. + */ +customerClass: string +} +/** + * Information on promotions and taxes that apply to the order. + */ +export interface RatesAndBenefitsData { +/** + * ID of the rate or benefit. + */ +id: string +/** + * Information about order's promotions and taxes identifiers. + */ +rateAndBenefitsIdentifiers: string[] +} +/** + * Object containing shipping data. + */ +export interface ShippingData { +/** + * Object ID, the expected value is `shippingData`. + */ +id: string +address: Address +/** + * Array of objects containing item's logistics information. + */ +logisticsInfo: LogisticsInfo[] +trackingHints: string +/** + * Information about selected adresses. + */ +selectedAddresses: SelectedAddress[] +} +/** + * Shipping address details. + */ +export interface Address { +/** + * Type of address. For example, `Residential` or `Pickup`, among others. + */ +addressType: string +/** + * Name of the person who is going to receive the order. + */ +receiverName: string +/** + * Shipping address ID. + */ +addressId: string +/** + * Shipping address version ID. + */ +versionId: string +/** + * Shipping address entity ID. + */ +entityId: string +/** + * Postal code of the shipping address. + */ +postalCode: string +/** + * City of the shipping address. + */ +city: string +/** + * State of the shipping address. + */ +state: string +/** + * Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3). + */ +country: string +/** + * Street of the shipping address. + */ +street: string +/** + * Number of the building, house or apartment in the shipping address. + */ +number: string +/** + * Neighborhood of the shipping address. + */ +neighborhood: string +/** + * Complement to the shipping address when it applies. + */ +complement: string +/** + * Complement to help locate the shipping address, in case of delivery. + */ +reference: string +/** + * Array with two numbers with geocoordinates, first longitude then latitude. + */ +geoCoordinates: number[] +} +export interface LogisticsInfo { +/** + * Index of the item starting from 0. + */ +itemIndex: number +/** + * Selected shipping option. + */ +selectedSla: string +/** + * Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time. + */ +lockTTL: string +/** + * Shipping price for the item in cents. Does not account for the whole order's shipping price. + */ +price: number +/** + * SKU's optional price for a specific trade policy. + */ +listPrice: number +/** + * Item's selling price. + */ +sellingPrice: number +/** + * [Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, if it applies to the item. + */ +deliveryWindow: string +/** + * [Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE) company's name. + */ +deliveryCompany: string +/** + * Total shipping estimate time in days. For instance, three business days is represented `3bd`. + */ +shippingEstimate: string +/** + * Shipping estimate date. It is defined only after the confirmation of the order. + */ +shippingEstimateDate: string +/** + * Information on Service Level Agreement (SLA), corresponding to [shipping policies](https://help.vtex.com/tutorial/shipping-policy--tutorials_140). + */ +slas: Sla[] +/** + * Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3). + */ +shipsTo: string[] +/** + * Information about delivery IDs. + */ +deliveryIds: DeliveryId[] +/** + * List of delivery channels associated with the trade policy. + */ +deliveryChannels: { +/** + * Delivery channel's shipping type, which can be `delivery` or `pickup-in-point`. + */ +id: string +/** + * Stock check for an SKU availability. + */ +stockBalance: number +}[] +/** + * If the delivery channel is `delivery` or `pickup-in-point`. + */ +deliveryChannel: string +pickupStoreInfo: PickupStoreInfo +/** + * Address ID. + */ +addressId: string +/** + * Shipping address version ID. + */ +versionId: string +/** + * Shipping address entity ID. + */ +entityId: string +/** + * Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy. + */ +polygonName: string +/** + * [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)'s ID. + */ +pickupPointId: string +/** + * Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`. + */ +transitTime: string +} +export interface Sla { +/** + * ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140). + */ +id: string +/** + * Name of the shipping policy. + */ +name: string +/** + * Total shipping estimate time in days. For instance, three business days is represented `3bd`. + */ +shippingEstimate: string +/** + * [Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, if it applies to the item. + */ +deliveryWindow: string +/** + * Shipping price for the item in cents. Does not account for the whole order's shipping price. + */ +price: number +/** + * If the delivery channel is `delivery` or `pickup-in-point`. + */ +deliveryChannel: string +pickupStoreInfo: PickupStoreInfo +/** + * Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy. + */ +polygonName: string +/** + * Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. + */ +lockTTL: string +/** + * [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA. + */ +pickupPointId: string +/** + * Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`. + */ +transitTime: string +/** + * Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line. + */ +pickupDistance: number +} +/** + * Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R). + */ +export interface PickupStoreInfo { +/** + * Additional information about the pickup point. + */ +additionalInfo: string +/** + * Pickup point's address. + */ +address: string +/** + * ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point. + */ +dockId: string +/** + * Name of the pickup point displayed at checkout. + */ +friendlyName: string +/** + * If this field is set `true`, it means the type of shipping is pickup, and if set as `false`, it is not. + */ +isPickupStore: boolean +} +/** + * Information about delivery IDs. + */ +export interface DeliveryId { +/** + * [Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)'s ID. + */ +courierId: string +/** + * Carrier's name. + */ +courierName: string +/** + * ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj). + */ +dockId: string +/** + * Quantity of items. + */ +quantity: number +/** + * ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb). + */ +warehouseId: string +/** + * Name of the account's [carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE). + */ +accountCarrierName: string +/** + * Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), if there are any. + */ +kitItemDetails: string[] +} +export interface SelectedAddress { +/** + * Selected address ID. + */ +addressId: string +/** + * Shipping address version ID of the selected address. + */ +versionId: string +/** + * Shipping address entity ID of the selected address. + */ +entityId: string +/** + * Selected adress's shipping type, which can be `pickup`, `residential`, `invoice`, `search`, `inStore`, `commercial` or `giftRegistry`. + */ +addressType: string +/** + * Name of the person who is going to receive the order in the selected address. + */ +receiverName: string +/** + * Street of the selected address. + */ +street: string +/** + * Number of the building, house or apartment of the selected address. + */ +number: string +/** + * Complement to the selected address if it applies. + */ +complement: string +/** + * Neighborhood of the selected address. + */ +neighborhood: string +/** + * Postal code of the selected address. + */ +postalCode: string +/** + * City of the selected address. + */ +city: string +/** + * State of the selected address. + */ +state: string +/** + * Three letters ISO code of the country of the selected address (ISO 3166 ALPHA-3). + */ +country: string +/** + * Complement to help locate the selected address. + */ +reference: string +/** + * Array with two numbers with the selected address's geocoordinates, first longitude then latitude. + */ +geoCoordinates: number[] +} +/** + * Object with information about the payment. + */ +export interface PaymentData { +/** + * Array with information about Gift Cards. + */ +giftCards?: string[] +/** + * Information about financial transactions. + */ +transactions: Transaction[] +} +/** + * Financial transaction details. + */ +export interface Transaction { +/** + * When this field is set as `true`, the payment is active, and when it is `false`, the payment is inactive. + */ +isActive: boolean +/** + * ID of the transaction. + */ +transactionId: string +/** + * Name of the merchant that will receive the payment. + */ +merchantName: string +/** + * Detailed information about payment. + */ +payments: Payment[] +} +/** + * Payment details. + */ +export interface Payment { +/** + * VTEX payment ID that can be used as unique identifier. + */ +id: string +/** + * Payment system's ID. + */ +paymentSystem: string +/** + * Payment system's name. + */ +paymentSystemName: string +/** + * Payment's final amount in cents. + */ +value: number +/** + * Number of payment installments. + */ +installments: number +/** + * Payment's reference value in cents. + */ +referenceValue: number +/** + * Name of the person who owns the card. + */ +cardHolder: string +/** + * Numeric sequence of the card used in the transaction. + */ +cardNumber: string +/** + * Fist digits of the card used in the transaction. + */ +firstDigits: string +/** + * Last digits of the card used in the transaction. + */ +lastDigits: string +/** + * Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions. + */ +cvv2: string +/** + * Expire month of the card used in the transaction (2-digits). + */ +expireMonth: string +/** + * Expire year of the card used in the transaction (4-digits). + */ +expireYear: string +/** + * Payment's URL. + */ +url: string +/** + * Gift Card's ID. + */ +giftCardId: string +/** + * Gift Card's name. + */ +giftCardName: string +/** + * Gift Card's caption. + */ +giftCardCaption: string +/** + * Code for the customer to use the Gift Card. + */ +redemptionCode: string +/** + * Name of the collection the Gift Card belongs to. + */ +group: string +/** + * Provider's unique identifier for the transaction. + */ +tid: string +/** + * Payment due date, with the format `yyyy-mm-dd`. + */ +dueDate: string +/** + * Information about the connector responses. + */ +connectorResponses: { +/** + * Provider's unique identifier for the transaction. + */ +Tid: string +/** + * Provider's operation/error code to be logged. + */ +ReturnCode: string +/** + * Provider's operation/error message to be logged. + */ +Message: string +/** + * Connector's authorization ID. + */ +authId: string +} +/** + * Gift Card provider's ID. + */ +giftCardProvider: string +/** + * When this field is set as `true`, the Gift Card is a discount over the price, and when set as `false`, it is not a discount. + */ +giftCardAsDiscount: boolean +/** + * Payment's account ID. + */ +koinUrl: string +/** + * Payment's account ID. + */ +accountId: string +/** + * This field retrieves the main account if the payment was made in a subaccount. + */ +parentAccountId: string +/** + * Numeric sequence that identifies the bank issued invoice. + */ +bankIssuedInvoiceIdentificationNumber: string +/** + * Bank issued invoice ID formatted. + */ +bankIssuedInvoiceIdentificationNumberFormatted: string +/** + * Number of the bank issued invoice bar code. + */ +bankIssuedInvoiceBarCodeNumber: string +/** + * Type of the bank issued invoice bar code. + */ +bankIssuedInvoiceBarCodeType: string +/** + * Billing address information. + */ +billingAddress: { + +} +} +/** + * Package object populated after order invoiced. + */ +export interface PackageAttachment { +/** + * Details of each package in the order. + */ +packages: Package[] +} +/** + * Details of an individual package in the order. + */ +export interface Package { +/** + * Fiscal operation code for the package. + */ +cfop: string +/** + * Invoice number associated with the package. + */ +invoiceNumber: string +/** + * Total value of the invoice. + */ +invoiceValue: number +/** + * URL for the invoice, if available. + */ +invoiceUrl: string +/** + * Date when the invoice was issued. + */ +issuanceDate: string +/** + * Tracking number for the package, if available. + */ +trackingNumber: string +/** + * Unique key for the invoice. + */ +invoiceKey: string +/** + * URL for tracking the package, if available. + */ +trackingUrl: string +/** + * Embedded invoice data. + */ +embeddedInvoice: string +/** + * Current status of the courier handling the package. + */ +courierStatus: { +/** + * Status of the courier, if available. + */ +status: string +/** + * Indicates if the delivery process is finished. + */ +finished: boolean +/** + * Date the package was delivered, if applicable. + */ +deliveredDate: string +} +/** + * Type of package, either 'Input' or 'Output'. + */ +type: ("Input" | "Output") +} +/** + * Information about the seller associated with the order. + */ +export interface Seller { +/** + * Seller ID that identifies the seller. + */ +id: string +/** + * Seller's name. + */ +name: string +/** + * URL of the seller's logo. + */ +logo: string +/** + * URL of the endpoint for fulfillment of seller's orders. + */ +fulfillmentEndpoint: string +} +/** + * Information about changes in the order. + */ +export interface ChangesAttachment { +/** + * Object ID, the expect value is `changeAttachment`. + */ +id: string +/** + * Order change details. + */ +changesData: ChangesDatum[] +} +export interface ChangesDatum { +/** + * Text explaining why there was a change in the order. This information may be shown to the customer in the UI or transactional emails. + */ +reason: string +/** + * Order change discount value. + */ +discountValue: number +/** + * Order change increment value. + */ +incrementValue: number +/** + * List of items added to the order. + */ +itemsAdded: string[] +/** + * List of items removed from the order. + */ +itemsRemoved: ItemsRemoved[] +receipt: Receipt +} +export interface ItemsRemoved { +/** + * SKU ID of the item removed from the order. + */ +id: string +/** + * Name of the item removed from the order. + */ +name: string +/** + * Quantity of items removed from the order. + */ +quantity: number +/** + * Total amount of items removed from the order. + */ +price: number +/** + * Unit multiplier of the item removed from the order. + */ +unitMultiplier: string +} +/** + * Information about the receipt for changed orders. + */ +export interface Receipt { +/** + * Date when the receipt was created. + */ +date: string +/** + * ID of the order. + */ +orderId: string +/** + * Receipt's unique identifier code. + */ +receipt: string +} +/** + * Object with data from the store's configuration - stored in VTEX's License Manager. + */ +export interface StorePreferencesData { +/** + * Three letters ISO code of the country (ISO 3166 ALPHA-3). + */ +countryCode: string +/** + * Currency code in ISO 4217. For example, `BRL`. + */ +currencyCode: string +currencyFormatInfo: CurrencyFormatInfo +/** + * Currency Locale Code in LCID in decimal. + */ +currencyLocale: number +/** + * Currency symbol. + */ +currencySymbol: string +/** + * Time zone from where the order was made. + */ +timeZone: string +} +/** + * Object with currency format details. + */ +export interface CurrencyFormatInfo { +/** + * Quantity of currency decimal digits. + */ +CurrencyDecimalDigits: number +/** + * Defines what currency decimal separator will be applied. + */ +CurrencyDecimalSeparator: string +/** + * Defines what currency group separator will be applied. + */ +CurrencyGroupSeparator: string +/** + * Defines how many characters will be grouped. + */ +CurrencyGroupSize: number +/** + * Defines if all prices will be initiated with the currency symbol (`true`) or not (`false`). + */ +StartsWithCurrencySymbol: boolean +} +/** + * Details about the marketplace related to the order. + */ +export interface Marketplace { +/** + * Marketplace base URL. + */ +baseURL: string +/** + * If is a certified marketplace. + */ +isCertified: string +/** + * Name of the marketplace. + */ +name: string +} +/** + * Metadata information about the order's items. + */ +export interface ItemMetadata { +/** + * Metadata items. + */ +Items: { +/** + * Item's SKU ID, which is a unique numerical identifier. + */ +Id: string +/** + * Seller ID that identifies the seller the item belongs to. + */ +Seller: string +/** + * Name of the item as displayed to customers in the storefront. + */ +Name: string +/** + * Name of the SKU corresponding to the item. + */ +SkuName: string +/** + * ID of the Product associated with the item. + */ +ProductId: string +/** + * Item's reference ID. + */ +RefId: string +/** + * EAN of the item. + */ +Ean: string +/** + * Item's SKU image URL. + */ +ImageUrl: string +/** + * URL slug of the item. + */ +DetailUrl: string +/** + * Displays information about assembly options related to the item, if there are any. + */ +AssemblyOptions: { +/** + * ID of the attachment related to the order. + */ +Id: string +/** + * Name of the attachment related to the order. + */ +Name: string +/** + * Indicates if sending the attachment is required. + */ +Required: boolean +/** + * Displays the attachment's content. + */ +InputValues: { + +} +/** + * Displays the attachment's composition. + */ +Composition: { + +} +}[] +}[] +} +/** + * Information about subscriptions. + */ +export interface SubscriptionData { +/** + * ID of the subscription's group. If this field returns `null` and the `executionCount` is `0`, the order is the first one with subscriptions. + */ +SubscriptionGroupId: string +/** + * List with subscriptions and their details. + */ +Subscriptions: { +/** + * Position of the order in the subscription cycle. + */ +ExecutionCount: number +/** + * Price of the order at the subscription start date. + */ +PriceAtSubscriptionDate: number +/** + * Each item in the subscriptions' order is identified by an index. + */ +ItemIndex: number +/** + * Information about the subscription's validity and frequency. + */ +Plan: { +/** + * Type of plan. + */ +type: string +/** + * Information about subscriptions' recurrence. + */ +frequency: { +/** + * Defines the subscriptions recurrence period. + */ +periodicity: string +/** + * Interval between subscription orders, depending on the periodicity. + */ +interval: number +} +/** + * Information about the period during which the subscription will be valid. + */ +validity: { +/** + * Subscription's start date in ISO 8601 format. + */ +begin: string +/** + * Subscription's end date in ISO 8601 format. + */ +end: string +} +} +}[] +} +/** + * Order's tax information. + */ +export interface TaxData { +/** + * Indicates if the taxes were designated by the marketplace (`true`) or not (`false`). + */ +areTaxesDesignatedByMarketplace: boolean +/** + * Array with detailed tax information for each item. + */ +taxInfoCollection: { +/** + * Index number of the item in the order. + */ +itemIndex: number +/** + * Alphanumeric sequence that identifies the item's SKU. + */ +sku: string +/** + * List of price tags associated with taxes for the item. + */ +priceTags: { +/** + * Indicates if the tax is a percentage (`true`) or a fixed amount (`false`). + */ +isPercentual: boolean +/** + * Name of the tax. + */ +name: string +/** + * Amount associated with the tax, in raw format. + */ +rawValue: string +}[] +}[] +} +/** + * Information about order cancellation, when it applies. + */ +export interface CancellationData { +/** + * Indicates if the order cancellation was requested by the customer (`true`) or not (`false`). + */ +RequestedByUser: boolean +/** + * Indicates if the order cancellation was made by the system (`true`) or not (`false`). + */ +RequestedBySystem: boolean +/** + * Indicates if the order cancellation was requested by the seller (`true`) or not (`false`). + */ +RequestedBySellerNotification: boolean +/** + * Indicates if the order cancellation was requested by the payment gateway (`true`) or not (`false`). + */ +RequestedByPaymentNotification: boolean +/** + * The reason provided for the cancellation of the order. + */ +Reason: string +/** + * The date and time when the order was canceled, in ISO 8601 format. + */ +CancellationDate: string +} +/** + * Information about the customer's preferences. + */ +export interface ClientPreferencesData { +/** + * Customer's preferred language in the store, typically represented by a locale code (e.g., 'en-US'). + */ +locale: string +/** + * Indicates if the customer opted to receive newsletters (`true` for yes, `false` for no). + */ +optinNewsLetter: boolean +} diff --git a/vtex/utils/openapi/vcs.openapi.json b/vtex/utils/openapi/vcs.openapi.json index e8a08bafa..b8b013298 100644 --- a/vtex/utils/openapi/vcs.openapi.json +++ b/vtex/utils/openapi/vcs.openapi.json @@ -1052,6 +1052,204 @@ } } }, + "/api/dataentities/{acronym}/documents/{id}": { + "get": { + "tags": [ + "Documents" + ], + "summary": "Get document", + "description": "Retrieves a document.\r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Dynamic Storage | Dynamic storage generic resources | **Read only documents** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "Getdocument", + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Accept" + }, + { + "$ref": "#/components/parameters/acronym" + }, + { + "$ref": "#/components/parameters/id" + }, + { + "$ref": "#/components/parameters/fields" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Document" + }, + "example": { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "description": "Error response body.", + "type": "object", + "properties": { + "Message": { + "description": "Error message.", + "type": "string" + } + } + }, + "example": { + "Message": "Cannot read private fields" + } + } + } + } + } + }, + "put": { + "tags": [ + "Documents" + ], + "summary": "Create document with custom ID or update entire document", + "description": "Creates a new document with a custom ID, or updates an entire document if there is already a document with the informed ID.\r\n\r\n>ℹ️ You can use this request to create or update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update.\r\n\r\n## Custom field types\r\n\r\nThe table below presents the types of custom fields you can use when creating or updating documents in Master Data v1 and example values.\r\n\r\n| Field Type| Example value |\r\n| - | - |\r\n| Boolean | `true` |\r\n| Currency | `2.5` |\r\n| Date | `1992-11-17` |\r\n| Date_Time | `2016-09-14T19:21:01.3163733Z` |\r\n| Decimal | `2.5` |\r\n| Email | `meu@email.com` |\r\n| Integer | `1000000` |\r\n| Long | `1000000000` |\r\n| Percent | `85.42` |\r\n| Time | `23:50` |\r\n| URL | `https://www.vtex.com` |\r\n| Varchar10 | `Lorem ipsu` |\r\n| Varchar50 | `Lorem ipsum dolor sit amet, consectetur adipiscing` |\r\n| Varchar750 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` |\r\n| Varchar100 | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` |\r\n| Relationship | `5eb31afb-7ab0-11e6-94b4-0a44686e393f` |\r\n| Text | `Lorem ipsum dolor sit amet, consectetur adipiscing elit...` |\r\n \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "Updateentiredocument", + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Accept" + }, + { + "$ref": "#/components/parameters/acronym" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Object with document fields and their respective values.", + "additionalProperties": true, + "properties": { + "{fieldName}": { + "type": "string", + "description": "Field name and value.", + "example": "{fieldValue}" + } + } + }, + "example": { + "Boolean": true, + "Currency": 2.5, + "Date": "1992-11-17", + "Date_Time": "2016-09-14T19:21:01.3163733Z", + "Decimal": 2.5, + "Email": "meu@email.com", + "Integer": 1000000, + "Long": 1000000000, + "Percent": 85.42, + "Time": "23:50", + "URL": "http://www.vtex.com", + "Varchar10": "Lorem ipsu", + "Varchar50": "Lorem ipsum dolor sit amet, consectetur adipiscing", + "Varchar750": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Varchar100": "Lorem ipsum dolor sit amet, consectetur adipiscing elit...", + "Relationship": "5eb31afb-7ab0-11e6-94b4-0a44686e393f", + "Text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content" + } + } + }, + "patch": { + "tags": [ + "Documents" + ], + "summary": "Update partial document", + "description": "Updates a subset of fields of a document, without impacting the other fields.\r\n\r\n>ℹ️ You can use this request to update documents in any given data entity. Because of this, you are not restricted to using the fields exemplified below in your requests. But you should be aware of the fields allowed or required for each document you wish to update. \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Dynamic Storage | Dynamic storage generic resources | **Insert or update document (not remove)** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "Updatepartialdocument", + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Accept" + }, + { + "$ref": "#/components/parameters/acronym" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Object with the fields to be updated and their respective values." + }, + "example": { + "addressName": "4726026151253" + } + } + }, + "required": true + }, + "responses": { + "204": { + "description": "No Content" + } + } + }, + "delete": { + "tags": [ + "Documents" + ], + "summary": "Delete document", + "description": "Deletes a document. \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| Dynamic Storage | Dynamic storage generic resources | **Full access to all documents** |\r\n| Dynamic Storage | Dynamic storage generic resources | **Master Data administrator** |\r\n\r\nThere are no applicable [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) for this resource list. You must [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) and add at least one of the resources above in order to use this endpoint.To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).\r\n\r\n>\u2757 To prevent integrations from having excessive permissions, consider the [best practices for managing app keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "Deletedocument", + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Accept" + }, + { + "$ref": "#/components/parameters/acronym" + }, + { + "$ref": "#/components/parameters/id" + } + ], + "responses": { + "204": { + "description": "No Content" + } + } + } + }, "/api/logistics/pvt/inventory/skus/{skuId}": { "get": { "parameters": [ @@ -38533,7 +38731,9 @@ }, "/api/oms/user/orders": { "get": { - "tags": ["User orders"], + "tags": [ + "User orders" + ], "summary": "Retrieve user's orders", "description": "Lists all orders from a given customer, filtering by their email. \r\n\r\n> You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). \r\n\r\n> Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| OMS | OMS access | **View order** |\r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| Call center operator | View order |\r\n| OMS - Read only | View order |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). \r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).", "operationId": "Userorderslist", @@ -39045,6 +39245,636 @@ } } } + }, + "/api/oms/user/orders/{orderId}": { + "get": { + "tags": [ + "User orders" + ], + "summary": "Retrieve user order details", + "description": "Lists all details from an order, through the perspective of the customer who placed the order. \r\n\r\n> You can only access information from orders created in the last two years, and that same period is valid for customers through [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh). \r\n\r\n> Note that this request should be made by an [user](https://developers.vtex.com/docs/guides/user-authentication-and-login) or [an appKey / appToken pair](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) that is associated with the [Call center operator](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy#call-center-operator) role. Otherwise, it will return only orders from the same email informed in the `clientEmail` query parameter. \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| OMS | OMS access | **View order** |\r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| Call center operator | View order |\r\n| OMS - Read only | View order |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). \r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).", + "operationId": "Userorderdetails", + "parameters": [ + { + "name": "clientEmail", + "in": "query", + "description": "Customer email.", + "required": true, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "example": "customer@mail.com" + } + }, + { + "name": "Content-Type", + "in": "header", + "description": "Type of the content being sent.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/json" + } + }, + { + "name": "Accept", + "in": "header", + "description": "HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/json" + } + }, + { + "name": "orderId", + "in": "path", + "description": "Order ID is a unique code that identifies an order.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "1172452900788-01" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Userorderdetails" + }, + "example": { + "orderId": "1172452900788-01", + "sequence": "502556", + "marketplaceOrderId": "", + "marketplaceServicesEndpoint": "http://oms.vtexinternal.com.br/api/oms?an=luxstore", + "sellerOrderId": "00-v502556llux-01", + "origin": "Marketplace", + "affiliateId": "GHB", + "salesChannel": "1", + "merchantName": "luxstore", + "status": "handling", + "statusDescription": "Preparando Entrega", + "value": 1160, + "creationDate": "2019-01-28T20:09:43.899958+00:00", + "lastChange": "2019-02-06T20:46:11.7010747+00:00", + "orderGroup": "v502556lspt", + "totals": [ + { + "id": "Items", + "name": "Total dos Itens", + "value": 3290 + }, + { + "id": "Discounts", + "name": "Total dos Descontos", + "value": 0 + }, + { + "id": "Shipping", + "name": "Total do Frete", + "value": 1160 + }, + { + "id": "Tax", + "name": "Total da Taxa", + "value": 0 + }, + { + "id": "Change", + "name": "Total das mudanças", + "value": -3290 + } + ], + "items": [ + { + "uniqueId": "87F0945396994B349158C7D9C9941442", + "id": "256", + "productId": "9429485", + "ean": "3256873", + "lockId": "00-v502556llux-01", + "itemAttachment": { + "content": {}, + "name": null + }, + "attachments": [], + "quantity": 1, + "seller": "1", + "name": "Bay Max L", + "refId": "BIGHEROBML", + "price": 3290, + "listPrice": 3290, + "manualPrice": null, + "priceTags": [], + "imageUrl": "http://luxstore.vteximg.com.br/arquivos/ids/159263-55-55/image-cc1aed75cbfa424a85a94900be3eacec.jpg?v=636795432619830000", + "detailUrl": "/bay-max-9429485/p", + "components": [], + "bundleItems": [], + "params": [], + "offerings": [], + "attachmentOfferings": [ + { + "name": "vtex.subscription.weekly", + "required": false, + "schema": { + "vtex.subscription.key.frequency": { + "MaximumNumberOfCharacters": 7, + "Domain": [ + "1 week", + " 2 week", + " 3 week", + " 4 week" + ] + } + } + } + ], + "sellerSku": "1234568358", + "priceValidUntil": null, + "commission": 0, + "tax": 0, + "preSaleDate": null, + "additionalInfo": { + "brandName": "VTEX", + "brandId": "2000023", + "categoriesIds": "/1/", + "categories": [ + { + "id": 12770, + "name": "Backpacks" + }, + { + "id": 2000126, + "name": "Packs & Duffel Bags" + }, + { + "id": 2000003, + "name": "Accessories" + } + ], + "productClusterId": "135,142", + "commercialConditionId": "5", + "dimension": { + "cubicweight": 0.7031, + "height": 15, + "length": 15, + "weight": 15, + "width": 15 + }, + "offeringInfo": null, + "offeringType": null, + "offeringTypeId": null + }, + "measurementUnit": "un", + "unitMultiplier": 1, + "sellingPrice": 3290, + "isGift": false, + "shippingPrice": null, + "rewardValue": 0, + "freightCommission": 0, + "priceDefinitions": { + "sellingPrices": [ + { + "value": 99, + "quantity": 1 + } + ], + "calculatedSellingPrice": 99, + "total": 99 + }, + "taxCode": null, + "parentItemIndex": null, + "parentAssemblyBinding": null, + "callCenterOperator": "callCenterOp5473869", + "serialNumbers": "3", + "assemblies": [], + "costPrice": 52 + } + ], + "marketplaceItems": [], + "clientProfileData": { + "id": "clientProfileData", + "email": "rodrigo.cunha@vtex.com.br", + "firstName": "Rodrigo", + "lastName": "Cunha", + "documentType": "cpf", + "document": "11047867702", + "phone": "+5521972321094", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false, + "userProfileId": "5a3692de-358a-4bea-8885-044bce33bb93", + "customerClass": null + }, + "giftRegistryData": null, + "marketingData": { + "id": "marketingData", + "utmSource": "fb", + "utmPartner": "utm partner name", + "utmMedium": "utm medium name", + "utmCampaign": "christmas", + "coupon": "sale", + "utmiCampaign": " ", + "utmipage": " ", + "utmiPart": " ", + "marketingTags": [ + "vtex-subscription" + ] + }, + "ratesAndBenefitsData": { + "id": "ratesAndBenefitsData", + "rateAndBenefitsIdentifiers": [] + }, + "shippingData": { + "id": "shippingData", + "address": { + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "518", + "neighborhood": "Botafogo", + "complement": "10", + "reference": null, + "geoCoordinates": [] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "lockTTL": "10d", + "price": 1160, + "listPrice": 1160, + "sellingPrice": 1160, + "deliveryWindow": null, + "deliveryCompany": "Todos os CEPS", + "shippingEstimate": "5bd", + "shippingEstimateDate": "2019-02-04T20:33:46.4595004+00:00", + "slas": [ + { + "id": "Normal", + "name": "Normal", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region196", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Expressa", + "name": "Expressa", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": null, + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Quebra Kit", + "name": "Quebra Kit", + "shippingEstimate": "2bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": null, + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Sob Encomenda", + "name": "Sob Encomenda", + "shippingEstimate": "32bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": null, + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + } + ], + "shipsTo": [ + "BRA" + ], + "deliveryIds": [ + { + "courierId": "197a56f", + "courierName": "Todos os CEPS", + "dockId": "1", + "quantity": 1, + "warehouseId": "1_1", + "accountCarrierName": "recorrenciaqa", + "kitItemDetails": [] + } + ], + "deliveryChannels": [ + { + "id": "delivery", + "stockBalance": 0 + } + ], + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "polygonName": null, + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d" + } + ], + "trackingHints": null, + "selectedAddresses": [ + { + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "street": "Praia de Botafogo", + "number": "518", + "complement": "10", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "reference": null, + "geoCoordinates": [] + } + ] + }, + "paymentData": { + "giftCards": [], + "transactions": [ + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3", + "paymentSystem": "6", + "paymentSystemName": "Boleto Bancário", + "value": 4450, + "installments": 1, + "referenceValue": 4450, + "cardHolder": null, + "cardNumber": null, + "firstDigits": null, + "lastDigits": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}", + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "bankInvoice", + "tid": null, + "dueDate": "2019-02-02", + "connectorResponses": { + "Tid": "94857956", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "857956" + }, + "giftCardProvider": "presentCard", + "giftCardAsDiscount": false, + "koinUrl": "koinURL", + "accountId": "5BC5C6B417FE432AB971B1D399F190C9", + "parentAccountId": "5BC5C6B417FE432AB971B1D399F190C9", + "bankIssuedInvoiceIdentificationNumber": "23797770100000019003099260100022107500729050", + "bankIssuedInvoiceIdentificationNumberFormatted": "32534.95739 75945.24534 54395.734214 5", + "bankIssuedInvoiceBarCodeNumber": "325349573975945245345439573421443986734065", + "bankIssuedInvoiceBarCodeType": "i25", + "billingAddress": {} + } + ] + } + ] + }, + "packageAttachment": { + "packages": [] + }, + "sellers": [ + { + "id": "1", + "name": "Lux Store", + "logo": "https://sellersLogo/images.png", + "fulfillmentEndpoint": "http://fulfillment.vtexcommerce.com.br/api/fulfillment?an=accountName" + } + ], + "callCenterOperatorData": null, + "followUpEmail": "7bf3a59bbc56402c810bda9521ba449e@ct.vtex.com.br", + "lastMessage": null, + "hostname": "luxstore", + "invoiceData": null, + "changesAttachment": { + "id": "changeAttachment", + "changesData": [ + { + "reason": "Blah", + "discountValue": 3290, + "incrementValue": 0, + "itemsAdded": [], + "itemsRemoved": [ + { + "id": "1234568358", + "name": "Bay Max L", + "quantity": 1, + "price": 3290, + "unitMultiplier": null + } + ], + "receipt": { + "date": "2019-02-06T20:46:04.4003606+00:00", + "orderId": "v502556llux-01", + "receipt": "029f9ab8-751a-4b1e-bf81-7dd25d14b49b" + } + } + ] + }, + "openTextField": null, + "roundingError": 0, + "orderFormId": "caae7471333e403f959fa5fd66951340", + "commercialConditionData": null, + "isCompleted": true, + "customData": null, + "storePreferencesData": { + "countryCode": "BRA", + "currencyCode": "BRL", + "currencyFormatInfo": { + "CurrencyDecimalDigits": 2, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + }, + "currencyLocale": 1046, + "currencySymbol": "R$", + "timeZone": "E. South America Standard Time" + }, + "allowCancellation": true, + "allowEdition": false, + "isCheckedIn": false, + "marketplace": { + "baseURL": "http://oms.vtexinternal.com.br/api/oms?an=luxstore", + "isCertified": null, + "name": "luxstore" + }, + "authorizedDate": "2019-01-28T20:33:04+00:00", + "invoicedDate": null, + "cancelReason": "The size was too big.", + "itemMetadata": { + "Items": [ + { + "Id": "18", + "Seller": "1", + "Name": "Cat food", + "SkuName": "Cat food", + "ProductId": "6", + "RefId": "105", + "Ean": "43673557", + "ImageUrl": "http://store.vteximg.com.br/ids/155392-55-55/AlconKOI.jpg?v=635918402228600000", + "DetailUrl": "/catfood/p", + "AssemblyOptions": [ + { + "Id": "vtex.subscription.plan-ana", + "Name": "vtex.subscription.plan-ana", + "Required": false, + "InputValues": { + "vtex.subscription.key.frequency": { + "MaximumNumberOfCharacters": 8, + "Domain": [ + "4 month", + "1 month" + ] + } + }, + "Composition": {} + } + ] + } + ] + }, + "subscriptionData": { + "SubscriptionGroupId": "A64AC73C0FB8693A7ADB4AC69CA4FD5F", + "Subscriptions": [ + { + "ExecutionCount": 724, + "PriceAtSubscriptionDate": 100.0, + "ItemIndex": 0, + "Plan": { + "type": "RECURRING_PAYMENT", + "frequency": { + "periodicity": "DAILY", + "interval": 1 + }, + "validity": { + "begin": "2022-01-10T00:00:00.0000000+00:00", + "end": "2024-02-03T00:00:00.0000000+00:00" + } + } + } + ] + }, + "taxData": { + "areTaxesDesignatedByMarketplace": true, + "taxInfoCollection": [ + { + "itemIndex": 0, + "sku": "COLOCAR_O_SKUID", + "priceTags": [ + { + "isPercentual": false, + "name": "Taxes (Magazine Luisa)", + "rawValue": "COLOCAR_O_VALOR_SEM_DECIMAL" + } + ] + } + ] + }, + "checkedInPickupPointId": "storeNameExample_901", + "cancellationData": { + "RequestedByUser": true, + "RequestedBySystem": false, + "RequestedBySellerNotification": false, + "RequestedByPaymentNotification": false, + "Reason": "Item was too big in the client.", + "CancellationDate": "2022-10--05T15:40:33" + }, + "clientPreferencesData": { + "locale": "en-US", + "optinNewsLetter": false + } + } + } + } + } + } + } } }, "components": { @@ -39128,6 +39958,39 @@ } }, "schemas": { + "Document": { + "title": "Document", + "required": [ + "id", + "dataEntityId", + "accountId", + "accountName" + ], + "type": "object", + "description": "Object representing each document.", + "properties": { + "{customProperty}": { + "type": "string", + "description": "Custom property." + }, + "id": { + "type": "string", + "description": "Unique identifier of the document." + }, + "accountId": { + "type": "string", + "description": "Unique identifier of the account." + }, + "accountName": { + "type": "string", + "description": "Account name." + }, + "dataEntityId": { + "type": "string", + "description": "Two-letter string that identifies the data entity." + } + } + }, "PickupPoint": { "type": "object", "description": "Pickup point information.", @@ -43114,7 +43977,12 @@ }, "Userorderslist": { "title": "Userorderslist", - "required": ["list", "facets", "paging", "stats"], + "required": [ + "list", + "facets", + "paging", + "stats" + ], "type": "object", "description": "Order list object.", "properties": { @@ -43442,7 +44310,9 @@ }, "Stats2": { "title": "Stats2", - "required": ["stats"], + "required": [ + "stats" + ], "type": "object", "properties": { "stats": { @@ -43478,7 +44348,10 @@ }, "Stats3": { "title": "Stats3", - "required": ["totalValue", "totalItems"], + "required": [ + "totalValue", + "totalItems" + ], "type": "object", "properties": { "totalValue": { @@ -43622,6 +44495,7885 @@ "SumOfSquares": 0, "Facets": {} } + }, + "Total": { + "required": [ + "id", + "name", + "value" + ], + "type": "object", + "description": "Object about order's totals.", + "properties": { + "id": { + "type": "string", + "description": "Code that identifies if the information is about `Items`, `Discounts`, `Shipping`, `Tax` or `Change`." + }, + "name": { + "type": "string", + "description": "Name of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`." + }, + "value": { + "type": "integer", + "description": "Total amount of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`." + } + } + }, + "ClientProfileData": { + "title": "ClientProfileData", + "description": "Object with information on the client's profile.", + "required": [ + "id", + "email", + "firstName", + "lastName", + "documentType", + "document", + "phone", + "corporateName", + "tradeName", + "corporateDocument", + "stateInscription", + "corporatePhone", + "isCorporate", + "userProfileId", + "customerClass" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Object ID, the expected value is `clientProfileData`." + }, + "email": { + "type": "string", + "description": "Customer's email." + }, + "firstName": { + "type": "string", + "description": "Customer's first name." + }, + "lastName": { + "type": "string", + "description": "Customer's last name." + }, + "documentType": { + "type": "string", + "description": "Type of the document informed by the customer." + }, + "document": { + "type": "string", + "description": "Document identification code informed by the customer." + }, + "phone": { + "type": "string", + "description": "Customers's phone number." + }, + "corporateName": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the corporate name." + }, + "tradeName": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the trade name." + }, + "corporateDocument": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the corporate document." + }, + "stateInscription": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the state inscription." + }, + "corporatePhone": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the corpany's phone number." + }, + "isCorporate": { + "type": "boolean", + "description": "The value is `true` when the customer is a legal entity and `false` when not." + }, + "userProfileId": { + "type": "string", + "description": "Customer user profile ID." + }, + "customerClass": { + "type": "string", + "nullable": true, + "description": "Identification of the class the customer belongs to." + } + }, + "example": { + "id": "clientProfileData", + "email": "rodrigo.cunha@vtex.com.br", + "firstName": "Rodrigo", + "lastName": "VTEX", + "documentType": "cpf", + "document": "11047867702", + "phone": "+5521972321094", + "corporateName": null, + "tradeName": null, + "corporateDocument": null, + "stateInscription": null, + "corporatePhone": null, + "isCorporate": false, + "userProfileId": "5a3692de-358a-4bea-8885-044bce33bb93", + "customerClass": null + } + }, + "RatesAndBenefitsDataUpdated": { + "type": "object", + "description": "Information on promotions and taxes that apply to the order.", + "properties": { + "id": { + "type": "string", + "description": "Object ID. The expected value is `ratesAndBenefitsData`." + }, + "rateAndBenefitsIdentifiers": { + "type": "array", + "description": "Information about order's promotions and taxes identifiers.", + "items": { + "type": "object", + "description": "Information about a given promotion or tax.", + "properties": { + "description": { + "type": "string", + "description": "Promotion or tax description.", + "nullable": true + }, + "featured": { + "type": "boolean", + "description": "Defines if the [target audience](https://help.vtex.com/en/tutorial/creating-a-campaign-audience--6cnuDZJzIkIeocewAQQK4K) is featured (`true`) or not (`false`)." + }, + "id": { + "type": "string", + "description": "Promotion or tax ID." + }, + "name": { + "type": "string", + "description": "Promotion or tax name." + }, + "matchedParameters": { + "type": "object", + "description": "Informs the criteria and conditions fulfilled so the promotion became valid.", + "additionalProperties": { + "type": "string", + "description": "Promotion or tax criteria content." + } + }, + "additionalInfo": { + "type": "object", + "description": "Object containing the promotion or tax additional information.", + "nullable": true, + "additionalProperties": { + "type": "string", + "description": "Additional information." + } + } + } + } + } + } + }, + "RatesAndBenefitsData": { + "title": "RatesAndBenefitsData", + "description": "Information on promotions and taxes that apply to the order.", + "required": [ + "id", + "rateAndBenefitsIdentifiers" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the rate or benefit." + }, + "rateAndBenefitsIdentifiers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Information about order's promotions and taxes identifiers." + } + }, + "example": { + "id": "ratesAndBenefitsData", + "rateAndBenefitsIdentifiers": [] + } + }, + "ShippingData": { + "title": "ShippingData", + "description": "Object containing shipping data.", + "required": [ + "id", + "address", + "logisticsInfo", + "trackingHints", + "selectedAddresses" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Object ID, the expected value is `shippingData`." + }, + "address": { + "$ref": "#/components/schemas/Address" + }, + "logisticsInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogisticsInfo" + }, + "description": "Array of objects containing item's logistics information." + }, + "trackingHints": { + "type": "string", + "nullable": true + }, + "selectedAddresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectedAddress" + }, + "description": "Information about selected adresses." + } + }, + "example": { + "id": "shippingData", + "address": { + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "neighborhood": "Botafogo", + "complement": "3", + "reference": null, + "geoCoordinates": [] + }, + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Normal", + "lockTTL": "10d", + "price": 1160, + "listPrice": 1160, + "sellingPrice": 1160, + "deliveryWindow": null, + "deliveryCompany": "Todos os CEPS", + "shippingEstimate": "5bd", + "shippingEstimateDate": "2019-02-04T20:33:46.4595004+00:00", + "slas": [ + { + "id": "Normal", + "name": "Normal", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "", + "lockTTL": "12d", + "pickupPointId": "store35", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Expressa", + "name": "Expressa", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "", + "lockTTL": "12d", + "pickupPointId": "store45", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Quebra Kit", + "name": "Quebra Kit", + "shippingEstimate": "2bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "", + "lockTTL": "12d", + "pickupPointId": "store45", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Sob Encomenda", + "name": "Sob Encomenda", + "shippingEstimate": "32bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "", + "lockTTL": "12d", + "pickupPointId": "store46", + "transitTime": "3d", + "pickupDistance": 0.0 + } + ], + "shipsTo": [ + "BRA" + ], + "deliveryIds": [ + { + "courierId": "197a56f", + "courierName": "Todos os CEPS", + "dockId": "1", + "quantity": 1, + "warehouseId": "1_1", + "accountCarrierName": "recorrenciaqa", + "kitItemDetails": [] + } + ], + "deliveryChannels": [ + { + "id": "delivery", + "stockBalance": 0 + } + ], + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "addressId": "4791759472332", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "polygonName": "", + "pickupPointId": "store67", + "transitTime": "3d" + } + ], + "trackingHints": null, + "selectedAddresses": [ + { + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "street": "Praia de Botafogo", + "number": "518", + "complement": "10", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "reference": null, + "geoCoordinates": [] + } + ] + } + }, + "Address": { + "title": "Address", + "description": "Shipping address details.", + "required": [ + "addressType", + "receiverName", + "addressId", + "versionId", + "entityId", + "postalCode", + "city", + "state", + "country", + "street", + "number", + "neighborhood", + "complement", + "reference", + "geoCoordinates" + ], + "type": "object", + "properties": { + "addressType": { + "type": "string", + "description": "Type of address. For example, `Residential` or `Pickup`, among others." + }, + "receiverName": { + "type": "string", + "description": "Name of the person who is going to receive the order." + }, + "addressId": { + "type": "string", + "description": "Shipping address ID." + }, + "versionId": { + "type": "string", + "description": "Shipping address version ID.", + "nullable": true + }, + "entityId": { + "type": "string", + "description": "Shipping address entity ID.", + "nullable": true + }, + "postalCode": { + "type": "string", + "description": "Postal code of the shipping address." + }, + "city": { + "type": "string", + "description": "City of the shipping address." + }, + "state": { + "type": "string", + "description": "State of the shipping address." + }, + "country": { + "type": "string", + "description": "Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3)." + }, + "street": { + "type": "string", + "description": "Street of the shipping address." + }, + "number": { + "type": "string", + "description": "Number of the building, house or apartment in the shipping address." + }, + "neighborhood": { + "type": "string", + "description": "Neighborhood of the shipping address." + }, + "complement": { + "type": "string", + "description": "Complement to the shipping address when it applies." + }, + "reference": { + "type": "string", + "nullable": true, + "description": "Complement to help locate the shipping address, in case of delivery." + }, + "geoCoordinates": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Array with two numbers with geocoordinates, first longitude then latitude." + } + }, + "example": { + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "street": "Praia de Botafogo", + "number": "300", + "neighborhood": "Botafogo", + "complement": "3", + "reference": null, + "geoCoordinates": [] + } + }, + "LogisticsInfo": { + "title": "LogisticsInfo", + "required": [ + "itemIndex", + "selectedSla", + "lockTTL", + "price", + "listPrice", + "sellingPrice", + "deliveryWindow", + "deliveryCompany", + "shippingEstimate", + "shippingEstimateDate", + "slas", + "shipsTo", + "deliveryIds", + "deliveryChannels", + "deliveryChannel", + "pickupStoreInfo", + "addressId", + "versionId", + "entityId", + "polygonName", + "pickupPointId", + "transitTime" + ], + "type": "object", + "properties": { + "itemIndex": { + "type": "integer", + "description": "Index of the item starting from 0." + }, + "selectedSla": { + "type": "string", + "description": "Selected shipping option." + }, + "lockTTL": { + "type": "string", + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time." + }, + "price": { + "type": "integer", + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price." + }, + "listPrice": { + "type": "integer", + "description": "SKU's optional price for a specific trade policy." + }, + "sellingPrice": { + "type": "integer", + "description": "Item's selling price." + }, + "deliveryWindow": { + "type": "string", + "nullable": true, + "description": "[Scheduled delivery](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) window information, if it applies to the item." + }, + "deliveryCompany": { + "type": "string", + "description": "[Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE) company's name." + }, + "shippingEstimate": { + "type": "string", + "description": "Total shipping estimate time in days. For instance, three business days is represented `3bd`." + }, + "shippingEstimateDate": { + "type": "string", + "description": "Shipping estimate date. It is defined only after the confirmation of the order." + }, + "slas": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Sla" + }, + "description": "Information on Service Level Agreement (SLA), corresponding to [shipping policies](https://help.vtex.com/tutorial/shipping-policy--tutorials_140)." + }, + "shipsTo": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Three letters ISO code of the country of the shipping address (ISO 3166 ALPHA-3)." + }, + "deliveryIds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryId" + }, + "description": "Information about delivery IDs." + }, + "deliveryChannels": { + "type": "array", + "description": "List of delivery channels associated with the trade policy.", + "items": { + "type": "object", + "required": [ + "id", + "stockBalance" + ], + "properties": { + "id": { + "type": "string", + "description": "Delivery channel's shipping type, which can be `delivery` or `pickup-in-point`." + }, + "stockBalance": { + "type": "integer", + "description": "Stock check for an SKU availability." + } + } + } + }, + "deliveryChannel": { + "type": "string", + "description": "If the delivery channel is `delivery` or `pickup-in-point`." + }, + "pickupStoreInfo": { + "$ref": "#/components/schemas/PickupStoreInfo" + }, + "addressId": { + "type": "string", + "description": "Address ID." + }, + "versionId": { + "type": "string", + "description": "Shipping address version ID.", + "nullable": true + }, + "entityId": { + "type": "string", + "description": "Shipping address entity ID." + }, + "polygonName": { + "type": "string", + "nullable": true, + "description": "Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy." + }, + "pickupPointId": { + "type": "string", + "description": "[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R)'s ID." + }, + "transitTime": { + "type": "string", + "description": "Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`." + } + }, + "example": { + "itemIndex": 0, + "selectedSla": "Normal", + "lockTTL": "10d", + "price": 1160, + "listPrice": 1160, + "sellingPrice": 1160, + "deliveryWindow": null, + "deliveryCompany": "Todos os CEPS", + "shippingEstimate": "5bd", + "shippingEstimateDate": "2019-02-04T20:33:46.4595004+00:00", + "slas": [ + { + "id": "Normal", + "name": "Normal", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region196", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Expressa", + "name": "Expressa", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region196", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Quebra Kit", + "name": "Quebra Kit", + "shippingEstimate": "2bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region196", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + }, + { + "id": "Sob Encomenda", + "name": "Sob Encomenda", + "shippingEstimate": "32bd", + "deliveryWindow": null, + "price": 1392, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region196", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + } + ], + "shipsTo": [ + "BRA" + ], + "deliveryIds": [ + { + "courierId": "197a56f", + "courierName": "Todos os CEPS", + "dockId": "1", + "quantity": 1, + "warehouseId": "1_1", + "accountCarrierName": "recorrenciaqa", + "kitItemDetails": [] + } + ], + "deliveryChannels": [ + { + "id": "delivery", + "stockBalance": 0 + } + ], + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "polygonName": null, + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d" + } + }, + "Sla": { + "title": "Sla", + "required": [ + "id", + "name", + "shippingEstimate", + "deliveryWindow", + "price", + "deliveryChannel", + "pickupStoreInfo", + "polygonName", + "lockTTL", + "pickupPointId", + "transitTime", + "pickupDistance" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)." + }, + "name": { + "type": "string", + "description": "Name of the shipping policy." + }, + "shippingEstimate": { + "type": "string", + "description": "Total shipping estimate time in days. For instance, three business days is represented `3bd`." + }, + "deliveryWindow": { + "type": "string", + "nullable": true, + "description": "[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, if it applies to the item." + }, + "price": { + "type": "integer", + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price." + }, + "deliveryChannel": { + "type": "string", + "description": "If the delivery channel is `delivery` or `pickup-in-point`." + }, + "pickupStoreInfo": { + "$ref": "#/components/schemas/PickupStoreInfo" + }, + "polygonName": { + "type": "string", + "nullable": true, + "description": "Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy." + }, + "lockTTL": { + "type": "string", + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA." + }, + "pickupPointId": { + "type": "string", + "description": "[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA." + }, + "transitTime": { + "type": "string", + "description": "Duration in business days of the time the carrier takes in transit to fulfill the order. For example, three business days is represented `3bd`." + }, + "pickupDistance": { + "type": "number", + "description": "Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line." + } + }, + "example": { + "id": "Normal", + "name": "Normal", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": null, + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "3d", + "pickupDistance": 0.0 + } + }, + "PickupStoreInfo": { + "title": "PickupStoreInfo", + "description": "Detailed information about a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).", + "required": [ + "additionalInfo", + "address", + "dockId", + "friendlyName", + "isPickupStore" + ], + "type": "object", + "properties": { + "additionalInfo": { + "type": "string", + "nullable": true, + "description": "Additional information about the pickup point." + }, + "address": { + "type": "string", + "nullable": true, + "description": "Pickup point's address." + }, + "dockId": { + "type": "string", + "nullable": true, + "description": "ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point." + }, + "friendlyName": { + "type": "string", + "nullable": true, + "description": "Name of the pickup point displayed at checkout." + }, + "isPickupStore": { + "type": "boolean", + "description": "If this field is set `true`, it means the type of shipping is pickup, and if set as `false`, it is not." + } + }, + "example": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + } + }, + "DeliveryId": { + "title": "DeliveryId", + "description": "Information about delivery IDs.", + "required": [ + "courierId", + "courierName", + "dockId", + "quantity", + "warehouseId", + "accountCarrierName", + "kitItemDetails" + ], + "type": "object", + "properties": { + "courierId": { + "type": "string", + "description": "[Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)'s ID." + }, + "courierName": { + "type": "string", + "description": "Carrier's name." + }, + "dockId": { + "type": "string", + "description": "ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)." + }, + "quantity": { + "type": "integer", + "description": "Quantity of items." + }, + "warehouseId": { + "type": "string", + "description": "ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)." + }, + "accountCarrierName": { + "type": "string", + "description": "Name of the account's [carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)." + }, + "kitItemDetails": { + "type": "array", + "description": "Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), if there are any.", + "nullable": true, + "items": { + "type": "string" + } + } + }, + "example": { + "courierId": "197a56f", + "courierName": "Todos os CEPS", + "dockId": "1", + "quantity": 1, + "warehouseId": "1_1", + "accountCarrierName": "recorrenciaqa", + "kitItemDetails": [] + } + }, + "SelectedAddress": { + "title": "SelectedAddress", + "required": [ + "addressId", + "versionId", + "entityId", + "addressType", + "receiverName", + "street", + "number", + "complement", + "neighborhood", + "postalCode", + "city", + "state", + "country", + "reference", + "geoCoordinates" + ], + "type": "object", + "properties": { + "addressId": { + "type": "string", + "description": "Selected address ID." + }, + "versionId": { + "type": "string", + "description": "Shipping address version ID of the selected address.", + "nullable": true + }, + "entityId": { + "type": "string", + "description": "Shipping address entity ID of the selected address.", + "nullable": true + }, + "addressType": { + "type": "string", + "description": "Selected adress's shipping type, which can be `pickup`, `residential`, `invoice`, `search`, `inStore`, `commercial` or `giftRegistry`." + }, + "receiverName": { + "type": "string", + "description": "Name of the person who is going to receive the order in the selected address." + }, + "street": { + "type": "string", + "description": "Street of the selected address." + }, + "number": { + "type": "string", + "description": "Number of the building, house or apartment of the selected address." + }, + "complement": { + "type": "string", + "description": "Complement to the selected address if it applies." + }, + "neighborhood": { + "type": "string", + "description": "Neighborhood of the selected address." + }, + "postalCode": { + "type": "string", + "description": "Postal code of the selected address." + }, + "city": { + "type": "string", + "description": "City of the selected address." + }, + "state": { + "type": "string", + "description": "State of the selected address." + }, + "country": { + "type": "string", + "description": "Three letters ISO code of the country of the selected address (ISO 3166 ALPHA-3)." + }, + "reference": { + "type": "string", + "nullable": true, + "description": "Complement to help locate the selected address." + }, + "geoCoordinates": { + "type": "array", + "items": { + "type": "number" + }, + "description": "Array with two numbers with the selected address's geocoordinates, first longitude then latitude." + } + }, + "example": { + "addressId": "-1425945657910", + "versionId": "e9c3bec2-125d-4b96-a021-316c3aa9f14f", + "entityId": "eabfb564-99d6-40d8-bd6c-bddbd4990aad", + "addressType": "residential", + "receiverName": "Rodrigo Cunha", + "street": "Praia de Botafogo", + "number": "518", + "complement": "10", + "neighborhood": "Botafogo", + "postalCode": "22250-040", + "city": "Rio de Janeiro", + "state": "RJ", + "country": "BRA", + "reference": null, + "geoCoordinates": [] + } + }, + "PaymentData": { + "title": "PaymentData", + "description": "Object with information about the payment.", + "required": [ + "transactions" + ], + "type": "object", + "properties": { + "giftCards": { + "type": "array", + "description": "Array with information about Gift Cards.", + "items": { + "type": "string" + } + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + }, + "description": "Information about financial transactions." + } + }, + "example": { + "giftCards": [], + "transactions": [ + { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3", + "paymentSystem": "6", + "paymentSystemName": "Boleto Bancário", + "value": 4450, + "installments": 1, + "referenceValue": 4450, + "cardHolder": null, + "cardNumber": null, + "firstDigits": null, + "lastDigits": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}", + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "bankInvoice", + "tid": null, + "dueDate": "2019-02-02", + "connectorResponses": { + "Tid": "94857956", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "857956" + }, + "giftCardProvider": "presentCard", + "giftCardAsDiscount": false, + "koinUrl": "koinURL", + "accountId": "5BC5C6B417FE432AB971B1D399F190C9", + "parentAccountId": "5BC5C6B417FE432AB971B1D399F190C9", + "bankIssuedInvoiceIdentificationNumber": "23797770100000019003099260100022107500729050", + "bankIssuedInvoiceIdentificationNumberFormatted": "32534.95739 75945.24534 54395.734214 5", + "bankIssuedInvoiceBarCodeNumber": "325349573975945245345439573421443986734065", + "bankIssuedInvoiceBarCodeType": "i25", + "billingAddress": {} + } + ] + } + ] + } + }, + "Transaction": { + "title": "Transaction", + "description": "Financial transaction details.", + "required": [ + "isActive", + "transactionId", + "merchantName", + "payments" + ], + "type": "object", + "properties": { + "isActive": { + "type": "boolean", + "description": "When this field is set as `true`, the payment is active, and when it is `false`, the payment is inactive." + }, + "transactionId": { + "type": "string", + "description": "ID of the transaction." + }, + "merchantName": { + "type": "string", + "description": "Name of the merchant that will receive the payment." + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + }, + "description": "Detailed information about payment." + } + }, + "example": { + "isActive": true, + "transactionId": "418213DE29634837A63DD693A937A696", + "merchantName": "luxstore", + "payments": [ + { + "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3", + "paymentSystem": "6", + "paymentSystemName": "Boleto Bancário", + "value": 4450, + "installments": 1, + "referenceValue": 4450, + "cardHolder": null, + "cardNumber": null, + "firstDigits": null, + "lastDigits": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}", + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "bankInvoice", + "tid": null, + "dueDate": "2019-02-02", + "connectorResponses": { + "Tid": "94857956", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "857956" + }, + "giftCardProvider": "presentCard", + "giftCardAsDiscount": false, + "koinUrl": "koinURL", + "accountId": "5BC5C6B417FE432AB971B1D399F190C9", + "parentAccountId": "5BC5C6B417FE432AB971B1D399F190C9", + "bankIssuedInvoiceIdentificationNumber": "23797770100000019003099260100022107500729050", + "bankIssuedInvoiceIdentificationNumberFormatted": "32534.95739 75945.24534 54395.734214 5", + "bankIssuedInvoiceBarCodeNumber": "325349573975945245345439573421443986734065", + "bankIssuedInvoiceBarCodeType": "i25", + "billingAddress": {} + } + ] + } + }, + "Payment": { + "title": "Payment", + "description": "Payment details.", + "required": [ + "id", + "paymentSystem", + "paymentSystemName", + "value", + "installments", + "referenceValue", + "cardHolder", + "cardNumber", + "firstDigits", + "lastDigits", + "cvv2", + "expireMonth", + "expireYear", + "url", + "giftCardId", + "giftCardName", + "giftCardCaption", + "redemptionCode", + "group", + "tid", + "dueDate", + "connectorResponses", + "giftCardProvider", + "giftCardAsDiscount", + "koinUrl", + "accountId", + "parentAccountId", + "bankIssuedInvoiceIdentificationNumber", + "bankIssuedInvoiceIdentificationNumberFormatted", + "bankIssuedInvoiceBarCodeNumber", + "bankIssuedInvoiceBarCodeType", + "billingAddress" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "VTEX payment ID that can be used as unique identifier." + }, + "paymentSystem": { + "type": "string", + "description": "Payment system's ID." + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system's name." + }, + "value": { + "type": "integer", + "description": "Payment's final amount in cents." + }, + "installments": { + "type": "integer", + "description": "Number of payment installments." + }, + "referenceValue": { + "type": "integer", + "description": "Payment's reference value in cents." + }, + "cardHolder": { + "type": "string", + "nullable": true, + "description": "Name of the person who owns the card." + }, + "cardNumber": { + "type": "string", + "nullable": true, + "description": "Numeric sequence of the card used in the transaction." + }, + "firstDigits": { + "type": "string", + "nullable": true, + "description": "Fist digits of the card used in the transaction." + }, + "lastDigits": { + "type": "string", + "nullable": true, + "description": "Last digits of the card used in the transaction." + }, + "cvv2": { + "type": "string", + "nullable": true, + "description": "Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions." + }, + "expireMonth": { + "type": "string", + "nullable": true, + "description": "Expire month of the card used in the transaction (2-digits)." + }, + "expireYear": { + "type": "string", + "nullable": true, + "description": "Expire year of the card used in the transaction (4-digits)." + }, + "url": { + "type": "string", + "description": "Payment's URL." + }, + "giftCardId": { + "type": "string", + "nullable": true, + "description": "Gift Card's ID." + }, + "giftCardName": { + "type": "string", + "nullable": true, + "description": "Gift Card's name." + }, + "giftCardCaption": { + "type": "string", + "nullable": true, + "description": "Gift Card's caption." + }, + "redemptionCode": { + "type": "string", + "nullable": true, + "description": "Code for the customer to use the Gift Card." + }, + "group": { + "type": "string", + "description": "Name of the collection the Gift Card belongs to." + }, + "tid": { + "type": "string", + "nullable": true, + "description": "Provider's unique identifier for the transaction." + }, + "dueDate": { + "type": "string", + "description": "Payment due date, with the format `yyyy-mm-dd`." + }, + "connectorResponses": { + "type": "object", + "description": "Information about the connector responses.", + "required": [ + "Tid", + "ReturnCode", + "Message", + "authId" + ], + "properties": { + "Tid": { + "type": "string", + "description": "Provider's unique identifier for the transaction." + }, + "ReturnCode": { + "type": "string", + "description": "Provider's operation/error code to be logged." + }, + "Message": { + "type": "string", + "description": "Provider's operation/error message to be logged." + }, + "authId": { + "type": "string", + "description": "Connector's authorization ID." + } + } + }, + "giftCardProvider": { + "type": "string", + "description": "Gift Card provider's ID." + }, + "giftCardAsDiscount": { + "type": "boolean", + "description": "When this field is set as `true`, the Gift Card is a discount over the price, and when set as `false`, it is not a discount." + }, + "koinUrl": { + "type": "string", + "description": "Payment's account ID." + }, + "accountId": { + "type": "string", + "description": "Payment's account ID." + }, + "parentAccountId": { + "type": "string", + "description": "This field retrieves the main account if the payment was made in a subaccount." + }, + "bankIssuedInvoiceIdentificationNumber": { + "type": "string", + "description": "Numeric sequence that identifies the bank issued invoice." + }, + "bankIssuedInvoiceIdentificationNumberFormatted": { + "type": "string", + "description": "Bank issued invoice ID formatted." + }, + "bankIssuedInvoiceBarCodeNumber": { + "type": "string", + "description": "Number of the bank issued invoice bar code." + }, + "bankIssuedInvoiceBarCodeType": { + "type": "string", + "description": "Type of the bank issued invoice bar code." + }, + "billingAddress": { + "type": "object", + "description": "Billing address information." + } + }, + "example": { + "id": "D3DEECAB3C6C4B9EAF8EF4C1FE062FF3", + "paymentSystem": "6", + "paymentSystemName": "Boleto Bancário", + "value": 4450, + "installments": 1, + "referenceValue": 4450, + "cardHolder": null, + "cardNumber": null, + "firstDigits": null, + "lastDigits": null, + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": "https://luxstore.vtexpayments.com.br:443/BankIssuedInvoice/Transaction/418213DE29634837A63DD693A937A696/Payment/D3DEECAB3C6C4B9EAF8EF4C1FE062FF3/Installment/{Installment}", + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "bankInvoice", + "tid": null, + "dueDate": "2019-02-02", + "connectorResponses": { + "Tid": "94857956", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "857956" + }, + "giftCardProvider": "presentCard", + "giftCardAsDiscount": false, + "koinUrl": "koinURL", + "accountId": "5BC5C6B417FE432AB971B1D399F190C9", + "parentAccountId": "5BC5C6B417FE432AB971B1D399F190C9", + "bankIssuedInvoiceIdentificationNumber": "23797770100000019003099260100022107500729050", + "bankIssuedInvoiceIdentificationNumberFormatted": "32534.95739 75945.24534 54395.734214 5", + "bankIssuedInvoiceBarCodeNumber": "325349573975945245345439573421443986734065", + "bankIssuedInvoiceBarCodeType": "i25", + "billingAddress": {} + } + }, + "PackageAttachment": { + "title": "PackageAttachment", + "description": "Package object populated after order invoiced.", + "required": [ + "packages" + ], + "type": "object", + "properties": { + "packages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Package" + }, + "description": "Details of each package in the order." + } + }, + "example": { + "packages": [] + } + }, + "Package": { + "title": "Package", + "description": "Details of an individual package in the order.", + "type": "object", + "required": [ + "cfop", + "invoiceNumber", + "invoiceValue", + "invoiceUrl", + "issuanceDate", + "trackingNumber", + "invoiceKey", + "trackingUrl", + "embeddedInvoice", + "courierStatus", + "type" + ], + "properties": { + "cfop": { + "type": "string", + "nullable": true, + "description": "Fiscal operation code for the package." + }, + "invoiceNumber": { + "type": "string", + "description": "Invoice number associated with the package." + }, + "invoiceValue": { + "type": "number", + "description": "Total value of the invoice." + }, + "invoiceUrl": { + "type": "string", + "nullable": true, + "description": "URL for the invoice, if available." + }, + "issuanceDate": { + "type": "string", + "description": "Date when the invoice was issued." + }, + "trackingNumber": { + "type": "string", + "nullable": true, + "description": "Tracking number for the package, if available." + }, + "invoiceKey": { + "type": "string", + "description": "Unique key for the invoice." + }, + "trackingUrl": { + "type": "string", + "nullable": true, + "description": "URL for tracking the package, if available." + }, + "embeddedInvoice": { + "type": "string", + "description": "Embedded invoice data." + }, + "courierStatus": { + "type": "object", + "description": "Current status of the courier handling the package.", + "properties": { + "status": { + "type": "string", + "nullable": true, + "description": "Status of the courier, if available." + }, + "finished": { + "type": "boolean", + "description": "Indicates if the delivery process is finished." + }, + "deliveredDate": { + "type": "string", + "description": "Date the package was delivered, if applicable." + } + }, + "required": [ + "status", + "finished", + "deliveredDate" + ] + }, + "type": { + "type": "string", + "enum": [ + "Input", + "Output" + ], + "description": "Type of package, either 'Input' or 'Output'." + } + } + }, + "Seller": { + "title": "Seller", + "description": "Information about the seller associated with the order.", + "required": [ + "id", + "name", + "logo", + "fulfillmentEndpoint" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Seller ID that identifies the seller." + }, + "name": { + "type": "string", + "description": "Seller's name." + }, + "logo": { + "type": "string", + "description": "URL of the seller's logo." + }, + "fulfillmentEndpoint": { + "type": "string", + "description": "URL of the endpoint for fulfillment of seller's orders." + } + }, + "example": { + "id": "1", + "name": "Loja do Suporte", + "logo": "https://sellersLogo/images.png", + "fulfillmentEndpoint": "http://fulfillment.vtexcommerce.com.br/api/fulfillment?an=accountName" + } + }, + "ChangesAttachment": { + "title": "ChangesAttachment", + "description": "Information about changes in the order.", + "required": [ + "id", + "changesData" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Object ID, the expect value is `changeAttachment`." + }, + "changesData": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ChangesDatum" + }, + "description": "Order change details." + } + }, + "example": { + "id": "changeAttachment", + "changesData": [ + { + "reason": "Blah", + "discountValue": 3290, + "incrementValue": 0, + "itemsAdded": [], + "itemsRemoved": [ + { + "id": "1234568358", + "name": "Bay Max L", + "quantity": 1, + "price": 3290, + "unitMultiplier": null + } + ], + "receipt": { + "date": "2019-02-06T20:46:04.4003606+00:00", + "orderId": "v5195004lux-01", + "receipt": "029f9ab8-751a-4b1e-bf81-7dd25d14b49b" + } + } + ] + } + }, + "ChangesDatum": { + "title": "ChangesDatum", + "required": [ + "reason", + "discountValue", + "incrementValue", + "itemsAdded", + "itemsRemoved", + "receipt" + ], + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Text explaining why there was a change in the order. This information may be shown to the customer in the UI or transactional emails." + }, + "discountValue": { + "type": "integer", + "description": "Order change discount value." + }, + "incrementValue": { + "type": "integer", + "description": "Order change increment value." + }, + "itemsAdded": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of items added to the order." + }, + "itemsRemoved": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ItemsRemoved" + }, + "description": "List of items removed from the order." + }, + "receipt": { + "$ref": "#/components/schemas/Receipt" + } + }, + "example": { + "reason": "Blah", + "discountValue": 3290, + "incrementValue": 0, + "itemsAdded": [], + "itemsRemoved": [ + { + "id": "1234568358", + "name": "Bay Max L", + "quantity": 1, + "price": 3290, + "unitMultiplier": null + } + ], + "receipt": { + "date": "2019-02-06T20:46:04.4003606+00:00", + "orderId": "v5195004lux-01", + "receipt": "029f9ab8-751a-4b1e-bf81-7dd25d14b49b" + } + } + }, + "ItemsRemoved": { + "title": "ItemsRemoved", + "required": [ + "id", + "name", + "quantity", + "price", + "unitMultiplier" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "SKU ID of the item removed from the order." + }, + "name": { + "type": "string", + "description": "Name of the item removed from the order." + }, + "quantity": { + "type": "integer", + "description": "Quantity of items removed from the order." + }, + "price": { + "type": "integer", + "description": "Total amount of items removed from the order." + }, + "unitMultiplier": { + "type": "string", + "nullable": true, + "description": "Unit multiplier of the item removed from the order." + } + }, + "example": { + "id": "1234568358", + "name": "Bay Max L", + "quantity": 1, + "price": 3290, + "unitMultiplier": null + } + }, + "Receipt": { + "title": "Receipt", + "description": "Information about the receipt for changed orders.", + "required": [ + "date", + "orderId", + "receipt" + ], + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date when the receipt was created." + }, + "orderId": { + "type": "string", + "description": "ID of the order." + }, + "receipt": { + "type": "string", + "description": "Receipt's unique identifier code." + } + }, + "example": { + "date": "2019-02-06T20:46:04.4003606+00:00", + "orderId": "v5195004lux-01", + "receipt": "029f9ab8-751a-4b1e-bf81-7dd25d14b49b" + } + }, + "StorePreferencesData": { + "title": "StorePreferencesData", + "description": "Object with data from the store's configuration - stored in VTEX's License Manager.", + "required": [ + "countryCode", + "currencyCode", + "currencyFormatInfo", + "currencyLocale", + "currencySymbol", + "timeZone" + ], + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "Three letters ISO code of the country (ISO 3166 ALPHA-3)." + }, + "currencyCode": { + "type": "string", + "description": "Currency code in ISO 4217. For example, `BRL`." + }, + "currencyFormatInfo": { + "$ref": "#/components/schemas/CurrencyFormatInfo" + }, + "currencyLocale": { + "type": "integer", + "description": "Currency Locale Code in LCID in decimal." + }, + "currencySymbol": { + "type": "string", + "description": "Currency symbol." + }, + "timeZone": { + "type": "string", + "description": "Time zone from where the order was made." + } + }, + "example": { + "countryCode": "BRA", + "currencyCode": "BRL", + "currencyFormatInfo": { + "CurrencyDecimalDigits": 2, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + }, + "currencyLocale": 1046, + "currencySymbol": "R$", + "timeZone": "E. South America Standard Time" + } + }, + "CurrencyFormatInfo": { + "title": "CurrencyFormatInfo", + "description": "Object with currency format details.", + "required": [ + "CurrencyDecimalDigits", + "CurrencyDecimalSeparator", + "CurrencyGroupSeparator", + "CurrencyGroupSize", + "StartsWithCurrencySymbol" + ], + "type": "object", + "properties": { + "CurrencyDecimalDigits": { + "type": "integer", + "description": "Quantity of currency decimal digits." + }, + "CurrencyDecimalSeparator": { + "type": "string", + "description": "Defines what currency decimal separator will be applied." + }, + "CurrencyGroupSeparator": { + "type": "string", + "description": "Defines what currency group separator will be applied." + }, + "CurrencyGroupSize": { + "type": "integer", + "description": "Defines how many characters will be grouped." + }, + "StartsWithCurrencySymbol": { + "type": "boolean", + "description": "Defines if all prices will be initiated with the currency symbol (`true`) or not (`false`)." + } + }, + "example": { + "CurrencyDecimalDigits": 2, + "CurrencyDecimalSeparator": ",", + "CurrencyGroupSeparator": ".", + "CurrencyGroupSize": 3, + "StartsWithCurrencySymbol": true + } + }, + "Marketplace": { + "title": "Marketplace", + "description": "Details about the marketplace related to the order.", + "required": [ + "baseURL", + "isCertified", + "name" + ], + "type": "object", + "properties": { + "baseURL": { + "type": "string", + "description": "Marketplace base URL." + }, + "isCertified": { + "type": "string", + "nullable": true, + "description": "If is a certified marketplace." + }, + "name": { + "type": "string", + "description": "Name of the marketplace." + } + }, + "example": { + "baseURL": "http://oms.vtexinternal.com.br/api/oms?an=luxstore", + "isCertified": null, + "name": "luxstore" + } + }, + "ListOrders": { + "title": "ListOrders", + "required": [ + "list", + "facets", + "paging", + "stats" + ], + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/List" + }, + "description": "Array containing list information." + }, + "facets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array containing facets information." + }, + "paging": { + "$ref": "#/components/schemas/Paging" + }, + "stats": { + "$ref": "#/components/schemas/Stats" + } + }, + "example": { + "list": [ + { + "orderId": "v502559llux-01", + "creationDate": "2019-02-04T10:29:11+00:00", + "clientName": "J C", + "items": null, + "totalValue": 7453, + "paymentNames": "Boleto Bancário", + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": null, + "sequence": "502559", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Sua Nota Fiscal foi emitida. Referente ao Pedido #v502559llux-01 Olá, J. Estamos empacotando seu produto para providenci", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-02-07T21:29:54+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502556llux-01", + "creationDate": "2019-01-28T20:09:43+00:00", + "clientName": "Rodrigo VTEX", + "items": null, + "totalValue": 1160, + "paymentNames": "Boleto Bancário", + "status": "handling", + "statusDescription": "Preparando Entrega", + "marketPlaceOrderId": null, + "sequence": "502556", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store Seu pedido foi alterado! Pedido realizado em: 28/01/2019 Olá, Rodrigo. Seu pedido foi alterado. Seguem informações abaixo: ", + "ShippingEstimatedDate": "2019-02-04T20:33:46+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-01-28T20:33:04+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502553llux-01", + "creationDate": "2019-01-24T12:35:19+00:00", + "clientName": "test test", + "items": null, + "totalValue": 10150, + "paymentNames": "Mastercard", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": null, + "sequence": "502554", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Sua Nota Fiscal foi emitida. Referente ao Pedido #v502553llux-01 Olá, test. Estamos empacotando seu produto para provide", + "ShippingEstimatedDate": "2019-01-31T12:36:30+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-01-24T12:36:01+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502550llux-01", + "creationDate": "2019-01-23T16:39:45+00:00", + "clientName": "test test", + "items": null, + "totalValue": 10150, + "paymentNames": "Mastercard", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": null, + "sequence": "502551", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pagamento foi aprovado. Referente ao Pedido #v502550llux-01 Olá, test. Estamos providenciando a emissão da Nota Fisc", + "ShippingEstimatedDate": "2019-01-30T16:40:55+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-01-23T16:40:27+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502547llux-01", + "creationDate": "2019-01-23T16:34:20+00:00", + "clientName": "test test", + "items": null, + "totalValue": 10150, + "paymentNames": "Mastercard", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": null, + "sequence": "502548", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pagamento foi aprovado. Referente ao Pedido #v502547llux-01 Olá, test. Estamos providenciando a emissão da Nota Fisc", + "ShippingEstimatedDate": "2019-01-30T16:35:30+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-01-23T16:35:04+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502544llux-01", + "creationDate": "2018-12-28T18:15:28+00:00", + "clientName": "test test", + "items": null, + "totalValue": 8990, + "paymentNames": "Boleto Bancário", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": null, + "sequence": "502544", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pedido foi cancelado. Referente ao Pedido #v502544llux-01 Resumo Itens R$ 89,90 Total R$ 89,90 Produto Alavanca De M", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502541llux-01", + "creationDate": "2018-12-18T18:48:17+00:00", + "clientName": "Douglas Rodrigues", + "items": null, + "totalValue": 3290, + "paymentNames": "Boleto Bancário", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": null, + "sequence": "502541", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pedido foi cancelado. Referente ao Pedido #v502541llux-01 Resumo Itens R$ 32,90 Total R$ 32,90 Produto Bay Max L 1 u", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "v502538llux-01", + "creationDate": "2018-12-12T18:21:47+00:00", + "clientName": "test test", + "items": null, + "totalValue": 8990, + "paymentNames": "Mastercard", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": null, + "sequence": "502538", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pagamento foi aprovado. Referente ao Pedido #v502538llux-01 Olá, test. Estamos providenciando a emissão da Nota Fisc", + "ShippingEstimatedDate": "2018-12-19T18:22:26+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-12-12T18:22:22+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-880102018018-01", + "creationDate": "2018-11-30T17:34:01+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "880102018018-01", + "sequence": "502537", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": "cancelamento teste shp ", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-30T17:34:42+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-880091692043-01", + "creationDate": "2018-11-30T17:28:35+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": "880091692043-01", + "sequence": "502536", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-30T17:29:22+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-880091058221-01", + "creationDate": "2018-11-30T17:18:00+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "880091058221-01", + "sequence": "502535", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": "Teste de cancelamento do ShopFácil ", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-30T17:18:44+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-880090643370-01", + "creationDate": "2018-11-30T17:10:59+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": "880090643370-01", + "sequence": "502534", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2018-12-07T17:11:39+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-30T17:11:42+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-880090622238-01", + "creationDate": "2018-11-30T17:10:45+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "880090622238-01", + "sequence": "502533", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "MNC-877730530419-01", + "creationDate": "2018-11-20T21:09:01+00:00", + "clientName": "Carlos VTEX", + "items": null, + "totalValue": 11150, + "paymentNames": "", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "877730530419-01", + "sequence": "502532", + "salesChannel": "1", + "affiliateId": "MNC", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-20T21:13:06+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + }, + { + "orderId": "SCP-876733475998-01", + "creationDate": "2018-11-16T16:58:18+00:00", + "clientName": "roberta grecco", + "items": null, + "totalValue": 1250, + "paymentNames": "", + "status": "ready-for-handling", + "statusDescription": "Pronto para o manuseio", + "marketPlaceOrderId": "876733475998-01", + "sequence": "502531", + "salesChannel": "1", + "affiliateId": "SCP", + "origin": "Fulfillment", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2018-11-23T16:58:48+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2018-11-16T16:58:53+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + } + ], + "facets": [], + "paging": { + "total": 84, + "pages": 6, + "currentPage": 1, + "perPage": 15 + }, + "stats": { + "stats": { + "totalValue": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + } + }, + "totalItems": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + } + } + } + } + } + }, + "List": { + "title": "List", + "required": [ + "orderId", + "creationDate", + "clientName", + "items", + "totalValue", + "paymentNames", + "status", + "statusDescription", + "marketPlaceOrderId", + "sequence", + "salesChannel", + "affiliateId", + "origin", + "workflowInErrorState", + "workflowInRetry", + "lastMessageUnread", + "ShippingEstimatedDate", + "ShippingEstimatedDateMax", + "ShippingEstimatedDateMin", + "orderIsComplete", + "listId", + "listType", + "authorizedDate", + "callCenterOperatorName", + "totalItems", + "currencyCode" + ], + "type": "object", + "properties": { + "orderId": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "clientName": { + "type": "string" + }, + "items": { + "type": "string", + "nullable": true + }, + "totalValue": { + "type": "integer" + }, + "paymentNames": { + "type": "string" + }, + "status": { + "type": "string" + }, + "statusDescription": { + "type": "string", + "description": "`Deprecated`. Status description which is displayed on the Admin panel. This field is obsolete and may not return any value." + }, + "marketPlaceOrderId": { + "type": "string", + "nullable": true + }, + "sequence": { + "type": "string" + }, + "salesChannel": { + "type": "string" + }, + "affiliateId": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "workflowInErrorState": { + "type": "boolean" + }, + "workflowInRetry": { + "type": "boolean" + }, + "lastMessageUnread": { + "type": "string", + "nullable": true + }, + "ShippingEstimatedDate": { + "type": "string", + "nullable": true + }, + "ShippingEstimatedDateMax": { + "type": "string", + "nullable": true + }, + "ShippingEstimatedDateMin": { + "type": "string", + "nullable": true + }, + "orderIsComplete": { + "type": "boolean" + }, + "listId": { + "type": "string", + "nullable": true + }, + "listType": { + "type": "string", + "nullable": true + }, + "authorizedDate": { + "type": "string", + "nullable": true + }, + "callCenterOperatorName": { + "type": "string", + "nullable": true + }, + "totalItems": { + "type": "integer" + }, + "currencyCode": { + "type": "string" + } + }, + "example": { + "orderId": "v502559llux-01", + "creationDate": "2019-02-04T10:29:11+00:00", + "clientName": "J C", + "items": null, + "totalValue": 7453, + "paymentNames": "Boleto Bancário", + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": null, + "sequence": "502559", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Sua Nota Fiscal foi emitida. Referente ao Pedido #v502559llux-01 Olá, J. Estamos empacotando seu produto para providenci", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": "2019-02-07T21:29:54+00:00", + "callCenterOperatorName": null, + "totalItems": 1, + "currencyCode": "BRL" + } + }, + "Paging": { + "type": "object", + "description": "Pagination information.", + "required": [ + "total", + "pages", + "currentPage", + "perPage" + ], + "properties": { + "total": { + "type": "integer", + "description": "Total number of orders." + }, + "pages": { + "type": "integer", + "description": "Total number of pages." + }, + "currentPage": { + "type": "integer", + "description": "Number of the current page." + }, + "perPage": { + "type": "integer", + "description": "Number of orders per page." + } + } + }, + "Stats": { + "title": "Stats", + "required": [ + "stats" + ], + "type": "object", + "properties": { + "stats": { + "$ref": "#/components/schemas/Stats1" + } + }, + "example": { + "stats": { + "totalValue": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + } + }, + "totalItems": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + } + } + } + } + }, + "Stats1": { + "title": "Stats1", + "required": [ + "totalValue", + "totalItems" + ], + "type": "object", + "properties": { + "totalValue": { + "$ref": "#/components/schemas/TotalValue" + }, + "totalItems": { + "$ref": "#/components/schemas/TotalItems" + } + }, + "example": { + "totalValue": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + } + }, + "totalItems": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + } + } + } + }, + "TotalValue": { + "title": "TotalValue", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "$ref": "#/components/schemas/Facets" + } + }, + "example": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + } + } + }, + "Facets": { + "title": "Facets", + "required": [ + "origin", + "currencyCode" + ], + "type": "object", + "properties": { + "origin": { + "$ref": "#/components/schemas/Origin" + }, + "currencyCode": { + "$ref": "#/components/schemas/CurrencyCode" + } + }, + "example": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + } + }, + "Origin": { + "title": "Origin", + "required": [ + "Fulfillment", + "Marketplace" + ], + "type": "object", + "properties": { + "Fulfillment": { + "$ref": "#/components/schemas/Fulfillment" + }, + "Marketplace": { + "$ref": "#/components/schemas/Marketplace1" + } + }, + "example": { + "Fulfillment": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + } + }, + "Fulfillment": { + "title": "Fulfillment", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 68, + "Max": 11150, + "Mean": 1395.5882352941176, + "Min": 1250, + "Missing": 0, + "StdDev": 1200.5513439298484, + "Sum": 94900, + "SumOfSquares": 229010000, + "Facets": null + } + }, + "Marketplace1": { + "title": "Marketplace1", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 16, + "Max": 21526180, + "Mean": 1373100.6875, + "Min": 1160, + "Missing": 0, + "StdDev": 5374326.141087491, + "Sum": 21969611, + "SumOfSquares": 463417210029853, + "Facets": null + } + }, + "CurrencyCode": { + "title": "CurrencyCode", + "required": [ + "BRL" + ], + "type": "object", + "properties": { + "BRL": { + "$ref": "#/components/schemas/BRL" + } + }, + "example": { + "BRL": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + } + }, + "BRL": { + "title": "BRL", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 84, + "Max": 21526180, + "Mean": 262672.75, + "Min": 1160, + "Missing": 0, + "StdDev": 2348087.3869179883, + "Sum": 22064511, + "SumOfSquares": 463417439039853, + "Facets": null + } + }, + "TotalItems": { + "title": "TotalItems", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "$ref": "#/components/schemas/Facets1" + } + }, + "example": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + } + } + }, + "Facets1": { + "title": "Facets1", + "required": [ + "origin", + "currencyCode" + ], + "type": "object", + "properties": { + "origin": { + "$ref": "#/components/schemas/Origin1" + }, + "currencyCode": { + "$ref": "#/components/schemas/CurrencyCode1" + } + }, + "example": { + "origin": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "currencyCode": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + } + }, + "Origin1": { + "title": "Origin1", + "required": [ + "Fulfillment", + "Marketplace" + ], + "type": "object", + "properties": { + "Fulfillment": { + "$ref": "#/components/schemas/Fulfillment1" + }, + "Marketplace": { + "$ref": "#/components/schemas/Marketplace2" + } + }, + "example": { + "Fulfillment": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + }, + "Marketplace": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + } + }, + "Fulfillment1": { + "title": "Fulfillment1", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "integer" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "integer" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 68, + "Max": 1, + "Mean": 1, + "Min": 1, + "Missing": 0, + "StdDev": 0, + "Sum": 68, + "SumOfSquares": 68, + "Facets": null + } + }, + "Marketplace2": { + "title": "Marketplace2", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 16, + "Max": 89, + "Mean": 7.4375, + "Min": 1, + "Missing": 0, + "StdDev": 21.92401651157926, + "Sum": 119, + "SumOfSquares": 8095, + "Facets": null + } + }, + "CurrencyCode1": { + "title": "CurrencyCode1", + "required": [ + "BRL" + ], + "type": "object", + "properties": { + "BRL": { + "$ref": "#/components/schemas/BRL1" + } + }, + "example": { + "BRL": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + } + }, + "BRL1": { + "title": "BRL1", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Max": { + "type": "integer" + }, + "Mean": { + "type": "number" + }, + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "number" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "string", + "nullable": true + } + }, + "example": { + "Count": 84, + "Max": 89, + "Mean": 2.2261904761904763, + "Min": 1, + "Missing": 0, + "StdDev": 9.660940100525016, + "Sum": 187, + "SumOfSquares": 8163, + "Facets": null + } + }, + "Updatepartialinvoice.SendTrackingNumber.Request": { + "title": "Updatepartialinvoice.SendTrackingNumber.Request", + "required": [ + "trackingNumber", + "trackingUrl", + "courier", + "dispatchedDate" + ], + "type": "object", + "properties": { + "trackingNumber": { + "type": "string", + "description": "The number code that identifies the order tracking." + }, + "trackingUrl": { + "type": "string", + "nullable": true, + "description": "Package tracking URL." + }, + "dispatchedDate": { + "type": "string", + "nullable": true, + "description": "Date when the package was dispatched. For example, 2023-01-08T13:16:13.4617653+00:00." + }, + "courier": { + "type": "string", + "nullable": true, + "description": "The name of the carrier responsible for delivering the order." + } + }, + "example": { + "trackingNumber": "87658", + "trackingUrl": "https://www.tracking.com/url", + "courier": "carrierOne", + "dispatchedDate": "2022-02-08T13:16:13.4617653+00:00" + } + }, + "Updatepartialinvoice.SendTrackingNumber": { + "title": "Updatepartialinvoice.SendTrackingNumber", + "required": [ + "date", + "orderId", + "receipt" + ], + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "receipt": { + "type": "string" + } + }, + "example": { + "date": "2019-02-08T13:16:13.4617653+00:00", + "orderId": "00-v5195004lux-01", + "receipt": "527b1ae251264ef1b7a9b597cd8f16b9" + } + }, + "UpdateTrackingStatusRequest": { + "title": "UpdateTrackingStatusRequest", + "required": [ + "isDelivered", + "deliveredDate", + "events" + ], + "type": "object", + "properties": { + "isDelivered": { + "type": "boolean", + "description": "When set as `true`, it means the order got to its final shipping address, whether by delivery or pickup shipping type. When set as `false`, the order is still in transit to its shipping address.", + "example": false + }, + "deliveredDate": { + "type": "string", + "nullable": true, + "description": "Date and time of when the package was delivered. Note that it is different from the tracking date parameter. The `deliveredDate` format is `yyyy-mm-dd hh:mm`.", + "example": "2022-10-01 21:15" + }, + "events": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Event" + }, + "description": "Array containing events information." + } + }, + "example": { + "isDelivered": false, + "deliveredDate": null, + "events": [ + { + "city": "Rio de Janeiro", + "state": "RJ", + "description": "Coletado pela transportadora", + "date": "2015-06-23" + }, + { + "city": "Sao Paulo", + "state": "SP", + "description": "A caminho de Curitiba", + "date": "2015-06-24" + } + ] + } + }, + "Event": { + "title": "Event", + "required": [ + "city", + "state", + "description", + "date" + ], + "type": "object", + "properties": { + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "description": { + "type": "string" + }, + "date": { + "type": "string" + } + }, + "example": { + "city": "Rio de Janeiro", + "state": "RJ", + "description": "Coletado pela transportadora", + "date": "2015-06-23" + } + }, + "UpdateTrackingStatus": { + "title": "UpdateTrackingStatus", + "required": [ + "date", + "orderId", + "receipt" + ], + "type": "object", + "properties": { + "date": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "receipt": { + "type": "string" + } + }, + "example": { + "date": "2017-03-29T18:04:31.0521233+00:00", + "orderId": "v501245lspt-01", + "receipt": "f67d33a8029c42ce9a8f07fc17f54449" + } + }, + "GetConversation": { + "title": "GetConversation", + "required": [ + "id", + "from", + "to", + "subject", + "firstWords", + "body", + "hasAttachment", + "attachmentNames", + "date" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Conversation ID.", + "example": "2023-01-23t09-23-08_619a80a05aa34efb982b309c7a1910e3" + }, + "from": { + "$ref": "#/components/schemas/From" + }, + "to": { + "type": "array", + "items": { + "$ref": "#/components/schemas/To" + }, + "description": "Conversation receiver." + }, + "subject": { + "type": "string", + "description": "Conversation content subject.", + "example": "Your payment has been aproved." + }, + "firstWords": { + "type": "string", + "description": "First words of Conversation content.", + "example": "Your payment has been aproved and we are waiting for..." + }, + "body": { + "type": "string", + "description": "Conversation content body.", + "example": " recorrenciaqa

Seu pagamento foi aprovado.

Referente ao Pedido #1305371685465-01

Olá, jose. Estamos providenciando a emissão da Nota Fiscal do seu pedido e o envio do seu produto.

Pagamento

Visa final 1111
R$ 3,99 à vista

Atenciosamente,
Equipe recorrenciaqa

" + }, + "hasAttachment": { + "type": "boolean", + "description": "When set as `true`, it means there are attachments, when set as `false`, there are not.", + "example": false + }, + "attachmentNames": { + "type": "array", + "items": { + "type": "string", + "description": "Name of the attachment.", + "example": "attachments439505" + }, + "description": "List with attachments' names, if there are any." + }, + "date": { + "type": "string", + "description": "Conversation date.", + "example": "2023-01-23T09:23:31.0000000+00:00" + } + }, + "example": { + "id": "2023-01-23t09-23-08_619a80a05aa34efb982b309c7a1910e3", + "from": { + "conversationRelatedTo": "1305371685465-01", + "conversationSubject": "oms", + "emailAlias": "noreply@vtexcommerce.com.br-9814872b.ct.store.com.br", + "aliasMaskType": 0, + "email": "noreply@store.com.br", + "name": "no reply", + "role": "null" + }, + "to": [ + { + "conversationRelatedTo": "1305371685465-01", + "conversationSubject": "oms", + "emailAlias": "64d8bd8dbe5c4e7b93b8b3c237e50be1@ct.name.com.br", + "aliasMaskType": 0, + "email": "customer.name@email.com", + "name": "Mary John", + "role": "Customer" + } + ], + "subject": "Your payment has been aproved.", + "firstWords": "Your payment has been aproved and we are waiting for...", + "body": " recorrenciaqa

Seu pagamento foi aprovado.

Referente ao Pedido #1305371685465-01

Olá, jose. Estamos providenciando a emissão da Nota Fiscal do seu pedido e o envio do seu produto.

Pagamento

Visa final 1111
R$ 3,99 à vista

Atenciosamente,
Equipe recorrenciaqa

", + "hasAttachment": false, + "attachmentNames": [ + "attachments439505" + ], + "date": "2023-01-23T09:23:31.0000000+00:00" + } + }, + "From": { + "title": "From", + "description": "Conversation sender.", + "required": [ + "conversationRelatedTo", + "conversationSubject", + "emailAlias", + "aliasMaskType", + "email", + "name", + "role" + ], + "type": "object", + "properties": { + "conversationRelatedTo": { + "type": "string", + "description": "Related order ID.", + "example": "1305371685465-01" + }, + "conversationSubject": { + "type": "string", + "description": "Conversation subject.", + "example": "oms" + }, + "emailAlias": { + "type": "string", + "description": "Sender transactional tracker email.", + "example": "64d8bd8dbe5c4e7b93b8b3c237e50be1@ct.name.com.br" + }, + "aliasMaskType": { + "type": "integer", + "description": "Conversation tracker mask type.", + "example": 0 + }, + "email": { + "type": "string", + "description": "Sender's email.", + "example": "noreply@store.com.br" + }, + "name": { + "type": "string", + "description": "Sender's name.", + "example": "no reply" + }, + "role": { + "type": "string", + "nullable": true, + "description": "If it is a client or null, for transactional emails.", + "example": "null" + } + }, + "example": { + "conversationRelatedTo": "1305371685465-01", + "conversationSubject": "oms", + "emailAlias": "noreply@vtexcommerce.com.br-9814872b.ct.store.com.br", + "aliasMaskType": 0, + "email": "noreply@store.com.br", + "name": "no reply", + "role": "null" + } + }, + "To": { + "title": "To", + "description": "Conversation receiver.", + "required": [ + "conversationRelatedTo", + "conversationSubject", + "emailAlias", + "aliasMaskType", + "email", + "name", + "role" + ], + "type": "object", + "properties": { + "conversationRelatedTo": { + "type": "string", + "description": "Related order ID.", + "example": "1305371685465-01" + }, + "conversationSubject": { + "type": "string", + "description": "Conversation subject.", + "example": "oms" + }, + "emailAlias": { + "type": "string", + "description": "Sender transactional tracker email.", + "example": "64d8bd8dbe5c4e7b93b8b3c237e50be1@ct.name.com.br" + }, + "aliasMaskType": { + "type": "integer", + "description": "Conversation tracker mask type.", + "example": 0 + }, + "email": { + "type": "string", + "description": "Receiver's email.", + "example": "customer.name@email.com" + }, + "name": { + "type": "string", + "description": "Receiver's name.", + "example": "Mary John" + }, + "role": { + "type": "string", + "description": "If it is a customer or null, for transactional emails.", + "example": "Customer" + } + }, + "example": { + "conversationRelatedTo": "1305371685465-01", + "conversationSubject": "oms", + "emailAlias": "64d8bd8dbe5c4e7b93b8b3c237e50be1@ct.name.com.br", + "aliasMaskType": 0, + "email": "customer.name@email.com", + "name": "Mary John", + "role": "Customer" + } + }, + "GetPaymenttransaction": { + "required": [ + "status", + "isActive", + "transactionId", + "merchantName", + "payments" + ], + "type": "object", + "properties": { + "status": { + "type": "string", + "description": "Transaction status." + }, + "isActive": { + "type": "boolean", + "description": "If it is an active transaction (`true`) or not (`false`)." + }, + "transactionId": { + "type": "string", + "description": "Transaction ID." + }, + "merchantName": { + "type": "string", + "description": "Transaction merchant's name." + }, + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment1" + }, + "description": "Payments' details object." + } + } + }, + "Payment1": { + "title": "Payment1", + "required": [ + "id", + "paymentSystem", + "paymentSystemName", + "value", + "installments", + "referenceValue", + "cardHolder", + "cardNumber", + "firstDigits", + "lastDigits", + "cvv2", + "expireMonth", + "expireYear", + "url", + "giftCardId", + "giftCardName", + "giftCardCaption", + "redemptionCode", + "group", + "tid", + "dueDate", + "connectorResponses" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Payment ID." + }, + "paymentSystem": { + "type": "string", + "description": "Payment system ID." + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system name." + }, + "value": { + "type": "integer", + "description": "Payment value." + }, + "installments": { + "type": "integer", + "description": "Payment Installments quantity." + }, + "referenceValue": { + "type": "integer", + "description": "Payment reference Value." + }, + "cardHolder": { + "type": "string", + "nullable": true, + "description": "Payment card holder." + }, + "cardNumber": { + "type": "string", + "nullable": true, + "description": "Payment card number." + }, + "firstDigits": { + "type": "string", + "description": "Payment card first digits." + }, + "lastDigits": { + "type": "string", + "description": "Payment card last digits." + }, + "cvv2": { + "type": "string", + "nullable": true, + "description": "Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions." + }, + "expireMonth": { + "type": "string", + "nullable": true, + "description": "Payment card expire month." + }, + "expireYear": { + "type": "string", + "nullable": true, + "description": "Payment card expire year." + }, + "url": { + "type": "string", + "nullable": true, + "description": "Payment URL." + }, + "giftCardId": { + "type": "string", + "nullable": true, + "description": "Gift Card ID." + }, + "giftCardName": { + "type": "string", + "nullable": true, + "description": "Gift Card name." + }, + "giftCardCaption": { + "type": "string", + "nullable": true, + "description": "Gift Card caption." + }, + "redemptionCode": { + "type": "string", + "nullable": true, + "description": "Code for the customer to use the Gift Card." + }, + "group": { + "type": "string", + "description": "It represents the payment method. For each method, it can have the following values: \n\r\n- **Credit card:** `creditCard` \r\n\r\n- **Debid card:** `debitCard`\r\n\r\n- **Bank invoice:** `bankInvoice`\r\n\r\n- **Promissory:** `promissory` \r\n\r\n- **Gift card:** `giftCard` \n\r\n- **Pix:** `instantPayment`." + }, + "tid": { + "type": "string", + "description": "Payment transaction ID." + }, + "dueDate": { + "type": "string", + "nullable": true, + "description": "Payment due date." + }, + "connectorResponses": { + "$ref": "#/components/schemas/ConnectorResponses" + } + }, + "example": { + "id": "721CBE1090324D12ABE301FE33DE775A", + "paymentSystem": "4", + "paymentSystemName": "Mastercard", + "value": 10150, + "installments": 1, + "referenceValue": 10150, + "cardHolder": null, + "cardNumber": null, + "firstDigits": "412341", + "lastDigits": "4123", + "cvv2": null, + "expireMonth": null, + "expireYear": null, + "url": null, + "giftCardId": null, + "giftCardName": null, + "giftCardCaption": null, + "redemptionCode": null, + "group": "creditCard", + "tid": "101770752", + "dueDate": null, + "connectorResponses": { + "Tid": "101770752", + "ReturnCode": "200", + "Message": "logMessage", + "authId": "170852" + } + } + }, + "ConnectorResponses": { + "title": "ConnectorResponses", + "required": [ + "Tid", + "ReturnCode", + "Message", + "authId" + ], + "type": "object", + "properties": { + "Tid": { + "type": "string", + "description": "Connector transaction ID." + }, + "ReturnCode": { + "type": "string", + "nullable": true, + "description": "Connector return code." + }, + "Message": { + "type": "string", + "nullable": true, + "description": "Information about the connector's responses." + }, + "authId": { + "type": "string", + "description": "Connector authorization ID." + } + }, + "example": { + "Tid": "101770752", + "ReturnCode": null, + "Message": null, + "authId": "170852" + } + }, + "ConfirmitemfeedorderstatusRequest": { + "title": "ConfirmitemfeedorderstatusRequest", + "required": [ + "commitToken" + ], + "type": "object", + "properties": { + "commitToken": { + "type": "string" + } + }, + "example": { + "commitToken": "Marketplace##{\"Receipt\":\"+eXJYhj5rDqHa28+XUcfebDO4pve3TvMpPlW0ivc5STyE/40J6wxooXgBF8LZ9CdhZkFJnMYBVDwPwQtNEoZQrVtErDB2Yq2zs16QqsJuYxSrQtBfl9rMfmkO5orB9oDHSpvwL6DjDzcuJeQBBNxono/m4F6BloJEsk9BmuTmPaRI+7xsrN5Oeg8NPUoNSnsT983JPr1B+Y+TbbFjC1R8ZkvFHGVfti1QbhOwmYWTHPG08YMqla+Qwh7kUONLBXPqporF/CcqJo5YVTSu2uBcCuXkUo+OH9uUTn6hHkUROo=\",\"PublisheId\":\"C0111A50CEB244E59C95422870127A4F\",\"PublisheId_Item\":\"C0111A50CEB244E59C95422870127A4F\",\"EventId\":\"0dc05b6b-48a5-4f03-975a-a69fb6550aaa\",\"LastSendOverwrite\":null}" + } + }, + "Getfeedorderstatus": { + "title": "Getfeedorderstatus", + "required": [ + "eventId", + "handle", + "domain", + "state", + "lastState", + "orderId", + "lastChange", + "currentChange" + ], + "type": "object", + "properties": { + "eventId": { + "type": "string" + }, + "handle": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "state": { + "type": "string" + }, + "lastState": { + "type": "string" + }, + "orderId": { + "type": "string" + }, + "lastChange": { + "type": "string" + }, + "currentChange": { + "type": "string" + } + } + }, + "HookFilter": { + "title": "Filter", + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Determines what orders appear in the hook and how they are filtered. As shown in the examples above, there are two ways:\r\n\r\n - `FromWorkflow`: the hook will receive order updates only when there is a change or update in the [order status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). You must send at least one value for the `status` field to determine by which status the orders will be filtered.\r\n\r\n - `FromOrders`: the hook will receive order updates when there is a change in the order. In this case, orders can be filtered by any property, according to JSONata expressions passed in the `expression` field. You must send the request with values for the `expression` and `disableSingleFire` fields.", + "example": "FromWorkflow" + }, + "status": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of order statuses that should be included in the hook. This should only be used in case `type` is `FromWorkflow`." + }, + "expression": { + "type": "string", + "description": "JSONata query expression that defines what conditions must be met for an order to be included in the hook. This should only be used in case `type` is `FromOrders`." + }, + "disableSingleFire": { + "type": "boolean", + "description": "Sets a limit to how many times a specific order shows on the hook, after it first meets filtering conditions. Using the `FromOrders` type configuration with JSONata filtering expressions might cause orders to appear more than once on a feed, whenever changes are made to that order. If this field is `false` orders will appear in the hook only once. Send this field if you want to filter `FromOrders`.", + "example": false + } + } + }, + "HookConfigurationRequest": { + "title": "HookConfigurationRequest", + "required": [ + "filter", + "hook" + ], + "type": "object", + "properties": { + "filter": { + "$ref": "#/components/schemas/HookFilter" + }, + "hook": { + "$ref": "#/components/schemas/Hook" + } + }, + "example": { + "filter": { + "type": "FromWorkflow", + "status": [ + "order-completed", + "handling", + "ready-for-handling", + "waiting-ffmt-authorization", + "cancel" + ] + }, + "hook": { + "url": "https://endpoint.example/path", + "headers": { + "key": "value" + } + } + } + }, + "Hook": { + "title": "Hook", + "required": [ + "url", + "headers" + ], + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "headers": { + "$ref": "#/components/schemas/Headers" + } + }, + "example": { + "url": "https://endpoint.example/path", + "headers": { + "key": "value" + } + } + }, + "Headers": { + "title": "Headers", + "required": [ + "key" + ], + "type": "object", + "properties": { + "key": { + "type": "string" + } + }, + "example": { + "key": "value" + } + }, + "HookConfiguration": { + "title": "HookConfiguration", + "required": [ + "Domain", + "OrderId", + "State", + "LastState", + "LastChange", + "CurrentChange", + "Origin" + ], + "type": "object", + "properties": { + "Domain": { + "type": "string" + }, + "OrderId": { + "type": "string" + }, + "State": { + "type": "string" + }, + "LastState": { + "type": "string" + }, + "LastChange": { + "type": "string" + }, + "CurrentChange": { + "type": "string" + }, + "Origin": { + "$ref": "#/components/schemas/Origin2" + } + } + }, + "Origin2": { + "title": "Origin2", + "required": [ + "Account", + "Key" + ], + "type": "object", + "properties": { + "Account": { + "type": "string" + }, + "Key": { + "type": "string" + } + }, + "example": { + "Account": "automacaoqa", + "Key": "vtexappkey-appvtex" + } + }, + "Createchange": { + "required": [ + "reason" + ], + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Reason why you wish to change order. Since you can make several changes to an order, filling this field with a clear explanation helps organize the change order history. The shopper can view this field value in [transactional emails](https://help.vtex.com/en/tutorial/order-transactional-email-templates--3g2S2kqBOoSGcCaqMYK2my) and [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).", + "example": "The client wants to change a weighable product." + }, + "replace": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Replace" + }, + "description": "Array containing `replace` change information. Besides `replace`, you can `add` or `remove` items from an order.\r\n\r\n- `add`: the schema will correspond to the object `to` inside the `replace` array.\r\n\r\n- `remove`: the schema will correspond to the object `from` inside the `replace` array.\r\n\r\nYou will find request body examples of both cases in the endpoint description on the top of the page. The successful response `202 - Accepted` schema is the same for all three operations, whether they are used separately or combined in the same request." + } + } + }, + "Replace": { + "required": [ + "from", + "to" + ], + "type": "object", + "description": "Replacing operation object.", + "properties": { + "from": { + "required": [ + "items" + ], + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "required": [ + "id", + "quantity" + ], + "type": "object", + "description": "Information about item being changed.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID of the item that will be changed.", + "example": "1" + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item being changed.", + "example": 1 + } + } + }, + "description": "Array with information about the item to be replaced." + } + }, + "description": "Object with information about the items been replaced. If instead of an order `replace` you wish to `remove` items, you will use the same schema naming the object `remove` instead of `from`. For a complete example, see the description at the top of the page." + }, + "to": { + "required": [ + "items" + ], + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "required": [ + "id", + "quantity", + "measurementUnit", + "unitMultiplier" + ], + "type": "object", + "description": "Replacing item details.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID of the item that will replace the previous one. If you only wish to replace the product weight, you will repeat the SKU ID used in `from`.", + "example": "1" + }, + "quantity": { + "type": "integer", + "description": "Updated quantity of the item been changed.", + "example": 1 + }, + "measurementUnit": { + "type": "string", + "description": "Measurement unit of the new item. The values accepted are the measurement units registered in the store's catalog. For example, `kg` for kilograms or `un` for unitary items. When you don't specify a value, the request gets the information from the Catalog.", + "example": "kg" + }, + "unitMultiplier": { + "type": "number", + "description": "Unit multiplier for item update. For example, if you wish to increase an order with three times more items than a single one, you would fill in with `3.0`.", + "example": 3.0 + } + } + }, + "description": "Array with information about the replacing items." + }, + "shippingData": { + "required": [ + "logisticsInfo" + ], + "type": "object", + "description": "Shipping data object.", + "properties": { + "logisticsInfo": { + "type": "array", + "items": { + "required": [ + "itemIndex", + "slaId", + "deliveryChannel", + "addressId", + "price" + ], + "type": "object", + "description": "Shipping details of the changed order.", + "properties": { + "itemIndex": { + "type": "integer", + "description": "Index that identifies the position of this item in the original array, starting from `0`.", + "example": 0 + }, + "slaId": { + "type": "string", + "description": "Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order.", + "example": "Normal" + }, + "deliveryChannel": { + "type": "string", + "description": "Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery.", + "enum": [ + "delivery", + "pickup-in-point" + ], + "example": "delivery" + }, + "addressId": { + "type": "string", + "description": "Shipping address ID.", + "example": "9ec276fd3a604eb1aa151b5333ca5db7" + }, + "price": { + "type": "integer", + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price.", + "example": 1000 + } + } + }, + "description": "Array containing information about the shipping address of the changed order. This field is optional, when you don't send it the request body, the system assumes there were no changes in shipping." + } + } + } + }, + "description": "Object with information about the new replacing items. If instead of an order `replace` you wish to `add` items, you will use the same schema naming the object `add` instead of `to`. For a complete example, see the description at the top of the page." + } + } + }, + "response202": { + "required": [ + "requestId", + "workflowId", + "reason", + "manualDiscountValue", + "manualIncrementValue", + "totalChangeValue", + "totals", + "add", + "remove", + "replace", + "date", + "origin", + "settings" + ], + "type": "object", + "properties": { + "requestId": { + "type": "string", + "description": "Unique code that identifies a change order request." + }, + "workflowId": { + "type": "string", + "description": "Code that identifies the transaction of changing the orders in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." + }, + "reason": { + "type": "string", + "description": "Reason that motivated the order change." + }, + "manualDiscountValue": { + "type": "integer", + "description": "This field shows if a manual price was applied to the total order amount. The value is in cents." + }, + "manualIncrementValue": { + "type": "integer", + "description": "This field shows if an increment value was applied to the total order amount. The value is in cents." + }, + "totalChangeValue": { + "type": "integer", + "description": "This field shows how much the order total price is considering that price changes might have been made. The value is in cents." + }, + "totals": { + "type": "array", + "items": { + "type": "string", + "description": "Item changing price details." + }, + "description": "Array containing information about change prices per item." + }, + "add": { + "type": "array", + "description": "Array with information about the `add` operation, when applicable. The schema will correspond to the object `to` inside the `replace` array.", + "nullable": true, + "items": { + "type": "string", + "description": "Adding details." + } + }, + "remove": { + "type": "array", + "description": "Array with information about the `remove` operation, when applicable. The schema will correspond to the object `from` inside the `replace` array.", + "nullable": true, + "items": { + "type": "string", + "description": "Removal details." + } + }, + "replace": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Replace1" + }, + "description": "Array with information about the `replace` operation, when applicable.", + "nullable": true + }, + "date": { + "type": "string", + "description": "Date and time of the request. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`." + }, + "origin": { + "$ref": "#/components/schemas/OriginV2" + }, + "settings": { + "$ref": "#/components/schemas/Settings" + } + } + }, + "Replace1": { + "required": [ + "from", + "to" + ], + "type": "object", + "description": "Details about what will be replaced.", + "properties": { + "from": { + "required": [ + "paymentData", + "items", + "shippingData" + ], + "type": "object", + "properties": { + "paymentData": { + "$ref": "#/components/schemas/PaymentDataV2" + }, + "items": { + "type": "array", + "description": "Array with items information.", + "items": { + "required": [ + "id", + "quantity", + "price", + "measurementUnit", + "unitMultiplier", + "sellingPrice", + "name", + "detailUrl", + "imageUrl" + ], + "type": "object", + "description": "Details about a given item.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID of the item been replaced." + }, + "quantity": { + "type": "integer", + "description": "Quantity of items been replaced." + }, + "price": { + "type": "integer", + "nullable": true, + "description": "Shipping price for the replaced item, in cents. It does not account for the whole order's shipping price." + }, + "measurementUnit": { + "type": "string", + "nullable": true, + "description": "Measurement unit of the item been replaced. For example, `kg` for kilograms or `un` for unitary items." + }, + "unitMultiplier": { + "type": "integer", + "description": "Unit multiplier for item been update." + }, + "sellingPrice": { + "type": "string", + "description": "Selling price of the item been replaced.", + "nullable": true + }, + "name": { + "type": "string", + "nullable": true, + "description": "Name of the item been replaced." + }, + "detailUrl": { + "type": "string", + "nullable": true, + "description": "URL slug of the item been replaced." + }, + "imageUrl": { + "type": "string", + "nullable": true, + "description": "Image URL slug of the item been replaced." + } + } + } + }, + "shippingData": { + "$ref": "#/components/schemas/ShippingData1" + } + }, + "description": "Information about what items were replaced." + }, + "to": { + "required": [ + "items", + "paymentData", + "receiptData", + "shippingData" + ], + "type": "object", + "description": "Information about items that replaced the previous one.", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item3" + }, + "description": "Array containing information about the item replacing the previous one." + }, + "paymentData": { + "$ref": "#/components/schemas/PaymentDataV2" + }, + "receiptData": { + "type": "object", + "nullable": true, + "description": "Information about the receipt after order change." + }, + "shippingData": { + "type": "object", + "description": "Shipping data object.", + "required": [ + "logisticsInfo" + ], + "properties": { + "logisticsInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogisticsInfo1" + }, + "description": "Array with shipping information." + } + } + } + } + } + } + }, + "PaymentDataV2": { + "type": "object", + "description": "Payment data object.", + "required": [ + "transactions" + ], + "properties": { + "transactions": { + "type": "array", + "description": "Information about financial transactions.", + "items": { + "type": "string", + "description": "Array containing financial information. This is an optional field.", + "example": "creditcard" + } + } + } + }, + "ShippingData1": { + "description": "Shipping data object.", + "required": [ + "logisticsInfo" + ], + "type": "object", + "properties": { + "logisticsInfo": { + "type": "array", + "description": "Array with logistics information about the order been replaced. If not sent in the original request, it will be an empty array in the response.", + "items": { + "type": "string", + "description": "Logistics details." + } + } + } + }, + "Item3": { + "type": "object", + "description": "Object with item details.", + "required": [ + "uniqueId", + "id", + "productId", + "productRefId", + "refId", + "ean", + "name", + "skuName", + "modalType", + "parentItemIndex", + "parentAssemblyBinding", + "assemblies", + "priceValidUntil", + "tax", + "price", + "listPrice", + "manualPrice", + "manualPriceAppliedBy", + "sellingPrice", + "rewardValue", + "isGift", + "additionalInfo", + "preSaleDate", + "productCategoryIds", + "productCategories", + "quantity", + "seller", + "sellerChain", + "imageUrl", + "detailUrl", + "components", + "bundleItems", + "attachments", + "attachmentOfferings", + "offerings", + "priceTags", + "availability", + "measurementUnit", + "unitMultiplier", + "manufacturerCode", + "priceDefinition" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Item's unique ID in the change order request.", + "example": "40E763F4378E4F40AD1FE915FE1078E1" + }, + "id": { + "type": "string", + "description": "SKU ID of the item replacing the previous one.", + "example": "3" + }, + "productId": { + "type": "string", + "nullable": true, + "description": "Product ID of the item replacing the previous one.", + "example": "7" + }, + "productRefId": { + "type": "string", + "nullable": true, + "description": "Product Ref ID of the item replacing the previous one.", + "example": "smallcup" + }, + "refId": { + "type": "string", + "nullable": true, + "description": "Reference ID of the item replacing the previous one.", + "example": "356" + }, + "ean": { + "type": "string", + "nullable": true, + "description": "European Article Number (EAN) of the item replacing the previous one.", + "example": "8745121641680" + }, + "name": { + "type": "string", + "nullable": true, + "description": "Name of the Product associated with the item replacing the previous one.", + "example": "Small cup of coffee with pink logo" + }, + "skuName": { + "type": "string", + "nullable": true, + "description": "Name of the SKU replacing the previous one.", + "example": "Small blue cup" + }, + "modalType": { + "type": "string", + "nullable": true, + "description": "A [modal](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) attaches an unusual product, such as meat or glass, to a carrier specialized in shipping it.", + "example": "GLASS" + }, + "parentItemIndex": { + "type": "integer", + "nullable": true, + "description": "Parent item index of the item replacing the previous one.", + "example": 0 + }, + "parentAssemblyBinding": { + "type": "string", + "nullable": true, + "description": "Parent assembly binding of the item replacing the previous one.", + "example": null + }, + "assemblies": { + "type": "array", + "description": "Array with information about services that may be offered for the item replacing the previous one. For example, the assembly of a piece of furniture or warranty.", + "nullable": true, + "items": { + "type": "string", + "description": "Customization information." + } + }, + "priceValidUntil": { + "type": "string", + "nullable": true, + "description": "Price expiration date of item replacing the previous one. The value is in the format `yyyy-mm-ddThh:mm:ss.sss`.", + "example": "2023-03-01T22:58:28.143" + }, + "tax": { + "type": "integer", + "description": "Tax in cents of the item replacing the previous one, when applicable.", + "example": 0 + }, + "price": { + "type": "integer", + "nullable": true, + "description": "Final price of the item replacing the previous one, calculated in cents.", + "example": 600 + }, + "listPrice": { + "type": "integer", + "nullable": true, + "description": "Item's price list for the item replacing the previous one.", + "example": 600 + }, + "manualPrice": { + "type": "integer", + "nullable": true, + "description": "Manual price of the item replacing the previous one. It is calculated in cents.", + "example": 6500 + }, + "manualPriceAppliedBy": { + "type": "string", + "nullable": true, + "description": "User ID or appKey that made the manual price change of the item replacing the previous one.", + "example": "4cc81d44-e42e-464b-8199-1e883bf4ab6b" + }, + "sellingPrice": { + "type": "integer", + "nullable": true, + "description": "Selling price of the item replacing the previous one. It is calculated in cents.", + "example": 600 + }, + "rewardValue": { + "type": "integer", + "description": "Reward value of the item replacing the previous one. It is calculated in cents.", + "example": 50 + }, + "isGift": { + "type": "boolean", + "description": "This field is `true` when the replacing item is a gift in the order context and `false` when it is not.", + "example": false + }, + "additionalInfo": { + "$ref": "#/components/schemas/AdditionalInfoV2" + }, + "preSaleDate": { + "type": "string", + "nullable": true, + "description": "Pre sale date of the item replacing the previous one.", + "example": "2023-01-01T00:00:00.0000000+00:00" + }, + "productCategoryIds": { + "type": "string", + "nullable": true, + "description": "Replacing item's category path composed of category IDs separated by `/`. For example: `/3/15/`.", + "example": "/2/" + }, + "productCategories": { + "type": "object", + "description": "Object containing product categories of the replacing item. Structure: `{CategoryID}: {CategoryName}`. Both the key and the value are strings.", + "example": { + "2": "Clothes" + } + }, + "quantity": { + "type": "integer", + "description": "Quantity of replacing items.", + "example": 1 + }, + "seller": { + "type": "string", + "nullable": true, + "description": "Seller ID that identifies the seller the replacing item belongs to.", + "example": "1" + }, + "sellerChain": { + "type": "array", + "description": "Array containing information about sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://developers.vtex.com/docs/guides/multilevel-omnichannel-inventory) order.", + "nullable": true, + "items": { + "type": "string", + "description": "Seller identification.", + "nullable": true + } + }, + "imageUrl": { + "type": "string", + "nullable": true, + "description": "Image URL slug of the replacing item.", + "example": "http://store.com.br/ids/155419-55-55//cupcoffee.png?v=6368858582363" + }, + "detailUrl": { + "type": "string", + "nullable": true, + "description": "URL slug of the replacing item.", + "example": "/cup-coffee/p" + }, + "components": { + "type": "array", + "items": { + "type": "string", + "description": "Replacing item's component." + }, + "description": "Array with information about replacing item's components." + }, + "bundleItems": { + "type": "array", + "items": { + "type": "string", + "description": "Service sold with the replacing item." + }, + "description": "Array with information about services sold along with the replacing item, such as a gift package." + }, + "attachments": { + "type": "array", + "items": { + "type": "string", + "description": "Information about a given attachment." + }, + "description": "Array containing information on attachments." + }, + "attachmentOfferings": { + "type": "array", + "items": { + "type": "string", + "description": "Information about a given offering." + }, + "description": "Array with the properties of the content declared in the field `attachments`." + }, + "offerings": { + "type": "array", + "items": { + "type": "string", + "description": "Item's offering." + }, + "description": "Array with replacing items Item's offerings." + }, + "priceTags": { + "type": "array", + "items": { + "type": "string", + "description": "Item modifier." + }, + "description": "Array containing objects with replacing item's price modifiers." + }, + "availability": { + "type": "string", + "nullable": true, + "description": "Availability to fulfill the order with the item.", + "example": "available" + }, + "measurementUnit": { + "type": "string", + "description": "Replacing item's measurement unit.", + "example": "un" + }, + "unitMultiplier": { + "type": "integer", + "description": "Replacing item's unit multiplier.", + "example": 1 + }, + "manufacturerCode": { + "type": "string", + "nullable": true, + "description": "Provided by the manufacturers to identify their product. This field must be completed if the replacing item has a manufacturer's code.", + "example": "manf-00005" + }, + "priceDefinition": { + "type": "string", + "nullable": true, + "description": "replacing item's price information.", + "example": null + } + } + }, + "AdditionalInfoV2": { + "type": "object", + "description": "Additional information object.", + "required": [ + "dimension", + "brandName", + "brandId", + "offeringInfo", + "offeringType", + "offeringTypeId", + "categoriesIds", + "productClusterId", + "commercialConditionId" + ], + "properties": { + "dimension": { + "type": "string", + "nullable": true, + "description": "Replacing tem's dimensions in the measure unit configured in the catalog.", + "example": null + }, + "brandName": { + "type": "string", + "nullable": true, + "description": "Replacing item's brand name.", + "example": "Special coffee cup" + }, + "brandId": { + "type": "string", + "nullable": true, + "description": "Replacing item's brand ID.", + "example": "2000001" + }, + "offeringInfo": { + "type": "string", + "nullable": true, + "description": "Offering information.", + "example": null + }, + "offeringType": { + "type": "string", + "nullable": true, + "description": "Offering type.", + "example": null + }, + "offeringTypeId": { + "type": "string", + "nullable": true, + "description": "Offering type ID.", + "example": null + }, + "categoriesIds": { + "type": "string", + "nullable": true, + "description": "ID of the replacing item product category.", + "example": null + }, + "productClusterId": { + "type": "string", + "nullable": true, + "description": "All product clusters related to the replacing item.", + "example": "135,137,143,518,1272" + }, + "commercialConditionId": { + "type": "string", + "nullable": true, + "description": "Replacing item commercial conditions ID.", + "example": "5" + } + } + }, + "LogisticsInfo1": { + "type": "object", + "description": "Logistics information object.", + "required": [ + "itemIndex", + "selectedSla", + "selectedDeliveryChannel", + "addressId", + "slas", + "shipsTo", + "itemId", + "deliveryChannels", + "price", + "listPrice", + "shippingEstimate", + "dockEstimate", + "shippingEstimateDate", + "lockTTL", + "deliveryCompany", + "polygonName", + "transitTime", + "sellingPrice", + "deliveryIds", + "deliveryWindow", + "pickupPointId", + "pickupStoreInfo", + "pickupDistance" + ], + "properties": { + "itemIndex": { + "type": "integer", + "description": "Index that identifies the position of the replacing item in the array, starting from `0`.", + "example": 0 + }, + "selectedSla": { + "type": "string", + "description": "Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order.", + "example": "Normal" + }, + "selectedDeliveryChannel": { + "type": "string", + "description": "Delivery channel selected by the customer, like `delivery` or `pickup-in-point`. This field is being deprecated and the information it retrieves can be usually be found in `deliveryChannel`.", + "example": "delivery", + "deprecated": true + }, + "addressId": { + "type": "string", + "description": "Shipping address ID of the replacing item.", + "example": "9ec276fd3a604eb1aa151b5333ca5db7" + }, + "slas": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlaV2" + }, + "description": "Information on Service Level Agreement (SLA) of the change order shipping policy." + }, + "shipsTo": { + "type": "array", + "items": { + "type": "string", + "description": "Country name represented in a three letters code ISO 3166 ALPHA-3.", + "example": "BRA" + }, + "description": "List of countries of the change order shipping address." + }, + "itemId": { + "type": "string", + "description": "Replacing item's SKU ID, which is a unique numerical identifier.", + "example": "3" + }, + "deliveryChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryChannel" + }, + "description": "Array with the delivery channels associated with the trade policy." + }, + "price": { + "type": "integer", + "description": "Replacing item's final price, calculated in cents.", + "example": 600 + }, + "listPrice": { + "type": "integer", + "description": "Replacing item's price list, calculated in cents.", + "example": 600 + }, + "shippingEstimate": { + "type": "string", + "nullable": true, + "description": "Replacing item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`.", + "example": "2023-07-29T17:52:18.6483116Z" + }, + "dockEstimate": { + "type": "string", + "nullable": true, + "description": "Replacing item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`.", + "example": "1bd" + }, + "shippingEstimateDate": { + "type": "string", + "nullable": true, + "description": "Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`.", + "example": "3bd" + }, + "lockTTL": { + "type": "string", + "nullable": true, + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`.", + "example": "1bd" + }, + "deliveryCompany": { + "type": "string", + "nullable": true, + "description": "[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name.", + "example": "Correios" + }, + "polygonName": { + "type": "string", + "nullable": true, + "description": "Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy.", + "example": "114 - Polanco _ H-05" + }, + "transitTime": { + "type": "string", + "nullable": true, + "description": "Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`.", + "example": "3bd" + }, + "sellingPrice": { + "type": "integer", + "description": "Change item's selling price.", + "example": 600 + }, + "deliveryIds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryIdV2" + }, + "description": "Array with delivery information." + }, + "deliveryWindow": { + "type": "string", + "nullable": true, + "description": "Change order [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.", + "example": null + }, + "pickupPointId": { + "type": "string", + "nullable": true, + "description": "ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).", + "example": "pup215rkw" + }, + "pickupStoreInfo": { + "$ref": "#/components/schemas/PickupStoreInfoV2" + }, + "pickupDistance": { + "type": "number", + "nullable": true, + "description": "Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line.", + "example": "1.0" + } + } + }, + "SlaV2": { + "description": "Service Level Agreement (SLA) object.", + "required": [ + "id", + "deliveryChannel", + "name", + "deliveryIds", + "shippingEstimate", + "shippingEstimateDate", + "lockTTL", + "availableDeliveryWindows", + "deliveryWindow", + "price", + "listPrice", + "tax", + "pickupStoreInfo", + "pickupPointId", + "pickupDistance", + "polygonName", + "transitTime" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup.", + "example": "Normal" + }, + "deliveryChannel": { + "type": "string", + "description": "Order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery.", + "example": "delivery" + }, + "name": { + "type": "string", + "description": "Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the order delivery or pickup. It corresponds to the `id` value.", + "example": "Normal" + }, + "deliveryIds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryIdV2" + }, + "description": "Information about delivery IDs." + }, + "shippingEstimate": { + "type": "string", + "nullable": true, + "description": "Total shipping duration estimated in days. For instance, three business days is represented as `3bd`.", + "example": "3bd" + }, + "shippingEstimateDate": { + "type": "string", + "nullable": true, + "description": "Shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`.", + "example": "2023-07-27T17:52:18.6483116Z" + }, + "lockTTL": { + "type": "string", + "nullable": true, + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`.", + "example": "1bd" + }, + "availableDeliveryWindows": { + "type": "array", + "items": { + "type": "string", + "description": "Delivery window." + }, + "description": "Available [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, for when the shipping policy has shipping windows configurations." + }, + "deliveryWindow": { + "type": "object", + "nullable": true, + "description": "[Scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.", + "properties": { + "startDateUtc": { + "type": "string", + "description": "Delivery window starting date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "example": "2024-03-14T00:00:00+00:00" + }, + "endDateUtc": { + "type": "string", + "description": "Delivery window ending date and time in [UTC ISO 8601 format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "example": "2024-03-14T23:59:59+00:00" + } + } + }, + "price": { + "type": "integer", + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price.", + "example": 600 + }, + "listPrice": { + "type": "integer", + "description": "Item's price list for a specific trade policy.", + "example": 600 + }, + "tax": { + "type": "integer", + "description": "Tax in cents, when applicable.", + "example": 0 + }, + "pickupStoreInfo": { + "$ref": "#/components/schemas/PickupStoreInfoV2" + }, + "pickupPointId": { + "type": "string", + "nullable": true, + "description": "Pickup point ID is the unique identifier of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) related to the SLA.", + "example": "pup215rkw" + }, + "pickupDistance": { + "type": "number", + "nullable": true, + "description": "Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line.", + "example": 1.0 + }, + "polygonName": { + "type": "string", + "nullable": true, + "description": "Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy.", + "example": "114 - Polanco _ H-05" + }, + "transitTime": { + "type": "string", + "nullable": true, + "description": "Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days is represented as `3bd`.", + "example": "3bd" + } + } + }, + "PickupStoreInfoV2": { + "type": "object", + "description": "Information about a loading dock that was transformed into a [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).", + "required": [ + "isPickupStore", + "friendlyName", + "address", + "additionalInfo", + "dockId" + ], + "deprecated": true, + "properties": { + "isPickupStore": { + "type": "boolean", + "description": "This field is related to converting a loading dock into a pickup point. It should always correspond to `false` because it has been deprecated.", + "example": false, + "nullable": true, + "deprecated": true + }, + "friendlyName": { + "type": "string", + "description": "Name of the loading dock converted to pickup point to be displayed at checkout. This field has been deprecated.", + "example": null, + "nullable": true, + "deprecated": true + }, + "address": { + "type": "string", + "nullable": true, + "description": "Address of the loading dock converted to pickup point. This field has been deprecated.", + "example": null, + "deprecated": true + }, + "additionalInfo": { + "type": "string", + "nullable": true, + "description": "Additional information about the loading dock converted to pickup point. This field has been deprecated.", + "example": null, + "deprecated": true + }, + "dockId": { + "type": "string", + "nullable": true, + "description": "ID of the loading dock converted to pickup point. This field has been deprecated.", + "example": "dockAjs28", + "deprecated": true + } + } + }, + "OriginV2": { + "required": [ + "account", + "orderId", + "component" + ], + "type": "object", + "properties": { + "account": { + "type": "string", + "description": "Name of the account where the order was made." + }, + "orderId": { + "type": "string", + "description": "Order ID is a unique code that identifies an order." + }, + "component": { + "type": "string", + "description": "Component information." + } + }, + "description": "Object containing information about the order origin." + }, + "Settings": { + "required": [ + "customPaymentSystemsAllowed" + ], + "type": "object", + "description": "Object with account settings information, such as custom payment.", + "properties": { + "customPaymentSystemsAllowed": { + "type": "array", + "description": "Store's [custom payment](https://help.vtex.com/tutorial/how-to-configure-a-custom-payment--tutorials_451) information. Applicable only for stores that configured custom payment options.", + "items": { + "type": "string", + "description": "Custom payment code." + } + } + } + }, + "From2": { + "type": "object", + "description": "What the order is changing from.", + "required": [ + "paymentData", + "items", + "shippingData" + ], + "properties": { + "paymentData": { + "$ref": "#/components/schemas/PaymentDataV2" + }, + "items": { + "type": "array", + "description": "Items information from before the order change.", + "items": { + "$ref": "#/components/schemas/Item4" + } + }, + "shippingData": { + "$ref": "#/components/schemas/ShippingData3" + } + } + }, + "Item4": { + "title": "Item4", + "required": [ + "id", + "quantity", + "price", + "measurementUnit", + "unitMultiplier", + "sellingPrice", + "name", + "detailUrl", + "imageUrl" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "SKU ID of the item.", + "example": "1" + }, + "quantity": { + "type": "integer", + "description": "Quantity of items been replaced.", + "example": 1 + }, + "price": { + "type": "string", + "nullable": true, + "description": "Item's shipping price. It does not account for the whole order's shipping price and is presented in cents.", + "example": 1000 + }, + "measurementUnit": { + "type": "string", + "nullable": true, + "description": "Item's measurement unit. For example, `kg` for kilograms or `un` for unitary items.", + "example": "kg" + }, + "unitMultiplier": { + "type": "integer", + "description": "Item's unit multiplier.", + "example": 3 + }, + "sellingPrice": { + "type": "string", + "description": "Item's selling price.", + "example": 100 + }, + "name": { + "type": "string", + "nullable": true, + "description": "Item's name.", + "example": "T-shirt with logo" + }, + "detailUrl": { + "type": "string", + "nullable": true, + "description": "Item's URL slug.", + "example": "/tshirt-logo/p" + }, + "imageUrl": { + "type": "string", + "nullable": true, + "description": "Item's image URL slug.", + "example": "http://store.com.br/ids/155419-55-55//tshirt-logo.png?v=6378858562367" + } + }, + "example": { + "id": "31", + "quantity": 1, + "price": 5000, + "measurementUnit": "un", + "unitMultiplier": 1, + "sellingPrice": 5000, + "name": "Fusca miniatura Fusca preto", + "detailUrl": "/fusca-miniatura-24/p", + "imageUrl": "http://qastore.vteximg.com.br/arquivos/ids/155431-55-55/image-bdab69af1e5c41cdbc498d02e370b376.jpg?v=636579391945870000" + } + }, + "ShippingData3": { + "title": "ShippingData3", + "required": [ + "logisticsInfo" + ], + "type": "object", + "properties": { + "logisticsInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogisticsInfo2" + }, + "description": "Array with shipping information." + } + }, + "example": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Lenta", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "slas": [ + { + "id": "Lenta", + "deliveryChannel": "delivery", + "name": "Lenta", + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 180, + "listPrice": 180, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + }, + { + "id": "Normal", + "deliveryChannel": "delivery", + "name": "Normal", + "deliveryIds": [ + { + "courierId": "1", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Transportadora", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "3bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 500, + "listPrice": 500, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "3bd" + }, + { + "id": "Pickup", + "deliveryChannel": "delivery", + "name": "Pickup", + "deliveryIds": [ + { + "courierId": "ech018654", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Retirada", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 700, + "listPrice": 700, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + } + ], + "shipsTo": [ + "BRA" + ], + "itemId": "31", + "deliveryChannels": [ + { + "id": "delivery" + } + ], + "price": 180, + "listPrice": 180, + "shippingEstimate": "25bd", + "dockEstimate": null, + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "deliveryCompany": null, + "polygonName": "", + "transitTime": "25bd", + "sellingPrice": 180, + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": null, + "accountCarrierName": "qastoreecho" + } + ], + "deliveryWindow": null, + "pickupPointId": null, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupDistance": null + } + ] + } + }, + "LogisticsInfo2": { + "title": "LogisticsInfo2", + "required": [ + "itemIndex", + "selectedSla", + "selectedDeliveryChannel", + "addressId", + "slas", + "shipsTo", + "itemId", + "deliveryChannels", + "price", + "listPrice", + "shippingEstimate", + "dockEstimate", + "shippingEstimateDate", + "lockTTL", + "deliveryCompany", + "polygonName", + "transitTime", + "sellingPrice", + "deliveryIds", + "deliveryWindow", + "pickupPointId", + "pickupStoreInfo", + "pickupDistance" + ], + "type": "object", + "properties": { + "itemIndex": { + "type": "integer", + "description": "Index that identifies the position of the replacing item in the array, starting from `0`.", + "example": 0 + }, + "selectedSla": { + "type": "string", + "description": "Shipping method of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) used in the replacing order.", + "example": "Normal" + }, + "selectedDeliveryChannel": { + "type": "string", + "description": "Delivery channel selected by the customer, like `delivery` or `pickup-in-point`. This field is being deprecated and the information it retrieves can be usually be found in `deliveryChannel`.", + "example": "delivery", + "deprecated": true + }, + "addressId": { + "type": "string", + "description": "Shipping address ID.", + "example": "9ec276fd3a604eb1aa151b5333ca5db7" + }, + "slas": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SlaV2" + }, + "description": "Information on Service Level Agreement (SLA) of the change order." + }, + "shipsTo": { + "type": "array", + "items": { + "type": "string", + "description": "Country name represented in a three letters code ISO 3166 ALPHA-3.", + "example": "BRA" + }, + "description": "List of countries of the change order shipping address." + }, + "itemId": { + "type": "string", + "description": "Replacing item's SKU ID, which is a unique numerical identifier.", + "example": "3" + }, + "deliveryChannels": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryChannel" + }, + "description": "Array with the delivery channels associated with the trade policy." + }, + "price": { + "type": "integer", + "description": "Item's final price, calculated in cents.", + "example": 600 + }, + "listPrice": { + "type": "integer", + "description": "Item's price list, calculated in cents.", + "example": 600 + }, + "shippingEstimate": { + "type": "string", + "nullable": true, + "description": "Item's shipping estimate date. The value is in UTC ISO 8601 format `yyyy-mm-ddThh:mm:ss.sssZ`.", + "example": "2023-07-29T17:52:18.6483116Z" + }, + "dockEstimate": { + "type": "string", + "nullable": true, + "description": "Item's estimate duration of the [loading dock](https://help.vtex.com/en/tutorial/loading-dock--5DY8xHEjOLYDVL41Urd5qj) time. For instance, one business day is represented as `1bd`.", + "example": "1bd" + }, + "shippingEstimateDate": { + "type": "string", + "nullable": true, + "description": "Replacing item's total shipping duration estimated in days. For instance, three business days are represented as `3bd`.", + "example": "3bd" + }, + "lockTTL": { + "type": "string", + "nullable": true, + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. For instance, one business day is represented as `1bd`.", + "example": "1bd" + }, + "deliveryCompany": { + "type": "string", + "nullable": true, + "description": "[Carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) company's name.", + "example": "Correios" + }, + "polygonName": { + "type": "string", + "nullable": true, + "description": "Name of the [polygon](https://help.vtex.com/en/tutorial/registering-geolocation/) associated with the shipping policy.", + "example": "114 - Polanco _ H-05" + }, + "transitTime": { + "type": "string", + "nullable": true, + "description": "Duration in business days of the time the [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE) takes in transit to fulfill the order. For example, three business days are represented as `3bd`.", + "example": "3bd" + }, + "sellingPrice": { + "type": "integer", + "description": "Item's selling price.", + "example": 600 + }, + "deliveryIds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeliveryIdV2" + }, + "description": "Array with delivery information." + }, + "deliveryWindow": { + "type": "string", + "nullable": true, + "description": "Change order [scheduled delivery](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) information, when applicable.", + "example": null + }, + "pickupPointId": { + "type": "string", + "nullable": true, + "description": "ID of the [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).", + "example": "pup215rkw" + }, + "pickupStoreInfo": { + "$ref": "#/components/schemas/PickupStoreInfoV2" + }, + "pickupDistance": { + "type": "number", + "nullable": true, + "description": "Distance in kilometers between the pickup point and the customer's address. The distance is measured as a straight line.", + "example": 1.0 + } + }, + "example": { + "itemIndex": 0, + "selectedSla": "Lenta", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "slas": [ + { + "id": "Lenta", + "deliveryChannel": "delivery", + "name": "Lenta", + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 180, + "listPrice": 180, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + }, + { + "id": "Normal", + "deliveryChannel": "delivery", + "name": "Normal", + "deliveryIds": [ + { + "courierId": "1", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Transportadora", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "3bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 500, + "listPrice": 500, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "3bd" + }, + { + "id": "Pickup", + "deliveryChannel": "delivery", + "name": "Pickup", + "deliveryIds": [ + { + "courierId": "ech018654", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Retirada", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 700, + "listPrice": 700, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + } + ], + "shipsTo": [ + "BRA" + ], + "itemId": "31", + "deliveryChannels": [ + { + "id": "delivery" + } + ], + "price": 180, + "listPrice": 180, + "shippingEstimate": "25bd", + "dockEstimate": null, + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "deliveryCompany": null, + "polygonName": "", + "transitTime": "25bd", + "sellingPrice": 180, + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": null, + "accountCarrierName": "qastoreecho" + } + ], + "deliveryWindow": null, + "pickupPointId": null, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupDistance": null + } + }, + "DeliveryIdV2": { + "title": "DeliveryIdV2", + "required": [ + "courierId", + "warehouseId", + "dockId", + "courierName", + "quantity", + "kitItemDetails", + "accountCarrierName" + ], + "type": "object", + "properties": { + "courierId": { + "type": "string", + "description": "ID of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).", + "example": "136769c" + }, + "warehouseId": { + "type": "string", + "description": "ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb).", + "example": "w_156" + }, + "dockId": { + "type": "string", + "description": "ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj).", + "example": "ld931" + }, + "courierName": { + "type": "string", + "description": "Name of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140).", + "example": "Crossborder" + }, + "quantity": { + "type": "integer", + "description": "Quantity of items.", + "example": 1 + }, + "kitItemDetails": { + "type": "array", + "items": { + "type": "string", + "description": "Information about [kits](https://help.vtex.com/tutorial/what-is-a-kit--5ov5s3eHM4AqAAgqWwoc28), when applicable to the order.", + "example": null, + "nullable": true + } + }, + "accountCarrierName": { + "type": "string", + "nullable": true, + "description": "Name of the account's [carrier](https://help.vtex.com/en/tutorial/carriers-on-vtex--7u9duMD5UQa2QQwukAWMcE).", + "example": "vtexlog" + } + }, + "example": { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + }, + "DeliveryChannel": { + "title": "DeliveryChannel", + "required": [ + "id" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Change order shipping type, which can be `pickup-in-point` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R), and `delivery` for delivery.", + "example": "delivery" + } + }, + "example": { + "id": "delivery" + } + }, + "To2": { + "title": "To2", + "required": [ + "items", + "paymentData", + "receiptData", + "shippingData" + ], + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item3" + }, + "description": "Array containing information about the item replacing the previous one." + }, + "paymentData": { + "$ref": "#/components/schemas/PaymentDataV2" + }, + "receiptData": { + "type": "object", + "nullable": true, + "description": "Information about the receipt after order change.", + "example": null + }, + "shippingData": { + "$ref": "#/components/schemas/ShippingData3" + } + }, + "example": { + "items": [ + { + "uniqueId": "40E763F4378E4F40AD1FE915FE1078E1", + "id": "1", + "productId": "1", + "productRefId": "", + "refId": "codrefxicaraazul", + "ean": "8745121641", + "name": "xícara azul", + "skuName": "azul", + "modalType": null, + "parentItemIndex": null, + "parentAssemblyBinding": null, + "assemblies": [], + "priceValidUntil": null, + "tax": 0, + "price": 5000, + "listPrice": null, + "manualPrice": null, + "manualPriceAppliedBy": null, + "sellingPrice": 5000, + "rewardValue": 0, + "isGift": false, + "additionalInfo": { + "dimension": null, + "brandName": null, + "brandId": null, + "offeringInfo": null, + "offeringType": null, + "offeringTypeId": null, + "categoriesIds": null, + "productClusterId": null, + "commercialConditionId": null + }, + "preSaleDate": null, + "productCategoryIds": "/1/", + "productCategories": { + "1": "Category" + }, + "quantity": 1, + "seller": "1", + "sellerChain": [ + "1" + ], + "imageUrl": "http://qastore.vteximg.com.br/arquivos/ids/155394-55-55/xicara.jpg?v=636565506415770000", + "detailUrl": "/xicara/p", + "components": [], + "bundleItems": [], + "attachments": [], + "attachmentOfferings": [], + "offerings": [], + "priceTags": [], + "availability": null, + "measurementUnit": "un", + "unitMultiplier": 1, + "manufacturerCode": null, + "priceDefinition": { + "calculatedSellingPrice": 5000, + "total": 5000, + "sellingPrices": [ + { + "value": 5000, + "quantity": 1 + } + ] + } + } + ], + "paymentData": { + "transactions": [] + }, + "receiptData": null, + "shippingData": { + "logisticsInfo": [ + { + "itemIndex": 0, + "selectedSla": "Lenta", + "selectedDeliveryChannel": "delivery", + "addressId": "9ec276fd3a604eb1aa151b5333ca5db6", + "slas": [ + { + "id": "Lenta", + "deliveryChannel": "delivery", + "name": "Lenta", + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 600, + "listPrice": 180, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + }, + { + "id": "Normal", + "deliveryChannel": "delivery", + "name": "Normal", + "deliveryIds": [ + { + "courierId": "1", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Transportadora", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "3bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 500, + "listPrice": 500, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "3bd" + }, + { + "id": "Pickup", + "deliveryChannel": "delivery", + "name": "Pickup", + "deliveryIds": [ + { + "courierId": "ech018654", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Retirada", + "quantity": 1, + "kitItemDetails": [], + "accountCarrierName": null + } + ], + "shippingEstimate": "25bd", + "shippingEstimateDate": null, + "lockTTL": "12d", + "availableDeliveryWindows": [], + "deliveryWindow": null, + "price": 700, + "listPrice": 700, + "tax": 0, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupPointId": null, + "pickupDistance": null, + "polygonName": "", + "transitTime": "25bd" + } + ], + "shipsTo": [ + "BRA" + ], + "itemId": "1", + "deliveryChannels": [ + { + "id": "delivery" + } + ], + "price": 600, + "listPrice": 180, + "shippingEstimate": "25bd", + "dockEstimate": null, + "shippingEstimateDate": "2023-08-30T10:17:24.6436519Z", + "lockTTL": "12d", + "deliveryCompany": null, + "polygonName": "", + "transitTime": "25bd", + "sellingPrice": 600, + "deliveryIds": [ + { + "courierId": "1c083bf", + "warehouseId": "1_1", + "dockId": "1", + "courierName": "Donkey", + "quantity": 1, + "kitItemDetails": null, + "accountCarrierName": "qastoreecho" + } + ], + "deliveryWindow": null, + "pickupPointId": null, + "pickupStoreInfo": { + "isPickupStore": false, + "friendlyName": null, + "address": null, + "additionalInfo": null, + "dockId": null + }, + "pickupDistance": null + } + ] + } + } + }, + "PriceDefinition": { + "title": "PriceDefinition", + "required": [ + "calculatedSellingPrice", + "total", + "sellingPrices" + ], + "type": "object", + "properties": { + "calculatedSellingPrice": { + "type": "integer" + }, + "total": { + "type": "integer" + }, + "sellingPrices": { + "type": "array", + "description": "Array containing selling price information.", + "items": { + "type": "object", + "description": "Selling price details.", + "required": [ + "value", + "quantity" + ], + "properties": { + "value": { + "type": "integer", + "description": "Selling price value in cents." + }, + "quantity": { + "type": "integer", + "description": "Quantity of items related to selling price." + } + } + } + } + }, + "example": { + "calculatedSellingPrice": 5000, + "total": 5000, + "sellingPrices": [ + { + "value": 5000, + "quantity": 1 + } + ] + } + }, + "ChangeOrderSettingsResponse": { + "type": "object", + "description": "Object with all VTEX account settings related to the **Change order** feature.", + "properties": { + "paymentConfiguration": { + "type": "object", + "description": "[Change order](https://help.vtex.com/en/tutorial/how-change-order-works-beta--56TO0bOFXsfmpc7YZ3wIUZ) payment configurations.", + "properties": { + "customPaymentSystemsAllowed": { + "type": "array", + "description": "List of custom payment system IDs configured for the VTEX account.", + "items": { + "type": "string", + "description": "Payment system ID." + } + } + } + }, + "rolloutConfiguration": { + "type": "object", + "description": "**Change order** settings regarding VTEX Admin, [Orders API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes?endpoint=patch-/api/order-system/orders/-changeOrderId-/changes) and **My Account** feature.", + "properties": { + "usingDefaultBehavior": { + "type": "boolean", + "description": "Defines if the **Change order** configurations are the default behaviour (`true`) or if the account made customizations to it (`false`). Subaccounts will have the same configurations as the main account.", + "default": false + }, + "enableApi": { + "type": "boolean", + "description": "Defines if the account enabled the [Change order API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) (`true`) or not (`false`). The account can only use the [Change order via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw) or [via API](https://developers.vtex.com/docs/api-reference/orders-api#patch-/api/order-system/orders/-changeOrderId-/changes) if this field is set to `true`.", + "default": false + }, + "enableAdminOrders": { + "type": "object", + "description": "Object about enabling the [Change order feature via VTEX Admin](https://help.vtex.com/en/tutorial/how-to-change-orders-beta--7btlG91rb6sHpW1dkd2kBw).", + "properties": { + "enabledWorkspaces": { + "type": "array", + "description": "List with the workspaces' names that have the **Change order** feature enabled via VTEX Admin.", + "items": { + "type": "string", + "description": "Name of the workspace with **Change order** enabled via VTEX Admin. The asterisk `*` value includes all of the account's workspaces." + } + } + } + }, + "enableMyOrders": { + "type": "object", + "description": "Object about enabling the **Change order** feature via [My Account](https://help.vtex.com/en/tutorial/how-my-account-works--2BQ3GiqhqGJTXsWVuio3Xh).", + "properties": { + "enabledWorkspaces": { + "type": "array", + "description": "List with the workspace names that have the **Change order** feature enabled via **My Account**.", + "items": { + "type": "string", + "description": "Name of the workspace with **Change order** enabled via **My Account**. The asterisk `*` value includes all of the account's workspaces." + } + } + } + } + } + }, + "pipelineConfiguration": { + "type": "object", + "description": "**Change order** settings related to taxes and shipping calculation.", + "properties": { + "enableTaxHubRecalculation": { + "type": "boolean", + "description": "Defines if the tax calculation is enabled for **Change order** (`true`) or not (`false`).", + "default": false + }, + "compensateShippingChanges": { + "type": "boolean", + "description": "Defines if orders changed will have zero shipping cost (`true`) or not (`false`). Merchants usually enable this configuration to change only items and prices, without impacting the orders original freight costs.", + "default": true + } + } + } + } + }, + "Userorderdetails": { + "title": "Userorderdetails", + "required": [ + "orderId", + "sequence", + "marketplaceOrderId", + "marketplaceServicesEndpoint", + "sellerOrderId", + "origin", + "affiliateId", + "salesChannel", + "merchantName", + "status", + "workflowIsInError", + "statusDescription", + "value", + "creationDate", + "lastChange", + "orderGroup", + "totals", + "items", + "marketplaceItems", + "clientProfileData", + "giftRegistryData", + "marketingData", + "ratesAndBenefitsData", + "shippingData", + "paymentData", + "packageAttachment", + "sellers", + "callCenterOperatorData", + "followUpEmail", + "lastMessage", + "hostname", + "invoiceData", + "changesAttachment", + "openTextField", + "roundingError", + "orderFormId", + "commercialConditionData", + "isCompleted", + "customData", + "storePreferencesData", + "allowCancellation", + "allowEdition", + "isCheckedIn", + "marketplace", + "authorizedDate", + "invoicedDate", + "cancelReason", + "itemMetadata", + "subscriptionData", + "taxData", + "checkedInPickupPointId", + "cancellationData", + "clientPreferencesData", + "cancellationRequests" + ], + "type": "object", + "properties": { + "orderId": { + "type": "string", + "description": "Order ID is a unique code that identifies an order." + }, + "sequence": { + "type": "string", + "description": "Sequence is a six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`." + }, + "marketplaceOrderId": { + "type": "string", + "description": "Marketplace order ID." + }, + "marketplaceServicesEndpoint": { + "type": "string", + "description": "Marketplace services endpoint." + }, + "sellerOrderId": { + "type": "string", + "description": "ID of the seller related to the order. It can be a VTEX seller or an external seller." + }, + "origin": { + "type": "string", + "description": "Order's [origin in the order flow](https://developers.vtex.com/docs/guides/orders-overview#understanding-order-flow-types), which can be `Marketplace`, `Fulfillment` or `Chain`." + }, + "affiliateId": { + "type": "string", + "description": "Corresponds to the three-digit [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order." + }, + "salesChannel": { + "type": "string", + "description": "Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order." + }, + "merchantName": { + "type": "string", + "description": "Name of the merchant." + }, + "status": { + "type": "string", + "description": "Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." + }, + "workflowIsInError": { + "type": "boolean", + "description": "Indicates if the order workflow is in an error state." + }, + "statusDescription": { + "type": "string", + "description": "`Deprecated`. Status description which is displayed on the Admin panel. This field is obsolete and may not return any value.", + "deprecated": true + }, + "value": { + "type": "integer", + "description": "Order's total amount." + }, + "creationDate": { + "type": "string", + "description": "Order's creation date." + }, + "lastChange": { + "type": "string", + "description": "Order's last change date." + }, + "orderGroup": { + "type": "string", + "description": "Order's group ID." + }, + "totals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Total" + }, + "description": "List with details about orders' totals." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderItem" + }, + "description": "Information about order's items." + }, + "marketplaceItems": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Marketplace details object." + }, + "clientProfileData": { + "$ref": "#/components/schemas/ClientProfileData" + }, + "giftRegistryData": { + "type": "string", + "nullable": true, + "description": "Information about gift list, when it applies." + }, + "marketingData": { + "type": "object", + "description": "Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs.", + "properties": { + "id": { + "type": "string", + "description": "Object ID. The expected value is `marketingData`." + }, + "utmSource": { + "type": "string", + "description": "Value of the `utm_source` parameter of the URL that led to the request." + }, + "utmPartner": { + "type": "string", + "description": "UTM Source Parameters." + }, + "utmMedium": { + "type": "string", + "description": "Value of the `utm_medium` parameter of the URL that led to the request." + }, + "utmCampaign": { + "type": "string", + "description": "Value of the `utm_campaign` parameter of the URL that led to the request." + }, + "coupon": { + "type": "string", + "description": "Coupon code." + }, + "utmiCampaign": { + "type": "string", + "description": "Internal UTM value `utmi_cp`." + }, + "utmipage": { + "type": "string", + "description": "Internal UTM value `utmi_p`." + }, + "utmiPart": { + "type": "string", + "description": "Internal UTM value `utmi_pc`." + }, + "marketingTags": { + "type": "array", + "description": "Marketing tags information. This field can be used to register campaign data or informative tags regarding promotions.", + "items": { + "type": "string", + "description": "Marketing tag." + } + } + }, + "nullable": true + }, + "ratesAndBenefitsData": { + "$ref": "#/components/schemas/RatesAndBenefitsData" + }, + "shippingData": { + "$ref": "#/components/schemas/ShippingData" + }, + "paymentData": { + "$ref": "#/components/schemas/PaymentData" + }, + "packageAttachment": { + "$ref": "#/components/schemas/PackageAttachment" + }, + "sellers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Seller" + }, + "description": "List of all sellers associated with the order." + }, + "callCenterOperatorData": { + "type": "string", + "nullable": true, + "description": "Call center operator responsible for the order." + }, + "followUpEmail": { + "type": "string", + "description": "Email of the store's employee responsible for managing the order." + }, + "lastMessage": { + "type": "string", + "nullable": true, + "description": "Last sent transactional message." + }, + "hostname": { + "type": "string", + "description": "Account Hostname registered in License Manager." + }, + "invoiceData": { + "type": "object", + "nullable": true, + "description": "Information pertinent to the order's invoice." + }, + "changesAttachment": { + "$ref": "#/components/schemas/ChangesAttachment" + }, + "openTextField": { + "type": "string", + "nullable": true, + "description": "Optional field with order's additional information. This field must be filled in using the following format: \n\r```\n\r{\r\n \"fieldExample\": \"ValueExample\"\r\n }\n\r```\n\r." + }, + "roundingError": { + "type": "integer", + "description": "Rounding error total amount, if it applies. For example, in orders with a discount over non-integer multiplier items, the rounding price is performed per item, not after the sum of all items. That can cause a difference in the total discount amount, which is informed in this field." + }, + "orderFormId": { + "type": "string", + "description": "[Order form](https://developers.vtex.com/docs/guides/orderform-fields) ID." + }, + "commercialConditionData": { + "type": "string", + "nullable": true, + "description": "Information about commercial conditions." + }, + "isCompleted": { + "type": "boolean", + "description": "When set as `true`, the order's payment has been settled, and when set as `false`, it has not been settled yet." + }, + "customData": { + "type": "string", + "nullable": true, + "description": "Custom information in the order. This field is useful for storing data not included in other fields, for example, a message for a gift or a name to be printed in a shirt." + }, + "storePreferencesData": { + "$ref": "#/components/schemas/StorePreferencesData" + }, + "allowCancellation": { + "type": "boolean", + "description": "When set as `true`, the order can be canceled, and when set as `false`, it is no longer possible to cancel the order." + }, + "allowEdition": { + "type": "boolean", + "description": "When set as `true`, the order can be edited, and when set as `false`, it is no longer possible to edit the order." + }, + "isCheckedIn": { + "type": "boolean", + "description": "This field is set `true` when the order was made via inStore and `false` when it was not." + }, + "marketplace": { + "$ref": "#/components/schemas/Marketplace" + }, + "authorizedDate": { + "type": "string", + "description": "Authorized order date." + }, + "invoicedDate": { + "type": "string", + "nullable": true, + "description": "Order's invoice date." + }, + "cancelReason": { + "type": "string", + "nullable": true, + "description": "Reason for order cancellation." + }, + "itemMetadata": { + "$ref": "#/components/schemas/ItemMetadata" + }, + "subscriptionData": { + "$ref": "#/components/schemas/SubscriptionData" + }, + "taxData": { + "$ref": "#/components/schemas/TaxData" + }, + "checkedInPickupPointId": { + "type": "string", + "description": "If the field `isCheckedIn` is set as `true`, the `checkedInPickupPointId` will retrieve the ID of the physical store where the order was made." + }, + "cancellationData": { + "$ref": "#/components/schemas/CancellationData" + }, + "clientPreferencesData": { + "$ref": "#/components/schemas/ClientPreferencesData" + }, + "cancellationRequests": { + "type": "array", + "description": "Details of cancellation requests made for the order.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the cancellation request." + }, + "reason": { + "type": "string", + "description": "Reason for the cancellation request." + }, + "cancellationRequestDate": { + "type": "string", + "description": "Date when the cancellation was requested." + }, + "requestedByUser": { + "type": "boolean", + "description": "Indicates if the request was made by the user." + }, + "deniedBySeller": { + "type": "boolean", + "description": "Indicates if the cancellation request was denied by the seller." + }, + "deniedBySellerReason": { + "type": "string", + "nullable": true, + "description": "Reason for denial by the seller." + }, + "cancellationRequestDenyDate": { + "type": "string", + "nullable": true, + "description": "Date when the cancellation request was denied." + } + } + } + } + } + }, + "ItemMetadata": { + "type": "object", + "description": "Metadata information about the order's items.", + "required": [ + "Items" + ], + "properties": { + "Items": { + "type": "array", + "description": "Metadata items.", + "items": { + "type": "object", + "required": [ + "Id", + "Seller", + "Name", + "SkuName", + "ProductId", + "RefId", + "Ean", + "ImageUrl", + "DetailUrl", + "AssemblyOptions" + ], + "properties": { + "Id": { + "type": "string", + "description": "Item's SKU ID, which is a unique numerical identifier." + }, + "Seller": { + "type": "string", + "description": "Seller ID that identifies the seller the item belongs to." + }, + "Name": { + "type": "string", + "description": "Name of the item as displayed to customers in the storefront." + }, + "SkuName": { + "type": "string", + "description": "Name of the SKU corresponding to the item." + }, + "ProductId": { + "type": "string", + "description": "ID of the Product associated with the item." + }, + "RefId": { + "type": "string", + "description": "Item's reference ID." + }, + "Ean": { + "type": "string", + "description": "EAN of the item." + }, + "ImageUrl": { + "type": "string", + "description": "Item's SKU image URL." + }, + "DetailUrl": { + "type": "string", + "description": "URL slug of the item." + }, + "AssemblyOptions": { + "type": "array", + "description": "Displays information about assembly options related to the item, if there are any.", + "items": { + "type": "object", + "required": [ + "Id", + "Name", + "Required", + "InputValues", + "Composition" + ], + "properties": { + "Id": { + "type": "string", + "description": "ID of the attachment related to the order." + }, + "Name": { + "type": "string", + "description": "Name of the attachment related to the order." + }, + "Required": { + "type": "boolean", + "description": "Indicates if sending the attachment is required." + }, + "InputValues": { + "type": "object", + "nullable": true, + "description": "Displays the attachment's content." + }, + "Composition": { + "type": "object", + "nullable": true, + "description": "Displays the attachment's composition." + } + } + } + } + } + } + } + } + }, + "SubscriptionData": { + "type": "object", + "description": "Information about subscriptions.", + "nullable": true, + "required": [ + "SubscriptionGroupId", + "Subscriptions" + ], + "properties": { + "SubscriptionGroupId": { + "type": "string", + "description": "ID of the subscription's group. If this field returns `null` and the `executionCount` is `0`, the order is the first one with subscriptions." + }, + "Subscriptions": { + "type": "array", + "description": "List with subscriptions and their details.", + "nullable": true, + "items": { + "type": "object", + "required": [ + "ExecutionCount", + "PriceAtSubscriptionDate", + "ItemIndex", + "Plan" + ], + "properties": { + "ExecutionCount": { + "type": "integer", + "description": "Position of the order in the subscription cycle." + }, + "PriceAtSubscriptionDate": { + "type": "number", + "description": "Price of the order at the subscription start date." + }, + "ItemIndex": { + "type": "integer", + "description": "Each item in the subscriptions' order is identified by an index." + }, + "Plan": { + "type": "object", + "description": "Information about the subscription's validity and frequency.", + "required": [ + "type", + "frequency", + "validity" + ], + "properties": { + "type": { + "type": "string", + "description": "Type of plan." + }, + "frequency": { + "type": "object", + "description": "Information about subscriptions' recurrence.", + "required": [ + "periodicity", + "interval" + ], + "properties": { + "periodicity": { + "type": "string", + "description": "Defines the subscriptions recurrence period." + }, + "interval": { + "type": "integer", + "description": "Interval between subscription orders, depending on the periodicity." + } + } + }, + "validity": { + "type": "object", + "description": "Information about the period during which the subscription will be valid.", + "required": [ + "begin", + "end" + ], + "properties": { + "begin": { + "type": "string", + "description": "Subscription's start date in ISO 8601 format." + }, + "end": { + "type": "string", + "description": "Subscription's end date in ISO 8601 format." + } + } + } + } + } + } + } + } + } + }, + "TaxData": { + "type": "object", + "description": "Order's tax information.", + "required": [ + "areTaxesDesignatedByMarketplace", + "taxInfoCollection" + ], + "properties": { + "areTaxesDesignatedByMarketplace": { + "type": "boolean", + "description": "Indicates if the taxes were designated by the marketplace (`true`) or not (`false`)." + }, + "taxInfoCollection": { + "type": "array", + "description": "Array with detailed tax information for each item.", + "items": { + "type": "object", + "required": [ + "itemIndex", + "sku", + "priceTags" + ], + "properties": { + "itemIndex": { + "type": "integer", + "description": "Index number of the item in the order." + }, + "sku": { + "type": "string", + "description": "Alphanumeric sequence that identifies the item's SKU." + }, + "priceTags": { + "type": "array", + "description": "List of price tags associated with taxes for the item.", + "items": { + "type": "object", + "required": [ + "isPercentual", + "name", + "rawValue" + ], + "properties": { + "isPercentual": { + "type": "boolean", + "description": "Indicates if the tax is a percentage (`true`) or a fixed amount (`false`)." + }, + "name": { + "type": "string", + "description": "Name of the tax." + }, + "rawValue": { + "type": "string", + "description": "Amount associated with the tax, in raw format." + } + } + } + } + } + } + } + } + }, + "CancellationData": { + "type": "object", + "description": "Information about order cancellation, when it applies.", + "required": [ + "RequestedByUser", + "RequestedBySystem", + "RequestedBySellerNotification", + "RequestedByPaymentNotification", + "Reason", + "CancellationDate" + ], + "properties": { + "RequestedByUser": { + "type": "boolean", + "description": "Indicates if the order cancellation was requested by the customer (`true`) or not (`false`)." + }, + "RequestedBySystem": { + "type": "boolean", + "description": "Indicates if the order cancellation was made by the system (`true`) or not (`false`)." + }, + "RequestedBySellerNotification": { + "type": "boolean", + "description": "Indicates if the order cancellation was requested by the seller (`true`) or not (`false`)." + }, + "RequestedByPaymentNotification": { + "type": "boolean", + "description": "Indicates if the order cancellation was requested by the payment gateway (`true`) or not (`false`)." + }, + "Reason": { + "type": "string", + "description": "The reason provided for the cancellation of the order." + }, + "CancellationDate": { + "type": "string", + "description": "The date and time when the order was canceled, in ISO 8601 format." + } + } + }, + "ClientPreferencesData": { + "type": "object", + "description": "Information about the customer's preferences.", + "required": [ + "locale", + "optinNewsLetter" + ], + "properties": { + "locale": { + "type": "string", + "description": "Customer's preferred language in the store, typically represented by a locale code (e.g., 'en-US')." + }, + "optinNewsLetter": { + "type": "boolean", + "description": "Indicates if the customer opted to receive newsletters (`true` for yes, `false` for no)." + } + } + }, + "OrderItem": { + "type": "object", + "description": "Information about an individual item in the order.", + "required": [ + "uniqueId", + "id", + "productId", + "ean", + "lockId", + "itemAttachment", + "attachments", + "quantity", + "seller", + "name", + "refId", + "price", + "listPrice", + "manualPrice", + "priceTags", + "imageUrl", + "detailUrl", + "components", + "bundleItems", + "params", + "offerings", + "attachmentOfferings", + "sellerSku", + "priceValidUntil", + "commission", + "tax", + "preSaleDate", + "additionalInfo", + "measurementUnit", + "unitMultiplier", + "sellingPrice", + "isGift", + "shippingPrice", + "rewardValue", + "freightCommission", + "priceDefinitions", + "taxCode", + "parentItemIndex", + "parentAssemblyBinding", + "callCenterOperator", + "serialNumbers", + "assemblies", + "costPrice" + ], + "properties": { + "uniqueId": { + "type": "string", + "description": "Unique identifier for the item in the order." + }, + "id": { + "type": "string", + "description": "SKU identifier of the item." + }, + "productId": { + "type": "string", + "description": "Product ID associated with the item." + }, + "ean": { + "type": "string", + "nullable": true, + "description": "European Article Number (EAN) for the item, if applicable." + }, + "lockId": { + "type": "string", + "description": "Identifier to lock the item in the order." + }, + "itemAttachment": { + "type": "object", + "description": "Attachment details associated with the item.", + "properties": { + "content": { + "type": "object", + "description": "Content of the attachment." + }, + "name": { + "type": "string", + "nullable": true, + "description": "Name of the attachment, if applicable." + } + } + }, + "attachments": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Additional attachments for the item." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the order." + }, + "seller": { + "type": "string", + "description": "Identifier of the seller providing the item." + }, + "name": { + "type": "string", + "description": "Name of the item as displayed to the customer." + }, + "refId": { + "type": "string", + "description": "Reference ID for the item." + }, + "price": { + "type": "integer", + "description": "Price of the item." + }, + "listPrice": { + "type": "integer", + "description": "List price of the item." + }, + "manualPrice": { + "type": "integer", + "nullable": true, + "description": "Manually defined price for the item, if applicable." + }, + "priceTags": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Tags associated with the pricing of the item." + }, + "imageUrl": { + "type": "string", + "description": "URL of the item's image." + }, + "detailUrl": { + "type": "string", + "description": "URL for more details about the item." + }, + "components": { + "type": "array", + "items": { + "type": "object" + }, + "description": "List of components included with the item." + }, + "bundleItems": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Items bundled with this item." + }, + "params": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Parameters associated with the item." + }, + "offerings": { + "type": "array", + "items": { + "type": "object" + }, + "description": "List of offerings related to the item." + }, + "attachmentOfferings": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "schema": { + "type": "object" + } + } + }, + "description": "Offerings attached to the item." + }, + "sellerSku": { + "type": "string", + "description": "SKU identifier as defined by the seller." + }, + "priceValidUntil": { + "type": "string", + "nullable": true, + "description": "Date until the price is valid." + }, + "commission": { + "type": "integer", + "description": "Commission on the item, if applicable." + }, + "tax": { + "type": "integer", + "description": "Tax applied to the item." + }, + "preSaleDate": { + "type": "string", + "nullable": true, + "description": "Date when the item will be available for sale." + }, + "additionalInfo": { + "type": "object", + "description": "Additional information about the item.", + "properties": { + "brandName": { + "type": "string", + "description": "Name of the brand associated with the item." + }, + "brandId": { + "type": "string", + "description": "ID of the brand associated with the item." + }, + "categoriesIds": { + "type": "string", + "description": "String of category IDs associated with the item." + }, + "productClusterId": { + "type": "string", + "description": "Product cluster ID for the item." + }, + "commercialConditionId": { + "type": "string", + "description": "ID of the commercial condition associated with the item." + }, + "dimension": { + "type": "object", + "description": "Dimensions of the item.", + "properties": { + "cubicweight": { + "type": "number", + "description": "Cubic weight of the item." + }, + "height": { + "type": "number", + "description": "Height of the item." + }, + "length": { + "type": "number", + "description": "Length of the item." + }, + "weight": { + "type": "number", + "description": "Weight of the item." + }, + "width": { + "type": "number", + "description": "Width of the item." + } + } + }, + "categories": { + "type": "array", + "description": "List of categories associated with the item.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "ID of the category." + }, + "name": { + "type": "string", + "description": "Name of the category." + } + }, + "required": [ + "id", + "name" + ] + } + } + } + }, + "measurementUnit": { + "type": "string", + "description": "Unit of measurement for the item." + }, + "unitMultiplier": { + "type": "integer", + "description": "Multiplier for the measurement unit." + }, + "sellingPrice": { + "type": "integer", + "description": "Final selling price of the item." + }, + "isGift": { + "type": "boolean", + "description": "Indicates if the item is a gift." + }, + "shippingPrice": { + "type": "integer", + "nullable": true, + "description": "Shipping cost for the item, if applicable." + }, + "rewardValue": { + "type": "integer", + "description": "Reward value associated with the item." + }, + "freightCommission": { + "type": "integer", + "description": "Freight commission on the item." + }, + "priceDefinitions": { + "type": "object", + "description": "Detailed information about the item's price structure.", + "properties": { + "sellingPrices": { + "type": "array", + "items": { + "type": "object", + "properties": { + "value": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + } + } + }, + "calculatedSellingPrice": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "taxCode": { + "type": "string", + "nullable": true, + "description": "Tax code associated with the item." + }, + "parentItemIndex": { + "type": "integer", + "nullable": true, + "description": "Index of the parent item, if this item is part of a bundle." + }, + "parentAssemblyBinding": { + "type": "string", + "nullable": true, + "description": "Assembly binding of the parent item, if applicable." + }, + "callCenterOperator": { + "type": "string", + "description": "ID of the call center operator handling the item." + }, + "serialNumbers": { + "type": "string", + "description": "Serial numbers associated with the item." + }, + "assemblies": { + "type": "array", + "items": { + "type": "object" + }, + "description": "List of assemblies related to the item." + }, + "costPrice": { + "type": "integer", + "description": "Cost price of the item." + } + } + } + }, + "parameters": { + "Content-Type": { + "name": "Content-Type", + "in": "header", + "description": "Type of the content being sent.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/json" + } + }, + "Content-Type-img": { + "name": "Content-Type", + "in": "header", + "description": "Type of the content being sent. If you are uploading an image, use `image/jpg` or `image/png`. When using JavaScript, use `multipart/form-data`.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "image/jpg" + } + }, + "Accept": { + "name": "Accept", + "in": "header", + "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/vnd.vtex.ds.v10+json" + } + }, + "acronym": { + "name": "acronym", + "in": "path", + "description": "Two-letter string that identifies the data entity.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "SP" + } + }, + "id": { + "name": "id", + "in": "path", + "description": "Unique identifier of the document.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "SP-b818cbda-e489-11e6-94f4-0ac138d2d42e" + } + }, + "fields": { + "name": "_fields", + "in": "query", + "description": "Names of the fields that will be returned per document, separated by a comma `,`. It is possible to fetch all fields using `_all` as the value of this query parameter. However, in order to avoid permission errors, we strongly recommend informing only the names of the exact fields that will be used.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "email,firstName,document" + } + }, + "_schema": { + "name": "_schema", + "in": "query", + "description": "Name of the [schema](https://developers.vtex.com/docs/guides/master-data-schema-lifecycle) that the document complies with. This field is required when using `_where` or `_fields` query parameters.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "schema" + } } } }, diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 04e06ac50..354ddd5bf 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1,3 +1,6 @@ +import { PaymentData as PaymentDataOpenAPI } from "./openapi/vcs.openapi.gen.ts"; +import { ChangesAttachment } from "./openapi/vcs.openapi.gen.ts"; + /** * @format dynamic-options * @options vtex/loaders/options/productIdByTerm.ts @@ -1430,9 +1433,9 @@ export interface OrderItem { deniedBySellerReason: string | null; cancellationRequestDenyDate: string | null; }[] | null; - changesAttachment: string; + changesAttachment: ChangesAttachment; checkedInPickupPointId: string | null; - paymentData: PaymentData; + paymentData: PaymentDataOpenAPI; shippingData: ShippingData; clientPreferencesData: ClientPreferencesData; clientProfileData: ClientProfileData; From ce20477d41db164c29f7af0224e2bd7da83ce937 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 6 Nov 2024 10:25:00 -0300 Subject: [PATCH 19/93] remove logged in if --- vtex/loaders/orders/order.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index e2c968e1b..722131a51 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -15,11 +15,6 @@ export default async function loader( const { vcs } = ctx; const { cookie, payload } = parseCookie(req.headers, ctx.account); - // sub is userEmail - if (!payload?.sub || !payload?.userId) { - return null; - } - const { slug } = props; const response = await vcs["GET /api/oms/user/orders/:orderId"]( From 8f17ada7b1a84721d8464f256be3e1367cd4a042 Mon Sep 17 00:00:00 2001 From: guitavano Date: Wed, 6 Nov 2024 13:32:33 -0300 Subject: [PATCH 20/93] add host header --- .../intelligentSearch/productListingPage.ts | 12 ++++++++++-- website/components/Seo.tsx | 14 +++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 38bd24557..234e4be9e 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -291,10 +291,15 @@ const loader = async ( if (!isInSeachFormat && !pathQuery) { return null; } + const locale = segment?.payload?.cultureInfo ?? ctx.defaultSegment?.cultureInfo ?? "pt-BR"; const params = withDefaultParams({ ...searchArgs, page, locale }); + + const headers = new Headers(); + headers.set("host", url.host); + // search products on VTEX. Feel free to change any of these parameters const [productsResult, facetsResult] = await Promise.all([ vcsDeprecated @@ -303,12 +308,15 @@ const loader = async ( facets: toPath(selected), }, { ...STALE, - headers: segment ? withSegmentCookie(segment) : undefined, + headers: segment ? withSegmentCookie(segment, headers) : headers, }).then((res) => res.json()), vcsDeprecated["GET /api/io/_v/api/intelligent-search/facets/*facets"]({ ...params, facets: toPath(fselected), - }, { ...STALE, headers: segment ? withSegmentCookie(segment) : undefined }) + }, { + ...STALE, + headers: segment ? withSegmentCookie(segment, headers) : headers, + }) .then((res) => res.json()), ]); diff --git a/website/components/Seo.tsx b/website/components/Seo.tsx index 1f23ef6ac..6bbbf3284 100644 --- a/website/components/Seo.tsx +++ b/website/components/Seo.tsx @@ -63,16 +63,20 @@ function Component({ return ( {title && {renderTemplateString(titleTemplate, title)}} - {description && } + {description && ( + + )} {themeColor && } {favicon && } {/* Twitter tags */} {title && } - {description && } + {description && ( + + )} {image && } {twitterCard && } From 31d25cc2a8912978f3afa2043002df2abf46c6af Mon Sep 17 00:00:00 2001 From: guitavano Date: Fri, 22 Nov 2024 08:47:06 -0300 Subject: [PATCH 21/93] remove excludePaths feature --- vtex/actions/profile/updateProfile.ts | 2 +- vtex/loaders/proxy.ts | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/vtex/actions/profile/updateProfile.ts b/vtex/actions/profile/updateProfile.ts index 17c4f724b..63a520df1 100644 --- a/vtex/actions/profile/updateProfile.ts +++ b/vtex/actions/profile/updateProfile.ts @@ -73,7 +73,7 @@ const updateProfile = async ( givenName: updatedUser?.firstName, familyName: updatedUser?.lastName, taxID: updatedUser?.document?.replace(/[^\d]/g, ""), - gender: updatedUser?.gender === "female" + gender: (updatedUser?.gender === "f" || updatedUser?.gender === "female") ? "https://schema.org/Female" : "https://schema.org/Male", telephone: updatedUser?.homePhone, diff --git a/vtex/loaders/proxy.ts b/vtex/loaders/proxy.ts index 92f4696dc..57d9c7a06 100644 --- a/vtex/loaders/proxy.ts +++ b/vtex/loaders/proxy.ts @@ -30,7 +30,6 @@ const buildProxyRoutes = ( includeSiteMap, generateDecoSiteMap, excludePathsFromDecoSiteMap, - excludePathsFromVtexProxy, includeScriptsToHead, includeScriptsToBody, }: { @@ -39,7 +38,6 @@ const buildProxyRoutes = ( includeSiteMap?: string[]; generateDecoSiteMap?: boolean; excludePathsFromDecoSiteMap: string[]; - excludePathsFromVtexProxy?: string[]; includeScriptsToHead?: { includes?: Script[]; }; @@ -86,10 +84,7 @@ const buildProxyRoutes = ( }, }); }; - const currentPathsToProxy = PATHS_TO_PROXY.filter((path) => - !excludePathsFromVtexProxy?.includes(path) - ); - const routesFromPaths = [...currentPathsToProxy, ...extraPaths].map( + const routesFromPaths = [...PATHS_TO_PROXY, ...extraPaths].map( routeFromPath, ); @@ -147,10 +142,6 @@ export interface Props { * @title Exclude paths from /deco-sitemap.xml */ excludePathsFromDecoSiteMap?: string[]; - /** - * @title Exclude paths from VTEX PATHS_TO_PROXY - */ - excludePathsFromVtexProxy?: string[]; /** * @title Scripts to include on Html head */ @@ -174,7 +165,6 @@ function loader( includeSiteMap = [], generateDecoSiteMap = true, excludePathsFromDecoSiteMap = [], - excludePathsFromVtexProxy = [], includeScriptsToHead = { includes: [] }, includeScriptsToBody = { includes: [] }, }: Props, @@ -184,7 +174,6 @@ function loader( return buildProxyRoutes({ generateDecoSiteMap, excludePathsFromDecoSiteMap, - excludePathsFromVtexProxy, includeSiteMap, publicUrl: ctx.publicUrl, extraPaths: extraPathsToProxy, From a570fe81b1b4dff698a6846a9fac5618ec8c483f Mon Sep 17 00:00:00 2001 From: guitavano Date: Fri, 22 Nov 2024 08:48:14 -0300 Subject: [PATCH 22/93] remove comment --- vtex/loaders/payments/userPayments.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/vtex/loaders/payments/userPayments.ts b/vtex/loaders/payments/userPayments.ts index 78cd5f2d0..256b84fe4 100644 --- a/vtex/loaders/payments/userPayments.ts +++ b/vtex/loaders/payments/userPayments.ts @@ -1,11 +1,3 @@ -// fetch("https://www.als.com/_v/private/graphql/v1?workspace=master&maxAge=long&appsEtag=remove&domain=store&locale=en-US&__bindingId=d8649f18-3877-43de-88e6-c45a81eddc02", { -// "headers": { -// "content-type": "application/json", -// }, -// "body": "{\"operationName\":\"Payments\",\"variables\":{},\"extensions\":{\"persistedQuery\":{\"version\":1,\"sha256Hash\":\"95af11127e44f1857144e38f18635e0d085113c3bfdda3e4b8bc99ae63e14e60\",\"sender\":\"vtex.my-cards@1.x\",\"provider\":\"vtex.store-graphql@2.x\"}}}", -// "method": "POST" -// }) - import { AppContext } from "../../mod.ts"; import { parseCookie } from "../../utils/vtexId.ts"; From 37892f0de5fe86ea6bff64ae758124a0d111c01b Mon Sep 17 00:00:00 2001 From: guitavano Date: Fri, 22 Nov 2024 08:54:13 -0300 Subject: [PATCH 23/93] remove unecessary host --- .../loaders/intelligentSearch/productListingPage.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 234e4be9e..7972a1fa9 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -297,9 +297,6 @@ const loader = async ( const params = withDefaultParams({ ...searchArgs, page, locale }); - const headers = new Headers(); - headers.set("host", url.host); - // search products on VTEX. Feel free to change any of these parameters const [productsResult, facetsResult] = await Promise.all([ vcsDeprecated @@ -308,15 +305,13 @@ const loader = async ( facets: toPath(selected), }, { ...STALE, - headers: segment ? withSegmentCookie(segment, headers) : headers, - }).then((res) => res.json()), + headers: segment ? withSegmentCookie(segment) : undefined, + }) + .then((res) => res.json()), vcsDeprecated["GET /api/io/_v/api/intelligent-search/facets/*facets"]({ ...params, facets: toPath(fselected), - }, { - ...STALE, - headers: segment ? withSegmentCookie(segment, headers) : headers, - }) + }, { ...STALE, headers: segment ? withSegmentCookie(segment) : undefined }) .then((res) => res.json()), ]); From 3719958cf14dc4e9a876f271c0566f1f7861887e Mon Sep 17 00:00:00 2001 From: guitavano Date: Fri, 22 Nov 2024 08:54:42 -0300 Subject: [PATCH 24/93] fix fmt --- vtex/loaders/intelligentSearch/productListingPage.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 7972a1fa9..8854c193c 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -306,8 +306,7 @@ const loader = async ( }, { ...STALE, headers: segment ? withSegmentCookie(segment) : undefined, - }) - .then((res) => res.json()), + }).then((res) => res.json()), vcsDeprecated["GET /api/io/_v/api/intelligent-search/facets/*facets"]({ ...params, facets: toPath(fselected), From 3db894b22fb75b63de9f2586ff5391a7417a78df Mon Sep 17 00:00:00 2001 From: guitavano Date: Fri, 22 Nov 2024 08:57:51 -0300 Subject: [PATCH 25/93] remove console log --- vtex/loaders/address/getAddressByZIP.ts | 2 +- vtex/loaders/profile/passwordLastUpdate.ts | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/vtex/loaders/address/getAddressByZIP.ts b/vtex/loaders/address/getAddressByZIP.ts index a7f7a1e53..0eac4ac00 100644 --- a/vtex/loaders/address/getAddressByZIP.ts +++ b/vtex/loaders/address/getAddressByZIP.ts @@ -42,7 +42,7 @@ export default async function loader( return addressByPostalCode; } catch (error) { - console.log(error); + console.error(error); return { postalCode: "", city: "", diff --git a/vtex/loaders/profile/passwordLastUpdate.ts b/vtex/loaders/profile/passwordLastUpdate.ts index f60d69731..f7ca8adc4 100644 --- a/vtex/loaders/profile/passwordLastUpdate.ts +++ b/vtex/loaders/profile/passwordLastUpdate.ts @@ -18,7 +18,6 @@ async function loader( if (!payload?.sub || !payload?.userId) { return null; } - console.log({ teste: payload?.userId }); const query = `query getUserProfile { profile { passwordLastUpdate }}`; @@ -28,8 +27,6 @@ async function loader( { headers: { cookie } }, ); - console.log({ profile }); - return profile.passwordLastUpdate ?? null; } catch (_) { return null; From af7e182af504d06e355b04aa309da7cb67226836 Mon Sep 17 00:00:00 2001 From: guitavano Date: Sat, 30 Nov 2024 18:50:25 -0300 Subject: [PATCH 26/93] fmt --- vtex/loaders/orders/list.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/vtex/loaders/orders/list.ts b/vtex/loaders/orders/list.ts index 2895c267a..d56004974 100644 --- a/vtex/loaders/orders/list.ts +++ b/vtex/loaders/orders/list.ts @@ -27,6 +27,7 @@ export default async function loader( clientEmail, page, per_page, + includeProfileLastPurchases: true, }, { headers: { From 6a7d36818e7094fd49897ebadee4f7be1bf5ba44 Mon Sep 17 00:00:00 2001 From: marcoferreiradev Date: Fri, 20 Dec 2024 10:25:43 -0300 Subject: [PATCH 27/93] feat: create loader that returns only suggestions based on the query --- vtex/loaders/intelligentSearch/searches.ts | 29 ++++ vtex/manifest.gen.ts | 150 +++++++++++---------- 2 files changed, 105 insertions(+), 74 deletions(-) create mode 100644 vtex/loaders/intelligentSearch/searches.ts diff --git a/vtex/loaders/intelligentSearch/searches.ts b/vtex/loaders/intelligentSearch/searches.ts new file mode 100644 index 000000000..07ee2dd34 --- /dev/null +++ b/vtex/loaders/intelligentSearch/searches.ts @@ -0,0 +1,29 @@ +import { Suggestion } from "../../../commerce/types.ts"; +import { AppContext } from "../../mod.ts"; +import { getSegmentFromBag, withSegmentCookie } from "../../utils/segment.ts"; + +export interface Props { + query?: string; +} + +export default async function loader( + { query }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const segment = getSegmentFromBag(ctx); + const locale = segment?.payload?.cultureInfo ?? + ctx.defaultSegment?.cultureInfo ?? "pt-BR"; + + return await ctx.vcsDeprecated[ + "GET /api/io/_v/api/intelligent-search/search_suggestions" + ]( + { + locale, + query: query ?? "", + }, + { + headers: withSegmentCookie(segment), + }, + ).then((res) => res.json()); +} diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index 1d95b3e79..01d761cca 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -47,43 +47,44 @@ import * as $$$6 from "./loaders/intelligentSearch/productDetailsPage.ts"; import * as $$$7 from "./loaders/intelligentSearch/productList.ts"; import * as $$$8 from "./loaders/intelligentSearch/productListingPage.ts"; import * as $$$9 from "./loaders/intelligentSearch/productSearchValidator.ts"; -import * as $$$10 from "./loaders/intelligentSearch/suggestions.ts"; -import * as $$$11 from "./loaders/intelligentSearch/topsearches.ts"; -import * as $$$12 from "./loaders/legacy/brands.ts"; -import * as $$$13 from "./loaders/legacy/pageType.ts"; -import * as $$$14 from "./loaders/legacy/productDetailsPage.ts"; -import * as $$$15 from "./loaders/legacy/productList.ts"; -import * as $$$16 from "./loaders/legacy/productListingPage.ts"; -import * as $$$17 from "./loaders/legacy/relatedProductsLoader.ts"; -import * as $$$18 from "./loaders/legacy/suggestions.ts"; -import * as $$$19 from "./loaders/logistics/getSalesChannelById.ts"; -import * as $$$20 from "./loaders/logistics/listPickupPoints.ts"; -import * as $$$21 from "./loaders/logistics/listPickupPointsByLocation.ts"; -import * as $$$22 from "./loaders/logistics/listSalesChannelById.ts"; -import * as $$$23 from "./loaders/logistics/listStockByStore.ts"; -import * as $$$24 from "./loaders/masterdata/searchDocuments.ts"; -import * as $$$25 from "./loaders/navbar.ts"; -import * as $$$26 from "./loaders/options/productIdByTerm.ts"; -import * as $$$27 from "./loaders/orders/list.ts"; -import * as $$$28 from "./loaders/orders/order.ts"; -import * as $$$29 from "./loaders/paths/PDPDefaultPath.ts"; -import * as $$$30 from "./loaders/paths/PLPDefaultPath.ts"; -import * as $$$31 from "./loaders/payments/info.ts"; -import * as $$$32 from "./loaders/payments/userPayments.ts"; -import * as $$$33 from "./loaders/product/extend.ts"; -import * as $$$34 from "./loaders/product/extensions/detailsPage.ts"; -import * as $$$35 from "./loaders/product/extensions/list.ts"; -import * as $$$36 from "./loaders/product/extensions/listingPage.ts"; -import * as $$$37 from "./loaders/product/extensions/suggestions.ts"; -import * as $$$38 from "./loaders/product/wishlist.ts"; -import * as $$$39 from "./loaders/profile/passwordLastUpdate.ts"; -import * as $$$40 from "./loaders/promotion/getPromotionById.ts"; -import * as $$$41 from "./loaders/proxy.ts"; -import * as $$$42 from "./loaders/sessions/info.ts"; -import * as $$$43 from "./loaders/user.ts"; -import * as $$$44 from "./loaders/wishlist.ts"; -import * as $$$45 from "./loaders/workflow/product.ts"; -import * as $$$46 from "./loaders/workflow/products.ts"; +import * as $$$10 from "./loaders/intelligentSearch/searches.ts"; +import * as $$$11 from "./loaders/intelligentSearch/suggestions.ts"; +import * as $$$12 from "./loaders/intelligentSearch/topsearches.ts"; +import * as $$$13 from "./loaders/legacy/brands.ts"; +import * as $$$14 from "./loaders/legacy/pageType.ts"; +import * as $$$15 from "./loaders/legacy/productDetailsPage.ts"; +import * as $$$16 from "./loaders/legacy/productList.ts"; +import * as $$$17 from "./loaders/legacy/productListingPage.ts"; +import * as $$$18 from "./loaders/legacy/relatedProductsLoader.ts"; +import * as $$$19 from "./loaders/legacy/suggestions.ts"; +import * as $$$20 from "./loaders/logistics/getSalesChannelById.ts"; +import * as $$$21 from "./loaders/logistics/listPickupPoints.ts"; +import * as $$$22 from "./loaders/logistics/listPickupPointsByLocation.ts"; +import * as $$$23 from "./loaders/logistics/listSalesChannelById.ts"; +import * as $$$24 from "./loaders/logistics/listStockByStore.ts"; +import * as $$$25 from "./loaders/masterdata/searchDocuments.ts"; +import * as $$$26 from "./loaders/navbar.ts"; +import * as $$$27 from "./loaders/options/productIdByTerm.ts"; +import * as $$$28 from "./loaders/orders/list.ts"; +import * as $$$29 from "./loaders/orders/order.ts"; +import * as $$$30 from "./loaders/paths/PDPDefaultPath.ts"; +import * as $$$31 from "./loaders/paths/PLPDefaultPath.ts"; +import * as $$$32 from "./loaders/payments/info.ts"; +import * as $$$33 from "./loaders/payments/userPayments.ts"; +import * as $$$34 from "./loaders/product/extend.ts"; +import * as $$$35 from "./loaders/product/extensions/detailsPage.ts"; +import * as $$$36 from "./loaders/product/extensions/list.ts"; +import * as $$$37 from "./loaders/product/extensions/listingPage.ts"; +import * as $$$38 from "./loaders/product/extensions/suggestions.ts"; +import * as $$$39 from "./loaders/product/wishlist.ts"; +import * as $$$40 from "./loaders/profile/passwordLastUpdate.ts"; +import * as $$$41 from "./loaders/promotion/getPromotionById.ts"; +import * as $$$42 from "./loaders/proxy.ts"; +import * as $$$43 from "./loaders/sessions/info.ts"; +import * as $$$44 from "./loaders/user.ts"; +import * as $$$45 from "./loaders/wishlist.ts"; +import * as $$$46 from "./loaders/workflow/product.ts"; +import * as $$$47 from "./loaders/workflow/products.ts"; import * as $$$$$$0 from "./sections/Analytics/Vtex.tsx"; import * as $$$$$$$$$$0 from "./workflows/events.ts"; import * as $$$$$$$$$$1 from "./workflows/product/index.ts"; @@ -100,43 +101,44 @@ const manifest = { "vtex/loaders/intelligentSearch/productList.ts": $$$7, "vtex/loaders/intelligentSearch/productListingPage.ts": $$$8, "vtex/loaders/intelligentSearch/productSearchValidator.ts": $$$9, - "vtex/loaders/intelligentSearch/suggestions.ts": $$$10, - "vtex/loaders/intelligentSearch/topsearches.ts": $$$11, - "vtex/loaders/legacy/brands.ts": $$$12, - "vtex/loaders/legacy/pageType.ts": $$$13, - "vtex/loaders/legacy/productDetailsPage.ts": $$$14, - "vtex/loaders/legacy/productList.ts": $$$15, - "vtex/loaders/legacy/productListingPage.ts": $$$16, - "vtex/loaders/legacy/relatedProductsLoader.ts": $$$17, - "vtex/loaders/legacy/suggestions.ts": $$$18, - "vtex/loaders/logistics/getSalesChannelById.ts": $$$19, - "vtex/loaders/logistics/listPickupPoints.ts": $$$20, - "vtex/loaders/logistics/listPickupPointsByLocation.ts": $$$21, - "vtex/loaders/logistics/listSalesChannelById.ts": $$$22, - "vtex/loaders/logistics/listStockByStore.ts": $$$23, - "vtex/loaders/masterdata/searchDocuments.ts": $$$24, - "vtex/loaders/navbar.ts": $$$25, - "vtex/loaders/options/productIdByTerm.ts": $$$26, - "vtex/loaders/orders/list.ts": $$$27, - "vtex/loaders/orders/order.ts": $$$28, - "vtex/loaders/paths/PDPDefaultPath.ts": $$$29, - "vtex/loaders/paths/PLPDefaultPath.ts": $$$30, - "vtex/loaders/payments/info.ts": $$$31, - "vtex/loaders/payments/userPayments.ts": $$$32, - "vtex/loaders/product/extend.ts": $$$33, - "vtex/loaders/product/extensions/detailsPage.ts": $$$34, - "vtex/loaders/product/extensions/list.ts": $$$35, - "vtex/loaders/product/extensions/listingPage.ts": $$$36, - "vtex/loaders/product/extensions/suggestions.ts": $$$37, - "vtex/loaders/product/wishlist.ts": $$$38, - "vtex/loaders/profile/passwordLastUpdate.ts": $$$39, - "vtex/loaders/promotion/getPromotionById.ts": $$$40, - "vtex/loaders/proxy.ts": $$$41, - "vtex/loaders/sessions/info.ts": $$$42, - "vtex/loaders/user.ts": $$$43, - "vtex/loaders/wishlist.ts": $$$44, - "vtex/loaders/workflow/product.ts": $$$45, - "vtex/loaders/workflow/products.ts": $$$46, + "vtex/loaders/intelligentSearch/searches.ts": $$$10, + "vtex/loaders/intelligentSearch/suggestions.ts": $$$11, + "vtex/loaders/intelligentSearch/topsearches.ts": $$$12, + "vtex/loaders/legacy/brands.ts": $$$13, + "vtex/loaders/legacy/pageType.ts": $$$14, + "vtex/loaders/legacy/productDetailsPage.ts": $$$15, + "vtex/loaders/legacy/productList.ts": $$$16, + "vtex/loaders/legacy/productListingPage.ts": $$$17, + "vtex/loaders/legacy/relatedProductsLoader.ts": $$$18, + "vtex/loaders/legacy/suggestions.ts": $$$19, + "vtex/loaders/logistics/getSalesChannelById.ts": $$$20, + "vtex/loaders/logistics/listPickupPoints.ts": $$$21, + "vtex/loaders/logistics/listPickupPointsByLocation.ts": $$$22, + "vtex/loaders/logistics/listSalesChannelById.ts": $$$23, + "vtex/loaders/logistics/listStockByStore.ts": $$$24, + "vtex/loaders/masterdata/searchDocuments.ts": $$$25, + "vtex/loaders/navbar.ts": $$$26, + "vtex/loaders/options/productIdByTerm.ts": $$$27, + "vtex/loaders/orders/list.ts": $$$28, + "vtex/loaders/orders/order.ts": $$$29, + "vtex/loaders/paths/PDPDefaultPath.ts": $$$30, + "vtex/loaders/paths/PLPDefaultPath.ts": $$$31, + "vtex/loaders/payments/info.ts": $$$32, + "vtex/loaders/payments/userPayments.ts": $$$33, + "vtex/loaders/product/extend.ts": $$$34, + "vtex/loaders/product/extensions/detailsPage.ts": $$$35, + "vtex/loaders/product/extensions/list.ts": $$$36, + "vtex/loaders/product/extensions/listingPage.ts": $$$37, + "vtex/loaders/product/extensions/suggestions.ts": $$$38, + "vtex/loaders/product/wishlist.ts": $$$39, + "vtex/loaders/profile/passwordLastUpdate.ts": $$$40, + "vtex/loaders/promotion/getPromotionById.ts": $$$41, + "vtex/loaders/proxy.ts": $$$42, + "vtex/loaders/sessions/info.ts": $$$43, + "vtex/loaders/user.ts": $$$44, + "vtex/loaders/wishlist.ts": $$$45, + "vtex/loaders/workflow/product.ts": $$$46, + "vtex/loaders/workflow/products.ts": $$$47, }, "handlers": { "vtex/handlers/sitemap.ts": $$$$0, From 0c195610763627fccda82d5d3f5169c45e18191f Mon Sep 17 00:00:00 2001 From: soutofernando Date: Fri, 20 Dec 2024 15:25:31 -0300 Subject: [PATCH 28/93] fix: cancel order --- vtex/actions/orders/cancel.ts | 4 +- vtex/utils/client.ts | 8 -- vtex/utils/openapi/vcs.openapi.gen.ts | 64 +++++++++++++++ vtex/utils/openapi/vcs.openapi.json | 107 ++++++++++++++++++++++++++ vtex/utils/types.ts | 6 +- 5 files changed, 176 insertions(+), 13 deletions(-) diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts index 78401327b..ed32f2e3d 100644 --- a/vtex/actions/orders/cancel.ts +++ b/vtex/actions/orders/cancel.ts @@ -13,7 +13,7 @@ async function action( req: Request, ctx: AppContext, ): Promise { - const { vcsDeprecated } = ctx; + const { vcs } = ctx; const { cookie, payload } = parseCookie(req.headers, ctx.account); if (!payload?.sub || !payload?.userId) { @@ -22,7 +22,7 @@ async function action( const { orderId, reason, requestedByUser } = props; - const response = await vcsDeprecated + const response = await vcs ["POST /api/oms/pvt/orders/:orderId/cancel"]( { orderId }, { diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index afe62a9ba..b66360953 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -1,7 +1,6 @@ import { Userorderslist } from "./openapi/vcs.openapi.gen.ts"; import { Brand, - CanceledOrder, Category, CreateNewDocument, FacetSearchResult, @@ -257,13 +256,6 @@ export interface VTEXCommerceStable { "GET /api/oms/user/orders/:orderId": { response: OrderItem; }; - "POST /api/oms/pvt/orders/:orderId/cancel": { - response: CanceledOrder; - body: { - reason: string; - requestedByUser: boolean; - }; - }; } export interface SP { diff --git a/vtex/utils/openapi/vcs.openapi.gen.ts b/vtex/utils/openapi/vcs.openapi.gen.ts index 29f7b5b58..24e4d5418 100644 --- a/vtex/utils/openapi/vcs.openapi.gen.ts +++ b/vtex/utils/openapi/vcs.openapi.gen.ts @@ -17822,6 +17822,70 @@ ascending?: boolean } } } +/** + * Cancels an order using its identification code (`orderId`). A common scenario is when the seller has a problem fulfilling the order and requests the marketplace to cancel it. + * + * ## Orders that cannot be canceled + * + * The following situations do not allow order cancellation: + * + * - **Partial invoices:** [Partially invoiced](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) orders cannot be canceled. However, the customer can [change the order](https://developers.vtex.com/docs/guides/change-order) to replace or remove items from it. + * + * - **Invoiced status:** Orders with `invoiced` [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) cannot be canceled. If the order has already been invoiced, you can use the [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/invoice) endpoint to generate a return invoice. + * + * - **Incomplete orders:** [Incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294) cannot be canceled. + * + * ## Declining order cancelation + * + * The order flow has a cancellation window (grace period) in which the customer can automatically cancel the order. Except for that period, the seller can [decline an order cancellation request](https://help.vtex.com/en/tutorial/declining-order-cancelation--F2n0h1TeQ5td540Gjyff4), regardless of whether the customer or the marketplace initiated it. + * + * For more information, see [Order canceling improvements](https://developers.vtex.com/docs/guides/order-canceling-improvements). + * + * ## Permissions + * + * Any user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint: + * + * | **Product** | **Category** | **Resource** | + * | --------------- | ----------------- | ----------------- | + * | OMS | OMS access | **Cancel order** | + * + * You can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy): + * + * | **Role** | **Resource** | + * | --------------- | ----------------- | + * | OMS - Full access | Cancel order | + * | IntegrationProfile - Fulfillment Oms | Cancel order | + * + * >❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). + * + * To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + */ +"POST /api/oms/pvt/orders/:orderId/cancel": { +body: { +/** + * Reason for cancelling the order. + */ +reason?: string +/** + * If requested by the user + */ +requestedByUser?: boolean +} +response: { +/** + * Date and time when the notification was received. + */ +date?: string +/** + * Identification of the order in the seller. + */ +orderId?: string +/** + * Protocol code generated by the update. It may be `null`. + */ +receipt?: string +} +} /** * Retrieves information on pickup points close to a given location determined by geocoordinates or postal code. * diff --git a/vtex/utils/openapi/vcs.openapi.json b/vtex/utils/openapi/vcs.openapi.json index b8b013298..ccf0dd933 100644 --- a/vtex/utils/openapi/vcs.openapi.json +++ b/vtex/utils/openapi/vcs.openapi.json @@ -35225,6 +35225,113 @@ "deprecated": false } }, + "/api/oms/pvt/orders/{orderId}/cancel": { + "post": { + "tags": [ + "Orders" + ], + "summary": "Cancel order", + "description": "Cancels an order using its identification code (`orderId`). A common scenario is when the seller has a problem fulfilling the order and requests the marketplace to cancel it. \r\n\r\n## Orders that cannot be canceled \r\n\r\nThe following situations do not allow order cancellation: \r\n\r\n- **Partial invoices:** [Partially invoiced](https://help.vtex.com/en/tracks/orders--2xkTisx4SXOWXQel8Jg8sa/q9GPspTb9cHlMeAZfdEUe) orders cannot be canceled. However, the customer can [change the order](https://developers.vtex.com/docs/guides/change-order) to replace or remove items from it. \r\n\r\n- **Invoiced status:** Orders with `invoiced` [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196) cannot be canceled. If the order has already been invoiced, you can use the [Order invoice notification](https://developers.vtex.com/docs/api-reference/orders-api#post-/api/oms/pvt/orders/-orderId-/invoice) endpoint to generate a return invoice. \r\n\r\n- **Incomplete orders:** [Incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294) cannot be canceled. \r\n\r\n## Declining order cancelation \r\n\r\nThe order flow has a cancellation window (grace period) in which the customer can automatically cancel the order. Except for that period, the seller can [decline an order cancellation request](https://help.vtex.com/en/tutorial/declining-order-cancelation--F2n0h1TeQ5td540Gjyff4), regardless of whether the customer or the marketplace initiated it. \r\n\r\nFor more information, see [Order canceling improvements](https://developers.vtex.com/docs/guides/order-canceling-improvements). \r\n\r\n## Permissions\r\n\r\nAny user or [application key](https://developers.vtex.com/docs/guides/api-authentication-using-application-keys) must have at least one of the appropriate [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3) to be able to successfully run this request. Otherwise they will receive a status code `403` error. These are the applicable resources for this endpoint:\r\n\r\n| **Product** | **Category** | **Resource** |\r\n| --------------- | ----------------- | ----------------- |\r\n| OMS | OMS access | **Cancel order** | \r\n\r\nYou can [create a custom role](https://help.vtex.com/en/tutorial/roles--7HKK5Uau2H6wxE1rH5oRbc#creating-a-role) with that resource or use one of the following [predefined roles](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy):\r\n\r\n| **Role** | **Resource** | \r\n| --------------- | ----------------- | \r\n| OMS - Full access | Cancel order |\r\n| IntegrationProfile - Fulfillment Oms | Cancel order |\r\n\r\n>❗ Assigning a [predefined role](https://help.vtex.com/en/tutorial/predefined-roles--jGDurZKJHvHJS13LnO7Dy) to users or application keys usually grants permission to multiple [License Manager resources](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see [Best practices for using application keys](https://help.vtex.com/en/tutorial/best-practices-application-keys--7b6nD1VMHa49aI5brlOvJm). \r\n\r\nTo learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication).", + "operationId": "CancelOrder", + "parameters": [ + { + "name": "Accept", + "in": "header", + "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/json" + } + }, + { + "name": "Content-Type", + "in": "header", + "description": "Describes the type of the content being sent.", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "default": "application/json" + } + }, + { + "name": "orderId", + "in": "path", + "description": "ID that identifies the order in the seller.", + "example": "1172452900788-01", + "required": true, + "style": "simple", + "schema": { + "type": "string", + "example": "1172452900788-01" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Reason for cancelling the order.", + "example": "Unexpected stock shortage" + }, + "requestedByUser": { + "type": "boolean", + "description": "If requested by the user", + "example": "User canceled the order " + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date and time when the notification was received." + }, + "orderId": { + "type": "string", + "description": "Identification of the order in the seller." + }, + "receipt": { + "type": "string", + "description": "Protocol code generated by the update. It may be `null`." + } + } + }, + "example": { + "date": "2024-02-07T15:22:56.7612218-02:00", + "orderId": "123543123", + "receipt": "38e0e47da2934847b489216d208cfd91" + } + } + } + }, + "429": { + "description": "Too many requests." + }, + "403": { + "description": "The credentials are not enabled to access the service." + }, + "404": { + "description": "Value not found." + } + } + } + }, "/api/checkout/pub/pickup-points": { "get": { "tags": [ diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 354ddd5bf..10ea37b3a 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1472,9 +1472,9 @@ export interface OrderItem { } export interface CanceledOrder { - date: string; - orderId: string; - receipt: string | null; + date?: string; + orderId?: string; + receipt?: string | null; } interface Marketplace { From d6a8eec2a5b6703b7ec08ddf777b760b042c453e Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 12 Mar 2025 10:30:38 -0400 Subject: [PATCH 29/93] fix: sanitize IS sort param --- .../intelligentSearch/productListingPage.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 8854c193c..3d163f4a3 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -63,6 +63,18 @@ const LEGACY_TO_IS: Record = { OrderByReleaseDateDESC: "release:desc", OrderByBestDiscountDESC: "discount:desc", }; + +const sortValues = [ + "price:desc", + "price:asc", + "orders:desc", + "name:desc", + "name:asc", + "release:desc", + "discount:desc", + "relevance:desc", +]; + export const mapLabelledFuzzyToFuzzy = ( labelledFuzzy?: LabelledFuzzy, ): Fuzzy | undefined => { @@ -162,10 +174,13 @@ const searchArgsOf = (props: Props, url: URL) => { : 0, VTEX_MAX_PAGES - currentPageoffset, ); - const sort = (url.searchParams.get("sort") as Sort) ?? + let sort = (url.searchParams.get("sort") as Sort) ?? LEGACY_TO_IS[url.searchParams.get("O") ?? ""] ?? props.sort ?? sortOptions[0].value; + if (!sort || !sortValues.includes(sort)) { + sort = sortOptions[0].value as Sort; + } const selectedFacets = mergeFacets( props.selectedFacets ?? [], filtersFromURL(url), From 1b22b54fff8de0a617c325933b3eb8ef821457f3 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 16 Apr 2025 22:24:30 -0400 Subject: [PATCH 30/93] feat: add get user order by id loader --- vtex/loaders/orders/getUserOrderById.ts | 27 ++++++++++ vtex/utils/client.ts | 4 ++ vtex/utils/types.ts | 65 +++++++++++++++++++++++++ vtex/utils/vtexId.ts | 18 +++---- 4 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 vtex/loaders/orders/getUserOrderById.ts diff --git a/vtex/loaders/orders/getUserOrderById.ts b/vtex/loaders/orders/getUserOrderById.ts new file mode 100644 index 000000000..303c75064 --- /dev/null +++ b/vtex/loaders/orders/getUserOrderById.ts @@ -0,0 +1,27 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface Props { + orderId: string; +} + +/** + * @title VTEX - Get User Order By Id + * @description Gets user order by id, the user must be authenticated or have access to the order + */ +export default async function loader( + { orderId }: Props, + req: Request, + ctx: AppContext, +) { + const { vcsDeprecated } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + const order = await vcsDeprecated["GET /api/checkout/pub/orders/:orderId"]({ + orderId, + }, { + headers: { cookie }, + }).then((res) => res.json()); + + return order; +} diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index b66360953..6a0a756cc 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -10,6 +10,7 @@ import { LegacySort, OrderForm, OrderItem, + OrderPlaced, PageType, PortalSuggestion, ProductSearchResult, @@ -21,6 +22,9 @@ import { } from "./types.ts"; export interface VTEXCommerceStable { + "GET /api/checkout/pub/orders/:orderId": { + response: OrderPlaced; + }; "POST /api/checkout/pub/orderForm/:orderFormId/messages/clear": { // deno-lint-ignore no-explicit-any body: Record; diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 10ea37b3a..dd84e249b 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1477,6 +1477,71 @@ export interface CanceledOrder { receipt?: string | null; } +interface OrderPlacedSeller { + id: string; + name: string; + logo: string; +} + +export interface OrderPlaced { + sellers: OrderPlacedSeller[]; + orderId: string; + orderGroup: string; + state: string; + isCheckedIn: boolean; + sellerOrderId: string; + storeId: string | null; + checkedInPickupPointId: string | null; + value: number; + items: OrderFormItem[]; + totals: Total[]; + clientProfileData: ClientProfileData; + ratesAndBenefitsData: RatesAndBenefitsData; + shippingData: ShippingData; + paymentData: PaymentData; + clientPreferencesData: ClientPreferencesData; + commercialConditionData: null; + giftRegistryData: null; + marketingData: MarketingData | null; + storePreferencesData: StorePreferencesData; + openTextField: null; + invoiceData: null; + itemMetadata: ItemMetadata; + taxData: null; + customData: null; + hooksData: null; + changeData: null; + subscriptionData: null; + merchantContextData: null; + purchaseAgentData: null; + salesChannel: string; + followUpEmail: string; + creationDate: string; + lastChange: string; + timeZoneCreationDate: string; + timeZoneLastChange: string; + isCompleted: boolean; + hostName: string; + merchantName: string | null; + userType: string; + roundingError: number; + allowEdition: boolean; + allowCancellation: boolean; + isUserDataVisible: boolean; + cancellationData: CancelattionData; + orderFormCreationDate: string; + marketplaceRequestedCancellationWindow: null; +} + +interface CancelattionData { + requestedByUser: true; + reason: string; + cancellationDate: string; + cancellationRequestId: string; + requestedBy: null; + cancellationSource: null; +} + interface Marketplace { baseURL: string; // deno-lint-ignore no-explicit-any diff --git a/vtex/utils/vtexId.ts b/vtex/utils/vtexId.ts index 51f367a94..2dec534ef 100644 --- a/vtex/utils/vtexId.ts +++ b/vtex/utils/vtexId.ts @@ -3,6 +3,7 @@ import { decode } from "https://deno.land/x/djwt@v2.8/mod.ts"; import { stringify } from "./cookies.ts"; export const VTEX_ID_CLIENT_COOKIE = "VtexIdclientAutCookie"; +export const CHECKOUT_DATA_ACCESS_COOKIE = "CheckoutDataAccess"; interface CookiePayload { sub: string; // user email @@ -14,7 +15,12 @@ interface CookiePayload { } export const parseCookie = (headers: Headers, account: string) => { - const cookies = getCookies(headers); + const cookies = Object.fromEntries( + Object.entries(getCookies(headers)).filter(([key]) => + key.startsWith(VTEX_ID_CLIENT_COOKIE) || + key.startsWith(CHECKOUT_DATA_ACCESS_COOKIE) + ), + ); const cookie = cookies[VTEX_ID_CLIENT_COOKIE] || cookies[`${VTEX_ID_CLIENT_COOKIE}_${account}`]; const decoded = cookie ? decode(cookie) : null; @@ -22,15 +28,7 @@ export const parseCookie = (headers: Headers, account: string) => { const payload = decoded?.[1] as CookiePayload | undefined; return { - cookie: stringify({ - ...(cookies[VTEX_ID_CLIENT_COOKIE] && - { [VTEX_ID_CLIENT_COOKIE]: cookies[VTEX_ID_CLIENT_COOKIE] }), - ...(cookies[`${VTEX_ID_CLIENT_COOKIE}_${account}`] && - { - [`${VTEX_ID_CLIENT_COOKIE}_${account}`]: - cookies[`${VTEX_ID_CLIENT_COOKIE}_${account}`], - }), - }), + cookie: stringify(cookies), payload, }; }; From 7bdfd8cba64ac400fbe9f5c443cc0e0533005c91 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 16 Apr 2025 22:41:32 -0400 Subject: [PATCH 31/93] fix: build manifest --- vtex/manifest.gen.ts | 82 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index 01d761cca..cbff42f0c 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -65,26 +65,27 @@ import * as $$$24 from "./loaders/logistics/listStockByStore.ts"; import * as $$$25 from "./loaders/masterdata/searchDocuments.ts"; import * as $$$26 from "./loaders/navbar.ts"; import * as $$$27 from "./loaders/options/productIdByTerm.ts"; -import * as $$$28 from "./loaders/orders/list.ts"; -import * as $$$29 from "./loaders/orders/order.ts"; -import * as $$$30 from "./loaders/paths/PDPDefaultPath.ts"; -import * as $$$31 from "./loaders/paths/PLPDefaultPath.ts"; -import * as $$$32 from "./loaders/payments/info.ts"; -import * as $$$33 from "./loaders/payments/userPayments.ts"; -import * as $$$34 from "./loaders/product/extend.ts"; -import * as $$$35 from "./loaders/product/extensions/detailsPage.ts"; -import * as $$$36 from "./loaders/product/extensions/list.ts"; -import * as $$$37 from "./loaders/product/extensions/listingPage.ts"; -import * as $$$38 from "./loaders/product/extensions/suggestions.ts"; -import * as $$$39 from "./loaders/product/wishlist.ts"; -import * as $$$40 from "./loaders/profile/passwordLastUpdate.ts"; -import * as $$$41 from "./loaders/promotion/getPromotionById.ts"; -import * as $$$42 from "./loaders/proxy.ts"; -import * as $$$43 from "./loaders/sessions/info.ts"; -import * as $$$44 from "./loaders/user.ts"; -import * as $$$45 from "./loaders/wishlist.ts"; -import * as $$$46 from "./loaders/workflow/product.ts"; -import * as $$$47 from "./loaders/workflow/products.ts"; +import * as $$$28 from "./loaders/orders/getUserOrderById.ts"; +import * as $$$29 from "./loaders/orders/list.ts"; +import * as $$$30 from "./loaders/orders/order.ts"; +import * as $$$31 from "./loaders/paths/PDPDefaultPath.ts"; +import * as $$$32 from "./loaders/paths/PLPDefaultPath.ts"; +import * as $$$33 from "./loaders/payments/info.ts"; +import * as $$$34 from "./loaders/payments/userPayments.ts"; +import * as $$$35 from "./loaders/product/extend.ts"; +import * as $$$36 from "./loaders/product/extensions/detailsPage.ts"; +import * as $$$37 from "./loaders/product/extensions/list.ts"; +import * as $$$38 from "./loaders/product/extensions/listingPage.ts"; +import * as $$$39 from "./loaders/product/extensions/suggestions.ts"; +import * as $$$40 from "./loaders/product/wishlist.ts"; +import * as $$$41 from "./loaders/profile/passwordLastUpdate.ts"; +import * as $$$42 from "./loaders/promotion/getPromotionById.ts"; +import * as $$$43 from "./loaders/proxy.ts"; +import * as $$$44 from "./loaders/sessions/info.ts"; +import * as $$$45 from "./loaders/user.ts"; +import * as $$$46 from "./loaders/wishlist.ts"; +import * as $$$47 from "./loaders/workflow/product.ts"; +import * as $$$48 from "./loaders/workflow/products.ts"; import * as $$$$$$0 from "./sections/Analytics/Vtex.tsx"; import * as $$$$$$$$$$0 from "./workflows/events.ts"; import * as $$$$$$$$$$1 from "./workflows/product/index.ts"; @@ -119,26 +120,27 @@ const manifest = { "vtex/loaders/masterdata/searchDocuments.ts": $$$25, "vtex/loaders/navbar.ts": $$$26, "vtex/loaders/options/productIdByTerm.ts": $$$27, - "vtex/loaders/orders/list.ts": $$$28, - "vtex/loaders/orders/order.ts": $$$29, - "vtex/loaders/paths/PDPDefaultPath.ts": $$$30, - "vtex/loaders/paths/PLPDefaultPath.ts": $$$31, - "vtex/loaders/payments/info.ts": $$$32, - "vtex/loaders/payments/userPayments.ts": $$$33, - "vtex/loaders/product/extend.ts": $$$34, - "vtex/loaders/product/extensions/detailsPage.ts": $$$35, - "vtex/loaders/product/extensions/list.ts": $$$36, - "vtex/loaders/product/extensions/listingPage.ts": $$$37, - "vtex/loaders/product/extensions/suggestions.ts": $$$38, - "vtex/loaders/product/wishlist.ts": $$$39, - "vtex/loaders/profile/passwordLastUpdate.ts": $$$40, - "vtex/loaders/promotion/getPromotionById.ts": $$$41, - "vtex/loaders/proxy.ts": $$$42, - "vtex/loaders/sessions/info.ts": $$$43, - "vtex/loaders/user.ts": $$$44, - "vtex/loaders/wishlist.ts": $$$45, - "vtex/loaders/workflow/product.ts": $$$46, - "vtex/loaders/workflow/products.ts": $$$47, + "vtex/loaders/orders/getUserOrderById.ts": $$$28, + "vtex/loaders/orders/list.ts": $$$29, + "vtex/loaders/orders/order.ts": $$$30, + "vtex/loaders/paths/PDPDefaultPath.ts": $$$31, + "vtex/loaders/paths/PLPDefaultPath.ts": $$$32, + "vtex/loaders/payments/info.ts": $$$33, + "vtex/loaders/payments/userPayments.ts": $$$34, + "vtex/loaders/product/extend.ts": $$$35, + "vtex/loaders/product/extensions/detailsPage.ts": $$$36, + "vtex/loaders/product/extensions/list.ts": $$$37, + "vtex/loaders/product/extensions/listingPage.ts": $$$38, + "vtex/loaders/product/extensions/suggestions.ts": $$$39, + "vtex/loaders/product/wishlist.ts": $$$40, + "vtex/loaders/profile/passwordLastUpdate.ts": $$$41, + "vtex/loaders/promotion/getPromotionById.ts": $$$42, + "vtex/loaders/proxy.ts": $$$43, + "vtex/loaders/sessions/info.ts": $$$44, + "vtex/loaders/user.ts": $$$45, + "vtex/loaders/wishlist.ts": $$$46, + "vtex/loaders/workflow/product.ts": $$$47, + "vtex/loaders/workflow/products.ts": $$$48, }, "handlers": { "vtex/handlers/sitemap.ts": $$$$0, From 421649fab92252bd2451cb89d4c4a021ab763839 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Thu, 17 Apr 2025 00:31:27 -0400 Subject: [PATCH 32/93] feat: send more cookies to vtex requests --- vtex/utils/vtexId.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vtex/utils/vtexId.ts b/vtex/utils/vtexId.ts index 2dec534ef..eae0fd27b 100644 --- a/vtex/utils/vtexId.ts +++ b/vtex/utils/vtexId.ts @@ -4,6 +4,7 @@ import { stringify } from "./cookies.ts"; export const VTEX_ID_CLIENT_COOKIE = "VtexIdclientAutCookie"; export const CHECKOUT_DATA_ACCESS_COOKIE = "CheckoutDataAccess"; +export const VTEX_CHKO_AUTH = "Vtex_CHKO_Auth"; interface CookiePayload { sub: string; // user email @@ -18,7 +19,8 @@ export const parseCookie = (headers: Headers, account: string) => { const cookies = Object.fromEntries( Object.entries(getCookies(headers)).filter(([key]) => key.startsWith(VTEX_ID_CLIENT_COOKIE) || - key.startsWith(CHECKOUT_DATA_ACCESS_COOKIE) + key.startsWith(CHECKOUT_DATA_ACCESS_COOKIE) || + key.startsWith(VTEX_CHKO_AUTH) ), ); const cookie = cookies[VTEX_ID_CLIENT_COOKIE] || From a3afc8977cac332984688538511063af1608531a Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Thu, 17 Apr 2025 18:44:55 -0400 Subject: [PATCH 33/93] feat: add security layer to order api --- vtex/loaders/orders/order.ts | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index 722131a51..dc340588b 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -1,3 +1,4 @@ +import { HttpError } from "@deco/deco"; import { RequestURLParam } from "../../../website/functions/requestToParam.ts"; import { AppContext } from "../../mod.ts"; import { Userorderdetails } from "../../utils/openapi/vcs.openapi.gen.ts"; @@ -13,14 +14,19 @@ export default async function loader( ctx: AppContext, ): Promise { const { vcs } = ctx; - const { cookie, payload } = parseCookie(req.headers, ctx.account); + const { cookie } = parseCookie(req.headers, ctx.account); const { slug } = props; + const user = await ctx.invoke.vtex.loaders.user(); + if (!user) { + throw new HttpError(new Response("Unauthorized", { status: 403 })); + } + const response = await vcs["GET /api/oms/user/orders/:orderId"]( { orderId: slug.includes("-") ? slug : slug + "-01", - clientEmail: payload?.sub, + clientEmail: user.email, }, { headers: { @@ -29,10 +35,15 @@ export default async function loader( }, ); - if (response.ok) { - const order = await response.json(); - return order; + if (!response.ok) { + throw new Error(`Failed to get order: ${response.status} ${response.statusText}`); + } + + const order = await response.json(); + + if (order.clientProfileData?.email !== user.email) { + throw new HttpError(new Response("Unauthorized", { status: 403 })); } - return null; + return order; } From b48f9c23603616f0f9f6acf977b4b3ea8f7d14e2 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Mon, 12 May 2025 11:01:01 -0400 Subject: [PATCH 34/93] idk anymore --- .../{getUserOrderById.ts => getById.ts} | 20 ++- vtex/loaders/orders/orderplaced.ts | 42 +++++ vtex/utils/client.ts | 16 +- vtex/utils/cookies.ts | 3 + vtex/utils/types.ts | 167 ++++++++++++++++++ 5 files changed, 234 insertions(+), 14 deletions(-) rename vtex/loaders/orders/{getUserOrderById.ts => getById.ts} (55%) create mode 100644 vtex/loaders/orders/orderplaced.ts diff --git a/vtex/loaders/orders/getUserOrderById.ts b/vtex/loaders/orders/getById.ts similarity index 55% rename from vtex/loaders/orders/getUserOrderById.ts rename to vtex/loaders/orders/getById.ts index 303c75064..f946604e3 100644 --- a/vtex/loaders/orders/getUserOrderById.ts +++ b/vtex/loaders/orders/getById.ts @@ -7,7 +7,7 @@ interface Props { /** * @title VTEX - Get User Order By Id - * @description Gets user order by id, the user must be authenticated or have access to the order + * @description The user must be authenticated or have OMS permissions to access this endpoint */ export default async function loader( { orderId }: Props, @@ -17,11 +17,17 @@ export default async function loader( const { vcsDeprecated } = ctx; const { cookie } = parseCookie(req.headers, ctx.account); - const order = await vcsDeprecated["GET /api/checkout/pub/orders/:orderId"]({ - orderId, - }, { - headers: { cookie }, - }).then((res) => res.json()); + const order = await vcsDeprecated["GET /api/oms/user/orders/:orderId"]( + { + orderId, + }, + { + headers: { + cookie, + accept: "application/json", + }, + }, + ).then((res) => res.json()); return order; -} +} \ No newline at end of file diff --git a/vtex/loaders/orders/orderplaced.ts b/vtex/loaders/orders/orderplaced.ts new file mode 100644 index 000000000..dc53f9f1e --- /dev/null +++ b/vtex/loaders/orders/orderplaced.ts @@ -0,0 +1,42 @@ +import { getCookies } from "@std/http"; +import { stringify } from "node:querystring"; +import { AppContext } from "../../mod.ts"; +import { + CHECKOUT_DATA_ACCESS_COOKIE, + VTEX_CHKO_AUTH, +} from "../../utils/cookies.ts"; +import { VTEX_ID_CLIENT_COOKIE } from "../../utils/vtexId.ts"; + +interface Props { + orderId: string; +} + +/** + * @title VTEX - Get Order Placed Order Details + * @description Should be used on order placed page, the user must be authenticated or have access to the order through permissions or cookies + */ +export default async function loader( + { orderId }: Props, + req: Request, + ctx: AppContext, +) { + const { vcsDeprecated } = ctx; + const cookies = Object.fromEntries( + Object.entries(getCookies(req.headers)).filter(([key]) => + key.startsWith(VTEX_ID_CLIENT_COOKIE) || + // these two cookies are set by VTEX after order is placed on checkout and are + // used to access the order placed page + key === CHECKOUT_DATA_ACCESS_COOKIE || + key === VTEX_CHKO_AUTH + ), + ); + const cookie = stringify(cookies); + + const order = await vcsDeprecated["GET /api/checkout/pub/orders/:orderId"]({ + orderId, + }, { + headers: { cookie }, + }).then((res) => res.json()); + + return order; +} \ No newline at end of file diff --git a/vtex/utils/client.ts b/vtex/utils/client.ts index 6a0a756cc..fe1897c59 100644 --- a/vtex/utils/client.ts +++ b/vtex/utils/client.ts @@ -1,4 +1,4 @@ -import { Userorderslist } from "./openapi/vcs.openapi.gen.ts"; +import { Userorderdetails, Userorderslist } from "./openapi/vcs.openapi.gen.ts"; import { Brand, Category, @@ -9,8 +9,7 @@ import { LegacyProduct, LegacySort, OrderForm, - OrderItem, - OrderPlaced, + OrderFormOrder, PageType, PortalSuggestion, ProductSearchResult, @@ -22,9 +21,6 @@ import { } from "./types.ts"; export interface VTEXCommerceStable { - "GET /api/checkout/pub/orders/:orderId": { - response: OrderPlaced; - }; "POST /api/checkout/pub/orderForm/:orderFormId/messages/clear": { // deno-lint-ignore no-explicit-any body: Record; @@ -258,7 +254,13 @@ export interface VTEXCommerceStable { response: Userorderslist; }; "GET /api/oms/user/orders/:orderId": { - response: OrderItem; + response: Userorderdetails; + }; + "GET /api/checkout/pub/orders/:orderId": { + response: OrderFormOrder; + }; + "GET /api/checkout/pub/orders/order-group/:orderGroupId": { + response: OrderFormOrder[]; }; } diff --git a/vtex/utils/cookies.ts b/vtex/utils/cookies.ts index d6dbe1595..e68c5afe2 100644 --- a/vtex/utils/cookies.ts +++ b/vtex/utils/cookies.ts @@ -23,3 +23,6 @@ export const proxySetCookie = ( setCookie(to, newCookie); } }; + +export const CHECKOUT_DATA_ACCESS_COOKIE = "CheckoutDataAccess"; +export const VTEX_CHKO_AUTH = "Vtex_CHKO_Auth"; diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index dd84e249b..5b6259d7a 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1781,3 +1781,170 @@ export interface AdvancedLoaderConfig { } export type Maybe = T | null | undefined; + +interface OrderPlacedSeller { + id: string; + name: string; + logo: string; +} + +export interface OrderPlaced { + sellers: OrderPlacedSeller[]; + orderId: string; + orderGroup: string; + state: string; + isCheckedIn: boolean; + sellerOrderId: string; + storeId: string | null; + checkedInPickupPointId: string | null; + value: number; + items: OrderFormItem[]; + totals: Total[]; + clientProfileData: ClientProfileData; + ratesAndBenefitsData: RatesAndBenefitsData; + shippingData: ShippingData; + paymentData: PaymentData; + clientPreferencesData: ClientPreferencesData; + commercialConditionData: null; + giftRegistryData: null; + marketingData: MarketingData | null; + storePreferencesData: StorePreferencesData; + openTextField: null; + invoiceData: null; + itemMetadata: ItemMetadata; + taxData: null; + customData: null; + hooksData: null; + changeData: null; + subscriptionData: null; + merchantContextData: null; + purchaseAgentData: null; + salesChannel: string; + followUpEmail: string; + creationDate: string; + lastChange: string; + timeZoneCreationDate: string; + timeZoneLastChange: string; + isCompleted: boolean; + hostName: string; + merchantName: string | null; + userType: string; + roundingError: number; + allowEdition: boolean; + allowCancellation: boolean; + isUserDataVisible: boolean; + cancellationData: CancelattionData; + orderFormCreationDate: string; + marketplaceRequestedCancellationWindow: null; +} + +interface CancelattionData { + requestedByUser: true; + reason: string; + cancellationDate: string; + cancellationRequestId: string; + requestedBy: null; + cancellationSource: null; +} + +export interface CanceledOrder { + date?: string; + orderId?: string; + receipt?: string | null; +} + +export interface ReceiptData { + ReceiptCollection: Receipt[]; +} + +export interface Receipt { + ReceiptType: string; + Date: string; + ReceiptToken: string; + Source: string; + InvoiceNumber: string | null; + TransactionId: string; + MerchantName: string; + SellerOrderId: string | null; + ValueAsInt: number | null; +} + +export interface CancellationData { + requestedByUser: boolean; + reason: string; + cancellationDate: string; + cancellationRequestId: string; + requestedBy: string | null; + cancellationSource: string | null; +} + +export interface OrderFormOrder { + sellers: Seller[]; + receiptData?: ReceiptData; + sequence?: string; + marketPlaceOrderId?: string; + origin?: number; + items: Item[]; + giftRegistryData?: unknown; + contextData?: unknown; + marketPlaceOrderGroup?: string | null; + marketplaceServicesEndpoint?: string | null; + orderFormId?: string; + affiliateId?: string; + status?: string; + callCenterOperator?: string; + userProfileId?: string; + creationVersion?: string; + creationEnvironment?: string; + lastChangeVersion?: string; + workflowInstanceId?: string; + workflowInstanceGroupId?: string | null; + marketplacePaymentValue?: number | null; + marketplacePaymentReferenceValue?: number | null; + marketplace?: string | null; + orderId: string; + orderGroup: string; + state: string; + isCheckedIn: boolean; + sellerOrderId: string; + storeId?: string | null; + checkedInPickupPointId?: string | null; + value: number; + totals: Total[]; + clientProfileData: ClientProfileData; + ratesAndBenefitsData: RatesAndBenefitsData; + shippingData: ShippingData; + paymentData: PaymentData; + clientPreferencesData: ClientPreferencesData; + commercialConditionData?: unknown; + marketingData?: unknown; + storePreferencesData: StorePreferencesData; + openTextField?: unknown; + invoiceData?: unknown; + itemMetadata: ItemMetadata; + taxData?: unknown; + customData?: unknown; + hooksData?: unknown; + changeData?: unknown; + subscriptionData?: unknown; + merchantContextData?: unknown; + purchaseAgentData?: unknown; + salesChannel: string; + followUpEmail?: string; + creationDate: string; + lastChange: string; + timeZoneCreationDate: string; + timeZoneLastChange: string; + isCompleted: boolean; + hostName: string; + merchantName?: string | null; + userType?: string; + roundingError?: number; + allowEdition?: boolean; + allowCancellation?: boolean; + isUserDataVisible?: boolean; + allowChangeSeller?: boolean; + cancellationData?: CancellationData; + orderFormCreationDate?: string; + marketplaceRequestedCancellationWindow?: unknown; +} From a1e68299a216a844b96a2866cba6a5f89a9e3160 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Mon, 12 May 2025 11:07:50 -0400 Subject: [PATCH 35/93] fix: check fmt manifest --- vtex/loaders/orders/getById.ts | 2 +- vtex/loaders/orders/order.ts | 8 +-- vtex/loaders/orders/orderplaced.ts | 2 +- vtex/manifest.gen.ts | 78 +++++++++++++++--------------- website/manifest.gen.ts | 54 +++++++++++---------- 5 files changed, 75 insertions(+), 69 deletions(-) diff --git a/vtex/loaders/orders/getById.ts b/vtex/loaders/orders/getById.ts index f946604e3..0698c5312 100644 --- a/vtex/loaders/orders/getById.ts +++ b/vtex/loaders/orders/getById.ts @@ -30,4 +30,4 @@ export default async function loader( ).then((res) => res.json()); return order; -} \ No newline at end of file +} diff --git a/vtex/loaders/orders/order.ts b/vtex/loaders/orders/order.ts index dc340588b..6000037cf 100644 --- a/vtex/loaders/orders/order.ts +++ b/vtex/loaders/orders/order.ts @@ -19,7 +19,7 @@ export default async function loader( const { slug } = props; const user = await ctx.invoke.vtex.loaders.user(); - if (!user) { + if (!user?.email) { throw new HttpError(new Response("Unauthorized", { status: 403 })); } @@ -36,11 +36,13 @@ export default async function loader( ); if (!response.ok) { - throw new Error(`Failed to get order: ${response.status} ${response.statusText}`); + throw new Error( + `Failed to get order: ${response.status} ${response.statusText}`, + ); } const order = await response.json(); - + if (order.clientProfileData?.email !== user.email) { throw new HttpError(new Response("Unauthorized", { status: 403 })); } diff --git a/vtex/loaders/orders/orderplaced.ts b/vtex/loaders/orders/orderplaced.ts index dc53f9f1e..0cafd4b04 100644 --- a/vtex/loaders/orders/orderplaced.ts +++ b/vtex/loaders/orders/orderplaced.ts @@ -39,4 +39,4 @@ export default async function loader( }).then((res) => res.json()); return order; -} \ No newline at end of file +} diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index cbff42f0c..8a0267aca 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -65,27 +65,28 @@ import * as $$$24 from "./loaders/logistics/listStockByStore.ts"; import * as $$$25 from "./loaders/masterdata/searchDocuments.ts"; import * as $$$26 from "./loaders/navbar.ts"; import * as $$$27 from "./loaders/options/productIdByTerm.ts"; -import * as $$$28 from "./loaders/orders/getUserOrderById.ts"; +import * as $$$28 from "./loaders/orders/getById.ts"; import * as $$$29 from "./loaders/orders/list.ts"; import * as $$$30 from "./loaders/orders/order.ts"; -import * as $$$31 from "./loaders/paths/PDPDefaultPath.ts"; -import * as $$$32 from "./loaders/paths/PLPDefaultPath.ts"; -import * as $$$33 from "./loaders/payments/info.ts"; -import * as $$$34 from "./loaders/payments/userPayments.ts"; -import * as $$$35 from "./loaders/product/extend.ts"; -import * as $$$36 from "./loaders/product/extensions/detailsPage.ts"; -import * as $$$37 from "./loaders/product/extensions/list.ts"; -import * as $$$38 from "./loaders/product/extensions/listingPage.ts"; -import * as $$$39 from "./loaders/product/extensions/suggestions.ts"; -import * as $$$40 from "./loaders/product/wishlist.ts"; -import * as $$$41 from "./loaders/profile/passwordLastUpdate.ts"; -import * as $$$42 from "./loaders/promotion/getPromotionById.ts"; -import * as $$$43 from "./loaders/proxy.ts"; -import * as $$$44 from "./loaders/sessions/info.ts"; -import * as $$$45 from "./loaders/user.ts"; -import * as $$$46 from "./loaders/wishlist.ts"; -import * as $$$47 from "./loaders/workflow/product.ts"; -import * as $$$48 from "./loaders/workflow/products.ts"; +import * as $$$31 from "./loaders/orders/orderplaced.ts"; +import * as $$$32 from "./loaders/paths/PDPDefaultPath.ts"; +import * as $$$33 from "./loaders/paths/PLPDefaultPath.ts"; +import * as $$$34 from "./loaders/payments/info.ts"; +import * as $$$35 from "./loaders/payments/userPayments.ts"; +import * as $$$36 from "./loaders/product/extend.ts"; +import * as $$$37 from "./loaders/product/extensions/detailsPage.ts"; +import * as $$$38 from "./loaders/product/extensions/list.ts"; +import * as $$$39 from "./loaders/product/extensions/listingPage.ts"; +import * as $$$40 from "./loaders/product/extensions/suggestions.ts"; +import * as $$$41 from "./loaders/product/wishlist.ts"; +import * as $$$42 from "./loaders/profile/passwordLastUpdate.ts"; +import * as $$$43 from "./loaders/promotion/getPromotionById.ts"; +import * as $$$44 from "./loaders/proxy.ts"; +import * as $$$45 from "./loaders/sessions/info.ts"; +import * as $$$46 from "./loaders/user.ts"; +import * as $$$47 from "./loaders/wishlist.ts"; +import * as $$$48 from "./loaders/workflow/product.ts"; +import * as $$$49 from "./loaders/workflow/products.ts"; import * as $$$$$$0 from "./sections/Analytics/Vtex.tsx"; import * as $$$$$$$$$$0 from "./workflows/events.ts"; import * as $$$$$$$$$$1 from "./workflows/product/index.ts"; @@ -120,27 +121,28 @@ const manifest = { "vtex/loaders/masterdata/searchDocuments.ts": $$$25, "vtex/loaders/navbar.ts": $$$26, "vtex/loaders/options/productIdByTerm.ts": $$$27, - "vtex/loaders/orders/getUserOrderById.ts": $$$28, + "vtex/loaders/orders/getById.ts": $$$28, "vtex/loaders/orders/list.ts": $$$29, "vtex/loaders/orders/order.ts": $$$30, - "vtex/loaders/paths/PDPDefaultPath.ts": $$$31, - "vtex/loaders/paths/PLPDefaultPath.ts": $$$32, - "vtex/loaders/payments/info.ts": $$$33, - "vtex/loaders/payments/userPayments.ts": $$$34, - "vtex/loaders/product/extend.ts": $$$35, - "vtex/loaders/product/extensions/detailsPage.ts": $$$36, - "vtex/loaders/product/extensions/list.ts": $$$37, - "vtex/loaders/product/extensions/listingPage.ts": $$$38, - "vtex/loaders/product/extensions/suggestions.ts": $$$39, - "vtex/loaders/product/wishlist.ts": $$$40, - "vtex/loaders/profile/passwordLastUpdate.ts": $$$41, - "vtex/loaders/promotion/getPromotionById.ts": $$$42, - "vtex/loaders/proxy.ts": $$$43, - "vtex/loaders/sessions/info.ts": $$$44, - "vtex/loaders/user.ts": $$$45, - "vtex/loaders/wishlist.ts": $$$46, - "vtex/loaders/workflow/product.ts": $$$47, - "vtex/loaders/workflow/products.ts": $$$48, + "vtex/loaders/orders/orderplaced.ts": $$$31, + "vtex/loaders/paths/PDPDefaultPath.ts": $$$32, + "vtex/loaders/paths/PLPDefaultPath.ts": $$$33, + "vtex/loaders/payments/info.ts": $$$34, + "vtex/loaders/payments/userPayments.ts": $$$35, + "vtex/loaders/product/extend.ts": $$$36, + "vtex/loaders/product/extensions/detailsPage.ts": $$$37, + "vtex/loaders/product/extensions/list.ts": $$$38, + "vtex/loaders/product/extensions/listingPage.ts": $$$39, + "vtex/loaders/product/extensions/suggestions.ts": $$$40, + "vtex/loaders/product/wishlist.ts": $$$41, + "vtex/loaders/profile/passwordLastUpdate.ts": $$$42, + "vtex/loaders/promotion/getPromotionById.ts": $$$43, + "vtex/loaders/proxy.ts": $$$44, + "vtex/loaders/sessions/info.ts": $$$45, + "vtex/loaders/user.ts": $$$46, + "vtex/loaders/wishlist.ts": $$$47, + "vtex/loaders/workflow/product.ts": $$$48, + "vtex/loaders/workflow/products.ts": $$$49, }, "handlers": { "vtex/handlers/sitemap.ts": $$$$0, diff --git a/website/manifest.gen.ts b/website/manifest.gen.ts index 79f0482e9..0bb585b91 100644 --- a/website/manifest.gen.ts +++ b/website/manifest.gen.ts @@ -18,19 +18,20 @@ import * as $$$$2 from "./handlers/redirect.ts"; import * as $$$$3 from "./handlers/router.ts"; import * as $$$$4 from "./handlers/sitemap.ts"; import * as $$$0 from "./loaders/asset.ts"; -import * as $$$1 from "./loaders/extension.ts"; -import * as $$$2 from "./loaders/fonts/googleFonts.ts"; -import * as $$$3 from "./loaders/fonts/local.ts"; -import * as $$$4 from "./loaders/image.ts"; -import * as $$$5 from "./loaders/options/routes.ts"; -import * as $$$6 from "./loaders/options/urlParams.ts"; -import * as $$$7 from "./loaders/pages.ts"; -import * as $$$8 from "./loaders/redirect.ts"; -import * as $$$9 from "./loaders/redirects.ts"; -import * as $$$10 from "./loaders/redirectsFromCsv.ts"; -import * as $$$11 from "./loaders/secret.ts"; -import * as $$$12 from "./loaders/secretString.ts"; -import * as $$$13 from "./loaders/whitelistAssets.ts"; +import * as $$$1 from "./loaders/environment.ts"; +import * as $$$2 from "./loaders/extension.ts"; +import * as $$$3 from "./loaders/fonts/googleFonts.ts"; +import * as $$$4 from "./loaders/fonts/local.ts"; +import * as $$$5 from "./loaders/image.ts"; +import * as $$$6 from "./loaders/options/routes.ts"; +import * as $$$7 from "./loaders/options/urlParams.ts"; +import * as $$$8 from "./loaders/pages.ts"; +import * as $$$9 from "./loaders/redirect.ts"; +import * as $$$10 from "./loaders/redirects.ts"; +import * as $$$11 from "./loaders/redirectsFromCsv.ts"; +import * as $$$12 from "./loaders/secret.ts"; +import * as $$$13 from "./loaders/secretString.ts"; +import * as $$$14 from "./loaders/whitelistAssets.ts"; import * as $$$$$$$0 from "./matchers/always.ts"; import * as $$$$$$$1 from "./matchers/cookie.ts"; import * as $$$$$$$2 from "./matchers/cron.ts"; @@ -61,19 +62,20 @@ const manifest = { }, "loaders": { "website/loaders/asset.ts": $$$0, - "website/loaders/extension.ts": $$$1, - "website/loaders/fonts/googleFonts.ts": $$$2, - "website/loaders/fonts/local.ts": $$$3, - "website/loaders/image.ts": $$$4, - "website/loaders/options/routes.ts": $$$5, - "website/loaders/options/urlParams.ts": $$$6, - "website/loaders/pages.ts": $$$7, - "website/loaders/redirect.ts": $$$8, - "website/loaders/redirects.ts": $$$9, - "website/loaders/redirectsFromCsv.ts": $$$10, - "website/loaders/secret.ts": $$$11, - "website/loaders/secretString.ts": $$$12, - "website/loaders/whitelistAssets.ts": $$$13, + "website/loaders/environment.ts": $$$1, + "website/loaders/extension.ts": $$$2, + "website/loaders/fonts/googleFonts.ts": $$$3, + "website/loaders/fonts/local.ts": $$$4, + "website/loaders/image.ts": $$$5, + "website/loaders/options/routes.ts": $$$6, + "website/loaders/options/urlParams.ts": $$$7, + "website/loaders/pages.ts": $$$8, + "website/loaders/redirect.ts": $$$9, + "website/loaders/redirects.ts": $$$10, + "website/loaders/redirectsFromCsv.ts": $$$11, + "website/loaders/secret.ts": $$$12, + "website/loaders/secretString.ts": $$$13, + "website/loaders/whitelistAssets.ts": $$$14, }, "handlers": { "website/handlers/fresh.ts": $$$$0, From 7061d39b142f18c766392734bc60f048663a711a Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Mon, 12 May 2025 13:39:25 -0400 Subject: [PATCH 36/93] fix: types and get order group on orderplaced --- vtex/loaders/orders/orderplaced.ts | 18 +++- vtex/utils/types.ts | 142 +---------------------------- 2 files changed, 18 insertions(+), 142 deletions(-) diff --git a/vtex/loaders/orders/orderplaced.ts b/vtex/loaders/orders/orderplaced.ts index 0cafd4b04..6922afa2e 100644 --- a/vtex/loaders/orders/orderplaced.ts +++ b/vtex/loaders/orders/orderplaced.ts @@ -1,8 +1,8 @@ import { getCookies } from "@std/http"; -import { stringify } from "node:querystring"; import { AppContext } from "../../mod.ts"; import { CHECKOUT_DATA_ACCESS_COOKIE, + stringify, VTEX_CHKO_AUTH, } from "../../utils/cookies.ts"; import { VTEX_ID_CLIENT_COOKIE } from "../../utils/vtexId.ts"; @@ -32,11 +32,23 @@ export default async function loader( ); const cookie = stringify(cookies); + const isOrderGroup = orderId.includes("-"); + if (isOrderGroup) { + const orderGroup = await vcsDeprecated + ["GET /api/checkout/pub/orders/order-group/:orderGroupId"]({ + orderGroupId: orderId, + }, { + headers: { cookie }, + }).then((res) => res.json()); + + return orderGroup; + } + const order = await vcsDeprecated["GET /api/checkout/pub/orders/:orderId"]({ - orderId, + orderId: orderId.includes("-") ? orderId : orderId + "-01", }, { headers: { cookie }, }).then((res) => res.json()); - return order; + return [order]; } diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index 5b6259d7a..98caf9467 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1477,63 +1477,7 @@ export interface CanceledOrder { receipt?: string | null; } -interface OrderPlacedSeller { - id: string; - name: string; - logo: string; -} - -export interface OrderPlaced { - sellers: OrderPlacedSeller[]; - orderId: string; - orderGroup: string; - state: string; - isCheckedIn: boolean; - sellerOrderId: string; - storeId: string | null; - checkedInPickupPointId: string | null; - value: number; - items: OrderFormItem[]; - totals: Total[]; - clientProfileData: ClientProfileData; - ratesAndBenefitsData: RatesAndBenefitsData; - shippingData: ShippingData; - paymentData: PaymentData; - clientPreferencesData: ClientPreferencesData; - commercialConditionData: null; - giftRegistryData: null; - marketingData: MarketingData | null; - storePreferencesData: StorePreferencesData; - openTextField: null; - invoiceData: null; - itemMetadata: ItemMetadata; - taxData: null; - customData: null; - hooksData: null; - changeData: null; - subscriptionData: null; - merchantContextData: null; - purchaseAgentData: null; - salesChannel: string; - followUpEmail: string; - creationDate: string; - lastChange: string; - timeZoneCreationDate: string; - timeZoneLastChange: string; - isCompleted: boolean; - hostName: string; - merchantName: string | null; - userType: string; - roundingError: number; - allowEdition: boolean; - allowCancellation: boolean; - isUserDataVisible: boolean; - cancellationData: CancelattionData; - orderFormCreationDate: string; - marketplaceRequestedCancellationWindow: null; -} - -interface CancelattionData { +interface CancellationData { requestedByUser: true; reason: string; cancellationDate: string; @@ -1782,77 +1726,6 @@ export interface AdvancedLoaderConfig { export type Maybe = T | null | undefined; -interface OrderPlacedSeller { - id: string; - name: string; - logo: string; -} - -export interface OrderPlaced { - sellers: OrderPlacedSeller[]; - orderId: string; - orderGroup: string; - state: string; - isCheckedIn: boolean; - sellerOrderId: string; - storeId: string | null; - checkedInPickupPointId: string | null; - value: number; - items: OrderFormItem[]; - totals: Total[]; - clientProfileData: ClientProfileData; - ratesAndBenefitsData: RatesAndBenefitsData; - shippingData: ShippingData; - paymentData: PaymentData; - clientPreferencesData: ClientPreferencesData; - commercialConditionData: null; - giftRegistryData: null; - marketingData: MarketingData | null; - storePreferencesData: StorePreferencesData; - openTextField: null; - invoiceData: null; - itemMetadata: ItemMetadata; - taxData: null; - customData: null; - hooksData: null; - changeData: null; - subscriptionData: null; - merchantContextData: null; - purchaseAgentData: null; - salesChannel: string; - followUpEmail: string; - creationDate: string; - lastChange: string; - timeZoneCreationDate: string; - timeZoneLastChange: string; - isCompleted: boolean; - hostName: string; - merchantName: string | null; - userType: string; - roundingError: number; - allowEdition: boolean; - allowCancellation: boolean; - isUserDataVisible: boolean; - cancellationData: CancelattionData; - orderFormCreationDate: string; - marketplaceRequestedCancellationWindow: null; -} - -interface CancelattionData { - requestedByUser: true; - reason: string; - cancellationDate: string; - cancellationRequestId: string; - requestedBy: null; - cancellationSource: null; -} - -export interface CanceledOrder { - date?: string; - orderId?: string; - receipt?: string | null; -} - export interface ReceiptData { ReceiptCollection: Receipt[]; } @@ -1869,22 +1742,13 @@ export interface Receipt { ValueAsInt: number | null; } -export interface CancellationData { - requestedByUser: boolean; - reason: string; - cancellationDate: string; - cancellationRequestId: string; - requestedBy: string | null; - cancellationSource: string | null; -} - export interface OrderFormOrder { sellers: Seller[]; receiptData?: ReceiptData; sequence?: string; marketPlaceOrderId?: string; origin?: number; - items: Item[]; + items: OrderFormItem[]; giftRegistryData?: unknown; contextData?: unknown; marketPlaceOrderGroup?: string | null; @@ -1917,7 +1781,7 @@ export interface OrderFormOrder { paymentData: PaymentData; clientPreferencesData: ClientPreferencesData; commercialConditionData?: unknown; - marketingData?: unknown; + marketingData?: MarketingData | null; storePreferencesData: StorePreferencesData; openTextField?: unknown; invoiceData?: unknown; From cd31f40d693eb8b6e9068d55b86f38f246fc8465 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 14 May 2025 11:19:50 -0400 Subject: [PATCH 37/93] fix: woopsy --- vtex/loaders/orders/orderplaced.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vtex/loaders/orders/orderplaced.ts b/vtex/loaders/orders/orderplaced.ts index 6922afa2e..084a88c4a 100644 --- a/vtex/loaders/orders/orderplaced.ts +++ b/vtex/loaders/orders/orderplaced.ts @@ -32,7 +32,7 @@ export default async function loader( ); const cookie = stringify(cookies); - const isOrderGroup = orderId.includes("-"); + const isOrderGroup = !orderId.includes("-"); if (isOrderGroup) { const orderGroup = await vcsDeprecated ["GET /api/checkout/pub/orders/order-group/:orderGroupId"]({ From 2994c9dc11d2b5e216d5af69921f9a081fbf0a48 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Tue, 20 May 2025 21:22:17 -0400 Subject: [PATCH 38/93] add simulation behavior props --- vtex/loaders/intelligentSearch/productList.ts | 12 ++++++++++++ vtex/loaders/intelligentSearch/productListingPage.ts | 8 ++++++++ vtex/utils/intelligentSearch.ts | 3 +++ 3 files changed, 23 insertions(+) diff --git a/vtex/loaders/intelligentSearch/productList.ts b/vtex/loaders/intelligentSearch/productList.ts index eae248a5b..edc76ec3b 100644 --- a/vtex/loaders/intelligentSearch/productList.ts +++ b/vtex/loaders/intelligentSearch/productList.ts @@ -109,6 +109,11 @@ export interface CommonProps { * @deprecated Use product extensions instead */ similars?: boolean; + /** + * @title Simulation Behavior + * @description Defines the simulation behavior. + */ + simulationBehavior?: "default" | "skip" | "only1P"; } /** @@ -142,6 +147,7 @@ const fromProps = ({ props }: Props) => { sort: props.sort || "", selectedFacets: [{ key: "", value: props.facets }], hideUnavailableItems: props.hideUnavailableItems, + simulationBehavior: props.simulationBehavior || "default", } as const; } @@ -152,6 +158,7 @@ const fromProps = ({ props }: Props) => { sort: "", selectedFacets: [], hideUnavailableItems: props.hideUnavailableItems, + simulationBehavior: props.simulationBehavior || "default", } as const; } @@ -163,6 +170,7 @@ const fromProps = ({ props }: Props) => { fuzzy: mapLabelledFuzzyToFuzzy(props.fuzzy), selectedFacets: [], hideUnavailableItems: props.hideUnavailableItems, + simulationBehavior: props.simulationBehavior || "default", } as const; } @@ -173,6 +181,7 @@ const fromProps = ({ props }: Props) => { sort: props.sort || "", selectedFacets: [{ key: "productClusterIds", value: props.collection }], hideUnavailableItems: props.hideUnavailableItems, + simulationBehavior: props.simulationBehavior || "default", } as const; } @@ -254,6 +263,7 @@ const getSearchParams = ( "hideUnavailableItems", (props.hideUnavailableItems ?? false).toString(), ], + ["simulationBehavior", props.simulationBehavior || "default"], ]; } @@ -267,6 +277,7 @@ const getSearchParams = ( "hideUnavailableItems", (props.hideUnavailableItems ?? false).toString(), ], + ["simulationBehavior", props.simulationBehavior || "default"], ]; } @@ -279,6 +290,7 @@ const getSearchParams = ( "hideUnavailableItems", (props.hideUnavailableItems ?? false).toString(), ], + ["simulationBehavior", props.simulationBehavior || "default"], ]; } diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 3d163f4a3..09f5d8ffa 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -160,9 +160,15 @@ export interface Props { * @description Further change loader behaviour */ advancedConfigs?: AdvancedLoaderConfig; + /** + * @title Simulation Behavior + * @description Defines the simulation behavior. + */ + simulationBehavior?: "default" | "skip" | "only1P"; } const searchArgsOf = (props: Props, url: URL) => { const hideUnavailableItems = props.hideUnavailableItems; + const simulationBehavior = props.simulationBehavior || "default"; const countFromSearchParams = url.searchParams.get("PS"); const count = Number(countFromSearchParams ?? props.count ?? 12); const query = props.query ?? url.searchParams.get("q") ?? ""; @@ -195,6 +201,7 @@ const searchArgsOf = (props: Props, url: URL) => { count, hideUnavailableItems, selectedFacets, + simulationBehavior, }; }; const PAGE_TYPE_TO_MAP_PARAM = { @@ -460,6 +467,7 @@ export const cacheKey = (props: Props, req: Request, ctx: AppContext) => { ).join("\\"), ], ["segment", segment], + ["simulationBehavior", props.simulationBehavior || "default"], ]); url.searchParams.forEach((value, key) => { if (!ALLOWED_PARAMS.has(key.toLowerCase()) && !isFilterParam(key)) { diff --git a/vtex/utils/intelligentSearch.ts b/vtex/utils/intelligentSearch.ts index 17a64781b..d9db82d6a 100644 --- a/vtex/utils/intelligentSearch.ts +++ b/vtex/utils/intelligentSearch.ts @@ -46,6 +46,7 @@ interface Params { fuzzy: string; locale: string; hideUnavailableItems: boolean; + simulationBehavior: "default" | "skip" | "only1P"; } export const withDefaultParams = ({ @@ -56,6 +57,7 @@ export const withDefaultParams = ({ fuzzy = "auto", locale = "pt-BR", hideUnavailableItems, + simulationBehavior = "default", }: Partial) => ({ page: page + 1, count, @@ -65,6 +67,7 @@ export const withDefaultParams = ({ locale, // locale: locale ?? ctx.configVTEX!.defaultLocale, hideUnavailableItems: hideUnavailableItems ?? false, + simulationBehavior, }); const IS_ANONYMOUS = Symbol("segment"); From e8167633475fcefa441ce40ac1d88b844ff62809 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Wed, 21 May 2025 13:22:53 -0400 Subject: [PATCH 39/93] add simulation behavior test a/b --- vtex/loaders/intelligentSearch/productList.ts | 22 +++++++++--- .../intelligentSearch/productListingPage.ts | 24 ++++++++++--- vtex/middleware.ts | 8 ++++- vtex/mod.ts | 17 ++++++++++ vtex/utils/simulationBehavior.ts | 34 +++++++++++++++++++ 5 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 vtex/utils/simulationBehavior.ts diff --git a/vtex/loaders/intelligentSearch/productList.ts b/vtex/loaders/intelligentSearch/productList.ts index edc76ec3b..8958cfc9a 100644 --- a/vtex/loaders/intelligentSearch/productList.ts +++ b/vtex/loaders/intelligentSearch/productList.ts @@ -9,14 +9,14 @@ import { } from "../../utils/intelligentSearch.ts"; import { getSegmentFromBag, withSegmentCookie } from "../../utils/segment.ts"; import { withIsSimilarTo } from "../../utils/similars.ts"; -import { toProduct } from "../../utils/transform.ts"; +import { getSkipSimulationBehaviorFromBag } from "../../utils/simulationBehavior.ts"; +import { sortProducts, toProduct } from "../../utils/transform.ts"; import type { Item, ProductID, Sort } from "../../utils/types.ts"; +import { getFirstItemAvailable } from "../legacy/productListingPage.ts"; import { LabelledFuzzy, mapLabelledFuzzyToFuzzy, } from "./productListingPage.ts"; -import { sortProducts } from "../../utils/transform.ts"; -import { getFirstItemAvailable } from "../legacy/productListingPage.ts"; /** * @title Collection ID @@ -205,8 +205,14 @@ const loader = async ( req: Request, ctx: AppContext, ): Promise => { - const props = expandedProps.props ?? + const _props = expandedProps.props ?? (expandedProps as unknown as Props["props"]); + const props = { + ..._props, + simulationBehavior: getSkipSimulationBehaviorFromBag(ctx) + ? "skip" + : _props.simulationBehavior || "default", + }; const { vcsDeprecated } = ctx; const { url } = req; const segment = getSegmentFromBag(ctx); @@ -304,8 +310,14 @@ export const cacheKey = ( req: Request, ctx: AppContext, ) => { - const props = expandedProps.props ?? + const _props = expandedProps.props ?? (expandedProps as unknown as Props["props"]); + const props = { + ..._props, + simulationBehavior: getSkipSimulationBehaviorFromBag(ctx) + ? "skip" + : _props.simulationBehavior || "default", + }; const url = new URL(req.url); diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index 09f5d8ffa..c7c270da4 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -1,3 +1,4 @@ +import { redirect } from "@deco/deco"; import type { ProductListingPage } from "../../../commerce/types.ts"; import { parseRange } from "../../../commerce/utils/filters.ts"; import { STALE } from "../../../utils/fetch.ts"; @@ -5,6 +6,7 @@ import sendEvent from "../../actions/analytics/sendEvent.ts"; import { AppContext } from "../../mod.ts"; import { isFilterParam, + pageTypesFromUrl, toPath, withDefaultFacets, withDefaultParams, @@ -15,8 +17,8 @@ import { pageTypesToSeo, } from "../../utils/legacy.ts"; import { getSegmentFromBag, withSegmentCookie } from "../../utils/segment.ts"; -import { pageTypesFromUrl } from "../../utils/intelligentSearch.ts"; import { withIsSimilarTo } from "../../utils/similars.ts"; +import { getSkipSimulationBehaviorFromBag } from "../../utils/simulationBehavior.ts"; import { slugify } from "../../utils/slugify.ts"; import { filtersFromURL, @@ -36,7 +38,7 @@ import type { } from "../../utils/types.ts"; import { getFirstItemAvailable } from "../legacy/productListingPage.ts"; import PLPDefaultPath from "../paths/PLPDefaultPath.ts"; -import { redirect } from "@deco/deco"; + /** this type is more friendly user to fuzzy type that is 0, 1 or auto. */ export type LabelledFuzzy = "automatic" | "disabled" | "enabled"; /** @@ -166,9 +168,15 @@ export interface Props { */ simulationBehavior?: "default" | "skip" | "only1P"; } -const searchArgsOf = (props: Props, url: URL) => { +const searchArgsOf = (props: Props, url: URL, ctx: AppContext) => { const hideUnavailableItems = props.hideUnavailableItems; - const simulationBehavior = props.simulationBehavior || "default"; + const simulationBehavior = getSkipSimulationBehaviorFromBag(ctx) + ? "skip" as const + : (url.searchParams.get("simulationBehavior") as + | "skip" + | "default" + | "only1P") || + props.simulationBehavior || "default"; const countFromSearchParams = url.searchParams.get("PS"); const count = Number(countFromSearchParams ?? props.count ?? 12); const query = props.query ?? url.searchParams.get("q") ?? ""; @@ -289,6 +297,7 @@ const loader = async ( const { selectedFacets: baseSelectedFacets, page, ...args } = searchArgsOf( props, url, + ctx, ); let pathToUse = url.href.replace(url.origin, ""); @@ -467,7 +476,12 @@ export const cacheKey = (props: Props, req: Request, ctx: AppContext) => { ).join("\\"), ], ["segment", segment], - ["simulationBehavior", props.simulationBehavior || "default"], + [ + "simulationBehavior", + getSkipSimulationBehaviorFromBag(ctx) + ? "skip" + : props.simulationBehavior || "default", + ], ]); url.searchParams.forEach((value, key) => { if (!ALLOWED_PARAMS.has(key.toLowerCase()) && !isFilterParam(key)) { diff --git a/vtex/middleware.ts b/vtex/middleware.ts index f4e33f34b..e70e9529e 100644 --- a/vtex/middleware.ts +++ b/vtex/middleware.ts @@ -5,14 +5,20 @@ import { setISCookiesBag, } from "./utils/intelligentSearch.ts"; import { getSegmentFromBag, setSegmentBag } from "./utils/segment.ts"; +import { + resolveSkipSimulationBehavior, + setSkipSimulationBehaviorToBag, +} from "./utils/simulationBehavior.ts"; -export const middleware = ( +export const middleware = async ( _props: unknown, req: Request, ctx: AppMiddlewareContext, ) => { const segment = getSegmentFromBag(ctx); const isCookies = getISCookiesFromBag(ctx); + const skipSimulationBehavior = await resolveSkipSimulationBehavior(ctx, req); + setSkipSimulationBehaviorToBag(ctx, skipSimulationBehavior); if (!isCookies || !segment) { const cookies = getCookies(req.headers); diff --git a/vtex/mod.ts b/vtex/mod.ts index 3d0a05f51..b21f5784d 100644 --- a/vtex/mod.ts +++ b/vtex/mod.ts @@ -18,6 +18,7 @@ import { type AppContext as AC, type AppMiddlewareContext as AMC, type AppRuntime, + asResolved, type ManifestOf, } from "@deco/deco"; export type App = ReturnType; @@ -36,6 +37,8 @@ export type SegmentCulture = Omit< | "priceTables" | "regionId" >; +import { Matcher } from "@deco/deco/blocks"; + /** @title VTEX */ export interface Props { /** @@ -76,6 +79,10 @@ export interface Props { * @hide true */ platform: "vtex"; + /** + * @title Skip Simulation Behavior + */ + skipSimulationBehavior?: Matcher; } export const color = 0xf71963; /** @@ -166,3 +173,13 @@ export const preview = async (props: AppRuntime) => { }, }; }; +export const onBeforeResolveProps = (props: Props) => { + const skipSimulationBehavior = props.skipSimulationBehavior + ? asResolved(props.skipSimulationBehavior, false) + : undefined; + + return { + ...props, + skipSimulationBehavior, + }; +}; diff --git a/vtex/utils/simulationBehavior.ts b/vtex/utils/simulationBehavior.ts new file mode 100644 index 000000000..068843d6b --- /dev/null +++ b/vtex/utils/simulationBehavior.ts @@ -0,0 +1,34 @@ +import { Resolved } from "@deco/deco"; +import { Matcher } from "@deco/deco/blocks"; +import { AppContext, AppMiddlewareContext } from "../mod.ts"; + +const SKIP_SIMULATION_BEHAVIOR_KEY = Symbol("skipSimulationBehavior"); + +export function getSkipSimulationBehaviorFromBag(ctx: AppContext) { + return ctx.bag.get(SKIP_SIMULATION_BEHAVIOR_KEY); +} + +export function setSkipSimulationBehaviorToBag( + ctx: AppMiddlewareContext, + skipSimulationBehavior: boolean, +) { + ctx.bag.set(SKIP_SIMULATION_BEHAVIOR_KEY, skipSimulationBehavior); +} + +export async function resolveSkipSimulationBehavior( + ctx: AppMiddlewareContext, + req: Request, +) { + const { __resolveType, ...props } = ctx + .skipSimulationBehavior as unknown as Resolved; + const skipSimulationBehavior = await ctx.invoke( + // @ts-ignore ignore + __resolveType, + props, + ) as Matcher; + return skipSimulationBehavior({ + request: req, + siteId: 0, + device: ctx.device, + }); +} From 6b6c28ead50263f33a68ea81c3646a81ca2efd52 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Thu, 22 May 2025 09:28:46 -0400 Subject: [PATCH 40/93] fix: undefined matcher --- vtex/utils/simulationBehavior.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vtex/utils/simulationBehavior.ts b/vtex/utils/simulationBehavior.ts index 068843d6b..5ffce3b8d 100644 --- a/vtex/utils/simulationBehavior.ts +++ b/vtex/utils/simulationBehavior.ts @@ -20,7 +20,10 @@ export async function resolveSkipSimulationBehavior( req: Request, ) { const { __resolveType, ...props } = ctx - .skipSimulationBehavior as unknown as Resolved; + .skipSimulationBehavior as unknown as Resolved || {}; + if (!__resolveType) { + return false; + } const skipSimulationBehavior = await ctx.invoke( // @ts-ignore ignore __resolveType, From fcdedc6d904fddadb0d79c78863aced9da2bce16 Mon Sep 17 00:00:00 2001 From: vitoUwu Date: Thu, 22 May 2025 09:50:22 -0400 Subject: [PATCH 41/93] fix: dangerously set inner HTML --- linx/loaders/product/listingPage.ts | 5 +++-- shopify/loaders/ProductListingPage.ts | 5 +++-- vnda/loaders/productListingPage.ts | 5 ++++- .../intelligentSearch/productListingPage.ts | 5 +++-- vtex/loaders/legacy/productListingPage.ts | 5 +++-- wake/loaders/productListingPage.ts | 7 +++--- wap/loaders/productListingPage.ts | 7 +++--- website/components/Seo.tsx | 8 +++---- website/utils/html.ts | 22 +++++++++++++++++++ 9 files changed, 50 insertions(+), 19 deletions(-) diff --git a/linx/loaders/product/listingPage.ts b/linx/loaders/product/listingPage.ts index 7b9c9440b..046d49286 100644 --- a/linx/loaders/product/listingPage.ts +++ b/linx/loaders/product/listingPage.ts @@ -1,4 +1,5 @@ import type { ProductListingPage } from "../../../commerce/types.ts"; +import { safeJsonSerialize } from "../../../website/utils/html.ts"; import { AppContext } from "../../mod.ts"; import { isGridProductsModel } from "../../utils/paths.ts"; import { @@ -107,11 +108,11 @@ const loader = async ( value: sort.Alias, label: sort.Label, })), - seo: { + seo: safeJsonSerialize({ title: pageInfo.PageTitle, description: pageInfo.MetaDescription || "", canonical: pageInfo.CanonicalLink, - }, + }), }; }; diff --git a/shopify/loaders/ProductListingPage.ts b/shopify/loaders/ProductListingPage.ts index 4672b8efa..90b810d80 100644 --- a/shopify/loaders/ProductListingPage.ts +++ b/shopify/loaders/ProductListingPage.ts @@ -1,5 +1,6 @@ import type { ProductListingPage } from "../../commerce/types.ts"; import { AppContext } from "../../shopify/mod.ts"; +import { safeJsonSerialize } from "../../website/utils/html.ts"; import { ProductsByCollection, SearchProducts, @@ -219,13 +220,13 @@ const loader = async ( recordPerPage: count, }, sortOptions: isSearch ? searchSortOptions : sortOptions, - seo: { + seo: safeJsonSerialize({ title: collectionTitle || "", description: collectionDescription || "", canonical: `${url.origin}${url.pathname}${ page >= 1 ? `?page=${page}` : "" }`, - }, + }), }; }; diff --git a/vnda/loaders/productListingPage.ts b/vnda/loaders/productListingPage.ts index 16a8d9a86..fd03219b8 100644 --- a/vnda/loaders/productListingPage.ts +++ b/vnda/loaders/productListingPage.ts @@ -5,6 +5,7 @@ import type { import { SortOption } from "../../commerce/types.ts"; import { STALE } from "../../utils/fetch.ts"; import type { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { safeJsonSerialize } from "../../website/utils/html.ts"; import type { AppContext } from "../mod.ts"; import { ProductSearchResult, Sort } from "../utils/client/types.ts"; import { Tag } from "../utils/openapi/vnda.openapi.gen.ts"; @@ -241,7 +242,9 @@ const searchLoader = async ( return { "@type": "ProductListingPage", - seo: getSEOFromTag(categories, url, seo.at(-1), hasTypeTags, isSearchPage), + seo: safeJsonSerialize( + getSEOFromTag(categories, url, seo.at(-1), hasTypeTags, isSearchPage), + ), breadcrumb: isSearchPage ? { "@type": "BreadcrumbList", diff --git a/vtex/loaders/intelligentSearch/productListingPage.ts b/vtex/loaders/intelligentSearch/productListingPage.ts index c7c270da4..9a65bb98d 100644 --- a/vtex/loaders/intelligentSearch/productListingPage.ts +++ b/vtex/loaders/intelligentSearch/productListingPage.ts @@ -2,6 +2,7 @@ import { redirect } from "@deco/deco"; import type { ProductListingPage } from "../../../commerce/types.ts"; import { parseRange } from "../../../commerce/utils/filters.ts"; import { STALE } from "../../../utils/fetch.ts"; +import { safeJsonSerialize } from "../../../website/utils/html.ts"; import sendEvent from "../../actions/analytics/sendEvent.ts"; import { AppContext } from "../../mod.ts"; import { @@ -445,11 +446,11 @@ const loader = async ( pageTypes: allPageTypes.map(parsePageType), }, sortOptions, - seo: pageTypesToSeo( + seo: safeJsonSerialize(pageTypesToSeo( currentPageTypes, baseUrl, hasPreviousPage ? currentPage : undefined, - ), + )), }; }; export const cache = "stale-while-revalidate"; diff --git a/vtex/loaders/legacy/productListingPage.ts b/vtex/loaders/legacy/productListingPage.ts index f4bbce15f..a7b74aca4 100644 --- a/vtex/loaders/legacy/productListingPage.ts +++ b/vtex/loaders/legacy/productListingPage.ts @@ -15,6 +15,7 @@ import { getSegmentFromBag, withSegmentCookie } from "../../utils/segment.ts"; import { withIsSimilarTo } from "../../utils/similars.ts"; import { parsePageType } from "../../utils/transform.ts"; import { legacyFacetToFilter, toProduct } from "../../utils/transform.ts"; +import { safeJsonSerialize } from "../../../website/utils/html.ts"; import type { AdvancedLoaderConfig, Item, @@ -431,11 +432,11 @@ const loader = async ( pageTypes: allPageTypes.map(parsePageType), }, sortOptions, - seo: pageTypesToSeo( + seo: safeJsonSerialize(pageTypesToSeo( currentPageTypes, baseUrl, hasPreviousPage ? currentPage : undefined, - ), + )), }; }; diff --git a/wake/loaders/productListingPage.ts b/wake/loaders/productListingPage.ts index 2a5a9bd25..faa195e98 100644 --- a/wake/loaders/productListingPage.ts +++ b/wake/loaders/productListingPage.ts @@ -1,7 +1,9 @@ +import { logger } from "@deco/deco/o11y"; import type { ProductListingPage } from "../../commerce/types.ts"; import { SortOption } from "../../commerce/types.ts"; import { capitalize } from "../../utils/capitalize.ts"; import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { safeJsonSerialize } from "../../website/utils/html.ts"; import type { AppContext } from "../mod.ts"; import { getVariations, @@ -35,7 +37,6 @@ import { toProduct, } from "../utils/transform.ts"; import { Filters } from "./productList.ts"; -import { logger } from "@deco/deco/o11y"; export type Sort = | "NAME:ASC" @@ -320,11 +321,11 @@ const searchLoader = async ( }, sortOptions: SORT_OPTIONS, breadcrumb, - seo: { + seo: safeJsonSerialize({ description: description || "", title: title || "", canonical, - }, + }), products: products ?.filter((p): p is ProductFragment => Boolean(p)) .map((variant) => { diff --git a/wap/loaders/productListingPage.ts b/wap/loaders/productListingPage.ts index 7770a807e..3bdbf3b9b 100644 --- a/wap/loaders/productListingPage.ts +++ b/wap/loaders/productListingPage.ts @@ -1,4 +1,6 @@ import { ProductListingPage } from "../../commerce/types.ts"; +import { TypedResponse } from "../../utils/http.ts"; +import { safeJsonSerialize } from "../../website/utils/html.ts"; import { AppContext } from "../mod.ts"; import { getUrl, @@ -7,7 +9,6 @@ import { toProduct, } from "../utils/transform.ts"; import { WapProductsListPage } from "../utils/type.ts"; -import { TypedResponse } from "../../utils/http.ts"; type ORDER_OPTS = "Favoritos" | "Maior Preço" | "Menor Preço" | "Popularidade"; @@ -171,13 +172,13 @@ const loader = async ( records: data.info.total, recordPerPage: limit, }, - seo: { + seo: safeJsonSerialize({ title: data.estrutura.seo.title, description: data.estrutura.seo.description, // TODO canonical canonical: getUrl(new URL(data.estrutura.seo.canonical).pathname, url.origin).href, - }, + }), }; }; diff --git a/website/components/Seo.tsx b/website/components/Seo.tsx index 6bbbf3284..a60e30daf 100644 --- a/website/components/Seo.tsx +++ b/website/components/Seo.tsx @@ -1,7 +1,7 @@ import { Head } from "$fresh/runtime.ts"; -import type { ImageWidget } from "../../admin/widgets.ts"; -import { stripHTML } from "../utils/html.ts"; import { JSX } from "preact"; +import type { ImageWidget } from "../../admin/widgets.ts"; +import { safeJsonSerialize, stripHTML } from "../utils/html.ts"; export const renderTemplateString = (template: string, value: string) => template.replace("%s", value); @@ -97,11 +97,11 @@ function Component({